From 70e44f17e4a6f65c84a88c7fa3fb75252f3d6f62 Mon Sep 17 00:00:00 2001 From: gilbo Date: Thu, 1 Oct 2015 20:28:54 -0700 Subject: [PATCH] converted keyword from Liszt to Ebb --- .gitignore | 4 +- LICENSE.txt | 2 +- Makefile | 16 +- README.md | 84 +++++++-- {release/ebb => deprecated}/domains/lmesh.t | 4 +- deprecated/tests/mesh.t | 2 +- devapps/benchmarks/3d_stable_fluids.t | 48 ++--- devapps/benchmarks/bunny_diffusion.t | 10 +- devapps/benchmarks/bunny_laplacian.t | 18 +- devapps/benchmarks/dual_contour.t | 24 +-- devapps/benchmarks/sphere_cloth.t | 18 +- devapps/benchmarks/stable_fluids.t | 54 +++--- devapps/benchmarks/stable_fluids_multigrid.t | 58 +++--- devapps/benchmarks/trimesh.t | 8 +- devapps/fem/README.md | 2 +- devapps/fem/neohookean.t | 24 +-- devapps/fem/run-fem-experiments.sh | 8 +- devapps/fem/sim_main.t | 68 +++---- devapps/fem/stvk.t | 36 ++-- devapps/fem/test.t | 10 +- devapps/fem/tetmesh.t | 34 ++-- devapps/fem/utils.t | 20 +-- devapps/fem/vegfileio.t | 2 +- devapps/fem/view_files.t | 12 +- devapps/fluidsGL.t | 24 +-- devapps/gpu/global_reductions.t | 2 +- devapps/gpu/heat_gpu.t | 2 +- devapps/gpu/saxpy.t | 28 +-- devapps/legion_test.t | 8 +- devapps/livecode_getting_started/example01.t | 4 +- devapps/livecode_getting_started/example02.t | 16 +- devapps/livecode_getting_started/example03.t | 16 +- devapps/livecode_getting_started/workspace.t | 10 +- devapps/load_csv.t | 4 +- devapps/lulesh/lulesh.t | 90 +++++----- devapps/old_tutorials/bunny_diffusion.t | 36 ++-- .../old_tutorials/factored_bunny_diffusion.t | 10 +- devapps/old_tutorials/trimesh.t | 4 +- devapps/performance_tests/diffuse.t | 8 +- devapps/rel_terra_callback.t | 4 +- devapps/rendering/clef_gl_test.t | 10 +- devapps/soleil/README | 8 +- devapps/soleil/cavity_32x32.lua | 2 +- devapps/soleil/cavity_64x64.lua | 2 +- devapps/soleil/couette.lua | 2 +- devapps/soleil/params.lua | 2 +- devapps/soleil/poiseuille.lua | 2 +- devapps/soleil/soleil.t | 170 +++++++++--------- devapps/soleil/taylor_green_vortex.lua | 2 +- devapps/tutorials/heat_diffusion.t | 38 ++-- devapps/tutorials/heat_diffusion_2.t | 70 ++++---- devapps/tutorials/heat_diffusion_3.t | 12 +- devapps/tutorials/spring_mass.t | 18 +- release/ebb/liszt.t => include/ebb.t | 30 ++-- {release => include}/ebb/domains/grid.t | 132 +++++++------- {release => include}/ebb/domains/ioOff.t | 2 +- {release => include}/ebb/domains/ioVeg.t | 2 +- {release => include}/ebb/domains/multigrid.t | 6 +- {release => include}/ebb/domains/tetmesh.t | 10 +- {release => include}/ebb/domains/trimesh.t | 10 +- {release => include}/ebb/gl/gclef.t | 2 +- {release => include}/ebb/gl/gl.t | 0 {release => include}/ebb/gl/mat4f.t | 0 {release => include}/ebb/gl/shader.t | 0 {release => include}/ebb/gl/vo.t | 0 {release => include}/ebb/lib/pathname.t | 32 ++-- {release => include}/ebb/lib/vdb.h | 0 {release => include}/ebb/lib/vdb.old.h | 0 {release => include}/ebb/lib/vdb.t | 16 +- {release => include}/ebb/src/ast.t | 11 +- {release => include}/ebb/src/builtins.t | 13 +- {release => include}/ebb/src/c.t | 15 +- {release => include}/ebb/src/codegen.t | 2 +- .../ebb/src/codegen_support.t | 0 {release => include}/ebb/src/cukernelwrap.t | 0 {release => include}/ebb/src/dld.t | 2 +- {release => include}/ebb/src/gpu_util.t | 0 {release => include}/ebb/src/launch_legion.t | 18 +- {release => include}/ebb/src/launch_script.t | 2 +- {release => include}/ebb/src/legionwrap.t | 5 +- {release => include}/ebb/src/parser.t | 25 +-- {release => include}/ebb/src/phase.t | 2 +- {release => include}/ebb/src/pratt.t | 0 {release => include}/ebb/src/rawdata.t | 0 {release => include}/ebb/src/relations.t | 22 +-- {release => include}/ebb/src/semant.t | 28 +-- {release => include}/ebb/src/specialization.t | 24 +-- {release => include}/ebb/src/stats.t | 0 {release => include}/ebb/src/types.t | 54 +++--- {release => include}/ebb/src/ufversions.t | 4 +- .../ebb/src/lisztlib.t => include/ebblib.t | 63 ++++--- src_interpreter/main.cpp | 18 +- tests/allany.t | 4 +- tests/arith.t | 10 +- tests/assert.t | 4 +- tests/assigntype.t | 4 +- tests/basic_func_map.t | 4 +- tests/basic_stress_loop.t | 4 +- tests/big_reduction.t | 4 +- tests/builtins.t | 6 +- tests/const_for.t | 8 +- tests/constants.t | 2 +- tests/cross.t | 4 +- tests/defrag_stress.t | 10 +- tests/delete_stmt.t | 12 +- tests/dot.t | 8 +- tests/fails/assert.t | 4 +- tests/fails/assertvar.t | 4 +- tests/fails/sillyarith.t | 4 +- tests/fails/veclit.t | 4 +- tests/fieldcopyswap.t | 8 +- tests/fieldreduce.t | 12 +- tests/fields.t | 26 +-- tests/fieldwrite.t | 4 +- tests/functions.t | 50 +++--- tests/global.t | 16 +- tests/gpu_multiblock_test.t | 6 +- tests/grid.t | 14 +- tests/gridreduce.t | 14 +- tests/heattransfer.t | 8 +- tests/insert_stmt.t | 24 +-- tests/length.t | 4 +- tests/luabuiltins.t | 4 +- tests/macro.t | 8 +- tests/math.t | 6 +- tests/meshsum.t | 6 +- tests/minmax.t | 6 +- tests/nest.t | 4 +- tests/pathname.t | 4 +- tests/phase.t | 20 +-- tests/print.t | 24 +-- tests/record_types.t | 2 +- tests/reduce_complex.t | 12 +- tests/reduction_stress_test.t | 4 +- tests/semant.t | 44 ++--- tests/shadow.t | 6 +- tests/simple.t | 18 +- tests/simple2.t | 6 +- tests/small_matrix.t | 26 +-- tests/statements.t | 4 +- tests/strargs.t | 28 +-- tests/subsets.t | 10 +- tests/terrabridge.t | 4 +- tests/types.t | 8 +- tests/usermacro.t | 26 +-- tests/vecindex.t | 10 +- tests/veclit.t | 6 +- tests/vector.t | 8 +- 148 files changed, 1187 insertions(+), 1123 deletions(-) rename {release/ebb => deprecated}/domains/lmesh.t (99%) rename release/ebb/liszt.t => include/ebb.t (72%) rename {release => include}/ebb/domains/grid.t (88%) rename {release => include}/ebb/domains/ioOff.t (99%) rename {release => include}/ebb/domains/ioVeg.t (99%) rename {release => include}/ebb/domains/multigrid.t (95%) rename {release => include}/ebb/domains/tetmesh.t (94%) rename {release => include}/ebb/domains/trimesh.t (95%) rename {release => include}/ebb/gl/gclef.t (99%) rename {release => include}/ebb/gl/gl.t (100%) rename {release => include}/ebb/gl/mat4f.t (100%) rename {release => include}/ebb/gl/shader.t (100%) rename {release => include}/ebb/gl/vo.t (100%) rename {release => include}/ebb/lib/pathname.t (94%) rename {release => include}/ebb/lib/vdb.h (100%) rename {release => include}/ebb/lib/vdb.old.h (100%) rename {release => include}/ebb/lib/vdb.t (81%) rename {release => include}/ebb/src/ast.t (99%) rename {release => include}/ebb/src/builtins.t (98%) rename {release => include}/ebb/src/c.t (88%) rename {release => include}/ebb/src/codegen.t (99%) rename {release => include}/ebb/src/codegen_support.t (100%) rename {release => include}/ebb/src/cukernelwrap.t (100%) rename {release => include}/ebb/src/dld.t (99%) rename {release => include}/ebb/src/gpu_util.t (100%) rename {release => include}/ebb/src/launch_legion.t (93%) rename {release => include}/ebb/src/launch_script.t (92%) rename {release => include}/ebb/src/legionwrap.t (99%) rename {release => include}/ebb/src/parser.t (96%) rename {release => include}/ebb/src/phase.t (99%) rename {release => include}/ebb/src/pratt.t (100%) rename {release => include}/ebb/src/rawdata.t (100%) rename {release => include}/ebb/src/relations.t (98%) rename {release => include}/ebb/src/semant.t (98%) rename {release => include}/ebb/src/specialization.t (95%) rename {release => include}/ebb/src/stats.t (100%) rename {release => include}/ebb/src/types.t (95%) rename {release => include}/ebb/src/ufversions.t (99%) rename release/ebb/src/lisztlib.t => include/ebblib.t (90%) diff --git a/.gitignore b/.gitignore index 4296f1a..f23218b 100644 --- a/.gitignore +++ b/.gitignore @@ -21,8 +21,8 @@ local_files simple_trimesh_diffusion_output vega_output -liszt_output -liszt_fem_output +ebb_output +ebb_fem_output vegamodels/ notes.txt diff --git a/LICENSE.txt b/LICENSE.txt index 32d0dca..6cf8f97 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,5 +1,5 @@ =============================================================================== -Terra Release License +Liszt-Ebb Release License =============================================================================== MIT License diff --git a/Makefile b/Makefile index 899ea97..2d91ab4 100644 --- a/Makefile +++ b/Makefile @@ -177,18 +177,18 @@ build/%.o: src_interpreter/%.cpp terra mkdir -p build $(CXX) $(FLAGS) $(CPPFLAGS) $< -c -o $@ -release/bin/$(EXECUTABLE): $(addprefix build/, $(EXEC_OBJS)) terra - mkdir -p release/bin +bin/$(EXECUTABLE): $(addprefix build/, $(EXEC_OBJS)) terra + mkdir -p bin $(CXX) $(addprefix build/, $(EXEC_OBJS)) -o $@ $(LFLAGS) -$(EXECUTABLE): release/bin/$(EXECUTABLE) - ln -s release/bin/$(EXECUTABLE) $(EXECUTABLE) +$(EXECUTABLE): bin/$(EXECUTABLE) + ln -sf bin/$(EXECUTABLE) $(EXECUTABLE) -release/bin/$(EXECUTABLE_CP): release/bin/$(EXECUTABLE) - ln -s release/bin/$(EXECUTABLE) release/bin/$(EXECUTABLE_CP) +bin/$(EXECUTABLE_CP): bin/$(EXECUTABLE) + ln -sf bin/$(EXECUTABLE) bin/$(EXECUTABLE_CP) -$(EXECUTABLE_CP): release/bin/$(EXECUTABLE) - ln -s release/bin/$(EXECUTABLE) $(EXECUTABLE_CP) +$(EXECUTABLE_CP): bin/$(EXECUTABLE) + ln -sf bin/$(EXECUTABLE) $(EXECUTABLE_CP) # # ----------------------------------------------------------------------- # # # Legion Rules diff --git a/README.md b/README.md index a0747b7..d19eca0 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,76 @@ -This project is a port of the Liszt DSL, which was originally embedded in Scala, to the Lua/Terra system, with the following (planned) extensions: - - implicit method support (both sparse matrix encoding and an interface to external solver libraries) - - particles -The following extensions have already been implemented: - - mesh data is stored on a generic OP2-like graph structure that allows us to represent mesh topology, fields and sparse matrices with the same data structure. +# Liszt-Ebb + +Ebb is a (domain-specific) language for writing physical simulations. It is part of the Liszt project at Stanford. + +## Quick Setup + +Once you've got your local copy of this repository, you can simply type + +``` +make +``` + +and Terra (dependency) will be downloaded for you. When this process is done, you can type + +``` +./runtests +``` + +to make sure everything is working. You should be good to go. + + +### Troubleshooting Quick Setup + +If you don't have wget or unzip installed, you may run into trouble with the automatic download of Terra. Please install those tools or try installing Terra yourself. + +(You may also run into trouble if you don't have libcurses and libz installed. If this is the case, please report back to the developers---we currently don't believe this will ever happen.) + + + +## Longer Setup Instructions + +If you are working on multiple DSLs using Terra and want to avoid a redundant Terra install, you can configure the variable `TERRA_DIR` at the top of the [`Makefile`](Makefile) to locate your Terra install directory instead. If you have a binary download, simply point `TERRA_DIR` variable at the root directory. If you are building Terra from source, then point `TERRA_DIR` at the `release` subdirectory. By default, `TERRA_DIR=../terra/release`. + + +### Legion Setup + +If you need to run Ebb on Legion, then please contact the developers directly. The feature is currently under development. + + + +## More Details + +See the [full manual](docs/manual.md) for more information. + +## Examples + +See the [examples](examples) directory for example Ebb programs. This is a good way to get a few ideas about how to proceed once you've got some code running. + +## Tests + +As mentioned before, you can run the testing suite by executing +``` +./run_tests +``` + + + +## Running Ebb on the GPU + +To run an Ebb program on the GPU instead of CPU, simply add the command line flag. + +``` +ebb -g my_program.t +``` + +Support for simultaneous CPU/GPU use is currently being worked on. Please contact the developers if the feature is particularly important for you. + + + + + + + -The original project is hosted at http://liszt.stanford.edu. -Directory structure: -compiler/ - liszt compiler implementation -examples/ - example liszt programs, and terra applications that use the liszt runtime -runtime/ - C++ liszt runtime interface used by the compiler -spec/ - contains example programs written in the Scala version of Liszt, paired with their Liszt-in-Terra equivalents. \ No newline at end of file diff --git a/release/ebb/domains/lmesh.t b/deprecated/domains/lmesh.t similarity index 99% rename from release/ebb/domains/lmesh.t rename to deprecated/domains/lmesh.t index 978858a..042c2b8 100644 --- a/release/ebb/domains/lmesh.t +++ b/deprecated/domains/lmesh.t @@ -97,7 +97,7 @@ function initFieldFromIndex(rel,name, key, row_idx) end local function initMeshRelations(mesh) - import "ebb.src.liszt" + import "ebb" -- initialize list of relations local relations = {} -- basic element relations @@ -152,7 +152,7 @@ local function initMeshRelations(mesh) end --setup the correct macros relations[xtoy.t1]:NewFieldMacro(xtoy.t2,L.NewMacro(function(f) - return liszt `L.Where(rel.[xtoy.n1],f).[xtoy.n2] + return ebb `L.Where(rel.[xtoy.n1],f).[xtoy.n2] end)) end diff --git a/deprecated/tests/mesh.t b/deprecated/tests/mesh.t index 2d9e83c..1fa0461 100644 --- a/deprecated/tests/mesh.t +++ b/deprecated/tests/mesh.t @@ -1,6 +1,6 @@ --DISABLE-TEST --DISABLE-ON-LEGION -import "ebb.liszt" +import "ebb" local LMesh = require "ebb.domains.lmesh" local M = LMesh.Load("examples/mesh.lmesh") diff --git a/devapps/benchmarks/3d_stable_fluids.t b/devapps/benchmarks/3d_stable_fluids.t index 576321f..5a894b8 100644 --- a/devapps/benchmarks/3d_stable_fluids.t +++ b/devapps/benchmarks/3d_stable_fluids.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" --L.default_processor = L.GPU local Grid = require 'ebb.domains.grid' @@ -51,7 +51,7 @@ grid.cells:NewField('velocity_prev', L.vec3f):Load({0,0,0}) grid.cells:NewField('vel_shadow', L.vec3f):Load({0,0,0}) -local liszt neumann_shadow_update (c : grid.cells) +local ebb neumann_shadow_update (c : grid.cells) if c.xneg_depth > 0 then var v = c(1,0,0).velocity c.vel_shadow = { -v[0], v[1], v[2] } @@ -72,7 +72,7 @@ local liszt neumann_shadow_update (c : grid.cells) c.vel_shadow = { v[0], v[1], -v[2] } end end -local liszt neumann_cpy_update (c : grid.cells) +local ebb neumann_cpy_update (c : grid.cells) c.velocity = c.vel_shadow end local function vel_neumann_bnd(cells) @@ -89,7 +89,7 @@ local diffuse_diagonal = L.Global(L.float, 0.0) local diffuse_edge = L.Global(L.float, 0.0) -- One Jacobi-Iteration -local liszt diffuse_lin_solve_jacobi_step (c : grid.cells) +local ebb diffuse_lin_solve_jacobi_step (c : grid.cells) var edge_sum = diffuse_edge * ( c(-1,0,0).velocity + c(1,0,0).velocity + c(0,-1,0).velocity + c(0,1,0).velocity + c(0,0,-1).velocity + c(0,0,1).velocity ) @@ -142,7 +142,7 @@ local min_y = grid:yOrigin() + ycwidth/2 + epsilon local max_y = grid:yOrigin() + grid:yWidth() - ycwidth/2 - epsilon local min_z = grid:zOrigin() + zcwidth/2 + epsilon local max_z = grid:zOrigin() + grid:zWidth() - zcwidth/2 - epsilon -local liszt wrap(val, lower, upper) +local ebb wrap(val, lower, upper) var diff : L.float = upper - lower var temp = L.float(cmath.fmod(val - lower, diff)) if temp < 0 then @@ -150,13 +150,13 @@ local liszt wrap(val, lower, upper) end return temp + lower end -local liszt clamp(val, lower, upper) +local ebb clamp(val, lower, upper) var result : L.float = val result max= L.float(lower) result min= L.float(upper) return result end -local snap_to_grid = liszt(p) +local snap_to_grid = ebb(p) var pxyz : L.vec3f = p pxyz[0] = clamp(pxyz[0], min_x, max_x) pxyz[1] = clamp(pxyz[1], min_y, max_y) @@ -170,7 +170,7 @@ if PERIODIC then max_y = grid:yOrigin() + grid:yWidth() min_z = grid:zOrigin() max_z = grid:zOrigin() + grid:zWidth() - snap_to_grid = liszt(p) + snap_to_grid = ebb(p) var pxyz : L.vec3f = p pxyz[0] = wrap(pxyz[0], min_x, max_x) pxyz[1] = wrap(pxyz[1], min_y, max_y) @@ -179,17 +179,17 @@ if PERIODIC then end end -local liszt advect_where_from (c : grid.cells) +local ebb advect_where_from (c : grid.cells) var offset = - c.velocity_prev -- Make sure all our lookups are appropriately confined c.lookup_pos = snap_to_grid(c.center + advect_dt * offset) end -local liszt advect_point_locate (c : grid.cells) +local ebb advect_point_locate (c : grid.cells) c.lookup_from = grid.dual_locate(c.lookup_pos) end -local liszt advect_interpolate_velocity (c : grid.cells) +local ebb advect_interpolate_velocity (c : grid.cells) var dc = c.lookup_from -- figure out fractional position in the dual cell in range [0.0, 1.0] @@ -245,7 +245,7 @@ grid.cells:NewField('divergence', L.float):Load(0) grid.cells:NewField('p', L.float):Load(0) grid.cells:NewField('p_temp', L.float):Load(0) -local liszt project_lin_solve_jacobi_step (c : grid.cells) +local ebb project_lin_solve_jacobi_step (c : grid.cells) var edge_sum = project_edge * ( c(-1,0,0).p + c(1,0,0).p + c(0,-1,0).p + c(0,1,0).p + c(0,0,-1).p + c(0,0,1).p ) @@ -253,7 +253,7 @@ local liszt project_lin_solve_jacobi_step (c : grid.cells) end -- Neumann condition -local liszt pressure_shadow_update (c : grid.cells) +local ebb pressure_shadow_update (c : grid.cells) if c.xneg_depth > 0 then c.p_temp = c(1,0,0).p elseif c.xpos_depth > 0 then @@ -268,7 +268,7 @@ local liszt pressure_shadow_update (c : grid.cells) c.p_temp = c(0,0,-1).p end end -local pressure_cpy_update = liszt (c : grid.cells) +local pressure_cpy_update = ebb (c : grid.cells) c.p = c.p_temp end local function pressure_neumann_bnd(cells) @@ -294,7 +294,7 @@ local function project_lin_solve(edge, diagonal) end end -local liszt compute_divergence (c : grid.cells) +local ebb compute_divergence (c : grid.cells) -- why the factor of N? var vx_dx = c(1,0,0).velocity[0] - c(-1,0,0).velocity[0] var vy_dy = c(0,1,0).velocity[1] - c(0,-1,0).velocity[1] @@ -302,7 +302,7 @@ local liszt compute_divergence (c : grid.cells) c.divergence = L.float(-(0.5/N)*(vx_dx + vy_dy + vz_dz)) end -local liszt compute_projection (c : grid.cells) +local ebb compute_projection (c : grid.cells) var grad = L.vec3f(0.5 * N * { c(1,0,0).p - c(-1,0,0).p, c(0,1,0).p - c(0,-1,0).p, c(0,0,1).p - c(0,0,-1).p }) @@ -365,16 +365,16 @@ end) particles:NewField('next_pos', L.vec3f):Load({0,0,0}) particles:NewField('pos', L.vec3f):Load({0,0,0}) -particles:foreach(liszt (p : particles) -- init... +particles:foreach(ebb (p : particles) -- init... p.pos = p.dual_cell.vertex.cell(-1,-1,-1).center + L.vec3f({xcwidth/2.0, ycwidth/2.0, zcwidth/2.0}) end) -local liszt locate_particles (p : particles) +local ebb locate_particles (p : particles) p.dual_cell = grid.dual_locate(p.pos) end -local liszt compute_particle_velocity (p : particles) +local ebb compute_particle_velocity (p : particles) var dc = p.dual_cell -- figure out fractional position in the dual cell in range [0.0, 1.0] @@ -395,7 +395,7 @@ local liszt compute_particle_velocity (p : particles) end end end end -local liszt update_particle_pos (p : particles) +local ebb update_particle_pos (p : particles) var r = L.vec3f({ cmath.rand_float() - 0.5, cmath.rand_float() - 0.5, @@ -413,7 +413,7 @@ end --grid.cells:print() local source_strength = 100.0 -local source_velocity = liszt (c : grid.cells) +local source_velocity = ebb (c : grid.cells) if cmath.fabs(c.center[0]) < 1.75 and cmath.fabs(c.center[1]) < 1.75 and cmath.fabs(c.center[2]) < 1.75 @@ -427,7 +427,7 @@ local source_velocity = liszt (c : grid.cells) end if PERIODIC then source_strength = 10.0 - source_velocity = liszt (c : grid.cells) + source_velocity = ebb (c : grid.cells) if cmath.fabs(c.center[0]) < 1.75 and cmath.fabs(c.center[1]) < 1.75 and cmath.fabs(c.center[2]) < 1.75 @@ -437,7 +437,7 @@ if PERIODIC then end end -local liszt draw_grid (c : grid.cells) +local ebb draw_grid (c : grid.cells) var color = {1.0, 1.0, 1.0} vdb.color(color) var p : L.vec3f = c.center @@ -446,7 +446,7 @@ local liszt draw_grid (c : grid.cells) vdb.line(p, p+v*N*10) end -local liszt draw_particles (p : particles) +local ebb draw_particles (p : particles) var color = {1.0,1.0,0.0} vdb.color(color) var pos : L.vec3f = p.pos diff --git a/devapps/benchmarks/bunny_diffusion.t b/devapps/benchmarks/bunny_diffusion.t index f6d69b5..6471f87 100644 --- a/devapps/benchmarks/bunny_diffusion.t +++ b/devapps/benchmarks/bunny_diffusion.t @@ -1,4 +1,4 @@ -import "ebb.liszt" -- Every Liszt File should start with this command +import "ebb" -- Every Ebb File should start with this command -- This line includes the trimesh.t file. -- As a result, the table 'Trimesh' defined in that file is bound to @@ -45,21 +45,21 @@ bunny.vertices.d_temperature:Load(0.0) -- we define the basic computation functions here: -- This could also be written as a function over the edges... -local liszt compute_diffusion ( v : bunny.vertices ) +local ebb compute_diffusion ( v : bunny.vertices ) for nv in v.neighbors do v.d_temperature += timestep * conduction * (nv.temperature - v.temperature) end end -local liszt apply_diffusion ( v : bunny.vertices ) +local ebb apply_diffusion ( v : bunny.vertices ) var d_temp = v.d_temperature / v.degree v.temperature += d_temp avg_temp_change += cmath.fabs(d_temp) end -local liszt clear_temporary ( v : bunny.vertices ) +local ebb clear_temporary ( v : bunny.vertices ) v.d_temperature = 0.0 end @@ -68,7 +68,7 @@ end local vdb = require('ebb.lib.vdb') local cold = L.Constant(L.vec3f,{0.5,0.5,0.5}) local hot = L.Constant(L.vec3f,{1.0,0.0,0.0}) -local liszt debug_tri_draw ( t : bunny.triangles ) +local ebb debug_tri_draw ( t : bunny.triangles ) -- color a triangle with the average temperature of its vertices var avg_temp = (t.v[0].temperature + t.v[1].temperature + t.v[2].temperature) / 3.0 diff --git a/devapps/benchmarks/bunny_laplacian.t b/devapps/benchmarks/bunny_laplacian.t index 1c497ac..b40d922 100644 --- a/devapps/benchmarks/bunny_laplacian.t +++ b/devapps/benchmarks/bunny_laplacian.t @@ -1,4 +1,4 @@ -import "ebb.liszt" -- Every Liszt File should start with this command +import "ebb" -- Every Ebb File should start with this command -- This line includes the trimesh.t file. -- As a result, the table 'Trimesh' defined in that file is bound to @@ -26,7 +26,7 @@ local bunny = Trimesh.LoadFromOFF(tri_mesh_filename) bunny.triangles:NewField('area_normal', L.vec3d):Load({0,0,0}) -local liszt compute_area_normals( t : bunny.triangles ) +local ebb compute_area_normals( t : bunny.triangles ) var p0 = t.v[0].pos var p1 = t.v[1].pos var p2 = t.v[2].pos @@ -37,11 +37,11 @@ end bunny.edges:NewField('laplacian', L.double):Load(0) bunny.vertices:NewField('laplacian_diag', L.double):Load(0) -local liszt zero_laplacian_edge(e : bunny.edges) +local ebb zero_laplacian_edge(e : bunny.edges) e.laplacian = 0 end -local liszt zero_laplacian_vert(v : bunny.vertices) +local ebb zero_laplacian_vert(v : bunny.vertices) v.laplacian_diag = 0 end -local liszt build_laplacian(t : bunny.triangles) +local ebb build_laplacian(t : bunny.triangles) var area : L.double = L.length(t.area_normal) / 2 if area < 0.00001 then area = 0.00001 end @@ -76,11 +76,11 @@ end local timestep = L.Global(L.double, 0.1) bunny.vertices:NewField('d_pos', L.vec3d):Load({0,0,0}) -local liszt zero_d_pos ( v : bunny.vertices ) +local ebb zero_d_pos ( v : bunny.vertices ) v.d_pos = {0,0,0} end -local liszt compute_diffusion ( v : bunny.vertices ) +local ebb compute_diffusion ( v : bunny.vertices ) var acc : L.vec3d = {0,0,0} for e in v.edges do acc += e.laplacian * (e.head.pos - v.pos) @@ -89,7 +89,7 @@ local liszt compute_diffusion ( v : bunny.vertices ) v.d_pos = timestep * acc / v.laplacian_diag end -local liszt apply_diffusion ( v : bunny.vertices ) +local ebb apply_diffusion ( v : bunny.vertices ) v.pos += v.d_pos end @@ -102,7 +102,7 @@ local sqrt3 = math.sqrt(3) -- EXTRA: (optional. It demonstrates the use of VDB, a visual debugger) local vdb = require('ebb.lib.vdb') -local liszt debug_tri_draw ( t : bunny.triangles ) +local ebb debug_tri_draw ( t : bunny.triangles ) -- Spoof a really simple directional light -- with a cos diffuse term determining the triangle gray scale var d = L.dot({1/sqrt3, 1/sqrt3, 1/sqrt3}, diff --git a/devapps/benchmarks/dual_contour.t b/devapps/benchmarks/dual_contour.t index 0fff163..7fe6c84 100644 --- a/devapps/benchmarks/dual_contour.t +++ b/devapps/benchmarks/dual_contour.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" --L.default_processor = L.GPU error("OUT OF DATE EXAMPLE") @@ -47,7 +47,7 @@ quads:NewField('v2', grid.cells):Load(0) quads:NewField('v3', grid.cells):Load(0) -local liszt clamp (val,minval,maxval) +local ebb clamp (val,minval,maxval) if val > maxval then val = maxval end if val < minval then val = minval end return val @@ -86,7 +86,7 @@ grid.cells:NewField('dual_pos', L.vec3f):Load({0,0,0}) ------------------------------- -- Scalar Field Options ------------------------------- -local liszt set_sphere_field( v : grid.vertices ) +local ebb set_sphere_field( v : grid.vertices ) var origin = L.vec3f({0,0,0}) var r = v.pos - origin var radius = L.float(width * 0.75) @@ -96,7 +96,7 @@ local liszt set_sphere_field( v : grid.vertices ) v.gradient = 2 * r -- gradient end -local liszt set_hyperboloid( v : grid.vertices ) +local ebb set_hyperboloid( v : grid.vertices ) var origin = L.vec3f({0,0,0}) var p = v.pos - origin @@ -107,7 +107,7 @@ local liszt set_hyperboloid( v : grid.vertices ) v.gradient[1] = -v.gradient[1] end -local liszt set_sins( v : grid.vertices) +local ebb set_sins( v : grid.vertices) var origin = L.vec3f({0,0,0}) var p = v.pos - origin @@ -142,7 +142,7 @@ end ------------------------------- -- Compute the contouring ------------------------------- -local liszt cut_edges( e : grid.edges ) +local ebb cut_edges( e : grid.edges ) -- guard against boundary cases? var head = e.head @@ -228,7 +228,7 @@ end -- I'm concerned about the stability of this routine... -local liszt cholesky3x3(diag, offdiag, rhs) +local ebb cholesky3x3(diag, offdiag, rhs) -- compute LDL decomposition with 1s along diagonal of L var D0 = diag[0] var L10 = (1/D0) * offdiag[0] @@ -251,7 +251,7 @@ local liszt cholesky3x3(diag, offdiag, rhs) return L.vec3f({ X0, X1, X2 }) end -local liszt householder3x3(diag, offdiag, rhs) +local ebb householder3x3(diag, offdiag, rhs) -- write out A explicitly (columns here) var A0 = {diag[0], offdiag[0], offdiag[1]} var A1 = {offdiag[0], diag[1], offdiag[2]} @@ -305,7 +305,7 @@ local liszt householder3x3(diag, offdiag, rhs) return {X0, X1, X2} end -local liszt cubeclamp(vec,minvec,maxvec) +local ebb cubeclamp(vec,minvec,maxvec) for i=0,3 do vec[i] = clamp(vec[i], minvec[i], maxvec[i]) end @@ -322,7 +322,7 @@ end -- which is a symmetric SPD linear system. To ensure non-singularity, -- we can add a small regularization term with an epsilon scale factor -local liszt gather_dual_pos( c : grid.cells ) +local ebb gather_dual_pos( c : grid.cells ) var v = c.vertex var n_cut = 0 @@ -413,7 +413,7 @@ end ------------------------------- local sqrt3 = math.sqrt(3) local lightdir = L.Constant(L.vec3f, {1/sqrt3, 1/sqrt3, 1/sqrt3}) -local liszt trinorm(p0,p1,p2) +local ebb trinorm(p0,p1,p2) var n = L.vec3f(L.cross(p1-p0, p2-p0)) var len = L.length(n) --if n < 0.00000001 then n = {0,0,0} @@ -422,7 +422,7 @@ local liszt trinorm(p0,p1,p2) return n / len end -local liszt debug_draw_quads( q : quads ) +local ebb debug_draw_quads( q : quads ) var p0 = q.v0.dual_pos var p1 = q.v1.dual_pos var p2 = q.v2.dual_pos diff --git a/devapps/benchmarks/sphere_cloth.t b/devapps/benchmarks/sphere_cloth.t index 276fe60..548e003 100644 --- a/devapps/benchmarks/sphere_cloth.t +++ b/devapps/benchmarks/sphere_cloth.t @@ -1,4 +1,4 @@ -import "ebb.liszt" -- Every Liszt File should start with this command +import "ebb" -- Every Ebb File should start with this command error("OUT OF DATE EXAMPLE") @@ -43,7 +43,7 @@ grid.vertices:NewField('dpos_temp', L.vec3d):Load({0,0,0}) --grid.edges:NewField('J_z', L.vec3d):Load({0,0,0}) grid.vertices:NewField('J_diag', L.vec3d):Load({0,0,0}) -local init_fields = liszt (v : grid.vertices) +local init_fields = ebb (v : grid.vertices) var i = L.int(v.xid) var j = L.int(v.yid) @@ -67,13 +67,13 @@ local FRICTION = 2.0 local dt = L.Global(L.double, 0.00005) -local liszt spring_dvel(dir) +local ebb spring_dvel(dir) var dir_len = L.length(dir) var stretch = (IDEAL_LEN - dir_len) / dir_len return SPRING_K * stretch * dir end -local accel_interior = liszt (v : grid.vertices) +local accel_interior = ebb (v : grid.vertices) v.dvel = { 0, 0, 0 } v.dpos = v.vel @@ -88,7 +88,7 @@ local accel_interior = liszt (v : grid.vertices) spring_dvel(v.pos - v(0, 1).pos) end -local accel_boundary = liszt (v : grid.vertices) +local accel_boundary = ebb (v : grid.vertices) v.dvel = { 0, 0, 0 } v.dpos = v.vel @@ -110,7 +110,7 @@ local accel_boundary = liszt (v : grid.vertices) end end -local accel_collisions = liszt (v : grid.vertices) +local accel_collisions = ebb (v : grid.vertices) -- collision penalty --var dir = v.pos - sphere_center --var lendir = L.length(dir) @@ -152,7 +152,7 @@ local accel_collisions = liszt (v : grid.vertices) v.vel += dt * v.dvel end -local compute_acceleration = liszt (v : grid.vertices) +local compute_acceleration = ebb (v : grid.vertices) var dvel : L.vec3d = { 0, 0, 0 } var dpos : L.vec3d = v.vel @@ -218,7 +218,7 @@ local compute_acceleration = liszt (v : grid.vertices) end -local apply_update = liszt (v : grid.vertices) +local apply_update = ebb (v : grid.vertices) v.pos += v.dpos v.vel += v.dvel end @@ -227,7 +227,7 @@ end local sqrt3 = math.sqrt(3) -local draw_cloth = liszt (v : grid.vertices) +local ebb draw_cloth(v : grid.vertices) if v.xpos_depth == 0 and v.ypos_depth == 0 then var p00 = v(0,0).pos diff --git a/devapps/benchmarks/stable_fluids.t b/devapps/benchmarks/stable_fluids.t index a769a0f..319ece1 100644 --- a/devapps/benchmarks/stable_fluids.t +++ b/devapps/benchmarks/stable_fluids.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" --L.default_processor = L.GPU local Grid = require 'ebb.domains.grid' @@ -63,7 +63,7 @@ grid.cells.velocity_prev:Load({0,0}) ----------------------------------------------------------------------------- grid.cells:NewField('vel_shadow', L.vec2f):Load({0,0}) -local liszt neumann_shadow_update (c : grid.cells) +local ebb neumann_shadow_update (c : grid.cells) if c.xneg_depth > 0 then var v = c(1,0).velocity c.vel_shadow = { -v[0], v[1] } @@ -78,7 +78,7 @@ local liszt neumann_shadow_update (c : grid.cells) c.vel_shadow = { v[0], -v[1] } end end -local liszt neumann_cpy_update (c : grid.cells) +local ebb neumann_cpy_update (c : grid.cells) c.velocity = c.vel_shadow end local function vel_neumann_bnd(cells) @@ -98,7 +98,7 @@ local diffuse_diagonal = L.Global(L.float, 0.0) local diffuse_edge = L.Global(L.float, 0.0) -- One Jacobi-Iteration -local liszt diffuse_lin_solve_jacobi_step (c : grid.cells) +local ebb diffuse_lin_solve_jacobi_step (c : grid.cells) var edge_sum = diffuse_edge * ( c(-1,0).velocity + c(1,0).velocity + c(0,-1).velocity + c(0,1).velocity ) c.vel_shadow = (c.velocity_prev - edge_sum) / diffuse_diagonal @@ -147,7 +147,7 @@ local min_x = grid:xOrigin() + cell_w/2 + epsilon local max_x = grid:xOrigin() + grid:xWidth() - cell_w/2 - epsilon local min_y = grid:yOrigin() + cell_h/2 + epsilon local max_y = grid:yOrigin() + grid:yWidth() - cell_h/2 - epsilon -local snap_to_grid = liszt(p) +local snap_to_grid = ebb(p) var pxy : L.vec2f = p if pxy[0] < min_x then pxy[0] = L.float(min_x) elseif pxy[0] > max_x then pxy[0] = L.float(max_x) end @@ -162,7 +162,7 @@ if PERIODIC then max_y = grid:yOrigin() + grid:yWidth() local d_x = grid:xWidth() local d_y = grid:yWidth() - local liszt wrap_func(val, lower, upper) + local ebb wrap_func(val, lower, upper) var diff = upper-lower var temp = val - lower temp = L.float(L.fmod(temp, diff)) @@ -171,7 +171,7 @@ if PERIODIC then end return temp + lower end - snap_to_grid = liszt(p) + snap_to_grid = ebb(p) var pxy : L.vec2f = p pxy[0] = L.float(wrap_func(pxy[0], min_x, max_x)) pxy[1] = L.float(wrap_func(pxy[1], min_y, max_y)) @@ -179,17 +179,17 @@ if PERIODIC then end end -local liszt advect_where_from(c : grid.cells) +local ebb advect_where_from(c : grid.cells) var offset = - c.velocity_prev -- Make sure all our lookups are appropriately confined c.lookup_pos = snap_to_grid(c.center + advect_dt * offset) end -local liszt advect_point_locate(c : grid.cells) +local ebb advect_point_locate(c : grid.cells) c.lookup_from = grid.dual_locate(c.lookup_pos) end -local liszt advect_interpolate_velocity(c : grid.cells) +local ebb advect_interpolate_velocity(c : grid.cells) -- lookup cell (this is the bottom left corner) var dc = c.lookup_from @@ -236,14 +236,14 @@ grid.cells:NewField('divergence', L.float):Load(0) grid.cells:NewField('p', L.float):Load(0) grid.cells:NewField('p_temp', L.float):Load(0) -local liszt project_lin_solve_jacobi_step (c : grid.cells) +local ebb project_lin_solve_jacobi_step (c : grid.cells) var edge_sum = project_edge * ( c(-1,0).p + c(1,0).p + c(0,-1).p + c(0,1).p ) c.p_temp = (c.divergence - edge_sum) / project_diagonal end -- Neumann condition -local liszt pressure_shadow_update (c : grid.cells) +local ebb pressure_shadow_update (c : grid.cells) if c.xneg_depth > 0 then c.p_temp = c(1,0).p elseif c.xpos_depth > 0 then @@ -254,7 +254,7 @@ local liszt pressure_shadow_update (c : grid.cells) c.p_temp = c(0,-1).p end end -local liszt pressure_cpy_update (c : grid.cells) +local ebb pressure_cpy_update (c : grid.cells) c.p = c.p_temp end local function pressure_neumann_bnd(cells) @@ -282,14 +282,14 @@ local function project_lin_solve(edge, diagonal) end end -local liszt compute_divergence (c : grid.cells) +local ebb compute_divergence (c : grid.cells) -- why the factor of N? var vx_dx = c(1,0).velocity[0] - c(-1,0).velocity[0] var vy_dy = c(0,1).velocity[1] - c(0,-1).velocity[1] c.divergence = L.float(-(0.5/N)*(vx_dx + vy_dy)) end -local liszt compute_projection (c : grid.cells) +local ebb compute_projection (c : grid.cells) var grad = L.vec2f(0.5 * N * { c(1,0).p - c(-1,0).p, c(0,1).p - c(0,-1).p }) c.velocity = c.velocity_prev - grad @@ -346,16 +346,16 @@ end) particles:NewField('next_pos', L.vec2f):Load({0,0}) particles:NewField('pos', L.vec2f):Load({0,0}) -particles:foreach(liszt (p : particles) -- init... +particles:foreach(ebb (p : particles) -- init... p.pos = p.dual_cell.vertex.cell(-1,-1).center + L.vec2f({cell_w/2.0, cell_h/2.0}) end) -local liszt locate_particles (p : particles) +local ebb locate_particles (p : particles) p.dual_cell = grid.dual_locate(p.pos) end -local liszt compute_particle_velocity (p : particles) +local ebb compute_particle_velocity (p : particles) -- lookup cell (this is the bottom left corner) var dc = p.dual_cell @@ -378,7 +378,7 @@ local liszt compute_particle_velocity (p : particles) + x1 * y1 * lc(1,1).velocity_prev ) end -local liszt particle_snap(p, pos) +local ebb particle_snap(p, pos) p.pos = snap_to_grid(pos) end if PERIODIC and INSERT_DELETE then @@ -387,7 +387,7 @@ if PERIODIC and INSERT_DELETE then min_y = grid:yOrigin() max_y = grid:yOrigin() + grid:yWidth() - particle_snap = liszt(p, pos) + particle_snap = ebb(p, pos) p.pos = pos if pos[0] > max_x or pos[0] < min_x or pos[1] > max_y or pos[1] < min_y then @@ -396,7 +396,7 @@ if PERIODIC and INSERT_DELETE then end end -local liszt update_particle_pos (p : particles) +local ebb update_particle_pos (p : particles) var r = L.vec2f({ rand_float() - 0.5, rand_float() - 0.5 }) var pos = p.next_pos + L.float(dt) * r particle_snap(p, pos) @@ -410,7 +410,7 @@ end --grid.cells:print() local source_strength = L.Constant(L.float, 100.0) -local source_velocity = liszt (c : grid.cells) +local source_velocity = ebb (c : grid.cells) if L.fabs(c.center[0]) < 1.75 and L.fabs(c.center[1]) < 1.75 then @@ -423,9 +423,9 @@ local source_velocity = liszt (c : grid.cells) end if PERIODIC then source_strength = L.Constant(L.float, 5.0) - local optional_insertion = liszt(c) end -- no-op + local optional_insertion = ebb(c) end -- no-op if INSERT_DELETE then - optional_insertion = liszt(c) + optional_insertion = ebb(c) var create_particle = rand_float() < 0.01 if create_particle then var pos = c.center + L.vec2f({ @@ -440,7 +440,7 @@ if PERIODIC then end end end - source_velocity = liszt (c : grid.cells) + source_velocity = ebb (c : grid.cells) if L.fabs(c.center[0]) < 1.75 and L.fabs(c.center[1]) < 1.75 then @@ -451,7 +451,7 @@ if PERIODIC then end end -local liszt draw_grid (c : grid.cells) +local ebb draw_grid (c : grid.cells) var color = {1.0, 1.0, 1.0} vdb.color(color) var p : L.vec3f = { c.center[0], c.center[1], 0.0f } @@ -460,7 +460,7 @@ local liszt draw_grid (c : grid.cells) vdb.line(p, p+v*N*10) end -local liszt draw_particles (p : particles) +local ebb draw_particles (p : particles) var color = {1.0,1.0,0.0} vdb.color(color) var pos : L.vec3f = { p.pos[0], p.pos[1], 0.0f } diff --git a/devapps/benchmarks/stable_fluids_multigrid.t b/devapps/benchmarks/stable_fluids_multigrid.t index 518a865..0c5dad2 100644 --- a/devapps/benchmarks/stable_fluids_multigrid.t +++ b/devapps/benchmarks/stable_fluids_multigrid.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" --L.default_processor = L.GPU local Grid = require 'ebb.domains.grid' @@ -65,7 +65,7 @@ for mgrid in pyramid:levelIter() do mgrid.cells:NewField('velocity_prev', L.vec2f):Load({0,0}) end -local liszt lift_up_velocity ( c ) +local ebb lift_up_velocity ( c ) c.velocity = c.down_cell.velocity c.velocity_prev = c.down_cell.velocity_prev --c.vel_shadow @@ -82,7 +82,7 @@ local liszt lift_up_velocity ( c ) end -- linearly interpolate values down -local liszt pull_down_velocity ( c ) +local ebb pull_down_velocity ( c ) var upc = c.up_cell -- interpolation weights @@ -103,7 +103,7 @@ end ----------------------------------------------------------------------------- grid.cells:NewField('vel_shadow', L.vec2f):Load({0,0}) -local liszt neumann_shadow_update (c) +local ebb neumann_shadow_update (c) if c.xneg_depth > 0 then var v = c(1,0).velocity c.vel_shadow = { -v[0], v[1] } @@ -118,7 +118,7 @@ local liszt neumann_shadow_update (c) c.vel_shadow = { v[0], -v[1] } end end -local liszt neumann_cpy_update (c) +local ebb neumann_cpy_update (c) c.velocity = c.vel_shadow end local function vel_neumann_bnd(cells) @@ -134,7 +134,7 @@ local diffuse_diagonal = L.Global(L.float, 0.0) local diffuse_edge = L.Global(L.float, 0.0) -- One Jacobi-Iteration -local liszt diffuse_lin_solve_jacobi_step ( c ) +local ebb diffuse_lin_solve_jacobi_step ( c ) var edge_sum = diffuse_edge * ( c(-1,0).velocity + c(1,0).velocity + c(0,-1).velocity + c(0,1).velocity ) c.vel_shadow = (c.velocity_prev - edge_sum) / diffuse_diagonal @@ -223,7 +223,7 @@ local min_x = grid:xOrigin() + cell_w/2 + epsilon local max_x = grid:xOrigin() + grid:xWidth() - cell_w/2 - epsilon local min_y = grid:yOrigin() + cell_h/2 + epsilon local max_y = grid:yOrigin() + grid:yWidth() - cell_h/2 - epsilon -local snap_to_grid = liszt(p) +local snap_to_grid = ebb(p) var pxy : L.vec2f = p if pxy[0] < min_x then pxy[0] = L.float(min_x) elseif pxy[0] > max_x then pxy[0] = L.float(max_x) end @@ -238,7 +238,7 @@ if PERIODIC then max_y = grid:yOrigin() + grid:yWidth() local d_x = grid:xWidth() local d_y = grid:yWidth() - local liszt wrap_func(val, lower, upper) + local ebb wrap_func(val, lower, upper) var diff = upper-lower var temp = val - lower temp = L.float(cmath.fmod(temp, diff)) @@ -247,7 +247,7 @@ if PERIODIC then end return temp + lower end - snap_to_grid = liszt(p) + snap_to_grid = ebb(p) var pxy : L.vec2f = p pxy[0] = L.float(wrap_func(pxy[0], min_x, max_x)) pxy[1] = L.float(wrap_func(pxy[1], min_y, max_y)) @@ -255,17 +255,17 @@ if PERIODIC then end end -local liszt advect_where_from(c : grid.cells) +local ebb advect_where_from(c : grid.cells) var offset = - c.velocity_prev -- Make sure all our lookups are appropriately confined c.lookup_pos = snap_to_grid(c.center + advect_dt * offset) end -local liszt advect_point_locate(c : grid.cells) +local ebb advect_point_locate(c : grid.cells) c.lookup_from = grid.dual_locate(c.lookup_pos) end -local liszt advect_interpolate_velocity(c : grid.cells) +local ebb advect_interpolate_velocity(c : grid.cells) -- lookup cell (this is the bottom left corner) var dc = c.lookup_from @@ -312,14 +312,14 @@ grid.cells:NewField('divergence', L.float):Load(0) grid.cells:NewField('p', L.float):Load(0) grid.cells:NewField('p_temp', L.float):Load(0) -local liszt project_lin_solve_jacobi_step (c : grid.cells) +local ebb project_lin_solve_jacobi_step (c : grid.cells) var edge_sum = project_edge * ( c(-1,0).p + c(1,0).p + c(0,-1).p + c(0,1).p ) c.p_temp = (c.divergence - edge_sum) / project_diagonal end -- Neumann condition -local liszt pressure_shadow_update (c : grid.cells) +local ebb pressure_shadow_update (c : grid.cells) if c.xneg_depth > 0 then c.p_temp = c(1,0).p elseif c.xpos_depth > 0 then @@ -330,7 +330,7 @@ local liszt pressure_shadow_update (c : grid.cells) c.p_temp = c(0,-1).p end end -local liszt pressure_cpy_update (c : grid.cells) +local ebb pressure_cpy_update (c : grid.cells) c.p = c.p_temp end local function pressure_neumann_bnd(cells) @@ -356,14 +356,14 @@ local function project_lin_solve(edge, diagonal) end end -local liszt compute_divergence (c : grid.cells) +local ebb compute_divergence (c : grid.cells) -- why the factor of N? var vx_dx = c(1,0).velocity[0] - c(-1,0).velocity[0] var vy_dy = c(0,1).velocity[1] - c(0,-1).velocity[1] c.divergence = L.float(-(0.5/N)*(vx_dx + vy_dy)) end -local liszt compute_projection (c : grid.cells) +local ebb compute_projection (c : grid.cells) var grad = L.vec2f(0.5 * N * { c(1,0).p - c(-1,0).p, c(0,1).p - c(0,-1).p }) c.velocity = c.velocity_prev - grad @@ -420,16 +420,16 @@ end) particles:NewField('next_pos', L.vec2f):Load({0,0}) particles:NewField('pos', L.vec2f):Load({0,0}) -particles:foreach(liszt (p : particles) -- init... +particles:foreach(ebb (p : particles) -- init... p.pos = p.dual_cell.vertex.cell(-1,-1).center + L.vec2f({cell_w/2.0, cell_h/2.0}) end) -local liszt locate_particles (p : particles) +local ebb locate_particles (p : particles) p.dual_cell = grid.dual_locate(p.pos) end -local liszt compute_particle_velocity (p : particles) +local ebb compute_particle_velocity (p : particles) -- lookup cell (this is the bottom left corner) var dc = p.dual_cell @@ -452,7 +452,7 @@ local liszt compute_particle_velocity (p : particles) + x1 * y1 * lc(1,1).velocity_prev ) end -local liszt particle_snap(p, pos) +local ebb particle_snap(p, pos) p.pos = snap_to_grid(pos) end if PERIODIC and INSERT_DELETE then @@ -461,7 +461,7 @@ if PERIODIC and INSERT_DELETE then min_y = grid:yOrigin() max_y = grid:yOrigin() + grid:yWidth() - particle_snap = liszt(p, pos) + particle_snap = ebb(p, pos) p.pos = pos if pos[0] > max_x or pos[0] < min_x or pos[1] > max_y or pos[1] < min_y then @@ -470,7 +470,7 @@ if PERIODIC and INSERT_DELETE then end end -local liszt update_particle_pos (p : particles) +local ebb update_particle_pos (p : particles) var r = L.vec2f({ cmath.rand_float() - 0.5, cmath.rand_float() - 0.5 }) var pos = p.next_pos + L.float(dt) * r particle_snap(p, pos) @@ -484,7 +484,7 @@ end --grid.cells:print() local source_strength = L.Constant(L.float, 100.0) -local source_velocity = liszt (c : grid.cells) +local source_velocity = ebb (c : grid.cells) if cmath.fabs(c.center[0]) < 1.75 and cmath.fabs(c.center[1]) < 1.75 then @@ -497,9 +497,9 @@ local source_velocity = liszt (c : grid.cells) end if PERIODIC then source_strength = L.Constant(L.float, 5.0) - local optional_insertion = liszt(c) end -- no-op + local optional_insertion = ebb(c) end -- no-op if INSERT_DELETE then - optional_insertion = liszt(c) + optional_insertion = ebb(c) var create_particle = cmath.rand_float() < 0.01f if create_particle then var pos = c.center + L.vec2f({ @@ -514,7 +514,7 @@ if PERIODIC then end end end - source_velocity = liszt (c : grid.cells) + source_velocity = ebb (c : grid.cells) if cmath.fabs(c.center[0]) < 1.75 and cmath.fabs(c.center[1]) < 1.75 then @@ -525,7 +525,7 @@ if PERIODIC then end end -local liszt draw_grid (c : grid.cells) +local ebb draw_grid (c : grid.cells) var color = {1.0, 1.0, 1.0} vdb.color(color) var p : L.vec3f = { c.center[0], c.center[1], 0.0f } @@ -534,7 +534,7 @@ local liszt draw_grid (c : grid.cells) vdb.line(p, p+v*N*10) end -local liszt draw_particles (p : particles) +local ebb draw_particles (p : particles) var color = {1.0f,1.0f,0.0f} vdb.color(color) var pos : L.vec3f = { p.pos[0], p.pos[1], 0.0f } diff --git a/devapps/benchmarks/trimesh.t b/devapps/benchmarks/trimesh.t index 81297a2..21d53dc 100644 --- a/devapps/benchmarks/trimesh.t +++ b/devapps/benchmarks/trimesh.t @@ -1,4 +1,4 @@ -import "ebb.liszt" -- Every Liszt File should start with this command +import "ebb" -- Every Ebb File should start with this command -- Declare a table named Trimesh @@ -58,10 +58,10 @@ local function build_edges(mesh, vs) --v1s, v2s, v3s) -- index the edges mesh.edges:GroupBy('tail') mesh.vertices:NewFieldMacro('edges', L.NewMacro(function(v) - return liszt ` L.Where(mesh.edges.tail, v) + return ebb ` L.Where(mesh.edges.tail, v) end)) mesh.vertices:NewFieldMacro('neighbors', L.NewMacro(function(v) - return liszt ` L.Where(mesh.edges.tail, v).head + return ebb ` L.Where(mesh.edges.tail, v).head end)) -- set up the pointers from triangles to edges @@ -71,7 +71,7 @@ local function build_edges(mesh, vs) --v1s, v2s, v3s) mesh.triangles:NewField('e31', mesh.edges):Load(0) mesh.triangles:NewField('e23', mesh.edges):Load(0) mesh.triangles:NewField('e32', mesh.edges):Load(0) - local liszt compute_tri_pointers ( t : mesh.triangles ) + local ebb compute_tri_pointers ( t : mesh.triangles ) for e in t.v[0].edges do if e.head == t.v[1] then t.e12 = e end if e.head == t.v[2] then t.e13 = e end diff --git a/devapps/fem/README.md b/devapps/fem/README.md index 4e7e405..abe9626 100644 --- a/devapps/fem/README.md +++ b/devapps/fem/README.md @@ -1,2 +1,2 @@ -This directory holds code for the Liszt comparisons to VEGA FEM +This directory holds code for the Ebb comparisons to VEGA FEM diff --git a/devapps/fem/neohookean.t b/devapps/fem/neohookean.t index a4e90f0..1bd0feb 100644 --- a/devapps/fem/neohookean.t +++ b/devapps/fem/neohookean.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" local PN = require 'ebb.lib.pathname' local U = require 'devapps.fem.utils' @@ -9,7 +9,7 @@ N.profile = false -------------------------------------------------------------------------------- --- All Liszt kernels go here. These are wrapped into Lua function calls (at the +-- All Ebb kernels go here. These are wrapped into Lua function calls (at the -- end of the file) which are called by any code external to this module. -- -- This code is based on the Matlab implementation of neohookean model by @@ -44,7 +44,7 @@ function N:setupFieldsFunctions(mesh) -- Compute B and W (similar computation, hence in one kernel) -- For corresponding Matlab code, see module computeB/ siggraph notes -- algorithm 1 - liszt self.computeBAndW(t : mesh.tetrahedra) + ebb self.computeBAndW(t : mesh.tetrahedra) var Dm : L.mat3d var x4 : L.vec3d = t.v[3].pos for j = 0,3 do @@ -66,7 +66,7 @@ function N:setupFieldsFunctions(mesh) -- For corresponding Matlab code, see module PK1/ siggraph notes -- u = t.muLame, l = t.lambdaLame (should be this, but u in the Matlab code is -- slightly different) - liszt self.PK1(t) + ebb self.PK1(t) var F = t.F var FinvT = t.FinvT var PP = t.muLame * (t.F - FinvT) + (t.lambdaLame * L.log(t.Fdet)) * FinvT @@ -77,7 +77,7 @@ function N:setupFieldsFunctions(mesh) -- For corresponding Matlab code, see module dPdF/ siggraph notes page 24/ 32 -- u = t.muLame, l = t.lambdaLame (should be this, but u in the Matlab code is -- slightly different) - liszt self.dPdF(t, dF) + ebb self.dPdF(t, dF) var dFT = U.transposeMatrix3(dF) var FinvT = t.FinvT var c1 = t.muLame - t.lambdaLame * L.log(t.Fdet) @@ -93,7 +93,7 @@ function N:setupFieldsFunctions(mesh) -- For corresponding code, see Matlab code fem.m/ siggraph notes algorithm 1 -- Reset internal forces and stiffness matrix - liszt self.recomputeAndResetTetTemporaries(t : mesh.tetrahedra) + ebb self.recomputeAndResetTetTemporaries(t : mesh.tetrahedra) -- recompute var Ds : L.mat3d = { { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } } var x4 = t.v[3].pos + t.v[3].q @@ -111,11 +111,11 @@ function N:setupFieldsFunctions(mesh) t.Fdet = L.fabs(U.detMatrix3d(F)) end - liszt self.recomputeAndResetEdgeTemporaries(e : mesh.edges) + ebb self.recomputeAndResetEdgeTemporaries(e : mesh.edges) e.stiffness = { { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } } end - liszt self.recomputeAndResetVertexTemporaries(v : mesh.vertices) + ebb self.recomputeAndResetVertexTemporaries(v : mesh.vertices) v.internal_forces = { 0, 0, 0 } end @@ -125,7 +125,7 @@ function N:setupFieldsFunctions(mesh) -- algorithm 1 -- u = t.muLame, l = t.lambdaLame (should be this, but u in the Matlab code is -- slightly different) - liszt self.computeInternalForces(t : mesh.tetrahedra) + ebb self.computeInternalForces(t : mesh.tetrahedra) var P : L.mat3d = self.PK1(t) var BmT : L.mat3d = U.transposeMatrix3(t.Bm) var rhs : L.mat3d = U.multiplyMatrices3d(P, BmT) @@ -143,7 +143,7 @@ function N:setupFieldsFunctions(mesh) -- ~ siggraph notes algorithm 2 (I couldn't translate the algorithm) -- u = t.muLame, l = t.lambdaLame (should be this, but u in the Matlab code is -- slightly different) - liszt self.computeStiffnessMatrix(t : mesh.tetrahedra) + ebb self.computeStiffnessMatrix(t : mesh.tetrahedra) var Bm : L.mat3d = t.Bm var BmT : L.mat3d = U.transposeMatrix3(t.Bm) var dFRow : L.mat4x3d = { { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } } @@ -207,11 +207,11 @@ function N.computeInternalForcesAndStiffnessMatrix(mesh) mesh.tetrahedra:foreach(N.computeInternalForces) local t_if = timer:Stop() * 1E6 print("Time to assemble force is "..(t_if).." us") - -- mesh:dumpVertFieldToFile('internal_forces', "liszt_output/nh-out/internal_forces_"..tostring(ts)) + -- mesh:dumpVertFieldToFile('internal_forces', "ebb_output/nh-out/internal_forces_"..tostring(ts)) timer:Start() mesh.tetrahedra:foreach(N.computeStiffnessMatrix) local t_stiff = timer:Stop() * 1E6 print("Time to assemble stiffness matrix is "..(t_stiff).." us") - -- mesh:dumpEdgeFieldToFile('stiffness', "liszt_output/nh-out/stiffness_"..tostring(ts)) + -- mesh:dumpEdgeFieldToFile('stiffness', "ebb_output/nh-out/stiffness_"..tostring(ts)) print("Time to assemble force and stiffness matrix is "..(t_if + t_stiff).." us") end diff --git a/devapps/fem/run-fem-experiments.sh b/devapps/fem/run-fem-experiments.sh index 34f3ac7..b9c4b3b 100755 --- a/devapps/fem/run-fem-experiments.sh +++ b/devapps/fem/run-fem-experiments.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # NOTE: To run this script, need to move it to/ make a symlink in project root -# directory, that is, liszt-in-terra. Also, the models in the config files that +# directory, that is, liszt-ebb. Also, the models in the config files that # this script uses are only on lightroast, so will need to update the config # files to run this elsewhere. @@ -19,7 +19,7 @@ steps=5 -outdir="liszt_times" +outdir="ebb_times" mkdir -p $outdir for model in "turtle" "dragon" "hose" # stvk @@ -31,12 +31,12 @@ do outfile="${outdir}/log_${model}_${force}_cpu" rm -rf $outfile echo "Running $config with $force force model, $steps steps, cpu ..." - command=`./liszt devapps/fem/sim_main.t -config $config -force $force -steps $steps >> ${outfile}` + command=`./ebb devapps/fem/sim_main.t -config $config -force $force -steps $steps >> ${outfile}` $command outfile="${outdir}/log_${model}_${force}_gpu" rm -rf $outfile echo "Running $config with $force force model, $steps steps, gpu ..." - command=`./liszt --gpu devapps/fem/sim_main.t -config $config -force $force -steps $steps >> ${outfile}` + command=`./ebb --gpu devapps/fem/sim_main.t -config $config -force $force -steps $steps >> ${outfile}` $command done done diff --git a/devapps/fem/sim_main.t b/devapps/fem/sim_main.t index 1b7c3e9..7a7710d 100644 --- a/devapps/fem/sim_main.t +++ b/devapps/fem/sim_main.t @@ -1,4 +1,4 @@ -import 'ebb.liszt' +import 'ebb' local vdb = require 'ebb.lib.vdb' local Tetmesh = require 'devapps.fem.tetmesh' @@ -11,7 +11,7 @@ local U = require 'devapps.fem.utils' -------------------------------------------------------------------------------- local function printUsageAndExit() - print("Usage : ./liszt [-gpu] devapps/fem/view-files.t ") + print("Usage : ./ebb [-gpu] devapps/fem/view-files.t ") print(" -config (** required **)") print(" -force ") print(" -steps ") @@ -102,11 +102,11 @@ local F = nil local outDirName = nil if forceModel == 'stvk' then F = require 'devapps.fem.stvk' - outDirName = 'liszt_output/stvk-out' + outDirName = 'ebb_output/stvk-out' os.execute('mkdir -p devapps/fem/' .. outDirName) else F = require 'devapps.fem.neohookean' - outDirName = 'liszt_output/nh-out' + outDirName = 'ebb_output/nh-out' os.execute('mkdir -p devapps/fem/' .. outDirName) end F.profile = false -- measure and print out detailed timing? @@ -133,7 +133,7 @@ function computeMassMatrix(mesh) -- Q: Is inflate3Dim flag on? -- A: Yes. This means we want the full mass matrix, -- not just a uniform scalar per-vertex - local liszt buildMassMatrix (t : mesh.tetrahedra) + local ebb buildMassMatrix (t : mesh.tetrahedra) var tet_vol = L.fabs(t.elementDet)/6 var factor = tet_vol * t.density/ 20 for i = 0,4 do @@ -202,100 +202,100 @@ function ImplicitBackwardEulerIntegrator:setupFieldsFunctions(mesh) self.alpha = L.Global(L.double, 0) self.beta = L.Global(L.double, 0) - liszt self.initializeQFields (v : mesh.vertices) + ebb self.initializeQFields (v : mesh.vertices) v.q_1 = v.q v.qvel_1 = v.qvel v.qaccel = { 0, 0, 0 } v.qaccel_1 = { 0, 0, 0 } end - liszt self.initializeqvdelta (v : mesh.vertices) + ebb self.initializeqvdelta (v : mesh.vertices) v.qvdelta = v.qresidual end - liszt self.scaleInternalForces (v : mesh.vertices) + ebb self.scaleInternalForces (v : mesh.vertices) v.internal_forces = self.internalForcesScalingFactor * v.internal_forces end - liszt self.scaleStiffnessMatrix (e : mesh.edges) + ebb self.scaleStiffnessMatrix (e : mesh.edges) e.stiffness = self.internalForcesScalingFactor * e.stiffness end if self.useDamp then - liszt self.createRayleighDampMatrix (e : mesh.edges) + ebb self.createRayleighDampMatrix (e : mesh.edges) e.raydamp = self.dampingStiffnessCoef * e.stiffness + U.diagonalMatrix(self.dampingMassCoef * e.mass) end else - liszt self.createRayleighDampMatrix (e : mesh.edhes) + ebb self.createRayleighDampMatrix (e : mesh.edhes) end end - liszt self.updateqresidual1 (v : mesh.vertices) + ebb self.updateqresidual1 (v : mesh.vertices) for e in v.edges do v.qresidual += U.multiplyMatVec3(e.stiffness, (e.head.q_1 - e.head.q)) end end - liszt self.updateqresidual2 (v : mesh.vertices) + ebb self.updateqresidual2 (v : mesh.vertices) for e in v.edges do v.qresidual += U.multiplyMatVec3(e.stiffness, e.head.qvel) end end - liszt self.updateqresidual3 (v : mesh.vertices) + ebb self.updateqresidual3 (v : mesh.vertices) v.qresidual += (v.internal_forces - v.external_forces) v.qresidual = - ( self.timestep * v.qresidual ) end - liszt self.updateqresidual4 (v : mesh.vertices) + ebb self.updateqresidual4 (v : mesh.vertices) for e in v.edges do v.qresidual += e.mass * (e.head.qvel_1 - e.head.qvel) end end if self.useDamp then - liszt self.updateStiffness1 (e : mesh.edges) + ebb self.updateStiffness1 (e : mesh.edges) e.stiffness = self.timestep * e.stiffness e.stiffness += e.raydamp end else - liszt self.updateStiffness1 (e : mesh.edges) + ebb self.updateStiffness1 (e : mesh.edges) e.stiffness = self.timestep * e.stiffness end end - liszt self.updateStiffness11 (e : mesh.edges) + ebb self.updateStiffness11 (e : mesh.edges) e.stiffness = self.timestep * e.stiffness end if self.useDamp then - liszt self.updateStiffness12 (e : mesh.edges) + ebb self.updateStiffness12 (e : mesh.edges) e.stiffness += e.raydamp end else - liszt self.updateStiffness12 (e : mesh.edges) + ebb self.updateStiffness12 (e : mesh.edges) end end - liszt self.updateStiffness2 (e : mesh.edges) + ebb self.updateStiffness2 (e : mesh.edges) e.stiffness = self.timestep * e.stiffness e.stiffness += U.diagonalMatrix(e.mass) end - liszt self.getError (v : mesh.vertices) + ebb self.getError (v : mesh.vertices) var qd = v.qvdelta var err = L.dot(qd, qd) self.err += err end - liszt self.pcgCalculatePreconditioner (v : mesh.vertices) + ebb self.pcgCalculatePreconditioner (v : mesh.vertices) var stiff = v.diag.stiffness var diag = { stiff[0,0], stiff[1,1], stiff[2,2] } v.precond = { 1.0/diag[0], 1.0/diag[1], 1.0/diag[2] } end - liszt self.pcgCalculateExactResidual (v : mesh.vertices) + ebb self.pcgCalculateExactResidual (v : mesh.vertices) v.r = { 0, 0, 0 } for e in v.edges do v.r += U.multiplyMatVec3(e.stiffness, e.head.x) @@ -303,15 +303,15 @@ function ImplicitBackwardEulerIntegrator:setupFieldsFunctions(mesh) v.r = v.qvdelta - v.r end - liszt self.pcgCalculateNormResidual (v : mesh.vertices) + ebb self.pcgCalculateNormResidual (v : mesh.vertices) self.normRes += L.dot(U.multiplyVectors(v.r, v.precond), v.r) end - liszt self.pcgInitialize (v : mesh.vertices) + ebb self.pcgInitialize (v : mesh.vertices) v.p = U.multiplyVectors(v.r, v.precond) end - liszt self.pcgComputeAp (v : mesh.vertices) + ebb self.pcgComputeAp (v : mesh.vertices) var Ap : L.vec3d = { 0, 0, 0 } for e in v.edges do var A = e.stiffness @@ -321,23 +321,23 @@ function ImplicitBackwardEulerIntegrator:setupFieldsFunctions(mesh) v.Ap = Ap end - liszt self.pcgComputeAlphaDenom (v : mesh.vertices) + ebb self.pcgComputeAlphaDenom (v : mesh.vertices) self.alphaDenom += L.dot(v.p, v.Ap) end - liszt self.pcgUpdateX (v : mesh.vertices) + ebb self.pcgUpdateX (v : mesh.vertices) v.x += self.alpha * v.p end - liszt self.pcgUpdateResidual (v : mesh.vertices) + ebb self.pcgUpdateResidual (v : mesh.vertices) v.r -= self.alpha * v.Ap end - liszt self.pcgUpdateP (v : mesh.vertices) + ebb self.pcgUpdateP (v : mesh.vertices) v.p = self.beta * v.p + U.multiplyVectors(v.precond, v.r) end - liszt self.updateAfterSolve (v : mesh.vertices) + ebb self.updateAfterSolve (v : mesh.vertices) v.qvdelta = v.x v.qvel += v.qvdelta -- TODO: subtracting q from q? @@ -489,12 +489,12 @@ end local setExternalForces = nil -local liszt setExternalForcesStvk (v : mesh.vertices) +local ebb setExternalForcesStvk (v : mesh.vertices) var pos = v.pos v.external_forces = { 10.0, -0.8*pos[1], 0 } end -local liszt setExternalForcesNh (v : mesh.vertices) +local ebb setExternalForcesNh (v : mesh.vertices) v.external_forces = { 5.0, 0, 0 } end diff --git a/devapps/fem/stvk.t b/devapps/fem/stvk.t index f900306..43893c4 100644 --- a/devapps/fem/stvk.t +++ b/devapps/fem/stvk.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" local PN = require 'ebb.lib.pathname' local U = require 'devapps.fem.utils' @@ -9,7 +9,7 @@ S.profile = false -------------------------------------------------------------------------------- --- All Liszt kernels go here. These are wrapped into Lua function calls (at the +-- All Ebb kernels go here. These are wrapped into Lua function calls (at the -- end of the file) which are called by any code external to this module. -------------------------------------------------------------------------------- @@ -23,7 +23,7 @@ function S:setupFieldsFunctions(mesh) -- Here, we precompute PhiG which is used to compute and cache dots, and -- compute A, b, C, and D as required, on a per element basis. - liszt self.precomputeStVKIntegrals (t : mesh.tetrahedra) + ebb self.precomputeStVKIntegrals (t : mesh.tetrahedra) var det = t.elementDet for i = 0,4 do for j = 0,3 do @@ -62,7 +62,7 @@ function S:setupFieldsFunctions(mesh) -- The VEGA Code seems to compute the dots matrix once, and then -- cache it for the duration of a per-tet computation rather than -- allocate disk space - liszt self.tetDots(Phig) + ebb self.tetDots(Phig) var dots : L.mat4d for i=0,4 do var Phigi : L.vec3d = { Phig[i, 0], Phig[i, 1], Phig[i, 2] } @@ -74,22 +74,22 @@ function S:setupFieldsFunctions(mesh) return dots end - liszt self.tetCoefA(volume, phi, i, j) + ebb self.tetCoefA(volume, phi, i, j) return ( volume * U.tensor3( { phi[i, 0], phi[i, 1], phi[i, 2] }, { phi[j, 0], phi[j, 1], phi[j, 2] } ) ) end - liszt self.tetCoefB(volume, dots, i, j) + ebb self.tetCoefB(volume, dots, i, j) return volume * dots[i, j] end - liszt self.tetCoefC(volume, phi, dots, i, j, k) + ebb self.tetCoefC(volume, phi, dots, i, j, k) var res : L.vec3d = volume * dots[j, k] * { phi[i, 0], phi[i, 1], phi[i, 2] } return res end - liszt self.tetCoefD(volume, dots, i, j, k, l) + ebb self.tetCoefD(volume, dots, i, j, k, l) return ( volume * dots[i, j] * dots[k, l] ) end @@ -103,7 +103,7 @@ function S:setupFieldsFunctions(mesh) -- Result is stored as a 3D vector field over all the vertices. -- Linear contributions to internal internal_forces - liszt self.addIFLinearTerms (t : mesh.tetrahedra) + ebb self.addIFLinearTerms (t : mesh.tetrahedra) var phi = t.Phig var dots = self.tetDots(phi) var lambda = t.lambdaLame @@ -128,7 +128,7 @@ function S:setupFieldsFunctions(mesh) end -- Quadratic contributions to internal internal_forces - liszt self.addIFQuadraticTerms (t : mesh.tetrahedra) + ebb self.addIFQuadraticTerms (t : mesh.tetrahedra) var phi = t.Phig var dots = self.tetDots(phi) var lambda = t.lambdaLame @@ -158,7 +158,7 @@ function S:setupFieldsFunctions(mesh) end -- Cubic contributions to internal internal_forces - liszt self.addIFCubicTerms (t : mesh.tetrahedra) + ebb self.addIFCubicTerms (t : mesh.tetrahedra) var phi = t.Phig var dots = self.tetDots(phi) var lambda = t.lambdaLame @@ -187,7 +187,7 @@ function S:setupFieldsFunctions(mesh) end end - liszt self.resetInternalForces (v : mesh.vertices) + ebb self.resetInternalForces (v : mesh.vertices) v.internal_forces = {0, 0, 0} end @@ -210,7 +210,7 @@ function S:setupFieldsFunctions(mesh) -- against scatter from tetrahedra. -- Linear contributions to stiffness matrix - liszt self.addStiffLinearTerms (t : mesh.tetrahedra) + ebb self.addStiffLinearTerms (t : mesh.tetrahedra) var phi = t.Phig var dots = self.tetDots(phi) var lambda = t.lambdaLame @@ -229,7 +229,7 @@ function S:setupFieldsFunctions(mesh) end -- Quadratic contributions to stiffness matrix - liszt self.addStiffQuadraticTerms (t : mesh.tetrahedra) + ebb self.addStiffQuadraticTerms (t : mesh.tetrahedra) var phi = t.Phig var dots = self.tetDots(phi) var lambda = t.lambdaLame @@ -261,7 +261,7 @@ function S:setupFieldsFunctions(mesh) end -- Cubic contributions to stiffness matrix - liszt self.addStiffCubicTerms (t : mesh.tetrahedra) + ebb self.addStiffCubicTerms (t : mesh.tetrahedra) var phi = t.Phig var dots = self.tetDots(phi) var lambda = t.lambdaLame @@ -290,7 +290,7 @@ function S:setupFieldsFunctions(mesh) end end - liszt self.resetStiffnessMatrix (e : mesh.edges) + ebb self.resetStiffnessMatrix (e : mesh.edges) e.stiffness = { { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } } end @@ -366,8 +366,8 @@ function S.computeInternalForcesAndStiffnessMatrix(mesh) local timer = U.Timer.New() timer:Start() computeInternalForces(mesh) - -- mesh:dumpVertFieldToFile('internal_forces', "liszt_output/stvk-out/internal_forces_"..tostring(ts)) + -- mesh:dumpVertFieldToFile('internal_forces', "ebb_output/stvk-out/internal_forces_"..tostring(ts)) computeStiffnessMatrix(mesh) - -- mesh:dumpEdgeFieldToFile('stiffness', "liszt_output/stvk-out/stiffness_"..tostring(ts)) + -- mesh:dumpEdgeFieldToFile('stiffness', "ebb_output/stvk-out/stiffness_"..tostring(ts)) print("Time to assemble force and stiffness matrix is "..(timer:Stop()*1E6).." us") end diff --git a/devapps/fem/test.t b/devapps/fem/test.t index dafd1b7..db05ef0 100644 --- a/devapps/fem/test.t +++ b/devapps/fem/test.t @@ -1,4 +1,4 @@ -import 'ebb.liszt' +import 'ebb' function split_on_spaces(str) local a = {} @@ -60,7 +60,7 @@ local turtle = VEGFileIO.LoadTetmesh local sqrt3 = math.sqrt(3) -local liszt tet_volume(p0,p1,p2,p3) +local ebb tet_volume(p0,p1,p2,p3) var d1 = p1-p0 var d2 = p2-p0 var d3 = p3-p0 @@ -68,7 +68,7 @@ local liszt tet_volume(p0,p1,p2,p3) -- triple product return L.dot(L.cross(d1,d2),d3) end -local liszt trinorm(p0,p1,p2) +local ebb trinorm(p0,p1,p2) var d1 = p1-p0 var d2 = p2-p0 var n = L.cross(d1,d2) @@ -76,7 +76,7 @@ local liszt trinorm(p0,p1,p2) if len < 1e-10 then len = L.float(1e-10) end return n/len end -local liszt dot_to_color(d) +local ebb dot_to_color(d) var val = d * 0.5 + 0.5 var col = L.vec3f({val,val,val}) return col @@ -86,7 +86,7 @@ local lightdir = L.Constant(L.vec3f,{sqrt3,sqrt3,sqrt3}) -- EXTRA: (optional. It demonstrates the use of VDB, a visual debugger) local vdb = require('ebb.lib.vdb') -local visualize = liszt ( t : turtle.tetrahedra ) +local visualize = ebb ( t : turtle.tetrahedra ) var p0 = L.vec3f(t.v0.pos) var p1 = L.vec3f(t.v1.pos) var p2 = L.vec3f(t.v2.pos) diff --git a/devapps/fem/tetmesh.t b/devapps/fem/tetmesh.t index 732a76d..406f6a0 100644 --- a/devapps/fem/tetmesh.t +++ b/devapps/fem/tetmesh.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" local PN = require 'ebb.lib.pathname' local Tetmesh = {} @@ -53,15 +53,15 @@ local function build_element_edges(mesh, elements) -- index the edges mesh.edges:GroupBy('tail') mesh.vertices:NewFieldMacro('edges', L.NewMacro(function(v) - return liszt ` L.Where(mesh.edges.tail, v) + return ebb ` L.Where(mesh.edges.tail, v) end)) mesh.vertices:NewFieldMacro('neighbors', L.NewMacro(function(v) - return liszt ` L.Where(mesh.edges.tail, v).head + return ebb ` L.Where(mesh.edges.tail, v).head end)) -- set up pointers from tetrahedra to edges mesh.tetrahedra:NewField('e', L.matrix(mesh.edges, 4, 4)) - local liszt compute_tet_edges (t : mesh.tetrahedra) + local ebb compute_tet_edges (t : mesh.tetrahedra) for i = 0,4 do for e in t.v[i].edges do for j = 0,4 do @@ -74,7 +74,7 @@ local function build_element_edges(mesh, elements) -- set up pointers from vertices to self edges mesh.vertices:NewField('diag', mesh.edges) - local liszt compute_self_edges (v : mesh.vertices) + local ebb compute_self_edges (v : mesh.vertices) for e in v.edges do if e.head == v then v.diag = e @@ -142,7 +142,7 @@ function Tetmesh.LoadFromLists(vertices, elements) -- get determintant for tetreahedron mesh.tetrahedra:NewFieldMacro('elementDet', L.NewMacro(function(t) - return liszt quote + return ebb quote var a = t.v[0].pos var b = t.v[1].pos var c = t.v[2].pos @@ -154,14 +154,14 @@ function Tetmesh.LoadFromLists(vertices, elements) -- element density mesh.tetrahedra:NewFieldMacro('density', L.NewMacro(function(t) - return liszt `mesh.density end )) + return ebb `mesh.density end )) -- lame constants mesh.tetrahedra:NewFieldMacro('lambdaLame', L.NewMacro(function(t) - return liszt `L.double(mesh.lambdaLame) + return ebb `L.double(mesh.lambdaLame) end )) mesh.tetrahedra:NewFieldMacro('muLame', L.NewMacro(function(t) - return liszt `L.double(mesh.muLame) + return ebb `L.double(mesh.muLame) end )) -- and return the resulting mesh @@ -199,8 +199,8 @@ end function Tetmesh:dumpTetFieldToFile(field, file_name) local field_list = self.tetrahedra[field]:DumpToList() - local field_liszt = PN.scriptdir() .. file_name - local out = io.open(tostring(field_liszt), 'w') + local field_file = PN.scriptdir() .. file_name + local out = io.open(tostring(field_file), 'w') for i = 1, #field_list do out:write(fieldToString(field_list[i]) .. "\n" ) end @@ -211,8 +211,8 @@ function Tetmesh:dumpEdgeFieldToFile(field, file_name) local field_list = self.edges[field]:DumpToList() local tail_list = self.edges.tail:DumpToList() local head_list = self.edges.head:DumpToList() - local field_liszt = PN.scriptdir() .. file_name - local out = io.open(tostring(field_liszt), 'w') + local field_file = PN.scriptdir() .. file_name + local out = io.open(tostring(field_file), 'w') for i = 1, #field_list do out:write( tostring(tail_list[i]) .. " " .. tostring(head_list[i]) .. " " .. @@ -223,8 +223,8 @@ end function Tetmesh:dumpVertFieldToFile(field, file_name) local field_list = self.vertices[field]:DumpToList() - local field_liszt = PN.scriptdir() .. file_name - local out = io.open(tostring(field_liszt), 'w') + local field_file = PN.scriptdir() .. file_name + local out = io.open(tostring(field_file), 'w') for i = 1, #field_list do out:write(fieldToString(field_list[i]) .. "\n" ) end @@ -234,8 +234,8 @@ end function Tetmesh:dumpDeformationToFile(file_name) local pos = self.vertices.pos:DumpToList() local d = self.vertices.q:DumpToList() - local field_liszt = PN.scriptdir() .. file_name - local out = io.open(tostring(field_liszt), 'w') + local field_file = PN.scriptdir() .. file_name + local out = io.open(tostring(field_file), 'w') for i = 1, #pos do out:write(tostring(pos[i][1] + d[i][1]) .. ", " .. tostring(pos[i][2] + d[i][2]) .. ", " .. diff --git a/devapps/fem/utils.t b/devapps/fem/utils.t index 43cfa68..f4c1135 100644 --- a/devapps/fem/utils.t +++ b/devapps/fem/utils.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" local PN = require 'ebb.lib.pathname' local U = {} @@ -55,17 +55,17 @@ end -------------------------------------------------------------------------------- -- Identity matrix -liszt U.getId3() +ebb U.getId3() return { { 1, 0, 0 }, { 0, 1, 0 }, { 0, 0, 1 } } end -- Diagonals -liszt U.diagonalMatrix(a) +ebb U.diagonalMatrix(a) return { { a, 0, 0 }, { 0, a, 0 }, { 0, 0, a } } end -- Tensor product of 2 vectors -liszt U.tensor3(a, b) +ebb U.tensor3(a, b) var result = { { a[0] * b[0], a[0] * b[1], a[0] * b[2] }, { a[1] * b[0], a[1] * b[1], a[1] * b[2] }, { a[2] * b[0], a[2] * b[1], a[2] * b[2] } } @@ -73,17 +73,17 @@ liszt U.tensor3(a, b) end -- Matrix vector product -liszt U.multiplyMatVec3(M, x) +ebb U.multiplyMatVec3(M, x) return { M[0, 0]*x[0] + M[0, 1]*x[1] + M[0, 2]*x[2], M[1, 0]*x[0] + M[1, 1]*x[1] + M[1, 2]*x[2], M[2, 0]*x[0] + M[2, 1]*x[1] + M[2, 2]*x[2] } end -liszt U.multiplyVectors(x, y) +ebb U.multiplyVectors(x, y) return { x[0]*y[0], x[1]*y[1], x[2]*y[2] } end -- Matrix matrix product -liszt U.multiplyMatrices3d(A, B) +ebb U.multiplyMatrices3d(A, B) var res : L.mat3d = { { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } } for i = 0, 3 do for j = 0, 3 do @@ -94,7 +94,7 @@ liszt U.multiplyMatrices3d(A, B) end -- Determinant of 3X3 matrix -liszt U.detMatrix3d(M) +ebb U.detMatrix3d(M) var res = ( M[0,0] * ( M[1,1] * M[2,2] - M[1,2] * M[2,1] ) + M[0,1] * ( M[1,2] * M[2,0] - M[2,2] * M[1,0] ) + M[0,2] * ( M[1,0] * M[2,1] - M[1,1] * M[2,0] ) @@ -103,7 +103,7 @@ liszt U.detMatrix3d(M) end -- Invert 3X3 matrix -liszt U.invertMatrix3d(M) +ebb U.invertMatrix3d(M) var det = U.detMatrix3d(M) var invdet = 1.0/det var res = { { (M[1,1] * M[2,2] - M[1,2] * M[2,1]) * invdet, @@ -119,7 +119,7 @@ liszt U.invertMatrix3d(M) end -- Transpose of a matrix -liszt U.transposeMatrix3(M) +ebb U.transposeMatrix3(M) var res = { { M[0,0], M[1,0], M[2,0] }, { M[0,1], M[1,1], M[2,1] }, { M[0,2], M[1,2], M[2,2] } } diff --git a/devapps/fem/vegfileio.t b/devapps/fem/vegfileio.t index 6f83d47..2d1247b 100644 --- a/devapps/fem/vegfileio.t +++ b/devapps/fem/vegfileio.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" local VEGFileIO = {} VEGFileIO.__index = VEGFileIO diff --git a/devapps/fem/view_files.t b/devapps/fem/view_files.t index fae16f1..80b5008 100644 --- a/devapps/fem/view_files.t +++ b/devapps/fem/view_files.t @@ -1,4 +1,4 @@ -import 'ebb.liszt' +import 'ebb' local vdb = require 'ebb.lib.vdb' local Tetmesh = require 'devapps.fem.tetmesh' @@ -11,7 +11,7 @@ local PN = require 'ebb.lib.pathname' -------------------------------------------------------------------------------- if not arg[2] or arg[2] == "-h" or arg[2] == "--help" then - print("Usage : ./liszt devapps/fem/view-files.t path_to_dir_with_sim_output") + print("Usage : ./ebb devapps/fem/view-files.t path_to_dir_with_sim_output") os.exit(1) end @@ -68,7 +68,7 @@ end local sqrt3 = math.sqrt(3) -local liszt tet_volume(p0,p1,p2,p3) +local ebb tet_volume(p0,p1,p2,p3) var d1 = p0-p3 var d2 = p1-p3 var d3 = p2-p3 @@ -76,7 +76,7 @@ local liszt tet_volume(p0,p1,p2,p3) -- triple product return L.dot(L.cross(d1,d2),d3) end -local liszt trinorm(p0,p1,p2) +local ebb trinorm(p0,p1,p2) var d1 = p1-p0 var d2 = p2-p0 var n = L.cross(d1,d2) @@ -84,7 +84,7 @@ local liszt trinorm(p0,p1,p2) if len < 1e-10 then len = L.float(1e-10) end return n/len end -local liszt dot_to_color(d) +local ebb dot_to_color(d) var val = d * 0.5 + 0.5 var col = L.vec3f({val,val,val}) return col @@ -92,7 +92,7 @@ end local lightdir = L.Constant(L.vec3f,{sqrt3,sqrt3,sqrt3}) -local liszt visualizeDeformation ( t : mesh.tetrahedra ) +local ebb visualizeDeformation ( t : mesh.tetrahedra ) var p0 = L.vec3f(t.v[0].pos) var p1 = L.vec3f(t.v[1].pos) var p2 = L.vec3f(t.v[2].pos) diff --git a/devapps/fluidsGL.t b/devapps/fluidsGL.t index f127ebd..98fe750 100644 --- a/devapps/fluidsGL.t +++ b/devapps/fluidsGL.t @@ -1,4 +1,4 @@ -import 'ebb.liszt' +import 'ebb' local useGPU = true if useGPU then @@ -117,7 +117,7 @@ grid.cells:NewField('advectFrom', grid.dual_cells):Load(0) -- Helper functions -- -local liszt wrapFunc(val, lower, upper) +local ebb wrapFunc(val, lower, upper) var diff = upper - lower var temp = val - lower --temp = L.float(C.fmod(temp, diff)) @@ -128,7 +128,7 @@ local liszt wrapFunc(val, lower, upper) return temp + lower end -local liszt snapToGrid(p) +local ebb snapToGrid(p) var pxy : L.vec2f pxy[0] = L.float(wrapFunc(p[0], min_x, max_x)) pxy[1] = L.float(wrapFunc(p[1], min_y, max_y)) @@ -139,15 +139,15 @@ end -- Advection Functions -- -local liszt advectWhereFrom (c : grid.cells) +local ebb advectWhereFrom (c : grid.cells) c.advectPos = snapToGrid(c.center + dt * N * -c.dv) end -local liszt advectPointLocate (c : grid.cells) +local ebb advectPointLocate (c : grid.cells) c.advectFrom = grid.dual_locate(c.advectPos) end -local liszt advectInterpolateVelocity (c : grid.cells) +local ebb advectInterpolateVelocity (c : grid.cells) -- lookup cell (this is the bottom left corner) var dc = c.advectFrom @@ -182,7 +182,7 @@ end -- Diffusion Function -- -local liszt diffuseProjectFFT (c : gridFFT.cells) +local ebb diffuseProjectFFT (c : gridFFT.cells) var xIndex = L.float(c.xid) var yIndex = L.float(c.yid) var xFFT = c.vx @@ -221,7 +221,7 @@ local liszt diffuseProjectFFT (c : gridFFT.cells) c.vy = yFFT end -local liszt updateVelocity (c : grid.cells) +local ebb updateVelocity (c : grid.cells) var scale = 1.0f / (N * N) c.dv[0] = c.vx[0] * scale c.dv[1] = c.vy[0] * scale @@ -307,16 +307,16 @@ end) particles:NewField('nextPos', L.vec2f):Load({0,0}) particles:NewField('pos', L.vec2f):Load({0,0}) -particles:foreach(liszt (p : particles) -- init... +particles:foreach(ebb (p : particles) -- init... p.pos = p.dual_cell.vertex.cell(-1,-1).center + L.vec2f({cell_w/2.0, cell_h/2.0}) end) -local liszt locateParticles (p : particles) +local ebb locateParticles (p : particles) p.dual_cell = grid.dual_locate(p.pos) end -local liszt computeParticleVelocity (p : particles) +local ebb computeParticleVelocity (p : particles) -- lookup cell (this is the bottom left corner) var dc = p.dual_cell @@ -339,7 +339,7 @@ local liszt computeParticleVelocity (p : particles) + x1 * y1 * lc(1,1).dv ) end -local liszt updateParticlePos (p : particles) +local ebb updateParticlePos (p : particles) --var r = L.vec2f({ C.randFloat() - 0.5, C.randFloat() - 0.5 }) var r = L.vec2f({ 0.0, 0.0 }) var pos = p.nextPos + L.float(dt) * r diff --git a/devapps/gpu/global_reductions.t b/devapps/gpu/global_reductions.t index c040968..15a83b9 100644 --- a/devapps/gpu/global_reductions.t +++ b/devapps/gpu/global_reductions.t @@ -26,7 +26,7 @@ to global memory. We do this twice to get a single result. ------------------------------------------------------------------------------- -- Imports -- ------------------------------------------------------------------------------- -import "ebb.liszt" +import "ebb" local tid = cudalib.nvvm_read_ptx_sreg_tid_x local bid_x = cudalib.nvvm_read_ptx_sreg_ctaid_x diff --git a/devapps/gpu/heat_gpu.t b/devapps/gpu/heat_gpu.t index 2aa9a95..6eecad6 100644 --- a/devapps/gpu/heat_gpu.t +++ b/devapps/gpu/heat_gpu.t @@ -2,7 +2,7 @@ if not terralib.cudacompile then print("This simulation requires CUDA support; exiting...") return end -import 'ebb.liszt' +import 'ebb' L.default_processor = L.GPU -------------------------------------------------------------------------------- diff --git a/devapps/gpu/saxpy.t b/devapps/gpu/saxpy.t index ea5d727..187d4e6 100644 --- a/devapps/gpu/saxpy.t +++ b/devapps/gpu/saxpy.t @@ -1,4 +1,4 @@ -import 'ebb.liszt' +import 'ebb' local tid_x = cudalib.nvvm_read_ptx_sreg_tid_x local b_dim_x = cudalib.nvvm_read_ptx_sreg_ntid_x @@ -7,12 +7,12 @@ local bid_x = cudalib.nvvm_read_ptx_sreg_ctaid_x local N = 100000 --------------------------------------------------------------------------------- ---[[ liszt saxpy ]]-- --------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +--[[ ebb saxpy ]]-- +------------------------------------------------------------------------------- L.default_processor = L.GPU -function run_liszt_saxpy (tests) +function run_ebb_saxpy (tests) local R = L.NewRelation { size = N, name = 'R' } R:NewField("x", L.float):Load(function(i) return i end) R:NewField("y", L.float):Load(function(i) return i*i end) @@ -20,19 +20,19 @@ function run_liszt_saxpy (tests) local a = L.Global(L.float, 3.49230) - local liszt liszt_saxpy (r : R) + local ebb ebb_saxpy (r : R) r.z = a * r.x + r.y end for i = 1, tests do - R:foreach(liszt_saxpy) + R:foreach(ebb_saxpy) end end --------------------------------------------------------------------------------- ---[[ terra saxpy ]]-- --------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +--[[ terra saxpy ]]-- +------------------------------------------------------------------------------- local terra terra_saxpy (n : int, a : float , x : &float, y : &float, z : &float) var id = tid_x() + b_dim_x() * bid_x() if id < n then @@ -65,9 +65,9 @@ function run_terra_saxpy (tests) end --------------------------------------------------------------------------------- ---[[ execute ]]-- --------------------------------------------------------------------------------- -run_liszt_saxpy(1) +------------------------------------------------------------------------------- +--[[ execute ]]-- +------------------------------------------------------------------------------- +run_ebb_saxpy(1) run_terra_saxpy(1) diff --git a/devapps/legion_test.t b/devapps/legion_test.t index 181faa7..973441d 100644 --- a/devapps/legion_test.t +++ b/devapps/legion_test.t @@ -1,9 +1,9 @@ --- This file is to test integration of Liszt with Legion. Add code to test +-- This file is to test integration of Ebb with Legion. Add code to test -- features as they are implemented. -print("* This is a Liszt application *") +print("* This is an Ebb application *") -import "ebb.liszt" +import "ebb" local DLD = require "ebb.src.dld" local C = terralib.includecstring([[ #include ]]) @@ -14,7 +14,7 @@ local cells = L.NewRelation { name = 'cells_1d', size = 4 } cells:NewField('mass', L.float):Load({1.2, 1.4, 2.1, 3.2}) -local liszt InitMass(c) +local ebb InitMass(c) L.print(c.mass) end diff --git a/devapps/livecode_getting_started/example01.t b/devapps/livecode_getting_started/example01.t index 590b0f5..9ef1741 100644 --- a/devapps/livecode_getting_started/example01.t +++ b/devapps/livecode_getting_started/example01.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" local ioOff = require 'ebb.domains.ioOff' local mesh = ioOff.LoadTrimesh( @@ -22,7 +22,7 @@ mesh.triangles.v:print() -- Then, let's try translating the mesh vertices -local liszt translate ( v : mesh.vertices ) +local ebb translate ( v : mesh.vertices ) v.pos += {1,0,0} end diff --git a/devapps/livecode_getting_started/example02.t b/devapps/livecode_getting_started/example02.t index 2a50e56..b350a9b 100644 --- a/devapps/livecode_getting_started/example02.t +++ b/devapps/livecode_getting_started/example02.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" local ioOff = require 'ebb.domains.ioOff' local mesh = ioOff.LoadTrimesh( @@ -9,14 +9,14 @@ local mesh = ioOff.LoadTrimesh( -- Ok, let's try to get some visual output. -- I usually use VDB while developing to do this. --- We created a simple Liszt wrapper around VDB so it's easy to use. +-- We created a simple Ebb wrapper around VDB so it's easy to use. -- We can load this wrapper like any other library. local vdb = require('ebb.lib.vdb') --[[--------------------------- -local liszt visualize ( v : mesh.vertices ) +local ebb visualize ( v : mesh.vertices ) vdb.point(v.pos) end @@ -24,7 +24,7 @@ mesh.vertices:foreach(visualize) ----------------------------- -local liszt visualize ( v : mesh.vertices ) +local ebb visualize ( v : mesh.vertices ) vdb.color({1,1,0}) vdb.point(v.pos) end @@ -40,7 +40,7 @@ mesh.vertices:foreach(visualize) mesh.vertices:NewField('q', L.vec3d):Load({0,0,0}) -local liszt set_oscillation ( v : mesh.vertices ) +local ebb set_oscillation ( v : mesh.vertices ) v.q = v.pos end @@ -51,7 +51,7 @@ mesh.vertices:foreach(set_oscillation) -- Ok, but how do we get this to change over time...? --- Liszt supports global variables that are not fields +-- Ebb supports global variables that are not fields -- so let's set up a global variable to represent time local time = L.Global(L.double, 0) @@ -60,13 +60,13 @@ local time = L.Global(L.double, 0) mesh.vertices:NewField('q', L.vec3d):Load({0,0,0}) -local liszt set_oscillation ( v : mesh.vertices ) +local ebb set_oscillation ( v : mesh.vertices ) v.q = 0.5*( L.sin(time) + 1) * v.pos end mesh.vertices:foreach(set_oscillation) -local liszt visualize ( v : mesh.vertices ) +local ebb visualize ( v : mesh.vertices ) vdb.color({1,1,0}) vdb.point(v.q) end diff --git a/devapps/livecode_getting_started/example03.t b/devapps/livecode_getting_started/example03.t index 4e35d96..3ac2efe 100644 --- a/devapps/livecode_getting_started/example03.t +++ b/devapps/livecode_getting_started/example03.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" local ioOff = require 'ebb.domains.ioOff' --local mesh = ioOff.LoadTrimesh( @@ -16,12 +16,12 @@ local time = L.Global(L.double, 0) mesh.vertices:NewField('q', L.vec3d):Load({0,0,0}) mesh.vertices:NewField('t', L.double):Load(0) -- <------------- -local liszt set_oscillation ( v : mesh.vertices ) +local ebb set_oscillation ( v : mesh.vertices ) v.q = 0.5*( L.sin(time) + 1) * v.pos v.t = 0.5*( L.sin(time) + 1) -- <------------- end -local liszt visualize ( v : mesh.vertices ) +local ebb visualize ( v : mesh.vertices ) vdb.color({v.t,v.t,0}) -- <------------- vdb.point(v.q) end @@ -51,7 +51,7 @@ end mesh.vertices.t:Load(init_temperature) -local liszt compute_update ( v : mesh.vertices ) +local ebb compute_update ( v : mesh.vertices ) var sum_t : L.double = 0.0 var count = 0 @@ -66,7 +66,7 @@ local liszt compute_update ( v : mesh.vertices ) end -local liszt visualize ( v : mesh.vertices ) +local ebb visualize ( v : mesh.vertices ) vdb.color({ 0.5 * v.t + 0.5, 0.5-v.t, 0.5-v.t }) vdb.point(v.pos) end @@ -98,7 +98,7 @@ end mesh.vertices.t:Load(init_temperature) -local liszt compute_update ( v : mesh.vertices ) +local ebb compute_update ( v : mesh.vertices ) var sum_t : L.double = 0.0 var count = 0 @@ -112,12 +112,12 @@ local liszt compute_update ( v : mesh.vertices ) v.d_t = timestep * conduction * diff_t end -local liszt apply_update ( v : mesh.vertices ) +local ebb apply_update ( v : mesh.vertices ) v.t += v.d_t end -local liszt visualize ( v : mesh.vertices ) +local ebb visualize ( v : mesh.vertices ) vdb.color({ 0.5 * v.t + 0.5, 0.5-v.t, 0.5-v.t }) vdb.point(v.pos) end diff --git a/devapps/livecode_getting_started/workspace.t b/devapps/livecode_getting_started/workspace.t index d78ca75..bbfea5f 100644 --- a/devapps/livecode_getting_started/workspace.t +++ b/devapps/livecode_getting_started/workspace.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" local ioOff = require 'ebb.domains.ioOff' --local mesh = ioOff.LoadTrimesh( @@ -25,24 +25,24 @@ local function init_temperature(idx) end mesh.vertices.t:Load(init_temperature) -local liszt compute_degree (e : mesh.edges) +local ebb compute_degree (e : mesh.edges) e.tail.degree += 1 end mesh.edges:foreach(compute_degree) -local liszt compute_update (e : mesh.edges ) +local ebb compute_update (e : mesh.edges ) var diff_t = e.head.t - e.tail.t e.head.d_t += - timestep * conduction * diff_t / e.head.degree e.tail.d_t += timestep * conduction * diff_t / e.tail.degree end -local liszt apply_update (v : mesh.vertices) +local ebb apply_update (v : mesh.vertices) v.t += v.d_t v.d_t = 0 end -local liszt visualize ( v : mesh.vertices ) +local ebb visualize ( v : mesh.vertices ) vdb.color({ 0.5 * v.t + 0.5, 0.5-v.t, 0.5-v.t }) vdb.point(v.pos) end diff --git a/devapps/load_csv.t b/devapps/load_csv.t index 7ab57e6..181ba03 100644 --- a/devapps/load_csv.t +++ b/devapps/load_csv.t @@ -1,4 +1,4 @@ -import 'ebb.liszt' +import 'ebb' -- local cells = L.NewRelation{ name = 'cells', size = 8 } -- local cells = L.NewRelation{ name = 'cells', dims = {2,4} } @@ -6,7 +6,7 @@ import 'ebb.liszt' -- local cells = L.NewRelation{ name = 'cells', dims = {1,8,1} } local cells = L.NewRelation{ name = 'cells', dims = {2,2,2} } -local liszt dump(c, field) +local ebb dump(c, field) L.print(c[field]) end diff --git a/devapps/lulesh/lulesh.t b/devapps/lulesh/lulesh.t index 85c6cdd..f9d9b2f 100644 --- a/devapps/lulesh/lulesh.t +++ b/devapps/lulesh/lulesh.t @@ -1,4 +1,4 @@ -import 'ebb.liszt' +import 'ebb' --L.default_processor = L.GPU @@ -52,9 +52,9 @@ grid.vertices:NewField("fz", L.double):Load(0) grid.vertices:NewField("mass", L.float):Load(0) -- nodal mass -grid.vertices:NewFieldMacro("position", L.NewMacro(function(v) return liszt `{v.px, v.py, v.pz} end)) -grid.vertices:NewFieldMacro("velocity", L.NewMacro(function(v) return liszt `{v.vx, v.vy, v.vz} end)) -grid.vertices:NewFieldMacro("forces", L.NewMacro(function(v) return liszt `{v.fx, v.fy, v.fz} end)) +grid.vertices:NewFieldMacro("position", L.NewMacro(function(v) return ebb `{v.px, v.py, v.pz} end)) +grid.vertices:NewFieldMacro("velocity", L.NewMacro(function(v) return ebb `{v.vx, v.vy, v.vz} end)) +grid.vertices:NewFieldMacro("forces", L.NewMacro(function(v) return ebb `{v.fx, v.fy, v.fz} end)) ------------------------------------------------------------------------------------------ @@ -83,7 +83,7 @@ grid.cells:NewField("force_temp", L.vector(L.double, 3*8)) -- This is also needed to maintain the code style which allows -- extensibility to less structured Hex-Mesh topologies grid.cells:NewField('v', L.vector(grid.vertices, 8)) -grid.cells:foreach(liszt( c : grid.cells ) +grid.cells:foreach(ebb( c : grid.cells ) c.v[0] = c.vertex(0,1,1) c.v[1] = c.vertex(1,1,1) c.v[2] = c.vertex(1,0,1) @@ -164,7 +164,7 @@ local dthydro_tmp = L.Global(L.double, 0.0) ------------------------------------------------------------------------------- --[[ Helper functions and mapped functions ]]-- ------------------------------------------------------------------------------- -local liszt fabs (num) +local ebb fabs (num) var result = num if num < 0 then result = -num end return result @@ -172,7 +172,7 @@ end -- called over individual cells, returns a 24-vector representing an 8x3 matrix in row-major -- form -local liszt getLocalNodeCoordVectors (c) +local ebb getLocalNodeCoordVectors (c) return { c.v[0].px, c.v[0].py, c.v[0].pz, c.v[1].px, c.v[1].py, c.v[1].pz, @@ -185,7 +185,7 @@ local liszt getLocalNodeCoordVectors (c) } end -local liszt getLocalNodeVelocityVectors (c) +local ebb getLocalNodeVelocityVectors (c) return { c.v[0].vx, c.v[0].vy, c.v[0].vz, c.v[1].vx, c.v[1].vy, c.v[1].vz, @@ -197,14 +197,14 @@ local liszt getLocalNodeVelocityVectors (c) c.v[7].vx, c.v[7].vy, c.v[7].vz } end -local liszt row (localCoords, i) +local ebb row (localCoords, i) return {localCoords[3*i], localCoords[3*i+1], localCoords[3*i+2]} end -local liszt TRIPLE_PRODUCT (a,b,c) +local ebb TRIPLE_PRODUCT (a,b,c) return L.dot(a, L.cross(b,c)) end -local liszt calcElemVolume (c) +local ebb calcElemVolume (c) var d61 = c.v[6].position - c.v[1].position var d70 = c.v[7].position - c.v[0].position var d63 = c.v[6].position - c.v[3].position @@ -225,7 +225,7 @@ local liszt calcElemVolume (c) TRIPLE_PRODUCT( d14+d25, d61, d50 ) return volume * twelfth end ---local liszt calcElemVolume (localCoords) +--local ebb calcElemVolume (localCoords) -- var d61 = row(localCoords,6) - row(localCoords,1) -- var d70 = row(localCoords,7) - row(localCoords,0) -- var d63 = row(localCoords,6) - row(localCoords,3) @@ -244,7 +244,7 @@ end -- return volume / 12.0 --end -local liszt calcElemShapeFunctionDerivatives1 (localCoords) +local ebb calcElemShapeFunctionDerivatives1 (localCoords) var r0 = row(localCoords, 0) var r1 = row(localCoords, 1) var r2 = row(localCoords, 2) @@ -269,7 +269,7 @@ local liszt calcElemShapeFunctionDerivatives1 (localCoords) return 8.0 * 0.125 * 0.125 * 0.125 * L.dot(fjet,cjet) end -local liszt calcElemShapeFunctionDerivatives2 (localCoords) +local ebb calcElemShapeFunctionDerivatives2 (localCoords) var r0 = row(localCoords, 0) var r1 = row(localCoords, 1) var r2 = row(localCoords, 2) @@ -327,7 +327,7 @@ local liszt calcElemShapeFunctionDerivatives2 (localCoords) } end -local liszt sumElemFaceNormal (coords20, coords31, stress) +local ebb sumElemFaceNormal (coords20, coords31, stress) var bisect0 = coords20 + coords31 var bisect1 = coords20 - coords31 var area = -.0625 * L.cross(bisect0, bisect1) @@ -338,7 +338,7 @@ local liszt sumElemFaceNormal (coords20, coords31, stress) return area end -local liszt calcElemNodeNormals (c, stress) +local ebb calcElemNodeNormals (c, stress) var x = {c.v[0].px, c.v[1].px, c.v[2].px, c.v[3].px, c.v[4].px, c.v[5].px, c.v[6].px, c.v[7].px } var y = {c.v[0].py, c.v[1].py, c.v[2].py, c.v[3].py, @@ -390,7 +390,7 @@ local liszt calcElemNodeNormals (c, stress) r6[0], r6[1], r6[2], r7[0], r7[1], r7[2] } end -local liszt voluDer (p0,p1,p2,p3,p4,p5) +local ebb voluDer (p0,p1,p2,p3,p4,p5) var m01 = p0.position + p1.position var m12 = p1.position + p2.position var m04 = p0.position + p4.position @@ -413,7 +413,7 @@ local liszt voluDer (p0,p1,p2,p3,p4,p5) return { dvdx*twelfth, dvdy*twelfth, dvdz*twelfth } end -local liszt calcElemVolumeDerivative (c) +local ebb calcElemVolumeDerivative (c) var p0 = c.v[0] var p1 = c.v[1] var p2 = c.v[2] @@ -437,7 +437,7 @@ local liszt calcElemVolumeDerivative (c) v0[2], v1[2], v2[2], v3[2], v4[2], v5[2], v6[2], v7[2] } end -local liszt initialVolumeCalc(c : grid.cells) +local ebb initialVolumeCalc(c : grid.cells) --var localCoords = getLocalNodeCoordVectors(c) var volume = calcElemVolume(c) @@ -461,7 +461,7 @@ end local Nth = 1.0 / N -local liszt initVectorPosition(v : grid.vertices) +local ebb initVectorPosition(v : grid.vertices) v.px = L.double(L.xid(v)) * sz * Nth v.py = L.double(L.yid(v)) * sz * Nth v.pz = L.double(L.zid(v)) * sz * Nth @@ -514,7 +514,7 @@ function timeIncrement( ) m.cycle = m.cycle + 1 end -local liszt accumulateForces(c, f) +local ebb accumulateForces(c, f) c.v[0].fx += row(f,0)[0] c.v[0].fy += row(f,0)[1] c.v[0].fz += row(f,0)[2] @@ -542,7 +542,7 @@ local liszt accumulateForces(c, f) end -local liszt mmult_4x8x3(ma, mb) +local ebb mmult_4x8x3(ma, mb) var result : L.vector(L.double, 12) result[0] = ma[0]*mb[0] + ma[1]*mb[3] + ma[2]*mb[6] + ma[3]*mb[9] + ma[4]*mb[12] + ma[5]*mb[15] + ma[6]*mb[18] + ma[7]*mb[21] result[1] = ma[0]*mb[1] + ma[1]*mb[4] + ma[2]*mb[7] + ma[3]*mb[10] + ma[4]*mb[13] + ma[5]*mb[16] + ma[6]*mb[19] + ma[7]*mb[22] @@ -559,7 +559,7 @@ local liszt mmult_4x8x3(ma, mb) return result end -local liszt mmult_4x3x8 (ma, mb) +local ebb mmult_4x3x8 (ma, mb) var result : L.vector(L.double, 32) result[0] = ma[0]*mb[0] + ma[1]*mb[8] + ma[2]*mb[16] result[1] = ma[0]*mb[1] + ma[1]*mb[9] + ma[2]*mb[17] @@ -596,7 +596,7 @@ local liszt mmult_4x3x8 (ma, mb) return result end -local liszt mmult_8x4x3 (ma, mb) +local ebb mmult_8x4x3 (ma, mb) var result : L.vector(L.double, 24) result[0] = ma[0]*mb[0] + ma[1]*mb[3] + ma[2]*mb[6] + ma[3]*mb[9] result[1] = ma[0]*mb[1] + ma[1]*mb[4] + ma[2]*mb[7] + ma[3]*mb[10] @@ -626,7 +626,7 @@ local liszt mmult_8x4x3 (ma, mb) end local transpose_4x8 = L.NewMacro(function(m) - return liszt `{ + return ebb `{ m[0], m[8], m[16], m[24], m[1], m[9], m[17], m[25], m[2], m[10], m[18], m[26], @@ -640,7 +640,7 @@ end) -local liszt calcVolumeForceForElems (c : grid.cells) +local ebb calcVolumeForceForElems (c : grid.cells) var determ = c.volo * c.vol var volinv = 1.0 / determ var volume13 = L.cbrt(determ) @@ -676,7 +676,7 @@ local liszt calcVolumeForceForElems (c : grid.cells) --c.force_temp = hgf end -local liszt calcPositionForNodes(v : grid.vertices) +local ebb calcPositionForNodes(v : grid.vertices) var accel = v.forces / v.mass -- Enforce boundary conditions of symmetry planes if L.xid(v) == 0 then accel[0] = 0 end @@ -707,7 +707,7 @@ function lagrangeNodal () grid.vertices:foreach(calcPositionForNodes) end -local liszt calcElemCharacteristicLength(localCoords, volume) +local ebb calcElemCharacteristicLength(localCoords, volume) var r0 = row(localCoords, 0) var r1 = row(localCoords, 1) var r2 = row(localCoords, 2) @@ -764,7 +764,7 @@ local liszt calcElemCharacteristicLength(localCoords, volume) return charlength end -local liszt calcElemVelocityGradient(localVelocities, pf, detJ) +local ebb calcElemVelocityGradient(localVelocities, pf, detJ) var inv_detJ = 1.0 / detJ var r06 = row(localVelocities,0) - row(localVelocities,6) var r17 = row(localVelocities,1) - row(localVelocities,7) @@ -820,7 +820,7 @@ end -- This function uses the scratchpade01-03 fields to temporarily store 2nd derivatives -- of position (?) in x, y, z local third = 1.0/3.0 -local liszt calcKinematicsForElem(c, localCoords, localVelocities) +local ebb calcKinematicsForElem(c, localCoords, localVelocities) var volume = calcElemVolume(c) var relativeVolume = volume / c.volo c.vnew = relativeVolume @@ -851,7 +851,7 @@ local liszt calcKinematicsForElem(c, localCoords, localVelocities) end -- TODO -local liszt calcMonotonicQGradientsForElem(c, localCoords, localVelocities) +local ebb calcMonotonicQGradientsForElem(c, localCoords, localVelocities) var ptiny = 1.e-36 var rc0 = row(localCoords,7) @@ -911,19 +911,19 @@ local liszt calcMonotonicQGradientsForElem(c, localCoords, localVelocities) end -- fused Kinematics and Monotonic Q Gradient calculations -local liszt calcKinemAndMQGradientsForElems1(c : grid.cells) +local ebb calcKinemAndMQGradientsForElems1(c : grid.cells) var localCoords = getLocalNodeCoordVectors(c) var localVelocities = getLocalNodeVelocityVectors(c) calcKinematicsForElem(c, localCoords, localVelocities) end -local liszt calcKinemAndMQGradientsForElems2(c : grid.cells) +local ebb calcKinemAndMQGradientsForElems2(c : grid.cells) var localCoords = getLocalNodeCoordVectors(c) var localVelocities = getLocalNodeVelocityVectors(c) calcMonotonicQGradientsForElem(c, localCoords, localVelocities) end -- TODO -local liszt calcMonotonicQRegionForElem(c) +local ebb calcMonotonicQRegionForElem(c) --[[ velocity gradient: delv_xi => scratchpade01 @@ -1062,7 +1062,7 @@ local liszt calcMonotonicQRegionForElem(c) end -- TODO -local liszt calcSoundSpeedForElem(vnewc, rho0, enewc, pnewc, pbvc, bvc) +local ebb calcSoundSpeedForElem(vnewc, rho0, enewc, pnewc, pbvc, bvc) var ss = (pbvc * enewc + vnewc * vnewc * bvc * pnewc) / rho0 if ss <= 0.111111e-36 then ss = 0.3333333e-18 @@ -1073,7 +1073,7 @@ local liszt calcSoundSpeedForElem(vnewc, rho0, enewc, pnewc, pbvc, bvc) end local two_thirds = 2./3. -local liszt calcPressureForElems(e_old, compression, vnewc, pmin, p_cut, eosvmax) +local ebb calcPressureForElems(e_old, compression, vnewc, pmin, p_cut, eosvmax) var c1s : L.double = two_thirds var bvc : L.double = c1s * (compression + 1) var pbvc : L.double = c1s @@ -1087,8 +1087,10 @@ local liszt calcPressureForElems(e_old, compression, vnewc, pmin, p_cut, eosvmax end local sixth = 1./6. -local liszt calcEnergyForElems (p_old, e_old, q_old, compression, compHalfStep, vnewc, - work, delvc, qq_old, ql_old, eosvmax, rho0) +local ebb calcEnergyForElems ( + p_old, e_old, q_old, compression, compHalfStep, vnewc, + work, delvc, qq_old, ql_old, eosvmax, rho0 +) var emin_tmp = m.emin var e_new : L.double = m.emin e_new max= (e_old - 0.5 * delvc * (p_old + q_old) + 0.5 * work) @@ -1136,13 +1138,13 @@ local liszt calcEnergyForElems (p_old, e_old, q_old, compression, compHalfStep, return { p_new, e_new, q_new, bvc, pbvc } end -local liszt updateVolumesForElem (c) +local ebb updateVolumesForElem (c) var tmpV = c.vnew if fabs(tmpV - 1.0) < m.v_cut then tmpV = 1.0 end c.vol = tmpV end -local liszt evalEOSForElem (c) +local ebb evalEOSForElem (c) var rho0 = m.refdens var vnewc = c.vnew var delvc = c.delv @@ -1186,13 +1188,13 @@ local liszt evalEOSForElem (c) c.ss = ssc end -local liszt applyMaterialPropertiesAndUpdateVolume(c : grid.cells) +local ebb applyMaterialPropertiesAndUpdateVolume(c : grid.cells) calcMonotonicQRegionForElem(c) evalEOSForElem(c) updateVolumesForElem(c) end -local liszt updateVolumeForElements(c : grid.cells) +local ebb updateVolumeForElements(c : grid.cells) var tmpV = c.vnew if fabs(tmpV - 1.0) < m.v_cut then tmpV = 1.0 end c.vol = tmpV @@ -1206,7 +1208,7 @@ end -- used to be called timeConstraintKernel -local liszt reduceDtCourant (c : grid.cells) +local ebb reduceDtCourant (c : grid.cells) -- courant constraint calculation var qqc_tmp : L.double = m.qqc var qqc2 = 64.0 * qqc_tmp * qqc_tmp @@ -1231,7 +1233,7 @@ local liszt reduceDtCourant (c : grid.cells) --end end -local liszt reduceDtHydro (c : grid.cells) +local ebb reduceDtHydro (c : grid.cells) var vdovtmp = c.vdov if vdovtmp ~= 0.0 then var dtdvov = m.dvovmax / (fabs(vdovtmp) + 1.e-20) diff --git a/devapps/old_tutorials/bunny_diffusion.t b/devapps/old_tutorials/bunny_diffusion.t index ee45b25..c5c4fc3 100644 --- a/devapps/old_tutorials/bunny_diffusion.t +++ b/devapps/old_tutorials/bunny_diffusion.t @@ -1,4 +1,4 @@ -import "ebb.liszt" -- Every Liszt File should start with this command +import "ebb" -- Every Ebb File should start with this command -- Single line comments in Lua look like this @@ -90,9 +90,9 @@ off_in:close() ------------------------------------------------------------------------------ --- Now We want to construct the Liszt relations +-- Now We want to construct the Ebb relations -- The 'L' namespace is available because of the --- initial 'import "ebb.liszt"' statement at the top of this file +-- initial 'import "ebb"' statement at the top of this file local triangles = L.NewRelation { size = n_tris, name = 'triangles' } local vertices = L.NewRelation { size = n_verts, name = 'vertices' } @@ -144,7 +144,7 @@ triangles.v3:Load(v3_data_array) -- should be at least 0 and less than (vertices:Size() - 1). -- WARNING: If you try to load Row fields with new data after the simulation --- begins, you may get undefined behavior. Liszt reserves the right +-- begins, you may get undefined behavior. Ebb reserves the right -- to arbitrarily re-order the rows during execution. This may happen -- to improve data access patterns, due to the creation or destruction -- of data, or any other number of contingencies! @@ -174,7 +174,7 @@ vertices.nTriangles:Load(0) ------------------------------------------------------------------------------ -- In addition to Fields, we can also define Globals. --- A Liszt Global is a kind of "global" variable that's useful for +-- An Ebb Global is a kind of "global" variable that's useful for -- controlling time-step behavior or computing simple summary statistics -- Unlike Fields, which have a different value for each entry/row in the -- relation, Globals have exactly one value visible to all rows. @@ -198,12 +198,12 @@ local avg_temp_change = L.Global(L.double, 0.0) ------------------------------------------------------------------------------ -- Before we launch into the full computation, we'll take a second --- here to compute the triangles' areas. We can do this in Liszt. +-- here to compute the triangles' areas. We can do this in Ebb. -- Let's see how... --- This first line declares that we're defining a new Liszt function. +-- This first line declares that we're defining a new Ebb function. -- (You can think of this function as the body of a parallel-for loop!) -local liszt compute_tri_area ( t : triangles ) +local ebb compute_tri_area ( t : triangles ) -- We specify that the function will be mapped over rows from the 'triangles' -- relation, and that we'll refer to rows using the variable name 't'. @@ -236,7 +236,7 @@ triangles:map(compute_tri_area) -- We can compute the number of triangles touching each vertex -- using another function -local liszt compute_n_triangles ( t : triangles ) +local ebb compute_n_triangles ( t : triangles ) t.v1.nTriangles += 1 t.v2.nTriangles += 1 t.v3.nTriangles += 1 @@ -251,7 +251,7 @@ triangles:map(compute_n_triangles) local conduction = L.Constant(L.double, 1.0) -- Note that we didn't define conduction as a Global. As a result, it will --- be compiled into the Liszt function. If we later change the value of +-- be compiled into the Ebb function. If we later change the value of -- conduction, by assigning a different constant to the name 'conduction' -- it will have no effect. If we wanted to change the conduction over -- the course of the simulation, then we should have created a Global. @@ -268,13 +268,13 @@ local cmath = terralib.includecstring [[ -- Let's first look at one way we could try writing heat diffusion --- as a single Liszt function. It turns out it will produce compiler +-- as a single Ebb function. It turns out it will produce compiler -- errors if we try to execute it. -- ( TRY IT OUT! Just uncomment the code below, and you should -- get a compiler error when you try to execute this file. ) --[[ -local liszt temp_update_fail ( t : triangles ) +local ebb temp_update_fail ( t : triangles ) -- We should compute edge coefficients to account for different -- geometries, but for simplicity right now, we'll just give -- each edge weight 1 @@ -308,7 +308,7 @@ end -- Why won't the code above work? --- Remember when we said you can think of a Liszt function as the body of a +-- Remember when we said you can think of an Ebb function as the body of a -- parallel-for loop? Suppose we looped over the triangles in two different -- ways: front-to-back and back-to-front. Would the result of the loop be -- the same? No, because each loop iteration both READs from the @@ -325,7 +325,7 @@ vertices.d_temperature:Load(0.0) -- Ok, this is mostly the same as above, except we're writing the -- resutls to a temporary field -local liszt compute_diffusion ( t : triangles ) +local ebb compute_diffusion ( t : triangles ) -- We should compute edge coefficients to account for different -- geometries, but for simplicity right now, we'll just give -- each edge weight 1 @@ -357,7 +357,7 @@ local liszt compute_diffusion ( t : triangles ) end -- Now, we can actually apply the change -local liszt apply_diffusion ( v : vertices ) +local ebb apply_diffusion ( v : vertices ) var d_temp = v.d_temperature -- adjust the temperature by the computed change v.temperature += d_temp @@ -369,7 +369,7 @@ local liszt apply_diffusion ( v : vertices ) end -- And we can clear out the temporary field once we've applied the change -local liszt clear_temporary ( v : vertices ) +local ebb clear_temporary ( v : vertices ) v.d_temperature = 0.0 end @@ -382,7 +382,7 @@ local vdb = require('ebb.lib.vdb') -- heat diffusing across the surface of the bunny model. local cold = L.Constant(L.vec3f,{0.5,0.5,0.5}) local hot = L.Constant(L.vec3f,{1.0,0.0,0.0}) -local liszt debug_tri_draw ( t : triangles ) +local ebb debug_tri_draw ( t : triangles ) -- color a triangle with the average temperature of its vertices var avg_temp = (t.v1.temperature + t.v2.temperature + t.v3.temperature) / 3.0 @@ -419,7 +419,7 @@ end ------------------------------------------------------------------------------ -- We can also dump data out of the relational storage. --- BEWARE: Liszt may re-order your data however it chooses. +-- BEWARE: Ebb may re-order your data however it chooses. -- This means that you need to dump out everything, not just -- a single field. diff --git a/devapps/old_tutorials/factored_bunny_diffusion.t b/devapps/old_tutorials/factored_bunny_diffusion.t index 73b28d7..734dd7a 100644 --- a/devapps/old_tutorials/factored_bunny_diffusion.t +++ b/devapps/old_tutorials/factored_bunny_diffusion.t @@ -1,4 +1,4 @@ -import "ebb.liszt" -- Every Liszt File should start with this command +import "ebb" -- Every Ebb File should start with this command -- This line includes the trimesh.t file. -- As a result, the table 'Trimesh' defined in that file is bound to @@ -52,7 +52,7 @@ bunny.vertices.d_temperature:Load(0.0) -- we define the basic computation functions here: -local liszt compute_diffusion ( tri : bunny.triangles ) +local ebb compute_diffusion ( tri : bunny.triangles ) var e12 : L.double = 1.0 var e23 : L.double = 1.0 var e13 : L.double = 1.0 @@ -73,14 +73,14 @@ local liszt compute_diffusion ( tri : bunny.triangles ) tri.v3.d_temperature += dt_3 end -local liszt apply_diffusion ( v : bunny.vertices ) +local ebb apply_diffusion ( v : bunny.vertices ) var d_temp = v.d_temperature v.temperature += d_temp avg_temp_change += cmath.fabs(d_temp) end -local liszt clear_temporary ( v : bunny.vertices ) +local ebb clear_temporary ( v : bunny.vertices ) v.d_temperature = 0.0 end @@ -89,7 +89,7 @@ end local vdb = require('ebb.lib.vdb') local cold = L.Constant(L.vec3f,{0.5,0.5,0.5}) local hot = L.Constant(L.vec3f,{1.0,0.0,0.0}) -local liszt debug_tri_draw ( t : bunny.triangles ) +local ebb debug_tri_draw ( t : bunny.triangles ) -- color a triangle with the average temperature of its vertices var avg_temp = (t.v1.temperature + t.v2.temperature + t.v3.temperature) / 3.0 diff --git a/devapps/old_tutorials/trimesh.t b/devapps/old_tutorials/trimesh.t index 5d2c202..ab5bd43 100644 --- a/devapps/old_tutorials/trimesh.t +++ b/devapps/old_tutorials/trimesh.t @@ -1,4 +1,4 @@ -import "ebb.liszt" -- Every Liszt File should start with this command +import "ebb" -- Every Ebb File should start with this command -- Declare a table named Trimesh @@ -150,7 +150,7 @@ function Trimesh:ComputeVertexDegree() self.vertices:NewField('degree', L.int) self.vertices.degree:Load(0) - local liszt compute_degrees ( tri : self.triangles ) + local ebb compute_degrees ( tri : self.triangles ) tri.v1.degree += 1 tri.v2.degree += 1 tri.v3.degree += 1 diff --git a/devapps/performance_tests/diffuse.t b/devapps/performance_tests/diffuse.t index c40667b..fec32ba 100644 --- a/devapps/performance_tests/diffuse.t +++ b/devapps/performance_tests/diffuse.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" local Grid = require 'ebb.domains.grid' -- parameters @@ -71,11 +71,11 @@ timer_exec:Start() end -- empty kernel -local liszt empty(c) +local ebb empty(c) end -- scatter field 'field' from 'from' relation to 'to' relation -local liszt Scatter(from, to, field) +local ebb Scatter(from, to, field) from[to](-1,-1,-1)[field] += from[field]/L.float(8) from[to](-1,-1, 1)[field] += from[field]/L.float(8) from[to](-1, 1,-1)[field] += from[field]/L.float(8) @@ -87,7 +87,7 @@ local liszt Scatter(from, to, field) end -- copy field x to y, to test for task parallelism -local liszt Update(rel, field1, field2) +local ebb Update(rel, field1, field2) rel[field2] = (L.float(1.2)*rel(-1, -1, -1)[field1] + L.float(2.7)*rel(1, 1, 1)[field1])/L.float(3.1) end diff --git a/devapps/rel_terra_callback.t b/devapps/rel_terra_callback.t index 4623d9e..c3f1a6e 100644 --- a/devapps/rel_terra_callback.t +++ b/devapps/rel_terra_callback.t @@ -1,4 +1,4 @@ -import 'ebb.liszt' +import 'ebb' local dld = require 'ebb.src.dld' local C = terralib.includecstring([[ #include @@ -7,7 +7,7 @@ local C = terralib.includecstring([[ local cells = L.NewRelation{ name = 'cells', dims = {2,3,1} } -- print fields -local liszt dump(c, field) +local ebb dump(c, field) L.print(c[field]) end diff --git a/devapps/rendering/clef_gl_test.t b/devapps/rendering/clef_gl_test.t index 5c12990..4219a5c 100644 --- a/devapps/rendering/clef_gl_test.t +++ b/devapps/rendering/clef_gl_test.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" --[[ @@ -76,7 +76,7 @@ end) ----------------------------------------------------------------------------- ---[[ Setup Liszt Relations & init GClef ]]-- +--[[ Setup Ebb Relations & init GClef ]]-- ----------------------------------------------------------------------------- local triangles = L.NewRelation { size = 1, name = 'triangles' } @@ -236,18 +236,18 @@ end --- Liszt Mumbo Jumbo +-- Ebb Mumbo Jumbo local time_global = L.Global(L.float, 0) vertices:NewField('pos_temp', L.vector(L.float, 4)):Load({0,0,0,0}) -local liszt update_pos1 (v : vertices) +local ebb update_pos1 (v : vertices) var y = v.pos[1] if y > 0 then y = L.float(0.5 + 0.4 * C.cos(3*time_global)) end v.pos_temp = { v.pos[0], y, v.pos[2], v.pos[3] } end -local liszt update_pos2 (v : vertices) +local ebb update_pos2 (v : vertices) var pos = v.pos_temp v.pos = pos vdb.color(v.color) diff --git a/devapps/soleil/README b/devapps/soleil/README index 807ee8c..1d15941 100644 --- a/devapps/soleil/README +++ b/devapps/soleil/README @@ -1,4 +1,4 @@ -This directory contains a Liszt implementation of the radiative particle-laden +This directory contains an Ebb implementation of the radiative particle-laden compressible flow solver on three-dimensional structured grids code provided originally at: https://github.com/ibermejomoreno/soleil. @@ -7,8 +7,8 @@ In addition, a postprocessing tool written in Python is also contained in this directory that can read the files written during the execution of the soleil.t program. -To run the code (for example, from the liszt-in-terra/ directory): -./liszt devapps/soleil/soleil.t +To run the code (for example, from the liszt-ebb/ directory): +./ebb devapps/soleil/soleil.t The visual debugger vdb can be used to visually monitor the simulation at runtime. It needs to be launched in advance of the execution of the soleil @@ -30,7 +30,7 @@ particlesArrowFactor=100 # Inverse factor to scale arrows (particle velocity) histogramsBinSize=30 # Number of bins in x-based and y-based pdfs added to plots for timeStep in `seq $timeStepMin $timeStepDelta $timeStepMax`; do - python ../liszt-in-terra/devapps/soleil/postprocessSoleil.py \ + python ../liszt-ebb/devapps/soleil/postprocessSoleil.py \ output ${timeStep} \ $fieldName\ $sliceIndex \ diff --git a/devapps/soleil/cavity_32x32.lua b/devapps/soleil/cavity_32x32.lua index 012dd4a..e95ca14 100644 --- a/devapps/soleil/cavity_32x32.lua +++ b/devapps/soleil/cavity_32x32.lua @@ -54,7 +54,7 @@ return { restartEveryTimeSteps = 100, headerFrequency = 20, outputFormat = 'Tecplot', -- Only 'Tecplot' is currently available - outputDirectory = '../soleilOutput/', -- relative to the liszt-in-terra home directory + outputDirectory = '../soleilOutput/', -- relative to the liszt-ebb home directory -- Fluid Options -- gasConstant = 287.058, diff --git a/devapps/soleil/cavity_64x64.lua b/devapps/soleil/cavity_64x64.lua index 0d06f31..98d9662 100644 --- a/devapps/soleil/cavity_64x64.lua +++ b/devapps/soleil/cavity_64x64.lua @@ -54,7 +54,7 @@ return { restartEveryTimeSteps = 1000, headerFrequency = 20, outputFormat = 'Tecplot', -- Only 'Tecplot' is currently available - outputDirectory = '../soleilOutput/', -- relative to the liszt-in-terra home directory + outputDirectory = '../soleilOutput/', -- relative to the liszt-ebb home directory -- Fluid Options -- gasConstant = 287.058, diff --git a/devapps/soleil/couette.lua b/devapps/soleil/couette.lua index 81e6351..6878249 100644 --- a/devapps/soleil/couette.lua +++ b/devapps/soleil/couette.lua @@ -111,6 +111,6 @@ return { outputEveryTimeSteps = 1000, -- Iterations between writing solutions restartEveryTimeSteps = 1000, -- Iterations between writing restarts headerFrequency = 20, -- Iterations between console output headers - outputDirectory = '../soleilOutput/' -- Relative to the liszt root dir + outputDirectory = '../soleilOutput/' -- Relative to the ebb root dir } diff --git a/devapps/soleil/params.lua b/devapps/soleil/params.lua index 1311208..6d1ac99 100644 --- a/devapps/soleil/params.lua +++ b/devapps/soleil/params.lua @@ -114,6 +114,6 @@ return { outputEveryTimeSteps = 10000, -- Iterations between writing solutions restartEveryTimeSteps = 10000, -- Iterations between writing restarts headerFrequency = 20, -- Iterations between console output headers - outputDirectory = '../forced_turbulence/' -- Relative to the liszt root dir + outputDirectory = '../forced_turbulence/' -- Relative to the ebb root dir } diff --git a/devapps/soleil/poiseuille.lua b/devapps/soleil/poiseuille.lua index ef7e5a1..977242c 100644 --- a/devapps/soleil/poiseuille.lua +++ b/devapps/soleil/poiseuille.lua @@ -112,6 +112,6 @@ return { outputEveryTimeSteps = 1000, -- Iterations between writing solutions restartEveryTimeSteps = 1000, -- Iterations between writing restarts headerFrequency = 20, -- Iterations between console output headers - outputDirectory = '../soleilOutput/' -- Relative to the liszt root dir + outputDirectory = '../soleilOutput/' -- Relative to the ebb root dir } diff --git a/devapps/soleil/soleil.t b/devapps/soleil/soleil.t index b03f157..0273601 100644 --- a/devapps/soleil/soleil.t +++ b/devapps/soleil/soleil.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" -- dld for terra callbacks (Tecplot output) local dld = require 'ebb.src.dld' @@ -867,7 +867,7 @@ print("| ____) | | |__| | | |__ | |__ _| |_ | |__ / /\\ \\ |") print("| |_____/ \\____/ |____| |____| |_____| |____| /__/ \\__\\ |") print("| |") print("| Soleil-X is a turbulence/particle/radiation solver written in |") -print("| the Liszt DSL for execution with the Legion runtime. |") +print("| the Liszt-Ebb DSL for execution with the Legion runtime. |") print("| |") print("---------------------------------------------------------------------") print("| |") @@ -1063,12 +1063,12 @@ print("") ----------------------------------------------------------------------------- -- Norm of a vector -local liszt norm (v) +local ebb norm (v) return L.sqrt(L.dot(v, v)) end -- Compute fluid dynamic viscosity from fluid temperature -local liszt GetDynamicViscosity (temperature) +local ebb GetDynamicViscosity (temperature) var viscosity = L.double(0.0) if fluid_options.viscosity_model == Viscosity.Constant then -- Constant @@ -1088,29 +1088,29 @@ local liszt GetDynamicViscosity (temperature) end -- Compute fluid flow sound speed based on temperature (a = sqrt(gamma*R*T)) -local liszt GetSoundSpeed (temperature) +local ebb GetSoundSpeed (temperature) return L.sqrt(fluid_options.gamma * fluid_options.gasConstant * temperature) end -- Function to retrieve particle area, volume and mass --- These are Liszt user-defined functions that behave like a field -particles:NewFieldFunction('cross_section_area', liszt(p) +-- These are Ebb user-defined functions that behave like a field +particles:NewFieldFunction('cross_section_area', ebb(p) return pi * L.pow(p.diameter, 2) / 4.0 end) -particles:NewFieldFunction('volume', liszt(p) +particles:NewFieldFunction('volume', ebb(p) return pi * L.pow(p.diameter, 3) / 6.0 end) -particles:NewFieldFunction('mass', liszt(p) +particles:NewFieldFunction('mass', ebb(p) return p.volume * p.density end) ----------------------------------------------------------------------------- ---[[ LISZT MACROS ]]-- +--[[ EBB MACROS ]]-- ----------------------------------------------------------------------------- local function GenerateTrilinearInterpolation(field_name) - return liszt(dc, xyz) + return ebb(dc, xyz) var c000 = dc.vertex.cell(-1, -1, -1) var c100 = dc.vertex.cell( 0, -1, -1) var c010 = dc.vertex.cell(-1, 0, -1) @@ -1160,7 +1160,7 @@ local InterpolateTriVelocity = GenerateTrilinearInterpolation('velocity') local InterpolateTriTemperature = GenerateTrilinearInterpolation('temperature') ----------------------------------------------------------------------------- ---[[ LISZT FUNCTIONS ]]-- +--[[ EBB FUNCTIONS ]]-- ----------------------------------------------------------------------------- ------- @@ -1172,30 +1172,30 @@ local InterpolateTriTemperature = GenerateTrilinearInterpolation('temperature') -- Here, we use a field for convenience when outputting to file, but this is -- to be removed after grid outputing is well defined from within the grid.t -- module. Similar story with the vertex coordinates (output only). -liszt Flow.InitializeCenterCoordinates (c : grid.cells) +ebb Flow.InitializeCenterCoordinates (c : grid.cells) var xy = c.center c.centerCoordinates = L.vec3d({xy[0], xy[1], xy[2]}) end -liszt Flow.InitializeCellRindLayer (c : grid.cells) +ebb Flow.InitializeCellRindLayer (c : grid.cells) c.cellRindLayer = 0 end -- Hard coding the vertices until we have access in grid.t -- WARNING: Here, I am using the id numbers, but this is unsafe! -liszt Flow.InitializeVertexCoordinates (v : grid.vertices) +ebb Flow.InitializeVertexCoordinates (v : grid.vertices) var x = grid_originX + grid_dx * (L.double(L.xid(v))) var y = grid_originY + grid_dy * (L.double(L.yid(v))) var z = grid_originZ + grid_dz * (L.double(L.zid(v))) v.centerCoordinates = L.vec3d({x, y, z}) end -liszt Flow.InitializeVertexRindLayer (v : grid.vertices) +ebb Flow.InitializeVertexRindLayer (v : grid.vertices) v.vertexRindLayer = 0 end -liszt Flow.InitializePrimitives (c : grid.cells) +ebb Flow.InitializePrimitives (c : grid.cells) if flow_options.initCase == Flow.TaylorGreen2DVortex then -- Define Taylor Green Vortex var taylorGreenDensity = flow_options.initParams[0] @@ -1265,7 +1265,7 @@ liszt Flow.InitializePrimitives (c : grid.cells) end end -liszt Flow.UpdateConservedFromPrimitive (c : grid.cells) +ebb Flow.UpdateConservedFromPrimitive (c : grid.cells) -- Equation of state: T = p / ( R * rho ) var tmpTemperature = c.pressure / (fluid_options.gasConstant * c.rho) @@ -1284,7 +1284,7 @@ liszt Flow.UpdateConservedFromPrimitive (c : grid.cells) end -- Initialize temporaries -liszt Flow.InitializeTemporaries (c : grid.cells) +ebb Flow.InitializeTemporaries (c : grid.cells) c.rho_old = c.rho c.rhoVelocity_old = c.rhoVelocity c.rhoEnergy_old = c.rhoEnergy @@ -1294,7 +1294,7 @@ liszt Flow.InitializeTemporaries (c : grid.cells) end -- Initialize derivatives -liszt Flow.InitializeTimeDerivatives (c : grid.cells) +ebb Flow.InitializeTimeDerivatives (c : grid.cells) c.rho_t = L.double(0.0) c.rhoVelocity_t = L.vec3d({0.0, 0.0, 0.0}) c.rhoEnergy_t = L.double(0.0) @@ -1305,7 +1305,7 @@ end ----------- -- Initialize enthalpy and derivatives -liszt Flow.AddInviscidInitialize (c : grid.cells) +ebb Flow.AddInviscidInitialize (c : grid.cells) c.rhoEnthalpy = c.rhoEnergy + c.pressure end @@ -1313,7 +1313,7 @@ end -- any two adjacent cells with a centered scheme. The left cell (c_l), -- right cell (c_r), and coordinate direction (x = 0, y = 1, or z = 2) -- are the inputs. -liszt Flow.CenteredInviscidFlux (c_l, c_r, direction) +ebb Flow.CenteredInviscidFlux (c_l, c_r, direction) -- Diagonal terms of inviscid flux var rhoFactorDiagonal = L.double(0.0) @@ -1373,7 +1373,7 @@ end -- Compute inviscid fluxes in X direction. Include the first boundary -- cell (c.xneg_depth == 1) to define left flux on first interior cell. -liszt Flow.AddInviscidGetFluxX (c : grid.cells) +ebb Flow.AddInviscidGetFluxX (c : grid.cells) if c.in_interior or c.xneg_depth == 1 then -- Compute the inviscid flux with a centered scheme. @@ -1391,7 +1391,7 @@ end -- Compute inviscid fluxes in Y direction. Include the first boundary -- cell (c.yneg_depth == 1) to define left flux on first interior cell. -liszt Flow.AddInviscidGetFluxY (c : grid.cells) +ebb Flow.AddInviscidGetFluxY (c : grid.cells) if c.in_interior or c.yneg_depth == 1 then -- Compute the inviscid flux with a centered scheme. @@ -1409,7 +1409,7 @@ end -- Compute inviscid fluxes in Z direction. Include the first boundary -- cell (c.zneg_depth == 1) to define left flux on first interior cell. -liszt Flow.AddInviscidGetFluxZ (c : grid.cells) +ebb Flow.AddInviscidGetFluxZ (c : grid.cells) if c.in_interior or c.zneg_depth == 1 then -- Compute the inviscid flux with a centered scheme. @@ -1431,7 +1431,7 @@ end -- (grid_dx, grid_dy, grid_dz) are not appropriate and should be changed -- to reflect those expressed in the Python prototype code -- WARNING_END -liszt Flow.AddInviscidUpdateUsingFluxX (c : grid.cells) +ebb Flow.AddInviscidUpdateUsingFluxX (c : grid.cells) c.rho_t += -(c( 0,0,0).rhoFlux - c(-1,0,0).rhoFlux)/grid_dx c.rhoVelocity_t += -(c( 0,0,0).rhoVelocityFlux - @@ -1439,7 +1439,7 @@ liszt Flow.AddInviscidUpdateUsingFluxX (c : grid.cells) c.rhoEnergy_t += -(c( 0,0,0).rhoEnergyFlux - c(-1,0,0).rhoEnergyFlux)/grid_dx end -liszt Flow.AddInviscidUpdateUsingFluxY (c : grid.cells) +ebb Flow.AddInviscidUpdateUsingFluxY (c : grid.cells) c.rho_t += -(c(0, 0,0).rhoFlux - c(0,-1,0).rhoFlux)/grid_dy c.rhoVelocity_t += -(c(0, 0,0).rhoVelocityFlux - @@ -1447,7 +1447,7 @@ liszt Flow.AddInviscidUpdateUsingFluxY (c : grid.cells) c.rhoEnergy_t += -(c(0, 0,0).rhoEnergyFlux - c(0,-1,0).rhoEnergyFlux)/grid_dy end -liszt Flow.AddInviscidUpdateUsingFluxZ (c : grid.cells) +ebb Flow.AddInviscidUpdateUsingFluxZ (c : grid.cells) c.rho_t += -(c(0,0, 0).rhoFlux - c(0,0,-1).rhoFlux)/grid_dz c.rhoVelocity_t += -(c(0,0, 0).rhoVelocityFlux - @@ -1461,7 +1461,7 @@ end ---------- -- Compute viscous fluxes in X direction -liszt Flow.AddViscousGetFluxX (c : grid.cells) +ebb Flow.AddViscousGetFluxX (c : grid.cells) -- Consider first boundary element (c.xneg_depth == 1) to define left flux -- on first interior cell if c.in_interior or c.xneg_depth == 1 then @@ -1525,7 +1525,7 @@ liszt Flow.AddViscousGetFluxX (c : grid.cells) end -- Compute viscous fluxes in Y direction -liszt Flow.AddViscousGetFluxY (c : grid.cells) +ebb Flow.AddViscousGetFluxY (c : grid.cells) -- Consider first boundary element (c.yneg_depth == 1) to define down flux -- on first interior cell if c.in_interior or c.yneg_depth == 1 then @@ -1589,7 +1589,7 @@ liszt Flow.AddViscousGetFluxY (c : grid.cells) end -- Compute viscous fluxes in Z direction -liszt Flow.AddViscousGetFluxZ (c : grid.cells) +ebb Flow.AddViscousGetFluxZ (c : grid.cells) -- Consider first boundary element (c.zneg_depth == 1) to define down flux -- on first interior cell if c.in_interior or c.zneg_depth == 1 then @@ -1652,21 +1652,21 @@ liszt Flow.AddViscousGetFluxZ (c : grid.cells) end end -liszt Flow.AddViscousUpdateUsingFluxX (c : grid.cells) +ebb Flow.AddViscousUpdateUsingFluxX (c : grid.cells) c.rhoVelocity_t += (c( 0,0,0).rhoVelocityFlux - c(-1,0,0).rhoVelocityFlux)/grid_dx c.rhoEnergy_t += (c( 0,0,0).rhoEnergyFlux - c(-1,0,0).rhoEnergyFlux)/grid_dx end -liszt Flow.AddViscousUpdateUsingFluxY (c : grid.cells) +ebb Flow.AddViscousUpdateUsingFluxY (c : grid.cells) c.rhoVelocity_t += (c(0, 0,0).rhoVelocityFlux - c(0,-1,0).rhoVelocityFlux)/grid_dy c.rhoEnergy_t += (c(0, 0,0).rhoEnergyFlux - c(0,-1,0).rhoEnergyFlux)/grid_dy end -liszt Flow.AddViscousUpdateUsingFluxZ (c : grid.cells) +ebb Flow.AddViscousUpdateUsingFluxZ (c : grid.cells) c.rhoVelocity_t += (c(0,0, 0).rhoVelocityFlux - c(0,0,-1).rhoVelocityFlux)/grid_dz c.rhoEnergy_t += (c(0,0, 0).rhoEnergyFlux - @@ -1677,7 +1677,7 @@ end -- Particles coupling --------------------- -liszt Flow.AddParticlesCoupling (p : particles) +ebb Flow.AddParticlesCoupling (p : particles) if p.state == 1 and particles_options.twoWayCoupling == ON then -- WARNING: Assumes that deltaVelocityOverRelaxationTime and -- deltaTemperatureTerm have been computed previously @@ -1706,7 +1706,7 @@ end -- Holding Temperature Fixed in the presence of Radiation -------------- -liszt Flow.AddEnergySource (c : grid.cells) +ebb Flow.AddEnergySource (c : grid.cells) if radiation_options.zeroAvgHeatSource == ON then -- Remove a constant heat flux in all cells to balance with radiation. -- Note that this has been pre-computed before reaching this kernel (above). @@ -1718,7 +1718,7 @@ end -- Body Forces -------------- -liszt Flow.AddBodyForces (c : grid.cells) +ebb Flow.AddBodyForces (c : grid.cells) -- Add body forces (accelerations) to the momentum c.rhoVelocity_t += c.rho * flow_options.bodyForce @@ -1743,7 +1743,7 @@ function Flow.GenerateUpdateFunctions(relation, stage) local coeff_time = TimeIntegrator.coeff_time[stage] local deltaTime = TimeIntegrator.deltaTime if stage <= 3 then - return liszt(r : relation) + return ebb(r : relation) r.rho_new += coeff_fun * deltaTime * r.rho_t r.rho = r.rho_old + coeff_time * deltaTime * r.rho_t @@ -1757,7 +1757,7 @@ function Flow.GenerateUpdateFunctions(relation, stage) coeff_time * deltaTime * r.rhoEnergy_t end elseif stage == 4 then - return liszt(r : relation) + return ebb(r : relation) r.rho = r.rho_new + coeff_fun * deltaTime * r.rho_t r.rhoVelocity = r.rhoVelocity_new + @@ -1771,14 +1771,14 @@ for sdx = 1, 4 do Flow.UpdateFunctions[sdx] = Flow.GenerateUpdateFunctions(grid.cells, sdx) end -liszt Flow.UpdateAuxiliaryVelocity (c : grid.cells) +ebb Flow.UpdateAuxiliaryVelocity (c : grid.cells) var velocity = c.rhoVelocity / c.rho c.velocity = velocity c.kineticEnergy = 0.5 * L.dot(velocity,velocity) end -- Helper function for updating the ghost fields to minimize repeated code -local liszt UpdateGhostFieldsHelper(c_bnd, c_int, sign, bnd_velocity, bnd_temperature) +local ebb UpdateGhostFieldsHelper(c_bnd, c_int, sign, bnd_velocity, bnd_temperature) -- Temporary variables for computing new halo state var rho = L.double(0.0) @@ -1815,7 +1815,7 @@ local liszt UpdateGhostFieldsHelper(c_bnd, c_int, sign, bnd_velocity, bnd_temper c_bnd.temperatureBoundary = temperature end -liszt Flow.UpdateGhostFieldsStep1 (c : grid.cells) +ebb Flow.UpdateGhostFieldsStep1 (c : grid.cells) if c.xneg_depth > 0 then UpdateGhostFieldsHelper(c, c( 1,0,0), x_sign, xneg_velocity, xneg_temperature) end @@ -1835,7 +1835,7 @@ liszt Flow.UpdateGhostFieldsStep1 (c : grid.cells) UpdateGhostFieldsHelper(c, c(0,0,-1), z_sign, zpos_velocity, zpos_temperature) end end -liszt Flow.UpdateGhostFieldsStep2 (c : grid.cells) +ebb Flow.UpdateGhostFieldsStep2 (c : grid.cells) c.rho = c.rhoBoundary c.rhoVelocity = c.rhoVelocityBoundary c.rhoEnergy = c.rhoEnergyBoundary @@ -1848,7 +1848,7 @@ function Flow.UpdateGhost() end -- Helper function for updating the ghost fields to minimize repeated code -local liszt UpdateGhostThermodynamicsHelper (c_bnd, c_int, bnd_temperature) +local ebb UpdateGhostThermodynamicsHelper (c_bnd, c_int, bnd_temperature) -- Temporary variables for computing new halo state var temp_wall = L.double(0.0) @@ -1866,7 +1866,7 @@ local liszt UpdateGhostThermodynamicsHelper (c_bnd, c_int, bnd_temperature) c_bnd.temperatureBoundary = temperature end -liszt Flow.UpdateGhostThermodynamicsStep1 (c : grid.cells) +ebb Flow.UpdateGhostThermodynamicsStep1 (c : grid.cells) if c.xneg_depth > 0 then UpdateGhostThermodynamicsHelper(c, c( 1,0,0), xneg_temperature) end @@ -1886,7 +1886,7 @@ liszt Flow.UpdateGhostThermodynamicsStep1 (c : grid.cells) UpdateGhostThermodynamicsHelper(c, c(0,0,-1), zpos_temperature) end end -liszt Flow.UpdateGhostThermodynamicsStep2 (c : grid.cells) +ebb Flow.UpdateGhostThermodynamicsStep2 (c : grid.cells) if c.in_boundary then c.pressure = c.pressureBoundary c.temperature = c.temperatureBoundary @@ -1898,7 +1898,7 @@ function Flow.UpdateGhostThermodynamics() end -- Helper function for updating the ghost fields to minimize repeated code -local liszt UpdateGhostVelocityHelper (c_bnd, c_int, sign, bnd_velocity) +local ebb UpdateGhostVelocityHelper (c_bnd, c_int, sign, bnd_velocity) -- Update the boundary cell based on the values in the matching interior cell for i = 0,3 do @@ -1906,7 +1906,7 @@ local liszt UpdateGhostVelocityHelper (c_bnd, c_int, sign, bnd_velocity) end end -liszt Flow.UpdateGhostVelocityStep1 (c : grid.cells) +ebb Flow.UpdateGhostVelocityStep1 (c : grid.cells) if c.xneg_depth > 0 then UpdateGhostVelocityHelper(c, c( 1,0,0), x_sign, xneg_velocity) end @@ -1926,7 +1926,7 @@ liszt Flow.UpdateGhostVelocityStep1 (c : grid.cells) UpdateGhostVelocityHelper(c, c(0,0,-1), z_sign, zpos_velocity) end end -liszt Flow.UpdateGhostVelocityStep2 (c : grid.cells) +ebb Flow.UpdateGhostVelocityStep2 (c : grid.cells) c.velocity = c.velocityBoundary end function Flow.UpdateGhostVelocity() @@ -1935,7 +1935,7 @@ function Flow.UpdateGhostVelocity() end -- Helper function for updating the conservatives to minimize repeated code -local liszt UpdateGhostConservedHelper (c_bnd, c_int, sign, bnd_velocity, +local ebb UpdateGhostConservedHelper (c_bnd, c_int, sign, bnd_velocity, bnd_temperature) -- Temporary variables for computing new halo state @@ -1971,7 +1971,7 @@ local liszt UpdateGhostConservedHelper (c_bnd, c_int, sign, bnd_velocity, 0.5*L.dot(velocity,velocity)) end -liszt Flow.UpdateGhostConservedStep1 (c : grid.cells) +ebb Flow.UpdateGhostConservedStep1 (c : grid.cells) if c.xneg_depth > 0 then UpdateGhostConservedHelper(c, c( 1,0,0), x_sign, xneg_velocity, xneg_temperature) end @@ -1991,7 +1991,7 @@ liszt Flow.UpdateGhostConservedStep1 (c : grid.cells) UpdateGhostConservedHelper(c, c(0,0,-1), z_sign, zpos_velocity, zpos_temperature) end end -liszt Flow.UpdateGhostConservedStep2 (c : grid.cells) +ebb Flow.UpdateGhostConservedStep2 (c : grid.cells) c.rho = c.rhoBoundary c.rhoVelocity = c.rhoVelocityBoundary c.rhoEnergy = c.rhoEnergyBoundary @@ -2001,7 +2001,7 @@ function Flow.UpdateGhostConserved() grid.cells.boundary:foreach(Flow.UpdateGhostConservedStep2) end -liszt Flow.UpdateAuxiliaryThermodynamics (c : grid.cells) +ebb Flow.UpdateAuxiliaryThermodynamics (c : grid.cells) var kineticEnergy = 0.5 * c.rho * L.dot(c.velocity,c.velocity) var pressure = (fluid_options.gamma - 1.0) *( c.rhoEnergy - kineticEnergy ) c.pressure = pressure @@ -2013,22 +2013,22 @@ end --------------------- -- WARNING: non-uniform grid assumption -liszt Flow.ComputeVelocityGradientX (c : grid.cells) +ebb Flow.ComputeVelocityGradientX (c : grid.cells) c.velocityGradientX = 0.5*(c(1,0,0).velocity - c(-1,0,0).velocity)/grid_dx end -- WARNING: non-uniform grid assumption -liszt Flow.ComputeVelocityGradientY (c : grid.cells) +ebb Flow.ComputeVelocityGradientY (c : grid.cells) c.velocityGradientY = 0.5*(c(0,1,0).velocity - c(0,-1,0).velocity)/grid_dy end -- WARNING: non-uniform grid assumption -liszt Flow.ComputeVelocityGradientZ (c : grid.cells) +ebb Flow.ComputeVelocityGradientZ (c : grid.cells) c.velocityGradientZ = 0.5*(c(0,0,1).velocity - c(0,0,-1).velocity)/grid_dz end -- Helper function for updating the boundary gradients to minimize repeated code -local liszt UpdateGhostVelocityGradientHelper (c_bnd, c_int, sign) +local ebb UpdateGhostVelocityGradientHelper (c_bnd, c_int, sign) -- Apply sign change and copy gradients from interior to boundary for i = 0,3 do @@ -2038,7 +2038,7 @@ local liszt UpdateGhostVelocityGradientHelper (c_bnd, c_int, sign) end end -liszt Flow.UpdateGhostVelocityGradientStep1 (c : grid.cells) +ebb Flow.UpdateGhostVelocityGradientStep1 (c : grid.cells) if c.xneg_depth > 0 then UpdateGhostVelocityGradientHelper(c, c( 1,0,0), x_sign) end @@ -2058,7 +2058,7 @@ liszt Flow.UpdateGhostVelocityGradientStep1 (c : grid.cells) UpdateGhostVelocityGradientHelper(c, c(0,0,-1), z_sign) end end -liszt Flow.UpdateGhostVelocityGradientStep2 (c : grid.cells) +ebb Flow.UpdateGhostVelocityGradientStep2 (c : grid.cells) if c.in_boundary then c.velocityGradientX = c.velocityGradientXBoundary c.velocityGradientY = c.velocityGradientYBoundary @@ -2076,7 +2076,7 @@ local dXYZInverseSquare = L.Constant(L.double, 1.0/grid_dx:get() * 1.0/grid_dx:get() + 1.0/grid_dy:get() * 1.0/grid_dy:get() + 1.0/grid_dz:get() * 1.0/grid_dz:get()) -local liszt calculateConvectiveSpectralRadius ( c : grid.cells ) +local ebb calculateConvectiveSpectralRadius ( c : grid.cells ) -- Convective spectral radii -- WARNING: uniform grid assumption c.convectiveSpectralRadius = @@ -2087,7 +2087,7 @@ local liszt calculateConvectiveSpectralRadius ( c : grid.cells ) maxConvectiveSpectralRadius max= c.convectiveSpectralRadius end -local liszt calculateViscousSpectralRadius ( c : grid.cells ) +local ebb calculateViscousSpectralRadius ( c : grid.cells ) -- Viscous spectral radii (including sgs model component) var dynamicViscosity = GetDynamicViscosity(c.temperature) var eddyViscosity = c.sgsEddyViscosity @@ -2097,7 +2097,7 @@ local liszt calculateViscousSpectralRadius ( c : grid.cells ) maxViscousSpectralRadius max= c.viscousSpectralRadius end -local liszt calculateHeatConductionSpectralRadius ( c : grid.cells ) +local ebb calculateHeatConductionSpectralRadius ( c : grid.cells ) var dynamicViscosity = GetDynamicViscosity(c.temperature) -- Heat conduction spectral radii (including sgs model component) @@ -2124,25 +2124,25 @@ end -- WARNING: update cellVolume computation for non-uniform grids local cellVolume = L.Constant(L.double, grid_dx:get() * grid_dy:get() * grid_dz:get()) -local liszt numberOfInteriorCells ( c : grid.cells ) +local ebb numberOfInteriorCells ( c : grid.cells ) Flow.numberOfInteriorCells += 1 end -local liszt areaInterior ( c : grid.cells ) +local ebb areaInterior ( c : grid.cells ) Flow.areaInterior += cellVolume end -local liszt averagePressure ( c : grid.cells ) +local ebb averagePressure ( c : grid.cells ) Flow.averagePressure += c.pressure * cellVolume end -local liszt averageTemperature ( c : grid.cells ) +local ebb averageTemperature ( c : grid.cells ) Flow.averageTemperature += c.temperature * cellVolume end -local liszt averageKineticEnergy ( c : grid.cells ) +local ebb averageKineticEnergy ( c : grid.cells ) Flow.averageKineticEnergy += c.kineticEnergy * cellVolume end -local liszt minTemperature ( c : grid.cells ) +local ebb minTemperature ( c : grid.cells ) Flow.minTemperature min= c.temperature end -local liszt maxTemperature ( c : grid.cells ) +local ebb maxTemperature ( c : grid.cells ) Flow.maxTemperature max= c.temperature end function Flow.IntegrateQuantities(cells) @@ -2184,7 +2184,7 @@ end ---------------- -- functions to draw particles and velocity for debugging purpose -liszt Flow.DrawFunction (c : grid.cells) +ebb Flow.DrawFunction (c : grid.cells) --var xMax = L.double(grid_options.xWidth) --var yMax = L.double(grid_options.yWidth) --var zMax = L.double(grid_options.zWidth) @@ -2274,12 +2274,12 @@ end ------------ -- Locate particles in dual cells -liszt Particles.Locate (p : particles) +ebb Particles.Locate (p : particles) p.dual_cell = grid.dual_locate(p.position) end -- Initialize temporaries for time stepper -liszt Particles.InitializeTemporaries (p : particles) +ebb Particles.InitializeTemporaries (p : particles) if p.state == 1 then p.position_old = p.position p.velocity_old = p.velocity @@ -2295,7 +2295,7 @@ end ---------------- -- Initialize time derivative for each stage of time stepper -liszt Particles.InitializeTimeDerivatives (p : particles) +ebb Particles.InitializeTimeDerivatives (p : particles) if p.state == 1 then p.position_t = L.vec3d({0, 0, 0}) p.velocity_t = L.vec3d({0, 0, 0}) @@ -2304,7 +2304,7 @@ liszt Particles.InitializeTimeDerivatives (p : particles) end -- Update particle fields based on flow fields -liszt Particles.AddFlowCoupling (p: particles) +ebb Particles.AddFlowCoupling (p: particles) if p.state == 1 then -- Locate the dual cell within which this particle is located @@ -2354,7 +2354,7 @@ end -- Body forces -------------- -liszt Particles.AddBodyForces (p : particles) +ebb Particles.AddBodyForces (p : particles) if p.state == 1 and particles_options.particleType == Particles.Free then p.velocity_t += particles_options.bodyForce end @@ -2364,7 +2364,7 @@ end -- Radiation ------------ -liszt Particles.AddRadiation (p : particles) +ebb Particles.AddRadiation (p : particles) if p.state == 1 and radiation_options.radiationType == ON then -- Calculate absorbed radiation intensity considering optically thin -- particles, for a collimated radiation source with negligible @@ -2380,7 +2380,7 @@ liszt Particles.AddRadiation (p : particles) end -- Set particle velocities to underlying flow velocity for initialization -liszt Particles.SetVelocitiesToFlow (p: particles) +ebb Particles.SetVelocitiesToFlow (p: particles) -- Locate the dual cell within which this particle is located p.dual_cell = grid.dual_locate(p.position) @@ -2413,7 +2413,7 @@ function Particles.GenerateUpdateFunctions(relation, stage) local coeff_time = TimeIntegrator.coeff_time[stage] local deltaTime = TimeIntegrator.deltaTime if stage <= 3 then - return liszt(r : relation) + return ebb(r : relation) if r.state == 1 then r.position_new += coeff_fun * deltaTime * r.position_t @@ -2430,7 +2430,7 @@ function Particles.GenerateUpdateFunctions(relation, stage) end end elseif stage == 4 then - return liszt(r : relation) + return ebb(r : relation) if r.state == 1 then r.position = r.position_new + coeff_fun * deltaTime * r.position_t @@ -2447,7 +2447,7 @@ for i = 1, 4 do Particles.GenerateUpdateFunctions(particles, i) end -liszt Particles.UpdateAuxiliaryStep1 (p : particles) +ebb Particles.UpdateAuxiliaryStep1 (p : particles) if p.state == 1 then -- Initialize position and velocity before we check for wall collisions @@ -2632,7 +2632,7 @@ liszt Particles.UpdateAuxiliaryStep1 (p : particles) end end -liszt Particles.UpdateAuxiliaryStep2 (p : particles) +ebb Particles.UpdateAuxiliaryStep2 (p : particles) if p.state == 1 then p.position = p.position_ghost p.velocity = p.velocity_ghost @@ -2645,7 +2645,7 @@ end --------- -- Particles feeder -liszt Particles.Feed(p: particles) +ebb Particles.Feed(p: particles) if p.state == 0 then @@ -2784,7 +2784,7 @@ end ------------ -- Particles collector -liszt Particles.Collect (p: particles) +ebb Particles.Collect (p: particles) if p.state == 1 then @@ -2818,7 +2818,7 @@ end -- Statistics ------------- -liszt Particles.IntegrateQuantities (p : particles) +ebb Particles.IntegrateQuantities (p : particles) if p.state == 1 then Particles.averageTemperature += p.temperature end @@ -2829,7 +2829,7 @@ end -- Visualization ---------------- -liszt Particles.DrawFunction (p : particles) +ebb Particles.DrawFunction (p : particles) --var xMax = L.double(grid_options.xWidth) --var yMax = L.double(grid_options.yWidth) --var zMax = L.double(grid_options.zWidth) diff --git a/devapps/soleil/taylor_green_vortex.lua b/devapps/soleil/taylor_green_vortex.lua index 4943e35..e027705 100644 --- a/devapps/soleil/taylor_green_vortex.lua +++ b/devapps/soleil/taylor_green_vortex.lua @@ -54,7 +54,7 @@ return { restartEveryTimeSteps = 50, headerFrequency = 20, outputFormat = 'Tecplot', -- Only 'Tecplot' is currently available - outputDirectory = '../soleilOutput/', -- relative to the liszt-in-terra home directory + outputDirectory = '../soleilOutput/', -- relative to the liszt-ebb home directory -- Fluid Options -- gasConstant = 20.4128, diff --git a/devapps/tutorials/heat_diffusion.t b/devapps/tutorials/heat_diffusion.t index a5e0dab..cd3e2b7 100644 --- a/devapps/tutorials/heat_diffusion.t +++ b/devapps/tutorials/heat_diffusion.t @@ -1,6 +1,6 @@ -import "ebb.liszt" -- Every Liszt File should start with this command +import "ebb" -- Every Ebb File should start with this command --- The first thing we do in most Liszt simulations is to load +-- The first thing we do in most Ebb simulations is to load -- a geometric domain library. The standard library comes with a -- couple of basic domains and code for loading from some simple file -- formats. Here we load a Trimesh from an OFF file. @@ -18,9 +18,9 @@ local PN = require 'ebb.lib.pathname' -- (In case you're wondering, those dots '.' in the middle of the -- library filenames are specifying subdirectories. i.e. the last -- library load said "pull in the pathname library from subdirectory lib". --- The actual file is LISZT_ROOT/lib/pathname.t on disk.) +-- The actual file is EBB_RELEASE/ebb/lib/pathname.t on disk.) --- Since Liszt is built on top of Terra, we can use Terra's +-- Since Ebb is built on top of Terra, we can use Terra's -- capabilities to quickly pull in C code. The following line -- loads the standard math library. local cmath = terralib.includecstring '#include ' @@ -39,31 +39,31 @@ local bunny = ioOff.LoadTrimesh(tri_mesh_filename) ------------------------------------------------------------------------------ --- Liszt allows us to define two special kinds of variables +-- Ebb allows us to define two special kinds of variables -- independently from the geometric domain: Globals and Constants -- Globals are values that do not vary over the geometric domain, --- nor are they local to a particular Liszt function. +-- nor are they local to a particular Ebb function. -- You can think of them as analogous to Globals in C/C++. --- Notice that we explicitly provide a Liszt type for each global +-- Notice that we explicitly provide a Ebb type for each global -- value when we create it. local timestep = L.Global(L.double, 0.45) -- Constants are just like Globals, except we can't change their values --- Of course, this allows the Liszt compiler to handle Constants more +-- Of course, this allows the Ebb compiler to handle Constants more -- efficiently, so make sure to choose appropriately which kind of -- value you want to use. local conduction = L.Constant(L.double, 1.0) ------------------------------------------------------------------------------ --- However, most of the data in a Liszt simulation is +-- However, most of the data in an Ebb simulation is -- not stored in Globals and Constants. -- It occurs in Fields, which are defined over different elements -- in the geometric domain. --- Liszt calls these sets of elements in the domain 'Relations'. +-- Ebb calls these sets of elements in the domain 'Relations'. -- For instance, the Trimesh domain defines 3 basic relations: -- * vertices -- * edges (directed) @@ -94,7 +94,7 @@ bunny.vertices.temperature:Load(initial_temperature) bunny.vertices:NewField('d_temperature', L.double):Load(0.0) -- Notice how we just appended the load to the end of the NewField() --- function. Liszt returns the Field object as the result of +-- function. Ebb returns the Field object as the result of -- the NewField call in order to make it more convenient to -- intialize fields as you define them. @@ -103,18 +103,18 @@ bunny.vertices:NewField('d_temperature', L.double):Load(0.0) -- At this point, we've successfully loaded the mesh into our -- Geometric domain, defined some useful variables and -- set up some fields. Now we're going to define the --- Liszt functions that will actually compute the simulation timesteps +-- Ebb functions that will actually compute the simulation timesteps -- Think of this as the body of a parallel for loop. -- For instance, in `compute_update` below, we're defining a -- parallel computation to be performed for each vertex of the mesh. --- The 'liszt' keyword here tells us that we're defining --- a Liszt function, with name compute_update and one argument +-- The 'ebb' keyword here tells us that we're defining +-- an Ebb function, with name compute_update and one argument -- a vertex from bunny.vertices -local liszt compute_update ( v : bunny.vertices ) +local ebb compute_update ( v : bunny.vertices ) -- Here we define some local variables. - -- If no explicit type is annotated, Liszt tries to infer one + -- If no explicit type is annotated, Ebb tries to infer one var sum_t : L.double = 0.0 var count = 0 @@ -132,7 +132,7 @@ local liszt compute_update ( v : bunny.vertices ) end -- Now, let's define a second function that applies the update -local liszt apply_update ( v : bunny.vertices ) +local ebb apply_update ( v : bunny.vertices ) v.temperature += v.d_temperature end @@ -147,7 +147,7 @@ end local vdb = require('ebb.lib.vdb') local cold = L.Constant(L.vec3f,{0.5,0.5,0.5}) local hot = L.Constant(L.vec3f,{1.0,0.0,0.0}) -local liszt debug_tri_draw ( t : bunny.triangles ) +local ebb debug_tri_draw ( t : bunny.triangles ) var avg_temp = 0.0 for i=0,3 do avg_temp += t.v[i].temperature end avg_temp = avg_temp / 3.0 @@ -166,7 +166,7 @@ end -- Ok, Let's recap. We -- 1) Loaded the mesh -- 2) Defined data (Globals, Constants, Fields) --- 3) Defined computations (Liszt functions) +-- 3) Defined computations (Ebb functions) -- Now, we're going to tie everything together by running a simulation -- loop. This loop is going to run in Lua and sequentially launch -- data parallel computations over the relations of the domain. diff --git a/devapps/tutorials/heat_diffusion_2.t b/devapps/tutorials/heat_diffusion_2.t index 1800452..866d4af 100644 --- a/devapps/tutorials/heat_diffusion_2.t +++ b/devapps/tutorials/heat_diffusion_2.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" local ioOff = require 'ebb.domains.ioOff' local PN = require 'ebb.lib.pathname' @@ -10,7 +10,7 @@ local bunny = ioOff.LoadTrimesh(tri_mesh_filename) -- Let's try writing the previous heat diffusion example a couple of -- different ways. We'll see some ways that don't work and -- some that do. In the process we'll learn a bit more about --- how Liszt works and different ways of defining Liszt simulations. +-- how Ebb works and different ways of defining Ebb simulations. ------------------------------------------------------------------------------ @@ -32,7 +32,7 @@ bunny.vertices:NewField('d_temperature', L.double):Load(0.0) -- To start with, let's re-define the original -- computation's functions. -local liszt compute_update ( v : bunny.vertices ) +local ebb compute_update ( v : bunny.vertices ) var sum_t : L.double = 0.0 var count = 0 @@ -46,37 +46,37 @@ local liszt compute_update ( v : bunny.vertices ) v.d_temperature = timestep * conduction * diff_t end -local liszt apply_update ( v : bunny.vertices ) +local ebb apply_update ( v : bunny.vertices ) v.temperature += v.d_temperature end ------------------------------------------------------------------------------ --- Let's take a second to talk about how Liszt compiles. As you may have --- noticed, Liszt is a Lua-embedded DSL. That means that the bulk of this --- file is just Lua code. When we define a Liszt function using the --- `liszt` command, then all of a sudden we switch from Lua into --- Liszt code. Instead of declaring variables with `local` we use +-- Let's take a second to talk about how Ebb compiles. As you may have +-- noticed, Ebb is a Lua-embedded DSL. That means that the bulk of this +-- file is just Lua code. When we define an Ebb function using the +-- `ebb` command, then all of a sudden we switch from Lua into +-- Ebb code. Instead of declaring variables with `local` we use -- `var`, and a number of other changes (e.g. explicitly typed variables) -- Lua is an interpreted and dynamically typed language, -- which means each line of the program is executed as you encounter it -- and any type-errors won't be discovered until you execute the code. --- Liszt is a compiled and statically typed language, --- which means that Liszt functions are passed through a compiler (LLVM) +-- Ebb is a compiled and statically typed language, +-- which means that Ebb functions are passed through a compiler (LLVM) -- in order to generate high performance code. Also, any type errors --- in Liszt code will be reported when its type-checked and then all +-- in Ebb code will be reported when its type-checked and then all -- of then we know the compiled version won't have any trivial type -- errors in it. -- How the heck do these two languages interact? --- The basic idea is that Liszt is JiT (Just in Time) compiled using a +-- The basic idea is that Ebb is JiT (Just in Time) compiled using a -- two-stage model (similar to Terra) -- Stage 1: (aka. Definition-Time) -- Whenever the thread of control in the Lua interpreter --- reaches a Liszt function declaration, *specialization* occurs. +-- reaches an Ebb function declaration, *specialization* occurs. -- Stage 2: (aka. Compile-Time) -- Whenever the function is first used, we compile it. -- At this point, *typechecking*, and *compilation* occur @@ -104,22 +104,22 @@ bunny.vertices:foreach(apply_update) -- both `compute_update` and for `apply_update`. -- Great, now that we've got that straight, let's look at --- how Liszt prevents parallel races using the typechecker. +-- how Ebb prevents parallel races using the typechecker. ------------------------------------------------------------------------------ --- Liszt functions can call each other (non-recursively). +-- Ebb functions can call each other (non-recursively). -- So we might rationally think -- "Hmmm, why are we mapping two functions, -- when we could be mapping just one?" -- Good question. Let's try defining an aggregate function -local liszt compute_and_apply_update( v : bunny.vertices ) +local ebb compute_and_apply_update( v : bunny.vertices ) compute_update(v) apply_update(v) end --- Remember, at this point Liszt hasn't yet tried to typecheck +-- Remember, at this point Ebb hasn't yet tried to typecheck -- `compute_and_apply_update`. To see what happens, uncomment the -- following line. @@ -146,21 +146,21 @@ end -- the parallel computation might happen in different orders. This is -- what we would normally call a race condition. --- Liszt prevents programmers from running code with potential races +-- Ebb prevents programmers from running code with potential races -- regardless of whether the programmer is running code on their --- laptop's CPU, a GPU or a supercomputer. As a result, Liszt can +-- laptop's CPU, a GPU or a supercomputer. As a result, Ebb can -- guarantee that code developed on one machine is safe to port to -- a different, parallel machine without introducing race conditions. --- Inside a Liszt function, each Field and Global variable is accessed +-- Inside an Ebb function, each Field and Global variable is accessed -- in some combination of the 3 basic Phases: -- * READ -- * WRITE -- * REDUCE(operator) (e.g. operator = + or *) -- --- Additionally, Liszt will notice if all Field accesses are done +-- Additionally, Ebb will notice if all Field accesses are done -- through the "centered" element. The element passed in as the main --- argument of a Liszt function; the element from the relation that +-- argument of an Ebb function; the element from the relation that -- the function is being mapped over is called the centered element, -- the centered key or the centered row. If a field is accessed -- exclusively through this centered element, then we say the field @@ -177,7 +177,7 @@ end -- instead of one. We need to use some kind of buffering trick -- in order to execute safely on parallel machines. If you stop and -- think about this, it becomes clear that this is a fundamental --- constraint of parallel processing that Liszt is exposing to you. +-- constraint of parallel processing that Ebb is exposing to you. ------------------------------------------------------------------------------ @@ -187,14 +187,14 @@ end -- update one of these from the either. -- This solution would normally involve a lot of bookkeeping, but since --- it's so common of a pattern, Liszt provides us with some helpful +-- it's so common of a pattern, Ebb provides us with some helpful -- functions to make it easier to write. -- First, let's create our secondary buffer of temperatures bunny.vertices:NewField('temp_temperature', L.double):Load(0.0) -- Now, we'll define the single compute function -local liszt compute_with_temp ( v : bunny.vertices ) +local ebb compute_with_temp ( v : bunny.vertices ) var sum_t : L.double = 0.0 var count = 0 @@ -234,7 +234,7 @@ bunny.vertices:Swap('temperature', 'temp_temperature') -- that on the fly before, but it'll be easier to cache it now. bunny.vertices:NewField('degree', L.int):Load(0) -local liszt compute_degree ( v : bunny.vertices ) +local ebb compute_degree ( v : bunny.vertices ) for e in v.edges do v.degree += 1 end @@ -246,7 +246,7 @@ bunny.vertices:foreach(compute_degree) -- At this point we should note that Trimesh provides directed edges, -- so we'll get one computation for each edge direction. -local liszt compute_edge_update ( e : bunny.edges ) +local ebb compute_edge_update ( e : bunny.edges ) var ht = e.head.temperature var tt = e.tail.temperature var dt = ht - tt @@ -260,13 +260,13 @@ end -- rather than a gather computation. -- We'll need some way to zero out the `d_temperature` field -local liszt zero_d_temperature ( v : bunny.vertices ) +local ebb zero_d_temperature ( v : bunny.vertices ) v.d_temperature = 0 end -- Then, we can define a way to apply the update. For convenience, -- we'll go ahead and zero out the temperature after we read it. -local liszt apply_edge_update ( v : bunny.vertices ) +local ebb apply_edge_update ( v : bunny.vertices ) v.temperature += v.d_temperature zero_d_temperature(v) end @@ -291,13 +291,13 @@ bunny.vertices:foreach(apply_edge_update) -- Great, let's summarize what we learned in this tutorial real quick --- 1) We learned about Liszt's execution model --- - Liszt specializes code at Definition-Time --- - Liszt typechecks code at Compile-Time --- - Liszt waits until the first time +-- 1) We learned about Ebb's execution model +-- - Ebb specializes code at Definition-Time +-- - Ebb typechecks code at Compile-Time +-- - Ebb waits until the first time -- a function is executed to compile it --- 2) We learned about how Liszt uses Phases to ensure safe and portable +-- 2) We learned about how Ebb uses Phases to ensure safe and portable -- parallel code. -- 3) We learned that we can `Swap` fields, which can help us manage diff --git a/devapps/tutorials/heat_diffusion_3.t b/devapps/tutorials/heat_diffusion_3.t index ab80e66..4e5baa0 100644 --- a/devapps/tutorials/heat_diffusion_3.t +++ b/devapps/tutorials/heat_diffusion_3.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" -- In this tutorial, we're going to write heat diffusion yet again. @@ -33,7 +33,7 @@ grid.cells:NewField('d_temperature', L.double) :Load(0) ------------------------------------------------------------------------------ -- Here we define the compute kernels again. -local liszt compute_update ( c : grid.cells ) +local ebb compute_update ( c : grid.cells ) -- Notice that now, instead of a for loop to loop over edges/neighbors, -- we're using relative offsets from the "centered" cell. -- This expression sums the temperatures in cells to the @@ -44,7 +44,7 @@ local liszt compute_update ( c : grid.cells ) c.d_temperature = timestep * conduction * (avg_t - c.temperature) end -local liszt apply_update ( c : grid.cells ) +local ebb apply_update ( c : grid.cells ) c.temperature += c.d_temperature end @@ -56,13 +56,13 @@ end -- over the "interior" cells, and then impose a boundary condition -- on the remaining "boundary" cells. --- To handle boundary conditions in Liszt, we use subsets +-- To handle boundary conditions in Ebb, we use subsets -- Our grid has two subsets: `interior` and `boundary` -- Let's define a Dirichlet boundary condition that will -- create a sinusoidal heat pattern local PI_N = 4.0 * math.pi / N -local liszt dirichlet_condition ( c : grid.cells ) +local ebb dirichlet_condition ( c : grid.cells ) -- c.center is the position of the cell center -- using the coordinate system we defined when we created -- the grid. @@ -83,7 +83,7 @@ grid.cells.boundary:foreach(dirichlet_condition) local vdb = require('ebb.lib.vdb') local cold = L.Constant(L.vec3f,{0.5,0.5,0.5}) local hot = L.Constant(L.vec3f,{1.0,0.0,0.0}) -local liszt debug_quad_draw ( c : grid.cells ) +local ebb debug_quad_draw ( c : grid.cells ) var scale = L.float(0.5 * c.temperature) var pos = c.center diff --git a/devapps/tutorials/spring_mass.t b/devapps/tutorials/spring_mass.t index bb66f17..51470af 100644 --- a/devapps/tutorials/spring_mass.t +++ b/devapps/tutorials/spring_mass.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" -- In this tutorial, we're going to write a spring-mass simulation @@ -41,7 +41,7 @@ print('read file') rendermesh.vertices:NewField('tet', dragon.tetrahedra):Load(tets) rendermesh.vertices:NewField('interp', L.vec4d):Load(interps) -local liszt update_rendermesh( rv : rendermesh.vertices ) +local ebb update_rendermesh( rv : rendermesh.vertices ) var pos : L.vec3d = { 0.0, 0.0, 0.0 } for k=0,4 do pos += rv.interp[k] * rv.tet.v[k].pos @@ -73,12 +73,12 @@ dragon.vertices:NewField('inv_mass', L.double) :Load(1) dragon.edges:NewField('rest_len', L.double) :Load(0) -- We'll initialize the mass and resting length using parallel functions -local liszt init_rest_len ( e : dragon.edges ) +local ebb init_rest_len ( e : dragon.edges ) var diff = e.head.pos - e.tail.pos e.rest_len = L.length(diff) end -- (hacky choice of mass to produce a diagonally dominant system) -local liszt init_mass ( v : dragon.vertices ) +local ebb init_mass ( v : dragon.vertices ) v.mass = 1.0e-3 for e in v.edges do v.mass += e.rest_len @@ -91,7 +91,7 @@ dragon.vertices:foreach(init_mass) -- Also, let's translate the dragon up above the y=0 plane -- so we can drop it onto the ground -local liszt lift_dragon ( v : dragon.vertices ) +local ebb lift_dragon ( v : dragon.vertices ) v.pos += {0,2.3,0} end dragon.vertices:foreach(lift_dragon) @@ -101,7 +101,7 @@ dragon.vertices:foreach(lift_dragon) -- Now let's define functions to perform the basic updates in our simualtion -- We're going to use a simple forward Euler integration scheme here. -local liszt compute_acceleration ( v : dragon.vertices ) +local ebb compute_acceleration ( v : dragon.vertices ) -- Force due to gravitational acceleration var force = gravity * v.mass @@ -121,7 +121,7 @@ local liszt compute_acceleration ( v : dragon.vertices ) v.acc = force * v.inv_mass end -local liszt update_vel_pos ( v : dragon.vertices ) +local ebb update_vel_pos ( v : dragon.vertices ) v.pos += timestep * v.vel + 0.5 * timestep * timestep * v.acc v.vel = (1.0 - damping * timestep) * v.vel + (timestep * v.acc) @@ -135,7 +135,7 @@ end -- START EXTRA VDB CODE local sqrt3 = math.sqrt(3) local vdb = require('ebb.lib.vdb') -local liszt compute_normal ( t )--t : dragon.triangles ) +local ebb compute_normal ( t )--t : dragon.triangles ) var p0 = t.v[0].pos var p1 = t.v[1].pos var p2 = t.v[2].pos @@ -144,7 +144,7 @@ local liszt compute_normal ( t )--t : dragon.triangles ) if len < 1.0e-6 then len = 1.0e6 else len = 1.0/len end -- invert len return n * len end -local liszt debug_tri_draw ( t )--t : dragon.triangles ) +local ebb debug_tri_draw ( t )--t : dragon.triangles ) -- Spoof a really simple directional light with a cos diffuse term var d = - L.dot({1/sqrt3, -1/sqrt3, 1/sqrt3}, compute_normal(t)) if d > 1.0 then d = 1.0 end diff --git a/release/ebb/liszt.t b/include/ebb.t similarity index 72% rename from release/ebb/liszt.t rename to include/ebb.t index e0d3434..7de05ba 100644 --- a/release/ebb/liszt.t +++ b/include/ebb.t @@ -1,14 +1,14 @@ --this file is used to extend the terra parser with ---the liszt language ---use it like: import "ebb.src.liszt" +--the ebb language +--use it like: import "ebb" local P = require "ebb.src.parser" -local lisztlib = require "ebb.src.lisztlib" +local ebblib = require "ebblib" local specialization = require "ebb.src.specialization" local semant = require "ebb.src.semant" --- include liszt library for programmer -L = lisztlib +-- include ebb library for programmer +L = ebblib local statement = function(self, lexer) local ast, assign = P.ParseStatement(lexer) @@ -16,21 +16,21 @@ local statement = function(self, lexer) if ast.kind == 'UserFunction' then constructor = function (env_fn) local env = env_fn() - return lisztlib.NewUserFunc(ast, env) + return ebblib.NewUserFunc(ast, env) end else -- quote - error("Expected liszt function!", 2) + error("Expected ebb function!", 2) end return constructor, assign end -local lisztlanguage = { - name = "liszt", -- name for debugging - entrypoints = {"liszt"}, +local ebblanguage = { + name = "ebb", -- name for debugging + entrypoints = {"ebb"}, -- including max and min as keywords is necessary to get -- the parser to interpret them as operators. This has the -- unfortunate affect of not allowing anyone to use 'min' or 'max - -- as variable names within Liszt code. + -- as variable names within Ebb code. keywords = { "quote", "max", "min", @@ -39,13 +39,13 @@ local lisztlanguage = { "_", -- want to hold onto this token in case it's useful }, - -- Liszt quotes and anonymous functions + -- Ebb quotes and anonymous functions expression = function (self, lexer) local ast = P.ParseExpression(lexer) if ast.kind == 'UserFunction' then return function (env_fn) local env = env_fn() - return lisztlib.NewUserFunc(ast, env) + return ebblib.NewUserFunc(ast, env) end else -- quote return function (env_fn) @@ -57,9 +57,9 @@ local lisztlanguage = { end end, - -- named Liszt functions + -- named Ebb functions statement = statement, localstatement = statement, } -return lisztlanguage +return ebblanguage diff --git a/release/ebb/domains/grid.t b/include/ebb/domains/grid.t similarity index 88% rename from release/ebb/domains/grid.t rename to include/ebb/domains/grid.t index c5141d1..3070b90 100644 --- a/release/ebb/domains/grid.t +++ b/include/ebb/domains/grid.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" local Grid = {} package.loaded["ebb.domains.grid"] = Grid @@ -9,10 +9,10 @@ Grid2d.__index = Grid2d Grid3d.__index = Grid3d local int_floor = L.NewMacro(function(v) - return liszt ` L.int(L.floor(v)) + return ebb ` L.int(L.floor(v)) end) local max_impl = L.NewMacro(function(a,b) - return liszt quote + return ebb quote var ret = a if b > a then ret = b end in @@ -20,7 +20,7 @@ local max_impl = L.NewMacro(function(a,b) end end) local min_impl = L.NewMacro(function(a,b) - return liszt quote + return ebb quote var ret = a if b < a then ret = b end in @@ -29,13 +29,13 @@ local min_impl = L.NewMacro(function(a,b) end) local clamp_impl = L.NewMacro(function(x, lower, upper) - return liszt `max_impl(lower, min_impl(upper, x)) + return ebb `max_impl(lower, min_impl(upper, x)) end) -- convert a potentially continuous signed value x to -- an address modulo the given uint m local float_to_uint64_mod = L.NewMacro(function(x, m) - return liszt `( int_floor(x) % m + m ) % m + return ebb `( int_floor(x) % m + m ) % m end) local function copy_table(tbl) @@ -54,7 +54,7 @@ local function setup2dCells(grid) grid.cells:NewFieldMacro('__apply_macro', L.NewMacro(function(c,xoff,yoff) - return liszt `L.Affine(grid.cells, {{1,0,xoff}, + return ebb `L.Affine(grid.cells, {{1,0,xoff}, {0,1,yoff}}, c) end)) @@ -69,14 +69,14 @@ local function setup2dCells(grid) end) grid.cells:NewFieldMacro('center', L.NewMacro(function(c) - return liszt ` L.vec2f({ + return ebb ` L.vec2f({ xorigin + xcwidth * (L.double(L.xid(c)) + 0.5), yorigin + ycwidth * (L.double(L.yid(c)) + 0.5) }) end)) grid.cell_locate = L.NewMacro(function(xy_vec) - return liszt quote + return ebb quote var xy = xy_vec -- prevent duplication var xval = (xy[0] - xorigin)/xcwidth var yval = (xy[1] - yorigin)/ycwidth @@ -89,24 +89,24 @@ local function setup2dCells(grid) -- boundary depths grid.cells:NewFieldMacro('xneg_depth', L.NewMacro(function(c) - return liszt `max_impl(L.int(xn_bd - L.xid(c)), 0) + return ebb `max_impl(L.int(xn_bd - L.xid(c)), 0) end)) grid.cells:NewFieldMacro('xpos_depth', L.NewMacro(function(c) - return liszt `max_impl(L.int(L.xid(c) - (xsize-1 - xn_bd)), 0) + return ebb `max_impl(L.int(L.xid(c) - (xsize-1 - xn_bd)), 0) end)) grid.cells:NewFieldMacro('yneg_depth', L.NewMacro(function(c) - return liszt `max_impl(L.int(yn_bd - L.yid(c)), 0) + return ebb `max_impl(L.int(yn_bd - L.yid(c)), 0) end)) grid.cells:NewFieldMacro('ypos_depth', L.NewMacro(function(c) - return liszt `max_impl(L.int(L.yid(c) - (ysize-1 - yn_bd)), 0) + return ebb `max_impl(L.int(L.yid(c) - (ysize-1 - yn_bd)), 0) end)) grid.cells:NewFieldMacro('in_boundary', L.NewMacro(function(c) - return liszt ` c.xneg_depth > 0 or c.xpos_depth > 0 or + return ebb ` c.xneg_depth > 0 or c.xpos_depth > 0 or c.yneg_depth > 0 or c.ypos_depth > 0 end)) grid.cells:NewFieldMacro('in_interior', L.NewMacro(function(c) - return liszt ` not c.in_boundary + return ebb ` not c.in_boundary end)) end @@ -120,13 +120,13 @@ local function setup2dDualCells(grid) grid.dual_cells:NewFieldMacro('__apply_macro', L.NewMacro(function(dc,xoff,yoff) - return liszt `L.Affine(grid.dual_cells, {{1,0,xoff}, + return ebb `L.Affine(grid.dual_cells, {{1,0,xoff}, {0,1,yoff}}, dc) end)) if not xpd and not ypd then grid.dual_cells:NewFieldMacro('center', L.NewMacro(function(dc) - return liszt `L.vec2f({ + return ebb `L.vec2f({ xorigin + xcwidth * (L.double(L.xid(dc))), yorigin + ycwidth * (L.double(L.yid(dc))) }) @@ -134,7 +134,7 @@ local function setup2dDualCells(grid) end grid.dual_locate = L.NewMacro(function(xy_vec) - return liszt quote + return ebb quote var xy = xy_vec -- prevent duplication var xval = (xy[0] - xorigin)/xcwidth + 0.5 var yval = (xy[1] - yorigin)/ycwidth + 0.5 @@ -166,7 +166,7 @@ local function setup2dVertices(grid) grid.vertices:NewFieldMacro('__apply_macro', L.NewMacro(function(v,xoff,yoff) - return liszt `L.Affine(grid.vertices, {{1,0,xoff}, + return ebb `L.Affine(grid.vertices, {{1,0,xoff}, {0,1,yoff}}, v) end)) @@ -182,24 +182,24 @@ local function setup2dVertices(grid) -- boundary depths grid.vertices:NewFieldMacro('xneg_depth', L.NewMacro(function(v) - return liszt `max_impl(L.int(xn_bd - L.xid(v)), 0) + return ebb `max_impl(L.int(xn_bd - L.xid(v)), 0) end)) grid.vertices:NewFieldMacro('xpos_depth', L.NewMacro(function(v) - return liszt `max_impl(L.int(L.xid(v) - (xsize-1 - xn_bd)), 0) + return ebb `max_impl(L.int(L.xid(v) - (xsize-1 - xn_bd)), 0) end)) grid.vertices:NewFieldMacro('yneg_depth', L.NewMacro(function(v) - return liszt `max_impl(L.int(yn_bd - L.yid(v)), 0) + return ebb `max_impl(L.int(yn_bd - L.yid(v)), 0) end)) grid.vertices:NewFieldMacro('ypos_depth', L.NewMacro(function(v) - return liszt `max_impl(L.int(L.yid(v) - (ysize-1 - yn_bd)), 0) + return ebb `max_impl(L.int(L.yid(v) - (ysize-1 - yn_bd)), 0) end)) grid.vertices:NewFieldMacro('in_boundary', L.NewMacro(function(v) - return liszt ` v.xneg_depth > 0 or v.xpos_depth > 0 or + return ebb ` v.xneg_depth > 0 or v.xpos_depth > 0 or v.yneg_depth > 0 or v.ypos_depth > 0 end)) grid.vertices:NewFieldMacro('in_interior', L.NewMacro(function(v) - return liszt ` not v.in_boundary + return ebb ` not v.in_boundary end)) end local function setup2dDualVertices(grid) @@ -211,7 +211,7 @@ local function setup2dDualVertices(grid) grid.dual_vertices:NewFieldMacro('__apply_macro', L.NewMacro(function(dv,xoff,yoff) - return liszt `L.Affine(grid.dual_vertices, {{1,0,xoff}, + return ebb `L.Affine(grid.dual_vertices, {{1,0,xoff}, {0,1,yoff}}, dv) end)) end @@ -224,48 +224,48 @@ local function setup2dInterconnects(grid) -- v <-> dc grid.dual_cells:NewFieldMacro('vertex', L.NewMacro(function(dc) - return liszt `L.Affine(grid.vertices, {{1,0,0}, + return ebb `L.Affine(grid.vertices, {{1,0,0}, {0,1,0}}, dc) end)) grid.vertices:NewFieldMacro('dual_cell', L.NewMacro(function(v) - return liszt `L.Affine(grid.dual_cells, {{1,0,0}, + return ebb `L.Affine(grid.dual_cells, {{1,0,0}, {0,1,0}}, v) end)) -- v <-> c grid.cells:NewFieldMacro('vertex', L.NewMacro(function(c) - return liszt `L.Affine(grid.vertices, {{1,0,0}, + return ebb `L.Affine(grid.vertices, {{1,0,0}, {0,1,0}}, c) end)) grid.vertices:NewFieldMacro('cell', L.NewMacro(function(v) - return liszt `L.Affine(grid.cells, {{1,0,0}, + return ebb `L.Affine(grid.cells, {{1,0,0}, {0,1,0}}, v) end)) -- dv <-> c grid.cells:NewFieldMacro('dual_vertex', L.NewMacro(function(c) - return liszt `L.Affine(grid.dual_vertices, {{1,0,0}, + return ebb `L.Affine(grid.dual_vertices, {{1,0,0}, {0,1,0}}, c) end)) grid.dual_vertices:NewFieldMacro('cell', L.NewMacro(function(dv) - return liszt `L.Affine(grid.cells, {{1,0,0}, + return ebb `L.Affine(grid.cells, {{1,0,0}, {0,1,0}}, dv) end)) -- dv <-> dc grid.dual_cells:NewFieldMacro('dual_vertex', L.NewMacro(function(dc) - return liszt `L.Affine(grid.dual_vertices, {{1,0,0}, + return ebb `L.Affine(grid.dual_vertices, {{1,0,0}, {0,1,0}}, dc) end)) grid.dual_vertices:NewFieldMacro('dual_cell', L.NewMacro(function(dv) - return liszt `L.Affine(grid.dual_cells, {{1,0,0}, + return ebb `L.Affine(grid.dual_cells, {{1,0,0}, {0,1,0}}, dv) end)) end @@ -375,7 +375,7 @@ local function setup3dCells(grid) -- relative offset grid.cells:NewFieldMacro('__apply_macro', L.NewMacro(function(c,xoff,yoff,zoff) - return liszt `L.Affine(grid.cells, {{1,0,0,xoff}, + return ebb `L.Affine(grid.cells, {{1,0,0,xoff}, {0,1,0,yoff}, {0,0,1,zoff}}, c) end)) @@ -392,7 +392,7 @@ local function setup3dCells(grid) end) grid.cells:NewFieldMacro('center', L.NewMacro(function(c) - return liszt ` L.vec3f({ + return ebb ` L.vec3f({ xorigin + xcwidth * (L.double(L.xid(c)) + 0.5), yorigin + ycwidth * (L.double(L.yid(c)) + 0.5), zorigin + zcwidth * (L.double(L.zid(c)) + 0.5) @@ -400,7 +400,7 @@ local function setup3dCells(grid) end)) grid.cell_locate = L.NewMacro(function(xyz_vec) - return liszt quote + return ebb quote var xyz = xyz_vec -- prevent duplication var xval = (xyz[0] - xorigin)/xcwidth var yval = (xyz[1] - yorigin)/ycwidth @@ -415,31 +415,31 @@ local function setup3dCells(grid) -- boundary depths grid.cells:NewFieldMacro('xneg_depth', L.NewMacro(function(c) - return liszt `max_impl(L.int(xn_bd - L.xid(c)), 0) + return ebb `max_impl(L.int(xn_bd - L.xid(c)), 0) end)) grid.cells:NewFieldMacro('xpos_depth', L.NewMacro(function(c) - return liszt `max_impl(L.int(L.xid(c) - (xsize-1 - xn_bd)), 0) + return ebb `max_impl(L.int(L.xid(c) - (xsize-1 - xn_bd)), 0) end)) grid.cells:NewFieldMacro('yneg_depth', L.NewMacro(function(c) - return liszt `max_impl(L.int(yn_bd - L.yid(c)), 0) + return ebb `max_impl(L.int(yn_bd - L.yid(c)), 0) end)) grid.cells:NewFieldMacro('ypos_depth', L.NewMacro(function(c) - return liszt `max_impl(L.int(L.yid(c) - (ysize-1 - yn_bd)), 0) + return ebb `max_impl(L.int(L.yid(c) - (ysize-1 - yn_bd)), 0) end)) grid.cells:NewFieldMacro('zneg_depth', L.NewMacro(function(c) - return liszt `max_impl(L.int(zn_bd - L.zid(c)), 0) + return ebb `max_impl(L.int(zn_bd - L.zid(c)), 0) end)) grid.cells:NewFieldMacro('zpos_depth', L.NewMacro(function(c) - return liszt `max_impl(L.int(L.zid(c) - (zsize-1 - zn_bd)), 0) + return ebb `max_impl(L.int(L.zid(c) - (zsize-1 - zn_bd)), 0) end)) grid.cells:NewFieldMacro('in_boundary', L.NewMacro(function(c) - return liszt ` c.xneg_depth > 0 or c.xpos_depth > 0 or + return ebb ` c.xneg_depth > 0 or c.xpos_depth > 0 or c.yneg_depth > 0 or c.ypos_depth > 0 or c.zneg_depth > 0 or c.zpos_depth > 0 end)) grid.cells:NewFieldMacro('in_interior', L.NewMacro(function(c) - return liszt ` not c.in_boundary + return ebb ` not c.in_boundary end)) end @@ -464,14 +464,14 @@ local function setup3dDualCells(grid) -- relative offset grid.dual_cells:NewFieldMacro('__apply_macro', L.NewMacro(function(dc,xoff,yoff,zoff) - return liszt `L.Affine(grid.dual_cells, {{1,0,0,xoff}, + return ebb `L.Affine(grid.dual_cells, {{1,0,0,xoff}, {0,1,0,yoff}, {0,0,1,zoff}}, dc) end)) if not xpd and not ypd and not zpd then grid.dual_cells:NewFieldMacro('center', L.NewMacro(function(dc) - return liszt `L.vec3f({ + return ebb `L.vec3f({ xorigin + xcwidth * (L.double(L.xid(dc))), yorigin + ycwidth * (L.double(L.yid(dc))), zorigin + zcwidth * (L.double(L.zid(dc))) @@ -480,7 +480,7 @@ local function setup3dDualCells(grid) end grid.dual_locate = L.NewMacro(function(xyz_vec) - return liszt quote + return ebb quote var xyz = xyz_vec -- prevent duplication var xval = (xyz[0] - xorigin)/xcwidth + 0.5 var yval = (xyz[1] - yorigin)/ycwidth + 0.5 @@ -530,7 +530,7 @@ local function setup3dVertices(grid) -- relative offset grid.vertices:NewFieldMacro('__apply_macro', L.NewMacro(function(v,xoff,yoff,zoff) - return liszt `L.Affine(grid.vertices, {{1,0,0,xoff}, + return ebb `L.Affine(grid.vertices, {{1,0,0,xoff}, {0,1,0,yoff}, {0,0,1,zoff}}, v) end)) @@ -548,32 +548,32 @@ local function setup3dVertices(grid) -- boundary depths grid.vertices:NewFieldMacro('xneg_depth', L.NewMacro(function(v) - return liszt `max_impl(L.int(xn_bd - L.xid(v)), 0) + return ebb `max_impl(L.int(xn_bd - L.xid(v)), 0) end)) grid.vertices:NewFieldMacro('xpos_depth', L.NewMacro(function(v) - return liszt `max_impl(L.int(L.xid(v) - (xsize-1 - xn_bd)), 0) + return ebb `max_impl(L.int(L.xid(v) - (xsize-1 - xn_bd)), 0) end)) grid.vertices:NewFieldMacro('yneg_depth', L.NewMacro(function(v) - return liszt `max_impl(L.int(yn_bd - L.yid(v)), 0) + return ebb `max_impl(L.int(yn_bd - L.yid(v)), 0) end)) grid.vertices:NewFieldMacro('ypos_depth', L.NewMacro(function(v) - return liszt `max_impl(L.int(L.yid(v) - (ysize-1 - yn_bd)), 0) + return ebb `max_impl(L.int(L.yid(v) - (ysize-1 - yn_bd)), 0) end)) grid.vertices:NewFieldMacro('zneg_depth', L.NewMacro(function(v) - return liszt `max_impl(L.int(zn_bd - L.zid(v)), 0) + return ebb `max_impl(L.int(zn_bd - L.zid(v)), 0) end)) grid.vertices:NewFieldMacro('zpos_depth', L.NewMacro(function(v) - return liszt `max_impl(L.int(L.zid(v) - (zsize-1 - zn_bd)), 0) + return ebb `max_impl(L.int(L.zid(v) - (zsize-1 - zn_bd)), 0) end)) grid.vertices:NewFieldMacro('in_boundary', L.NewMacro(function(v) - return liszt ` v.xneg_depth > 0 or v.xpos_depth > 0 or + return ebb ` v.xneg_depth > 0 or v.xpos_depth > 0 or v.yneg_depth > 0 or v.ypos_depth > 0 or v.zneg_depth > 0 or v.zpos_depth > 0 end)) grid.vertices:NewFieldMacro('in_interior', L.NewMacro(function(v) - return liszt ` not v.in_boundary + return ebb ` not v.in_boundary end)) end @@ -581,7 +581,7 @@ local function setup3dDualVertices(grid) grid.dual_vertices:NewFieldMacro('__apply_macro', L.NewMacro(function(dv,xoff,yoff,zoff) - return liszt `L.Affine(grid.dual_vertices, {{1,0,0,xoff}, + return ebb `L.Affine(grid.dual_vertices, {{1,0,0,xoff}, {0,1,0,yoff}, {0,0,1,zoff}}, dv) end)) @@ -601,13 +601,13 @@ local function setup3dInterconnects(grid) -- v <-> dc grid.dual_cells:NewFieldMacro('vertex', L.NewMacro(function(dc) - return liszt `L.Affine(grid.vertices, {{1,0,0,0}, + return ebb `L.Affine(grid.vertices, {{1,0,0,0}, {0,1,0,0}, {0,0,1,0}}, dc) end)) grid.vertices:NewFieldMacro('dual_cell', L.NewMacro(function(v) - return liszt `L.Affine(grid.dual_cells, {{1,0,0,0}, + return ebb `L.Affine(grid.dual_cells, {{1,0,0,0}, {0,1,0,0}, {0,0,1,0}}, v) end)) @@ -615,13 +615,13 @@ local function setup3dInterconnects(grid) -- v <-> c grid.cells:NewFieldMacro('vertex', L.NewMacro(function(c) - return liszt `L.Affine(grid.vertices, {{1,0,0,0}, + return ebb `L.Affine(grid.vertices, {{1,0,0,0}, {0,1,0,0}, {0,0,1,0}}, c) end)) grid.vertices:NewFieldMacro('cell', L.NewMacro(function(v) - return liszt `L.Affine(grid.cells, {{1,0,0,0}, + return ebb `L.Affine(grid.cells, {{1,0,0,0}, {0,1,0,0}, {0,0,1,0}}, v) end)) @@ -629,13 +629,13 @@ local function setup3dInterconnects(grid) -- dv <-> c grid.cells:NewFieldMacro('dual_vertex', L.NewMacro(function(c) - return liszt `L.Affine(grid.dual_vertices, {{1,0,0,0}, + return ebb `L.Affine(grid.dual_vertices, {{1,0,0,0}, {0,1,0,0}, {0,0,1,0}}, c) end)) grid.dual_vertices:NewFieldMacro('cell', L.NewMacro(function(dv) - return liszt `L.Affine(grid.cells, {{1,0,0,0}, + return ebb `L.Affine(grid.cells, {{1,0,0,0}, {0,1,0,0}, {0,0,1,0}}, dv) end)) @@ -643,13 +643,13 @@ local function setup3dInterconnects(grid) -- dv <-> dc grid.dual_cells:NewFieldMacro('dual_vertex', L.NewMacro(function(dc) - return liszt `L.Affine(grid.dual_vertices, {{1,0,0,0}, + return ebb `L.Affine(grid.dual_vertices, {{1,0,0,0}, {0,1,0,0}, {0,0,1,0}}, dc) end)) grid.dual_vertices:NewFieldMacro('dual_cell', L.NewMacro(function(dv) - return liszt `L.Affine(grid.dual_cells, {{1,0,0,0}, + return ebb `L.Affine(grid.dual_cells, {{1,0,0,0}, {0,1,0,0}, {0,0,1,0}}, dv) end)) diff --git a/release/ebb/domains/ioOff.t b/include/ebb/domains/ioOff.t similarity index 99% rename from release/ebb/domains/ioOff.t rename to include/ebb/domains/ioOff.t index a8e0ef4..8c90b66 100644 --- a/release/ebb/domains/ioOff.t +++ b/include/ebb/domains/ioOff.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" local ioOff = {} ioOff.__index = ioOff diff --git a/release/ebb/domains/ioVeg.t b/include/ebb/domains/ioVeg.t similarity index 99% rename from release/ebb/domains/ioVeg.t rename to include/ebb/domains/ioVeg.t index dd4d56d..cbc3590 100644 --- a/release/ebb/domains/ioVeg.t +++ b/include/ebb/domains/ioVeg.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" local ioVeg = {} ioVeg.__index = ioVeg diff --git a/release/ebb/domains/multigrid.t b/include/ebb/domains/multigrid.t similarity index 95% rename from release/ebb/domains/multigrid.t rename to include/ebb/domains/multigrid.t index a993b7e..e41ed65 100644 --- a/release/ebb/domains/multigrid.t +++ b/include/ebb/domains/multigrid.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" local MultiGrid = {} package.loaded["ebb.domains.multigrid"] = MultiGrid @@ -32,12 +32,12 @@ function build_next_level(cellrel) } -- link the cells of down to up - cellrel:NewFieldFunction('up_cell', liszt (c) + cellrel:NewFieldFunction('up_cell', ebb (c) return L.Affine(grid.cells, {{ 0.5, 0, 0}, { 0, 0.5, 0}}, c) end) -- link the cells of up to down - grid.cells:NewFieldFunction('down_cell', liszt (c) + grid.cells:NewFieldFunction('down_cell', ebb (c) return L.Affine(cellrel, {{ 2, 0, 0}, { 0, 2, 0}}, c) end) diff --git a/release/ebb/domains/tetmesh.t b/include/ebb/domains/tetmesh.t similarity index 94% rename from release/ebb/domains/tetmesh.t rename to include/ebb/domains/tetmesh.t index 9f9d2d9..174da3d 100644 --- a/release/ebb/domains/tetmesh.t +++ b/include/ebb/domains/tetmesh.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" local Tetmesh = {} @@ -74,16 +74,16 @@ function Tetmesh:build_edges(elements) -- and group the edges for access from vertices mesh.edges:GroupBy('tail') mesh.vertices:NewFieldMacro('edges', L.NewMacro(function(v) - return liszt ` L.Where(mesh.edges.tail, v) + return ebb ` L.Where(mesh.edges.tail, v) end)) mesh.vertices:NewFieldMacro('neighbors', L.NewMacro(function(v) - return liszt ` L.Where(mesh.edges.tail, v).head + return ebb ` L.Where(mesh.edges.tail, v).head end)) -- set up pointers from tetrahedra to edges mesh.tetrahedra:NewField('e', L.matrix(mesh.edges, 4, 4)) - local liszt compute_tet_edges (t : mesh.tetrahedra) + local ebb compute_tet_edges (t : mesh.tetrahedra) for i = 0,4 do for e in t.v[i].edges do for j = 0,4 do @@ -96,7 +96,7 @@ function Tetmesh:build_edges(elements) -- set up pointers from vertices to self edges mesh.vertices:NewField('diag', mesh.edges) - local liszt compute_self_edges (v : mesh.vertices) + local ebb compute_self_edges (v : mesh.vertices) for e in v.edges do if e.head == v then v.diag = e diff --git a/release/ebb/domains/trimesh.t b/include/ebb/domains/trimesh.t similarity index 95% rename from release/ebb/domains/trimesh.t rename to include/ebb/domains/trimesh.t index 519200f..941a838 100644 --- a/release/ebb/domains/trimesh.t +++ b/include/ebb/domains/trimesh.t @@ -1,4 +1,4 @@ -import "ebb.liszt" -- Every Liszt File should start with this command +import "ebb" -- Every Ebb File should start with this command -- Declare a table named Trimesh for the Module local Trimesh = {} @@ -108,12 +108,12 @@ function Trimesh:build_edges(vs) -- In order to abstract this query for the user, we install a macro -- on the vertices relation mesh.vertices:NewFieldMacro('edges', L.NewMacro(function(v) - return liszt ` L.Where(mesh.edges.tail, v) + return ebb ` L.Where(mesh.edges.tail, v) end)) -- We also store a slight modification where neighboring vertices -- are given directly instead of the edges themselves mesh.vertices:NewFieldMacro('neighbors', L.NewMacro(function(v) - return liszt ` L.Where(mesh.edges.tail, v).head + return ebb ` L.Where(mesh.edges.tail, v).head end)) -- Finally, to make it easier to update quantities on the edges @@ -124,10 +124,10 @@ function Trimesh:build_edges(vs) mesh.triangles:NewField('e31', mesh.edges):Load(0) mesh.triangles:NewField('e23', mesh.edges):Load(0) mesh.triangles:NewField('e32', mesh.edges):Load(0) - -- and then we compute these links by mapping a liszt function + -- and then we compute these links by mapping a ebb function -- over the triangles. We have to do a somewhat silly -- search to find the correct edge keys to write in here. - local liszt compute_tri_pointers ( t : mesh.triangles ) + local ebb compute_tri_pointers ( t : mesh.triangles ) for e in t.v[0].edges do if e.head == t.v[1] then t.e12 = e end if e.head == t.v[2] then t.e13 = e end diff --git a/release/ebb/gl/gclef.t b/include/ebb/gl/gclef.t similarity index 99% rename from release/ebb/gl/gclef.t rename to include/ebb/gl/gclef.t index ec1fcfb..ac8b1bd 100644 --- a/release/ebb/gl/gclef.t +++ b/include/ebb/gl/gclef.t @@ -5,7 +5,7 @@ local GClef_Module = {} package.loaded["ebb.gl.gclef"] = GClef_Module -local L = require "ebb.src.lisztlib" +local L = require "ebblib" local C = require "ebb.src.c" local DLD = require "ebb.src.dld" diff --git a/release/ebb/gl/gl.t b/include/ebb/gl/gl.t similarity index 100% rename from release/ebb/gl/gl.t rename to include/ebb/gl/gl.t diff --git a/release/ebb/gl/mat4f.t b/include/ebb/gl/mat4f.t similarity index 100% rename from release/ebb/gl/mat4f.t rename to include/ebb/gl/mat4f.t diff --git a/release/ebb/gl/shader.t b/include/ebb/gl/shader.t similarity index 100% rename from release/ebb/gl/shader.t rename to include/ebb/gl/shader.t diff --git a/release/ebb/gl/vo.t b/include/ebb/gl/vo.t similarity index 100% rename from release/ebb/gl/vo.t rename to include/ebb/gl/vo.t diff --git a/release/ebb/lib/pathname.t b/include/ebb/lib/pathname.t similarity index 94% rename from release/ebb/lib/pathname.t rename to include/ebb/lib/pathname.t index c11d633..c2309ef 100644 --- a/release/ebb/lib/pathname.t +++ b/include/ebb/lib/pathname.t @@ -91,7 +91,7 @@ char* readdir_str(DIR *dirp) { ------------------------------------------------------------------------------ --- Reference Path Strings: Liszt Root & Working Directory -- +-- Reference Path Strings: Ebb Root & Working Directory -- ------------------------------------------------------------------------------ -- compute the current working directory... @@ -107,24 +107,24 @@ if not WORKING_DIRECTORY_CACHED or #WORKING_DIRECTORY_CACHED == 0 then error('Failed to determine working directory. Aborting system') end --- Compute the Liszt root directory +-- Compute the Ebb root directory -- Super Hacky! -local LISZT_ROOT_DIR_CACHED +local EBB_RELEASE_DIR_CACHED (function() local info = debug.getinfo(1, "S") local src = info.source -- strip leading '@' and trailing '/compiler/pathname.t' - local strip = ('/lib/pathname.t'):len() - LISZT_ROOT_DIR_CACHED = src:sub(2,-strip-1) - if LISZT_ROOT_DIR_CACHED:sub(1,1) == '.' then - LISZT_ROOT_DIR_CACHED = WORKING_DIRECTORY_CACHED.. - (LISZT_ROOT_DIR_CACHED:sub(2)) + local strip = ('ebb/lib/pathname.t'):len() + EBB_RELEASE_DIR_CACHED = src:sub(2,-strip-1) + if EBB_RELEASE_DIR_CACHED:sub(1,1) == '.' then + EBB_RELEASE_DIR_CACHED = WORKING_DIRECTORY_CACHED.. + (EBB_RELEASE_DIR_CACHED:sub(2)) end end)() -- functions providing absolute paths as strings PN.pwd_str = function() return WORKING_DIRECTORY_CACHED end -PN.liszt_root_str = function() return LISZT_ROOT_DIR_CACHED end +PN.ebb_root_str = function() return EBB_RELEASE_DIR_CACHED end ------------------------------------------------------------------------------ @@ -279,26 +279,26 @@ Pathname.__tostring = Pathname.tostring -- Pathname Constants -- ------------------------------------------------------------------------------ --- throw a comprehensible error if the liszt_root contains +-- throw a comprehensible error if the ebb_root contains -- non POSIX-portable filenames along the way. Right now, -- let's just error on this case. We may be forced to support -- a wider class of valid pathnames later to prevent users complaining. -if not POSIX_valid_pathname(PN.liszt_root_str()) then +if not POSIX_valid_pathname(PN.ebb_root_str()) then error(POSIX_name_rules_text.."\n".. - "The current installation path for Liszt is not POSIX portable.\n".. + "The current installation path for Ebb is not POSIX portable.\n".. "The current installation path is... \n".. - PN.liszt_root_str().."\n".. + PN.ebb_root_str().."\n".. "\n".. - "Please contact the Liszt developers if this is a serious problem.") + "Please contact the Ebb developers if this is a serious problem.") end Pathname.root = Pathname.new('/') Pathname.pwd = Pathname.new(PN.pwd_str()) -Pathname.liszt_root = Pathname.new(PN.liszt_root_str()) +Pathname.ebb_root = Pathname.new(PN.ebb_root_str()) function PN.root () return Pathname.root end function PN.pwd () return Pathname.pwd end -function PN.liszt_root () return Pathname.liszt_root end +function PN.ebb_root () return Pathname.ebb_root end PN.getwd = PN.pwd function Pathname.scriptdir() diff --git a/release/ebb/lib/vdb.h b/include/ebb/lib/vdb.h similarity index 100% rename from release/ebb/lib/vdb.h rename to include/ebb/lib/vdb.h diff --git a/release/ebb/lib/vdb.old.h b/include/ebb/lib/vdb.old.h similarity index 100% rename from release/ebb/lib/vdb.old.h rename to include/ebb/lib/vdb.old.h diff --git a/release/ebb/lib/vdb.t b/include/ebb/lib/vdb.t similarity index 81% rename from release/ebb/lib/vdb.t rename to include/ebb/lib/vdb.t index 222e664..ed33eac 100644 --- a/release/ebb/lib/vdb.t +++ b/include/ebb/lib/vdb.t @@ -1,9 +1,9 @@ -import 'ebb.liszt' +import 'ebb' local vdb = {} package.loaded["ebb.lib.vdb"] = vdb -local L = require "ebb.src.lisztlib" +local L = require "ebb.src.ebblib" local T = require "ebb.src.types" local Pathname = (require "ebb.lib.pathname").Pathname @@ -14,7 +14,7 @@ local VDB_C = terralib.includecstring([[ local function check_vec(vec, errmsg) if not vec or - not T.isLisztType(vec.node_type) or + not T.isEbbType(vec.node_type) or not vec.node_type:isVector() or not vec.node_type:isNumeric() or vec.node_type.N < 3 @@ -25,27 +25,27 @@ end vdb.color = L.NewMacro(function(vec) check_vec(vec, "vdb.color() expects a vector argument of length 3 or more") - return liszt `VDB_C.vdb_color(vec[0], vec[1], vec[2]) + return ebb `VDB_C.vdb_color(vec[0], vec[1], vec[2]) end) vdb.normal = L.NewMacro(function(p0, p1) local err = "vdb.normal() expects 2 vector arguments of length 3 or more" check_vec(p0, err) check_vec(p1, err) - return liszt `VDB_C.vdb_normal(p0[0], p0[1], p0[2], + return ebb `VDB_C.vdb_normal(p0[0], p0[1], p0[2], p1[0], p1[1], p1[2]) end) vdb.point = L.NewMacro(function(vec) check_vec(vec, "vdb.point() expects a vector argument of length 3 or more") - return liszt `VDB_C.vdb_point(vec[0], vec[1], vec[2]) + return ebb `VDB_C.vdb_point(vec[0], vec[1], vec[2]) end) vdb.line = L.NewMacro(function(p0, p1) local err = "vdb.line() expects 2 vector arguments of length 3 or more" check_vec(p0, err) check_vec(p1, err) - return liszt `VDB_C.vdb_line(p0[0], p0[1], p0[2], + return ebb `VDB_C.vdb_line(p0[0], p0[1], p0[2], p1[0], p1[1], p1[2]) end) @@ -54,7 +54,7 @@ vdb.triangle = L.NewMacro(function(p0, p1, p2) check_vec(p0, err) check_vec(p1, err) check_vec(p2, err) - return liszt `VDB_C.vdb_triangle(p0[0], p0[1], p0[2], + return ebb `VDB_C.vdb_triangle(p0[0], p0[1], p0[2], p1[0], p1[1], p1[2], p2[0], p2[1], p2[2]) end) diff --git a/release/ebb/src/ast.t b/include/ebb/src/ast.t similarity index 99% rename from release/ebb/src/ast.t rename to include/ebb/src/ast.t index 1f51887..93392df 100644 --- a/release/ebb/src/ast.t +++ b/include/ebb/src/ast.t @@ -1,6 +1,7 @@ ---[[ Module defines all of the AST nodes used to represent the Liszt - language. -]]-- +-- +-- Module defines all of the AST nodes used +-- to represent the Ebb language. +-- local A = {} package.loaded["ebb.src.ast"] = A @@ -40,7 +41,7 @@ end --------------------------- --[[ Declare AST types ]]-- --------------------------- -local AST = { kind = 'AST', is_liszt_ast = true } +local AST = { kind = 'AST', is_ebb_ast = true } AST.__index = AST A.AST = AST @@ -48,7 +49,7 @@ local all_asts = {} function A.is_ast(obj) local mt = getmetatable(obj) - return mt and mt.is_liszt_ast + return mt and mt.is_ebb_ast end function AST:NewKind(kind, child_asts, child_ast_lists) diff --git a/release/ebb/src/builtins.t b/include/ebb/src/builtins.t similarity index 98% rename from release/ebb/src/builtins.t rename to include/ebb/src/builtins.t index 05ff4d3..5de6651 100644 --- a/release/ebb/src/builtins.t +++ b/include/ebb/src/builtins.t @@ -1,7 +1,7 @@ local B = {} package.loaded["ebb.src.builtins"] = B -local L = require "ebb.src.lisztlib" +local L = require "ebblib" local T = require "ebb.src.types" local C = require "ebb.src.c" local G = require "ebb.src.gpu_util" @@ -335,7 +335,7 @@ function B.assert.check(ast, ctxt) end end -local terra lisztAssert(test : bool, file : rawstring, line : int) +local terra ebbAssert(test : bool, file : rawstring, line : int) if not test then C.fprintf(C.get_stderr(), "%s:%d: assertion failed!\n", file, line) C.exit(1) @@ -360,7 +360,7 @@ function B.assert.codegen(ast, ctxt) local test = ast.params[1] local code = test:codegen(ctxt) - local tassert = lisztAssert + local tassert = ebbAssert if ctxt:onGPU() then tassert = gpuAssert end if test.node_type:isVector() then @@ -932,11 +932,12 @@ local function TerraCheck(func) -- case of no return value, no type is needed return end - if not T.terraToLisztType(rettype) then - ctxt:error(ast, "unable to use return type '" .. tostring(rettype) .. "' of terra function in Liszt") + if not T.terraToEbbType(rettype) then + ctxt:error(ast, "unable to use return type '"..tostring(rettype).. + "' of terra function in Ebb") return L.error end - return T.terraToLisztType(rettype) + return T.terraToEbbType(rettype) end end diff --git a/release/ebb/src/c.t b/include/ebb/src/c.t similarity index 88% rename from release/ebb/src/c.t rename to include/ebb/src/c.t index 01a30a3..d1904bb 100644 --- a/release/ebb/src/c.t +++ b/include/ebb/src/c.t @@ -1,17 +1,6 @@ -- location to put all C includes -- the rest of the compiler should just require this file --- Super ultra hack to get the directory of this file, --- which can be mangled into the root Liszt directory. --- Then we can make sure to stick the Liszt root on the --- Clang path - --- Super Hacky! -local info = debug.getinfo(1, "S") -local src = info.source --- strip leading '@'' and trailing 'compiler/c.t' -local liszt_dir = src:sub(2,-14) - local ffi = require 'ffi' @@ -55,7 +44,7 @@ end -- inject a bit of code for extracting enum values local enum_c_define = [[ -void liszt_c_terra_enum_define_helper(void **out) { +void ebb_c_terra_enum_define_helper(void **out) { ]] for i,enum in ipairs(enum_list) do enum_c_define = enum_c_define .. @@ -126,7 +115,7 @@ do end -- execute our extraction function - c_blob.liszt_c_terra_enum_define_helper(out_arr) + c_blob.ebb_c_terra_enum_define_helper(out_arr) -- now read out the values and store them in the cblob for i,enum in ipairs(enum_list) do diff --git a/release/ebb/src/codegen.t b/include/ebb/src/codegen.t similarity index 99% rename from release/ebb/src/codegen.t rename to include/ebb/src/codegen.t index 6f93684..860bfcb 100644 --- a/release/ebb/src/codegen.t +++ b/include/ebb/src/codegen.t @@ -8,7 +8,7 @@ local ast = require "ebb.src.ast" local T = require "ebb.src.types" local C = require 'ebb.src.c' -local L = require 'ebb.src.lisztlib' +local L = require 'ebblib' local G = require 'ebb.src.gpu_util' local Support = require 'ebb.src.codegen_support' diff --git a/release/ebb/src/codegen_support.t b/include/ebb/src/codegen_support.t similarity index 100% rename from release/ebb/src/codegen_support.t rename to include/ebb/src/codegen_support.t diff --git a/release/ebb/src/cukernelwrap.t b/include/ebb/src/cukernelwrap.t similarity index 100% rename from release/ebb/src/cukernelwrap.t rename to include/ebb/src/cukernelwrap.t diff --git a/release/ebb/src/dld.t b/include/ebb/src/dld.t similarity index 99% rename from release/ebb/src/dld.t rename to include/ebb/src/dld.t index 12dad7e..50fb1ab 100644 --- a/release/ebb/src/dld.t +++ b/include/ebb/src/dld.t @@ -33,7 +33,7 @@ dld.__index = dld ]]-- -- TODO(Chinmayee): Change dims to bounds with lower and upper bound when --- support for distributing Liszt programs (partitioning) is added. +-- support for distributing Ebb programs (partitioning) is added. ------------------------------------------------------------------------------- diff --git a/release/ebb/src/gpu_util.t b/include/ebb/src/gpu_util.t similarity index 100% rename from release/ebb/src/gpu_util.t rename to include/ebb/src/gpu_util.t diff --git a/release/ebb/src/launch_legion.t b/include/ebb/src/launch_legion.t similarity index 93% rename from release/ebb/src/launch_legion.t rename to include/ebb/src/launch_legion.t index 5e924ef..f89fa17 100644 --- a/release/ebb/src/launch_legion.t +++ b/include/ebb/src/launch_legion.t @@ -1,4 +1,4 @@ --- Launch liszt program as a top level legion task. +-- Launch ebb program as a top level legion task. -- set up a global structure to stash legion variables into rawset(_G, '_legion_env', {}) @@ -36,8 +36,8 @@ local function top_level_err_handler(errobj) os.exit(1) end --- Launch Liszt application -function load_liszt() +-- Launch Ebb application +function load_ebb() local script_filename = arg[0] local success = xpcall( function () assert(terralib.loadfile(script_filename))() @@ -45,7 +45,7 @@ function load_liszt() end, top_level_err_handler) end --- Run Liszt compiler/ Lua-Terra interpreter as a top level task +-- Run Ebb compiler/ Lua-Terra interpreter as a top level task local terra top_level_task( task_args : LW.legion_task_t, regions : &LW.legion_physical_region_t, @@ -55,7 +55,7 @@ local terra top_level_task( ) LE.legion_env.ctx = ctx LE.legion_env.runtime = runtime - load_liszt() + load_ebb() end -- Note 4 types of processors @@ -88,8 +88,8 @@ if run_config.num_cpus == 0 then run_config.num_cpus = n_cpu end -local use_legion_spy = rawget(_G, 'LISZT_LEGION_USE_SPY') -local use_legion_prof = rawget(_G, 'LISZT_LEGION_USE_PROF') +local use_legion_spy = rawget(_G, 'EBB_LEGION_USE_SPY') +local use_legion_prof = rawget(_G, 'EBB_LEGION_USE_PROF') local logging_level = 5 if use_legion_prof or use_legion_spy then logging_level = 2 @@ -186,12 +186,12 @@ local terra main() -- arguments var n_args = [1 + #legion_args] var args = arrayof(rawstring, - [arg[0]], -- include the Liszt invocation here; + [arg[0]], -- include the Ebb invocation here; -- doesn't matter though [legion_args] ) - --LW.register_liszt_gpu_mapper() + --LW.register_ebb_gpu_mapper() LW.legion_runtime_start(n_args, args, false) end diff --git a/release/ebb/src/launch_script.t b/include/ebb/src/launch_script.t similarity index 92% rename from release/ebb/src/launch_script.t rename to include/ebb/src/launch_script.t index 485276e..7e54005 100644 --- a/release/ebb/src/launch_script.t +++ b/include/ebb/src/launch_script.t @@ -2,7 +2,7 @@ -- This file is really dumb. -- Its entire goal is to provide an -- opportunity to shim in extra Lua --- junk before we launch a Liszt program. +-- junk before we launch an Ebb program. -- Here, we wrap the call with error handling. diff --git a/release/ebb/src/legionwrap.t b/include/ebb/src/legionwrap.t similarity index 99% rename from release/ebb/src/legionwrap.t rename to include/ebb/src/legionwrap.t index 26ea9ed..65e869e 100644 --- a/release/ebb/src/legionwrap.t +++ b/include/ebb/src/legionwrap.t @@ -11,7 +11,7 @@ local C = require "ebb.src.c" -- have this module expose the full C-API. Then, we'll augment it below. local APIblob = terralib.includecstring([[ #include "legion_c.h" -#include "liszt_gpu_mapper.h" +//#include "ebb_gpu_mapper.h" ]]) for k,v in pairs(APIblob) do LW[k] = v end @@ -156,7 +156,8 @@ function LW.NewTaskLauncher(params) ' '..tostring(LW.FutureTaskPtrType)..'\n', 2) end if VERBOSE then - print("Liszt LOG: task id " .. tostring(taskfunc.name) .. " = " .. tostring(TID)) + print("Ebb LOG: task id " .. tostring(taskfunc.name) .. + " = " .. tostring(TID)) end end diff --git a/release/ebb/src/parser.t b/include/ebb/src/parser.t similarity index 96% rename from release/ebb/src/parser.t rename to include/ebb/src/parser.t index 67b4c89..e0f4c6b 100644 --- a/release/ebb/src/parser.t +++ b/include/ebb/src/parser.t @@ -1,6 +1,7 @@ ---[[ Module defines all of the parsing functions used to generate -an AST for Liszt code -]]-- +-- +-- Module defines all of the parsing functions used to generate +-- an AST for Ebb code +-- local P = {} package.loaded["ebb.src.parser"] = P @@ -60,7 +61,7 @@ local function unary (P) end ---------------------------------- ---[[ Build Liszt Pratt parser ]]-- +--[[ Build Ebb Pratt parser ]]-- ---------------------------------- local lang = { } @@ -187,7 +188,7 @@ lang.func_name = function (P) end lang.generate_name_from_entry = function (P) - local lz = P:nextif('liszt') + local lz = P:nextif('ebb') if lz then local anon = "anon_" .. tostring(P.source) .. '_' .. tostring(lz.linenumber) -- remove characters that will be escaped out by llvm to make the @@ -195,7 +196,7 @@ lang.generate_name_from_entry = function (P) anon = string.gsub(anon, '[^%a%d_]','_') return anon else - P:errorexpected("'liszt'") + P:errorexpected("'ebb'") end end @@ -235,7 +236,7 @@ lang.user_function = function (P, id) return function_node end -lang.lisztExpression = function (P) +lang.ebbExpression = function (P) local code_type local anon_name = P:generate_name_from_entry() if P:nextif('`') then @@ -273,12 +274,12 @@ lang.lisztExpression = function (P) end end -lang.lisztStatement = function (P) +lang.ebbStatement = function (P) local code_type - if P:nextif("liszt") then + if P:nextif("ebb") then code_type = 'function' else - P:errorexpected("'liszt'") + P:errorexpected("'ebb'") end local assign_tuple, name = P:func_name() @@ -489,9 +490,9 @@ lang.block = function (P) end function P.ParseExpression(lexer) - return pratt.Parse(lang, lexer, "lisztExpression") + return pratt.Parse(lang, lexer, "ebbExpression") end function P.ParseStatement(lexer) - return pratt.Parse(lang, lexer, "lisztStatement") + return pratt.Parse(lang, lexer, "ebbStatement") end diff --git a/release/ebb/src/phase.t b/include/ebb/src/phase.t similarity index 99% rename from release/ebb/src/phase.t rename to include/ebb/src/phase.t index 84c0ffe..d6436fd 100644 --- a/release/ebb/src/phase.t +++ b/include/ebb/src/phase.t @@ -290,7 +290,7 @@ function Phase.phasePass(ufunc_ast) diag:begin() ufunc_ast:phasePass(ctxt) - diag:finishandabortiferrors("Errors during phasechecking Liszt", 1) + diag:finishandabortiferrors("Errors during phasechecking Ebb", 1) local field_use = ctxt:dumpFieldTypes() local global_use = ctxt:dumpGlobalTypes() diff --git a/release/ebb/src/pratt.t b/include/ebb/src/pratt.t similarity index 100% rename from release/ebb/src/pratt.t rename to include/ebb/src/pratt.t diff --git a/release/ebb/src/rawdata.t b/include/ebb/src/rawdata.t similarity index 100% rename from release/ebb/src/rawdata.t rename to include/ebb/src/rawdata.t diff --git a/release/ebb/src/relations.t b/include/ebb/src/relations.t similarity index 98% rename from release/ebb/src/relations.t rename to include/ebb/src/relations.t index 2ad09ac..2da51ed 100644 --- a/release/ebb/src/relations.t +++ b/include/ebb/src/relations.t @@ -5,7 +5,7 @@ package.loaded["ebb.src.relations"] = R local use_legion = not not rawget(_G, '_legion_env') local use_single = not use_legion -local L = require "ebb.src.lisztlib" +local L = require "ebblib" local T = require "ebb.src.types" local C = require "ebb.src.c" local DLD = require "ebb.src.dld" @@ -249,7 +249,7 @@ end function L.LRelation:foreach(user_func, ...) if not L.is_function(user_func) then - error('foreach(): expects a liszt function as the first argument', 2) + error('foreach(): expects an ebb function as the first argument', 2) end user_func:_doForEach(self, ...) end @@ -338,7 +338,7 @@ function L.LRelation:NewFieldFunction (name, userfunc) end if not L.is_function(userfunc) then - error("NewFieldFunction() expects a Liszt Function ".. + error("NewFieldFunction() expects an Ebb Function ".. "as the 2nd argument", 2) end @@ -556,7 +556,7 @@ end function L.LSubset:foreach(user_func, ...) if not L.is_function(user_func) then - error('map(): expects a liszt function as the argument', 2) + error('map(): expects an Ebb function as the argument', 2) end user_func:_doForEach(self, ...) end @@ -713,8 +713,8 @@ function L.LRelation:NewField (name, typ) if L.is_relation(typ) then typ = L.key(typ) end - if not T.isLisztType(typ) or not typ:isFieldType() then - error("NewField() expects a Liszt type or ".. + if not T.istype(typ) or not typ:isFieldType() then + error("NewField() expects an Ebb type or ".. "relation as the 2nd argument", 2) end @@ -889,7 +889,7 @@ function L.LField:LoadFunction(lua_callback) error("lua value does not conform to field type ".. tostring(self.type), 3) end - local tval = T.luaToLisztVal(lval, self.type) + local tval = T.luaToEbbVal(lval, self.type) terralib.cast(&(self.type:terraType()), ptrs[1])[0] = tval end elseif use_single then @@ -903,7 +903,7 @@ function L.LField:LoadFunction(lua_callback) error("lua value does not conform to field type ".. tostring(self.type), 5) end - dataptr[lin] = T.luaToLisztVal(val, self.type) + dataptr[lin] = T.luaToEbbVal(val, self.type) end end) -- write_ptr end @@ -1095,7 +1095,7 @@ function L.LField:LoadConstant(constant) local terra LoadConstantFunction(darray : &DLD.ctype) var d = darray[0] - var c : ttype = [T.luaToLisztVal(constant, self.type)] + var c : ttype = [T.luaToEbbVal(constant, self.type)] var b = d.dims var s = d.stride for i = 0, b[0] do @@ -1190,7 +1190,7 @@ function L.LRelation:DumpJoint(fields_arg, lua_callback) local vals = {} for k=1,#fields do local tval = terralib.cast(&(typs[k]:terraType()), ptrs[k])[0] - vals[k] = T.lisztToLuaVal(tval, typs[k]) + vals[k] = T.ebbToLuaVal(tval, typs[k]) end lua_callback(ids, unpack(vals)) end @@ -1205,7 +1205,7 @@ function L.LRelation:DumpJoint(fields_arg, lua_callback) for lin,ids in self:_INTERNAL_iter_gen() do local vals = {} for k=1,nfields do - vals[k] = T.lisztToLuaVal(ptrs[k][lin], typs[k]) + vals[k] = T.ebbToLuaVal(ptrs[k][lin], typs[k]) end lua_callback(ids, unpack(vals)) end diff --git a/release/ebb/src/semant.t b/include/ebb/src/semant.t similarity index 98% rename from release/ebb/src/semant.t rename to include/ebb/src/semant.t index 215ed05..a7c555d 100644 --- a/release/ebb/src/semant.t +++ b/include/ebb/src/semant.t @@ -4,7 +4,7 @@ package.loaded["ebb.src.semant"] = S local ast = require "ebb.src.ast" local B = require "ebb.src.builtins" local T = require "ebb.src.types" -local L = require 'ebb.src.lisztlib' +local L = require 'ebblib' --[[ AST:check(ctxt) type checking routines These methods define type checking. @@ -35,7 +35,7 @@ function Context.new(env, diag) }, Context) return ctxt end -function Context:liszt() +function Context:ebb() return self.env:localenv() end function Context:enterblock() @@ -333,7 +333,7 @@ function ast.DeclStatement:check(ctxt) "or keys to local temporaries") end - ctxt:liszt()[decl.name] = decl.node_type + ctxt:ebb()[decl.name] = decl.node_type return decl end @@ -376,7 +376,7 @@ function ast.NumericFor:check(ctxt) ctxt:enterblock() ctxt:enterloop() - ctxt:liszt()[numfor.name] = numfor.node_type + ctxt:ebb()[numfor.name] = numfor.node_type numfor.body = self.body:check(ctxt) ctxt:leaveloop() ctxt:leaveblock() @@ -403,7 +403,7 @@ function ast.GenericFor:check(ctxt) local keyType = L.key(rel) ctxt:enterblock() ctxt:enterloop() - ctxt:liszt()[r.name] = keyType + ctxt:ebb()[r.name] = keyType r.body = self.body:check(ctxt) ctxt:leaveloop() ctxt:leaveblock() @@ -761,10 +761,10 @@ end ------------------------------------------------------------------------------ function ast.Name:check(ctxt) - -- try to find the name in the local Liszt scope - local typ = ctxt:liszt()[self.name] + -- try to find the name in the local Ebb scope + local typ = ctxt:ebb()[self.name] -- if the name is in the local scope, then it must have been declared - -- somewhere in the liszt function. Thus, it has to be a primitive, a + -- somewhere in the ebb function. Thus, it has to be a primitive, a -- bool, or a topological element. if typ then local node = ast.Name:DeriveFrom(self) @@ -802,7 +802,7 @@ function ast.Number:check(ctxt) elseif self.valuetype == uint64 then number.node_type = L.uint64 else - ctxt:error(self, "numeric literal type unsupported by Liszt") + ctxt:error(self, "numeric literal type unsupported by Ebb") number.node_type = L.error end elseif tonumber(self.value) % 1 == 0 then @@ -1163,7 +1163,7 @@ local function InlineUserFunc(ctxt, src_node, the_func, param_asts) q.code = expansion ctxt:enterblock() for name,strtype in pairs(string_literals) do - ctxt:liszt()[name] = strtype + ctxt:ebb()[name] = strtype end local qchecked = q:check(ctxt) ctxt:leaveblock() @@ -1357,7 +1357,7 @@ function ast.Call:check(ctxt) call = RunMacro(ctxt, self, v, call.params) elseif v and L.is_function(v) then call = InlineUserFunc(ctxt, self, v, call.params) - elseif v and T.isLisztType(v) and v:isValueType() then + elseif v and T.istype(v) and v:isValueType() then local params = call.params if #params ~= 1 then ctxt:error(self, "Cast to " .. v:toString() .. @@ -1489,7 +1489,7 @@ function ast.UserFunction:check(ctxt) end -- record the first parameter in the context ctxt:recordcenter(keyparam) - ctxt:liszt()[keyparam] = keytype + ctxt:ebb()[keyparam] = keytype for i=2,#self.params do local pname = self.params[i] @@ -1498,7 +1498,7 @@ function ast.UserFunction:check(ctxt) ctxt:error(self, 'Expected secondary arguments to be strings') ptype = L.error end - ctxt:liszt()[pname] = ptype + ctxt:ebb()[pname] = ptype end -- double-check that there's no return value; redundant @@ -1530,6 +1530,6 @@ function S.check(some_ast) env:enterblock() local typed_ast = some_ast:check(ctxt) env:leaveblock() - diag:finishandabortiferrors("Errors during typechecking liszt", 1) + diag:finishandabortiferrors("Errors during typechecking ebb", 1) return typed_ast end diff --git a/release/ebb/src/specialization.t b/include/ebb/src/specialization.t similarity index 95% rename from release/ebb/src/specialization.t rename to include/ebb/src/specialization.t index 62d9200..30b4341 100644 --- a/release/ebb/src/specialization.t +++ b/include/ebb/src/specialization.t @@ -22,7 +22,7 @@ function Context.new(env, diag) }, Context) return ctxt end -function Context:liszt() +function Context:ebb() return self.env:localenv() end function Context:lua() @@ -54,7 +54,7 @@ function S.specialize(luaenv, some_ast) env:enterblock() local new_ast = some_ast:specialize(ctxt) env:leaveblock() - diag:finishandabortiferrors("Errors during specializing Liszt", 1) + diag:finishandabortiferrors("Errors during specializing Ebb", 1) return new_ast end @@ -78,8 +78,8 @@ local function exec_type_annotation(typexp, ast_node, ctxt) -- handle use of relations as shorthand for key types if L.is_relation(typ) then typ = L.key(typ) end - if not T.isLisztType(typ) then - ctxt:error(ast_node, "Expected Liszt type annotation but found " .. + if not T.istype(typ) then + ctxt:error(ast_node, "Expected Ebb type annotation but found " .. type(typ)) typ = L.error end @@ -217,7 +217,7 @@ function ast.DeclStatement:specialize(ctxt) -- REGISTER SYMBOL local name_str = decl.name decl.name = ast.GenSymbol(name_str) - ctxt:liszt()[name_str] = decl.name + ctxt:ebb()[name_str] = decl.name return decl end @@ -235,7 +235,7 @@ function ast.NumericFor:specialize(ctxt) -- REGISTER SYMBOL local name_str = numfor.name numfor.name = ast.GenSymbol(name_str) - ctxt:liszt()[name_str] = numfor.name + ctxt:ebb()[name_str] = numfor.name numfor.body = self.body:specialize(ctxt) ctxt:leaveblock() @@ -264,7 +264,7 @@ function ast.GenericFor:specialize(ctxt) -- REGISTER SYMBOL local name_str = r.name r.name = ast.GenSymbol(name_str) - ctxt:liszt()[name_str] = r.name + ctxt:ebb()[name_str] = r.name r.body = self.body:specialize(ctxt) ctxt:leaveblock() @@ -375,8 +375,8 @@ local function luav_to_ast(luav, src_node) end function ast.Name:specialize(ctxt) - -- try to find the name in the local Liszt scope - local symbol = ctxt:liszt()[self.name] + -- try to find the name in the local Ebb scope + local symbol = ctxt:ebb()[self.name] if symbol then local name_clone = self:clone() name_clone.name = symbol @@ -392,7 +392,7 @@ function ast.Name:specialize(ctxt) return ast else ctxt:error(self, "could not convert Lua value of '"..self.name.."' ".. - "to a Liszt value") + "to an Ebb value") return self:clone() end end @@ -435,7 +435,7 @@ function ast.TableLookup:specialize(ctxt) return ast else ctxt:error(self, "The table member '"..member.."' could not be ".. - "resolved to a Liszt value") + "resolved to an Ebb value") return self end else @@ -463,7 +463,7 @@ function ast.UserFunction:specialize(ctxt) for i=1,#(self.params) do local name_str = self.params[i] params[i] = ast.GenSymbol(name_str) - ctxt:liszt()[name_str] = params[i] + ctxt:ebb()[name_str] = params[i] if self.ptypes[i] then ptypes[i] = exec_type_annotation(self.ptypes[i], self, ctxt) diff --git a/release/ebb/src/stats.t b/include/ebb/src/stats.t similarity index 100% rename from release/ebb/src/stats.t rename to include/ebb/src/stats.t diff --git a/release/ebb/src/types.t b/include/ebb/src/types.t similarity index 95% rename from release/ebb/src/types.t rename to include/ebb/src/types.t index 602997c..94ef9a2 100644 --- a/release/ebb/src/types.t +++ b/include/ebb/src/types.t @@ -1,10 +1,10 @@ local T = {} -- Warning: DO NOT UNCOMMENT this line! --- Circular dependencies for types.t cannot be resolved this way because Liszt +-- Circular dependencies for types.t cannot be resolved this way because Ebb -- types are defined inline when this file is first executed. -- packed.loaded["ebb.src.types"] = T -local L = require "ebb.src.lisztlib" +local L = require "ebblib" local use_legion = not not rawget(_G, '_legion_env') local LW @@ -26,7 +26,7 @@ function pairs_sorted(tbl, compare) end ------------------------------------------------------------------------------- ---[[ Liszt type prototype: ]]-- +--[[ Ebb type prototype: ]]-- ------------------------------------------------------------------------------- local Type = {} Type.__index = Type @@ -35,10 +35,10 @@ function Type:new (kind) return setmetatable({kind = kind}, self) end -function T.isLisztType (obj) +function T.istype (obj) return getmetatable(obj) == Type end -L.is_type = T.isLisztType +L.is_type = T.istype ------------------------------------------------------------------------------- --[[ Basic Type Methods ]]-- @@ -72,7 +72,7 @@ function Type:isRecord() return self.kind == "record" end --- These types represent Liszt values (not keys though) +-- These types represent Ebb values (not keys though) function Type:isValueType() if self:isVector() or self:isMatrix() then return self.type:isPrimitive() @@ -147,9 +147,9 @@ end local vector_types = {} local function vectorType (typ, len) - -- Liszt may not be fully loaded yet, so... + -- Ebb may not be fully loaded yet, so... if L.is_relation and L.is_relation(typ) then typ = L.key(typ) end - if not T.isLisztType(typ) or not typ:isScalar() then + if not T.istype(typ) or not typ:isScalar() then error("invalid type argument to vector type constructor ".. "(is this a terra type?)", 2) end @@ -171,9 +171,9 @@ end local smatrix_types = {} local function matrixType (typ, nrow, ncol) - -- Liszt may not be fully loaded yet, so... + -- Ebb may not be fully loaded yet, so... if L.is_relation and L.is_relation(typ) then typ = L.key(typ) end - if not T.isLisztType(typ) or not typ:isScalar() then + if not T.istype(typ) or not typ:isScalar() then error("invalid type argument to small matrix type constructor ".. "(is this a terra type?)", 2) end @@ -210,7 +210,7 @@ local function recordType (rec) error('invalid argument to record type constructor:\n'.. ' table keys must be strings', 2) end - if not T.isLisztType(typ) or + if not T.istype(typ) or not (typ:isValueType() or typ:isKey()) then error('invalid argument to record type constructor:\n'.. @@ -412,7 +412,7 @@ end ------------------------------------------------------------------------------- -- Primitives -local terraprimitive_to_liszt = {} +local terraprimitive_to_ebb = {} local primitives = {"int","uint", "uint64","bool","float","double"} for i=1,#primitives do local p = primitives[i] @@ -420,7 +420,7 @@ for i=1,#primitives do t.terratype = _G[p] t.name = p L[p] = t - terraprimitive_to_liszt[t.terratype] = t + terraprimitive_to_ebb[t.terratype] = t primitives[i] = t end L.color_type = L.uint @@ -516,7 +516,7 @@ end -- Coercion defines a partial order. This function defines that order function Type:isCoercableTo(target) -- make sure we have two types - if not T.isLisztType(target) then return false end + if not T.istype(target) then return false end -- identity relationship preserved -- ensures reflexivity of the relation @@ -666,7 +666,7 @@ local function luaValConformsToType (luaval, tp) return false end -local function luaToLisztVal (luaval, typ) +local function luaToEbbVal (luaval, typ) if typ:isPrimitive() then return luaval @@ -680,14 +680,14 @@ local function luaToLisztVal (luaval, typ) elseif typ:isVector() then local btyp = typ:baseType() local terraval = terralib.new(typ:terraType()) - for i=1,typ.N do terraval.d[i-1] = luaToLisztVal(luaval[i], btyp) end + for i=1,typ.N do terraval.d[i-1] = luaToEbbVal(luaval[i], btyp) end return terraval elseif typ:isMatrix() then local btyp = typ:baseType() local terraval = terralib.new(typ:terraType()) for r=1,typ.Nrow do for c=1,typ.Ncol do - terraval.d[r-1][c-1] = luaToLisztVal(luaval[r][c], btyp) + terraval.d[r-1][c-1] = luaToEbbVal(luaval[r][c], btyp) end end return terraval @@ -697,7 +697,7 @@ local function luaToLisztVal (luaval, typ) end end -local function lisztToLuaVal(lzval, typ) +local function ebbToLuaVal(lzval, typ) if typ:isPrimitive() then if typ:isNumeric() then return tonumber(lzval) @@ -723,7 +723,7 @@ local function lisztToLuaVal(lzval, typ) elseif typ:isVector() then local vec = {} for i=1,typ.N do - vec[i] = lisztToLuaVal(lzval.d[i-1], typ:baseType()) + vec[i] = ebbToLuaVal(lzval.d[i-1], typ:baseType()) end return vec @@ -732,7 +732,7 @@ local function lisztToLuaVal(lzval, typ) for r=1,typ.Nrow do mat[r] = {} for c=1,typ.Ncol do - mat[r][c] = lisztToLuaVal(lzval.d[r-1][c-1], typ:baseType()) + mat[r][c] = ebbToLuaVal(lzval.d[r-1][c-1], typ:baseType()) end end return mat @@ -743,15 +743,15 @@ local function lisztToLuaVal(lzval, typ) end end --- converts a terra vector or primitive type into a liszt type -local function terraToLisztType (tp) +-- converts a terra vector or primitive type into an ebb type +local function terraToEbbType (tp) -- return primitive type - local typ = terraprimitive_to_liszt[tp] + local typ = terraprimitive_to_ebb[tp] if typ then return typ end -- return vector type (WARNING: different backing for types now...) --if tp:isvector() then - -- local p = terraToLisztType(tp.type) + -- local p = terraToEbbType(tp.type) -- return p and L.vector(p,tp.N) --end @@ -807,10 +807,10 @@ end ------------------------------------------------------------------------------- T.type_join = type_join T.luaValConformsToType = luaValConformsToType -T.luaToLisztVal = luaToLisztVal -T.lisztToLuaVal = lisztToLuaVal +T.luaToEbbVal = luaToEbbVal +T.ebbToLuaVal = ebbToLuaVal -T.terraToLisztType = terraToLisztType +T.terraToEbbType = terraToEbbType T.Type = Type return T diff --git a/release/ebb/src/ufversions.t b/include/ebb/src/ufversions.t similarity index 99% rename from release/ebb/src/ufversions.t rename to include/ebb/src/ufversions.t index 4a1c615..5d2cc44 100644 --- a/release/ebb/src/ufversions.t +++ b/include/ebb/src/ufversions.t @@ -4,7 +4,7 @@ package.loaded["ebb.src.ufversions"] = UF local use_legion = not not rawget(_G, '_legion_env') local use_single = not use_legion -local L = require "ebb.src.lisztlib" +local L = require "ebblib" local C = require "ebb.src.c" local G = require "ebb.src.gpu_util" @@ -130,7 +130,7 @@ function UFVersion:Compile() if use_single then -- allocate memory for the arguments struct on the CPU. It will be used - -- to hold the parameter values that will be passed to the Liszt function. + -- to hold the parameter values that will be passed to the Ebb function. self._args = DataArray.New{ size = 1, type = self._arg_layout:TerraStruct(), diff --git a/release/ebb/src/lisztlib.t b/include/ebblib.t similarity index 90% rename from release/ebb/src/lisztlib.t rename to include/ebblib.t index 1191945..01654bd 100644 --- a/release/ebb/src/lisztlib.t +++ b/include/ebblib.t @@ -1,10 +1,10 @@ local L = {} -package.loaded["ebb.src.lisztlib"] = L +package.loaded["ebblib"] = L local use_legion = not not rawget(_G, '_legion_env') local use_single = not use_legion --- Liszt types are created here +-- Ebb types are created here local T = require 'ebb.src.types' local DataArray = use_single and @@ -17,13 +17,13 @@ if use_legion then LW = require 'ebb.src.legionwrap' end ------------------------------------------------------------------------------- ---[[ Liszt modules: ]]-- +--[[ Ebb modules: ]]-- ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- ---[[ Liszt Constants: ]]-- +--[[ Ebb Constants: ]]-- ------------------------------------------------------------------------------- local ProcConstant = {} @@ -33,19 +33,19 @@ L.CPU = setmetatable({ str = 'CPU' }, ProcConstant) L.GPU = setmetatable({ str = 'GPU' }, ProcConstant) L.default_processor = L.CPU -- global signal from the launch script -if rawget(_G, 'LISZT_USE_GPU_SIGNAL') then +if rawget(_G, 'EBB_USE_GPU_SIGNAL') then L.default_processor = L.GPU end ------------------------------------------------------------------------------- ---[[ Liszt object prototypes: ]]-- +--[[ Ebb object prototypes: ]]-- ------------------------------------------------------------------------------- local function make_prototype(objname,name) - local tb = {} - tb.__index = tb - L["is_"..name] = function(obj) return getmetatable(obj) == tb end - L[objname] = tb - return tb + local tb = {} + tb.__index = tb + L["is_"..name] = function(obj) return getmetatable(obj) == tb end + L[objname] = tb + return tb end local LRelation = make_prototype("LRelation","relation") local LField = make_prototype("LField","field") @@ -73,21 +73,26 @@ local Stats = require "ebb.src.stats" ------------------------------------------------------------------------------- function L.Global (typ, init) - if not T.isLisztType(typ) or not typ:isValueType() then error("First argument to L.Global must be a Liszt expression type", 2) end - if not T.luaValConformsToType(init, typ) then error("Second argument to L.Global must be an instance of type " .. typ:toString(), 2) end + if not T.istype(typ) or not typ:isValueType() then + error("First argument to L.Global must be an Ebb value type", 2) + end + if not T.luaValConformsToType(init, typ) then + error("Second argument to L.Global must be an ".. + "instance of type " .. typ:toString(), 2) + end - local s = setmetatable({type=typ}, LGlobal) + local s = setmetatable({type=typ}, LGlobal) - if use_single then - local tt = typ:terraType() - s.data = DataArray.New({size=1,type=tt}) - s:set(init) + if use_single then + local tt = typ:terraType() + s.data = DataArray.New({size=1,type=tt}) + s:set(init) - elseif use_legion then - s:set(init) - end + elseif use_legion then + s:set(init) + end - return s + return s end function LGlobal:set(val) @@ -95,14 +100,14 @@ function LGlobal:set(val) if use_single then self.data:write_ptr(function(ptr) - ptr[0] = T.luaToLisztVal(val, self.type) + ptr[0] = T.luaToEbbVal(val, self.type) end) elseif use_legion then local typ = self.type local tt = typ:terraType() local blob = C.safemalloc( tt ) - blob[0] = T.luaToLisztVal(val, typ) + blob[0] = T.luaToEbbVal(val, typ) local future = LW.legion_future_from_buffer(legion_env.runtime, blob, terralib.sizeof(tt)) @@ -119,14 +124,14 @@ function LGlobal:get() if use_single then self.data:read_ptr(function(ptr) - value = T.lisztToLuaVal(ptr[0], self.type) + value = T.ebbToLuaVal(ptr[0], self.type) end) elseif use_legion then local tt = self.type:terraType() local result = LW.legion_future_get_result(self.data) local rptr = terralib.cast(&tt, result.value) - value = T.lisztToLuaVal(rptr[0], self.type) + value = T.ebbToLuaVal(rptr[0], self.type) LW.legion_task_result_destroy(result) end @@ -171,9 +176,9 @@ local function deep_copy(tbl) end function L.Constant (typ, init) - if not T.isLisztType(typ) or not typ:isValueType() then - error("First argument to L.Constant must be a ".. - "Liszt expression type", 2) + if not T.istype(typ) or not typ:isValueType() then + error("First argument to L.Constant must be an ".. + "Ebb value type", 2) end if not T.luaValConformsToType(init, typ) then error("Second argument to L.Constant must be a ".. diff --git a/src_interpreter/main.cpp b/src_interpreter/main.cpp index 9c48be3..0850286 100644 --- a/src_interpreter/main.cpp +++ b/src_interpreter/main.cpp @@ -162,7 +162,7 @@ void setupebb(lua_State * L, ebb_Options * ebboptions) { // Make sure we can find the Terra files snprintf(buffer, bufsize, - "package.terrapath = package.terrapath..';%s/../?.t;'", + "package.terrapath = package.terrapath..';%s/../include/?.t;'", bindir); if (terra_dostring(L, buffer)) doerror(L); @@ -202,17 +202,17 @@ void setupebb(lua_State * L, ebb_Options * ebboptions) { if (ebboptions->legionspy) { lua_pushboolean(L, true); - lua_setglobal(L, "LISZT_LEGION_USE_SPY"); + lua_setglobal(L, "EBB_LEGION_USE_SPY"); } if (ebboptions->legionprof) { lua_pushboolean(L, true); - lua_setglobal(L, "LISZT_LEGION_USE_PROF"); + lua_setglobal(L, "EBB_LEGION_USE_PROF"); } } if (ebboptions->usegpu) { lua_pushboolean(L, true); - lua_setglobal(L, "LISZT_USE_GPU_SIGNAL"); + lua_setglobal(L, "EBB_USE_GPU_SIGNAL"); } } int load_launchscript( lua_State * L, ebb_Options * ebboptions ) { @@ -225,9 +225,11 @@ int load_launchscript( lua_State * L, ebb_Options * ebboptions ) { size_t bufsize = MAX_PATH_LEN; if (ebboptions->uselegion) { - snprintf(buffer, bufsize, "%s/../ebb/src/launch_legion.t", bindir); + snprintf(buffer, bufsize, + "%s/../include/ebb/src/launch_legion.t", bindir); } else { - snprintf(buffer, bufsize, "%s/../ebb/src/launch_script.t", bindir); + snprintf(buffer, bufsize, + "%s/../include/ebb/src/launch_script.t", bindir); } return terra_loadfile(L,buffer); } @@ -286,7 +288,7 @@ static void print_welcome(); void usage() { print_welcome(); printf( - "liszt [OPTIONS] [source-file] [arguments-to-source-file]\n" + "ebb [OPTIONS] [source-file] [arguments-to-source-file]\n" " -v enable verbose debugging output\n" " -d enable debugging symbols\n" " -h print this help message\n" @@ -547,7 +549,7 @@ static int docall (lua_State *L, int narg, int clear) { } static void print_welcome() { printf("\n" - "Liszt/Ebb -- A Language for Physical Simulation\n" + "Liszt-Ebb -- A Language for Physical Simulation\n" " (built w/ Terra)\n" "\n" "Stanford University\n" diff --git a/tests/allany.t b/tests/allany.t index b9a562e..72e994d 100644 --- a/tests/allany.t +++ b/tests/allany.t @@ -1,9 +1,9 @@ -import "ebb.liszt" +import "ebb" require "tests/test" local R = L.NewRelation { name="R", size=5 } -local liszt pass(r : R) +local ebb pass(r : R) L.assert(L.any({true})) L.assert(not L.any({false})) L.assert(L.any({true, true, true})) diff --git a/tests/arith.t b/tests/arith.t index b227912..f856ce7 100644 --- a/tests/arith.t +++ b/tests/arith.t @@ -1,25 +1,25 @@ -import "ebb.liszt" +import "ebb" require "tests.test" local R = L.NewRelation { name="R", size=5 } test.fail_function(function() - local liszt t(r : R) + local ebb t(r : R) var x = {1, 2, 3} + 4 end R:foreach(t) end, "incompatible types") test.fail_function(function() - local liszt t(r : R) + local ebb t(r : R) var x = {1, 2, 3} / {4, 5, 6} end R:foreach(t) end, "invalid types") test.fail_function(function() - local liszt t(r : R) + local ebb t(r : R) var x = 5 < true end R:foreach(t) @@ -28,7 +28,7 @@ end, "invalid types") local t = {} local s = {} test.fail_function(function() - local liszt t(r : R) + local ebb t(r : R) var x = s < t end R:foreach(t) diff --git a/tests/assert.t b/tests/assert.t index bb99296..9920f1b 100644 --- a/tests/assert.t +++ b/tests/assert.t @@ -1,8 +1,8 @@ -import "ebb.liszt" +import "ebb" local R = L.NewRelation { name="R", size=5 } -local pass_assert = liszt(r : R) +local pass_assert = ebb(r : R) L.assert(true) end R:foreach(pass_assert) diff --git a/tests/assigntype.t b/tests/assigntype.t index d7b2438..37e657e 100644 --- a/tests/assigntype.t +++ b/tests/assigntype.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" require "tests/test" local R = L.NewRelation { name="R", size=5 } @@ -6,7 +6,7 @@ local R = L.NewRelation { name="R", size=5 } sf = L.Global(L.float, 0.0) test.fail_function(function() - local liszt test (r : R) + local ebb test (r : R) sf.a = 1 end R:foreach(test) diff --git a/tests/basic_func_map.t b/tests/basic_func_map.t index bd4f6d2..c0a27ca 100644 --- a/tests/basic_func_map.t +++ b/tests/basic_func_map.t @@ -1,8 +1,8 @@ -import "ebb.liszt" +import "ebb" local R = L.NewRelation { name="R", size=5 } -- The identity function: -local pass_func = liszt(r : R) end +local pass_func = ebb(r : R) end R:foreach(pass_func) diff --git a/tests/basic_stress_loop.t b/tests/basic_stress_loop.t index d754165..fbdcc2a 100644 --- a/tests/basic_stress_loop.t +++ b/tests/basic_stress_loop.t @@ -1,10 +1,10 @@ -import "ebb.liszt" +import "ebb" local R = L.NewRelation { name="R", size=5 } -- The identity function: -local liszt pass_func (r : R) end +local ebb pass_func (r : R) end for i=1,1000 do R:foreach(pass_func) diff --git a/tests/big_reduction.t b/tests/big_reduction.t index c49756b..70eaac8 100644 --- a/tests/big_reduction.t +++ b/tests/big_reduction.t @@ -1,5 +1,5 @@ -import 'ebb.liszt' +import 'ebb' require 'tests.test' local N = 1000000 @@ -7,7 +7,7 @@ local N = 1000000 local vertices = L.NewRelation { size = N, name = 'vertices' } local gerr = L.Global(L.int, 0) -local liszt RunRed(v : vertices) +local ebb RunRed(v : vertices) gerr += 1 end diff --git a/tests/builtins.t b/tests/builtins.t index 685c22a..ae338b2 100644 --- a/tests/builtins.t +++ b/tests/builtins.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" require "tests/test" @@ -6,7 +6,7 @@ local ioOff = require 'ebb.domains.ioOff' local mesh = ioOff.LoadTrimesh('tests/octa.off') test.fail_function(function() - local liszt bad_id (e : mesh.edges) + local ebb bad_id (e : mesh.edges) var v = L.id({ e.head, e.tail }) L.print(v) end @@ -15,7 +15,7 @@ end, "expected a relational key") test.fail_function(function() - local liszt bad_length (e : mesh.edges) + local ebb bad_length (e : mesh.edges) var l = L.length({e.head, e.tail}) L.print(l) end diff --git a/tests/const_for.t b/tests/const_for.t index 51abb51..2077904 100644 --- a/tests/const_for.t +++ b/tests/const_for.t @@ -1,5 +1,5 @@ --DISABLE-TEST -import "ebb.liszt" +import "ebb" require "tests/test" local Grid = require 'ebb.domains.grid' @@ -20,7 +20,7 @@ grid.cells:NewField('new_t', L.double):Load(0) -- 4 neighbors local dirs = {'left', 'right', 'up', 'down'} -local diffuse_names = liszt ( c : grid.cells ) +local diffuse_names = ebb ( c : grid.cells ) if not c.in_boundary then c.new_t = 0 for dir in dirs do @@ -30,7 +30,7 @@ local diffuse_names = liszt ( c : grid.cells ) end -- 8 neighbors -local diffuse_nums = liszt ( c : grid.cells ) +local diffuse_nums = ebb ( c : grid.cells ) if not c.in_boundary then c.new_t = 0 for i=-1,2 do @@ -49,7 +49,7 @@ grid.cells:foreach(diffuse_nums) local cutoff = L.NewGlobal(L.int, 2) test.fail_function(function() - local liszt nonconst(c : grid.cells) + local ebb nonconst(c : grid.cells) if not c.in_boundary then c.new_t = 0 for i=-1,cutoff do diff --git a/tests/constants.t b/tests/constants.t index 6a95530..2115636 100644 --- a/tests/constants.t +++ b/tests/constants.t @@ -1,5 +1,5 @@ --DISABLE-TEST -import "ebb.liszt" +import "ebb" require "tests/test" local R = L.NewRelation { name="R", size=5 } diff --git a/tests/cross.t b/tests/cross.t index 232bc0a..bc54206 100644 --- a/tests/cross.t +++ b/tests/cross.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" local assert = L.assert local cross = L.cross @@ -11,7 +11,7 @@ local v2 = L.Constant(L.vec3f, {5, 7, 11}) local v3 = L.Constant(L.vec3i, {1, 2, 3}) local v4 = L.Constant(L.vec3i, {5, 7, 11}) -local test_cross = liszt(r : R) +local test_cross = ebb(r : R) assert(cross(v1, v2) == {1, 4, -3}) -- simple test assert(cross(v3, v4) == {1, 4, -3}) -- int only assert(cross(v1, v4) == {1, 4, -3}) -- cross types diff --git a/tests/defrag_stress.t b/tests/defrag_stress.t index 1ed42a6..df3c63f 100644 --- a/tests/defrag_stress.t +++ b/tests/defrag_stress.t @@ -1,6 +1,6 @@ --DISABLE-ON-LEGION -import "ebb.liszt" +import "ebb" require "tests/test" local Ncell = 1000 @@ -20,21 +20,21 @@ particles:NewField('cell', cells):Load(0) -local seed_particles = liszt( c : cells ) +local seed_particles = ebb( c : cells ) insert { cell = c } into particles end -local liszt delete_even ( p : particles ) +local ebb delete_even ( p : particles ) if L.id(p.cell) % 2 == 0 then delete p end end -local liszt delete_odd ( p : particles ) +local ebb delete_odd ( p : particles ) if L.id(p.cell) % 2 == 1 then delete p end end -local liszt delete_third ( p : particles ) +local ebb delete_third ( p : particles ) if L.id(p.cell) % 3 == 0 then delete p end diff --git a/tests/delete_stmt.t b/tests/delete_stmt.t index fa02ebf..c961518 100644 --- a/tests/delete_stmt.t +++ b/tests/delete_stmt.t @@ -1,6 +1,6 @@ --DISABLE-ON-LEGION -import "ebb.liszt" +import "ebb" require "tests/test" local cells = L.NewRelation { size = 10, name = 'cells' } @@ -23,7 +23,7 @@ particles:NewField('pos', L.vec3d):Load({0, 1, 2}) -- another relation test.fail_function(function() -- try to delete each cell - local liszt test( c : cells ) + local ebb test( c : cells ) delete c end cells:foreach(test) @@ -31,7 +31,7 @@ end, "Cannot delete from relation cells because it\'s not ELASTIC") -- cannot delete indirectly test.fail_function(function() - local liszt test( p : particles ) + local ebb test( p : particles ) delete p.cell end particles:foreach(test) @@ -39,7 +39,7 @@ end, "Only centered keys may be deleted") -- CANNOT HAVE 2 DELETE STATEMENTS in the same function test.fail_function(function() - local liszt test( p : particles ) + local ebb test( p : particles ) if L.id(p) % 2 == 0 then delete p else @@ -57,7 +57,7 @@ end, "Temporary: can only have one delete statement per function") -- delete half the particles test.eq(particles:Size(), 10) -local liszt delete_even ( p : particles ) +local ebb delete_even ( p : particles ) if L.id(p) % 2 == 0 then delete p else @@ -65,7 +65,7 @@ local liszt delete_even ( p : particles ) end end -local liszt post_delete_trivial( p : particles ) +local ebb post_delete_trivial( p : particles ) L.assert(p.pos[0] == 3) end diff --git a/tests/dot.t b/tests/dot.t index 2391aa1..de0210f 100644 --- a/tests/dot.t +++ b/tests/dot.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" require "tests/test" local assert, dot = L.assert, L.dot @@ -14,7 +14,7 @@ local v4 = L.Constant(L.vector(L.int, 1), {0}) local v5 = L.Constant(L.vec3i, {1, 2, 3}) local v6 = L.Constant(L.vec3i, {5, 7, 11}) -local test_dot = liszt(r : R) +local test_dot = ebb(r : R) assert(dot(v1, v2) == 52) -- simple test assert(dot(v3, v4) == 0) -- type conversion, length-1 assert(dot(v1, v1) == 14) -- vector with itself @@ -29,7 +29,7 @@ R:foreach(test_dot) test.fail_function(function() - local liszt t(r : R) + local ebb t(r : R) assert(dot(v1, v3) == 7) end R:foreach(t) @@ -37,7 +37,7 @@ end, "must have equal dimensions") local vb = L.Constant(L.vec3b, {true, true, false}) test.fail_function(function() - local liszt t(r : R) + local ebb t(r : R) assert(dot(v1, vb) == 52) end R:foreach(t) diff --git a/tests/fails/assert.t b/tests/fails/assert.t index 63788bd..e0d3ec8 100644 --- a/tests/fails/assert.t +++ b/tests/fails/assert.t @@ -1,8 +1,8 @@ -import "ebb.liszt" +import "ebb" local R = L.NewRelation { name="R", size=5 } -local liszt fail_assert (r : R) +local ebb fail_assert (r : R) L.assert(false) end R:foreach(fail_assert) diff --git a/tests/fails/assertvar.t b/tests/fails/assertvar.t index a714bb5..d80f81d 100644 --- a/tests/fails/assertvar.t +++ b/tests/fails/assertvar.t @@ -1,8 +1,8 @@ -import "ebb.liszt" +import "ebb" local R = L.NewRelation { name="R", size=5 } -local liszt fail_assert (r : R) +local ebb fail_assert (r : R) var x = 5 L.assert(x == 4) end diff --git a/tests/fails/sillyarith.t b/tests/fails/sillyarith.t index 24cab47..9ebc0c8 100644 --- a/tests/fails/sillyarith.t +++ b/tests/fails/sillyarith.t @@ -1,7 +1,7 @@ -import "ebb.liszt" +import "ebb" local R = L.NewRelation { name="R", size=5 } -local liszt fail_assert (r : R) +local ebb fail_assert (r : R) L.assert(2 + 2 == 5) end R:foreach(fail_assert) diff --git a/tests/fails/veclit.t b/tests/fails/veclit.t index 54c7bb0..d025f02 100644 --- a/tests/fails/veclit.t +++ b/tests/fails/veclit.t @@ -1,7 +1,7 @@ -import "ebb.liszt" +import "ebb" local R = L.NewRelation { name="R", size=5 } -local liszt vk (v : R) +local ebb vk (v : R) var v = { } end R:foreach(vk) diff --git a/tests/fieldcopyswap.t b/tests/fieldcopyswap.t index 2939cdf..f949fe3 100644 --- a/tests/fieldcopyswap.t +++ b/tests/fieldcopyswap.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" require "tests/test" local cells = L.NewRelation { size = 10, name = 'cells' } @@ -6,14 +6,14 @@ local cells = L.NewRelation { size = 10, name = 'cells' } cells:NewField('f1', L.double):Load(0) cells:NewField('f2', L.double):Load(0) -local setup = liszt ( c : cells ) +local setup = ebb ( c : cells ) c.f1 = 5 end cells:foreach(setup) cells:Swap('f1','f2') -local check1 = liszt ( c : cells ) +local check1 = ebb ( c : cells ) L.assert(c.f2 == 5) L.assert(c.f1 == 0) end @@ -21,7 +21,7 @@ cells:foreach(check1) cells:Copy{to='f1',from='f2'} -local check2 = liszt ( c : cells ) +local check2 = ebb ( c : cells ) L.assert(c.f2 == 5) L.assert(c.f1 == 5) end diff --git a/tests/fieldreduce.t b/tests/fieldreduce.t index 3ce1c3c..172dfb3 100644 --- a/tests/fieldreduce.t +++ b/tests/fieldreduce.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" local ioOff = require 'ebb.domains.ioOff' local M = ioOff.LoadTrimesh('tests/octa.off') @@ -9,7 +9,7 @@ local P = V.pos local loc_data = P:DumpToList() function shift(x,y,z) - local liszt shift_func (v : M.vertices) + local ebb shift_func (v : M.vertices) v.pos += {x,y,z} end M.vertices:foreach(shift_func) @@ -44,14 +44,14 @@ local T = M.triangles T:NewField("mat", L.mat3d) -local liszt m_set(t : T) +local ebb m_set(t : T) var d = L.double(L.id(t)) t.mat = {{d, 0.0, 0.0}, {0.0, d, 0.0}, {0.0, 0.0, d}} end -local liszt m_reduce_centered (t : T) +local ebb m_reduce_centered (t : T) t.mat += { {.11, .11, .11}, {.22, .22, .22}, @@ -73,13 +73,13 @@ local E = M.edges V:NewField("mat", L.mat3d) -local liszt m_set_v(v : V) +local ebb m_set_v(v : V) var d = L.double(L.id(v)) v.mat = {{d, 0.0, 0.0}, {0.0, d, 0.0}, {0.0, 0.0, d}} end -local liszt m_reduce_uncentered (e : E) +local ebb m_reduce_uncentered (e : E) e.head.mat += .5*{ {.11, .11, .11}, {.22, .22, .22}, diff --git a/tests/fields.t b/tests/fields.t index a11b454..97d8f3f 100644 --- a/tests/fields.t +++ b/tests/fields.t @@ -3,7 +3,7 @@ produces something that can compile. ]] -import "ebb.liszt" +import "ebb" require "tests.test" local assert = L.assert @@ -53,51 +53,51 @@ local b = L.Constant(L.vec4f, {1, 3, 4, 5}) --------------------- -- Test functions: -- --------------------- -local reduce1 = liszt (t : T) +local reduce1 = ebb (t : T) t.field1 -= 3 - 1/6 * a end -local reduce2 = liszt (t : T) +local reduce2 = ebb (t : T) t.field2 *= 3 * 7 / 3 end -local read1 = liszt (t : T) +local read1 = ebb (t : T) var tmp = t.field3 + 5 assert(tmp == 11) end -local write1 = liszt(t : T) +local write1 = ebb(t : T) t.field3 = 0.0f end -local write2 = liszt (t : T) +local write2 = ebb (t : T) t.field5 = b end -local reduce3 = liszt (t : T) +local reduce3 = ebb (t : T) t.field5 += {1.0f,1.0f,1.0f,1.0f} end -local check2 = liszt (t : T) +local check2 = ebb (t : T) assert(t.field5[0] == 2) assert(t.field5[1] == 4) assert(t.field5[2] == 5) assert(t.field5[3] == 6) end -local write3 = liszt (t : T) +local write3 = ebb (t : T) t.field4 = true end -local check3 = liszt (t : T) +local check3 = ebb (t : T) assert(t.field4) end -local write4 = liszt (t : T) +local write4 = ebb (t : T) t.field4 = false end -local check4 = liszt(t : T) +local check4 = ebb(t : T) assert(not t.field4) end @@ -134,7 +134,7 @@ local function check_write () T:foreach(reduce3) f4:set({0, 0, 0, 0}) - local sum_positions = liszt (t : T) + local sum_positions = ebb (t : T) f4 += t.field5 end T:foreach(sum_positions) diff --git a/tests/fieldwrite.t b/tests/fieldwrite.t index 13ed524..a96d1c2 100644 --- a/tests/fieldwrite.t +++ b/tests/fieldwrite.t @@ -1,10 +1,10 @@ -import "ebb.liszt" +import "ebb" local R = L.NewRelation { name="R", size=5 } R:NewField('position', L.vec3d):Load({0,0,0}) function shift(x,y,z) - local liszt pass_func (r : R) + local ebb pass_func (r : R) r.position = {x,y,z} end R:foreach(pass_func) diff --git a/tests/functions.t b/tests/functions.t index d484a7d..9d7f3d2 100644 --- a/tests/functions.t +++ b/tests/functions.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" require "tests/test" local cells = L.NewRelation { size = 10, name = 'cells' } @@ -14,11 +14,11 @@ local assert, length, print, dot = L.assert, L.length, L.print, L.dot ------------------- -- Test function -- ------------------- -local square = liszt(x) +local square = ebb(x) return x*x end -local t1 = liszt(c : cells) +local t1 = ebb(c : cells) assert(square(7) == 49) end cells:foreach(t1) @@ -26,10 +26,10 @@ cells:foreach(t1) ------------------------------- --Test stacked function calls-- ------------------------------- -local sum = liszt(x, y, z) +local sum = ebb(x, y, z) return x + y + z end -local t2 = liszt(c : cells) +local t2 = ebb(c : cells) assert(sum(square(1), square(2), square(3)) == 14) end cells:foreach(t2) @@ -37,10 +37,10 @@ cells:foreach(t2) ------------------------------------------- --Test function that behaves like a field-- ------------------------------------------- -cells:NewFieldFunction('scaledposition', liszt(c) +cells:NewFieldFunction('scaledposition', ebb(c) return 2*c.position end) -local t3 = liszt(c : cells) +local t3 = ebb(c : cells) assert(c.scaledposition == 2 * c.position) end cells:foreach(t3) @@ -48,10 +48,10 @@ cells:foreach(t3) -------------------------------------- --Combine normal and field functions-- -------------------------------------- -local norm = liszt(v) +local norm = ebb(v) return dot(v, v) end -local t4 = liszt(c : cells) +local t4 = ebb(c : cells) var lensq = norm(c.scaledposition) var expected = 4.0 * length(c.position) * length(c.position) assert(square(lensq - expected) < 0.00005) @@ -61,12 +61,12 @@ cells:foreach(t4) ------------------------------------------ --Test Functions with more than one line-- ------------------------------------------ -local sub1_but_non_neg = liszt(num) +local sub1_but_non_neg = ebb(num) var result = num - 1 if result < 0 then result = 0 end return result end -local t5 = liszt (c : cells) +local t5 = ebb (c : cells) assert(sub1_but_non_neg(2) == 1) assert(sub1_but_non_neg(0) == 0) end @@ -76,13 +76,13 @@ cells:foreach(t5) --Test Dynamic Scoping Bug-- ---------------------------- -- (symbols fixed this bug w/o alpha-renaming) -local dyn_prod = liszt(d, x) -- the two parameters is important +local dyn_prod = ebb(d, x) -- the two parameters is important return d*x end -local dyn_outer = liszt(d) +local dyn_outer = ebb(d) return dyn_prod(1, d+d) end -local dyn_kern = liszt (c : cells) +local dyn_kern = ebb (c : cells) var r = dyn_outer(2) assert(r == 4) end @@ -92,20 +92,20 @@ cells:foreach(dyn_kern) ------------------ --Empty Function-- ------------------ -local empty_f = liszt() end -local t6 = liszt (c : cells) +local empty_f = ebb() end +local t6 = ebb (c : cells) empty_f() end cells:foreach(t6) -- Two failure cases to exercise case of no return value test.fail_function(function() - local liszt t(c : cells) + local ebb t(c : cells) var x = empty_f() end cells:foreach(t) end, 'can only assign numbers, bools, or keys') test.fail_function(function() - local liszt t(c : cells) + local ebb t(c : cells) var x = 2 + empty_f() end cells:foreach(t) @@ -114,8 +114,8 @@ end, "invalid types for operator '%+'") -------------- --Just Print-- -------------- -local print_42 = liszt() L.print(42) end -local do_print = liszt ( c : cells ) +local print_42 = ebb() L.print(42) end +local do_print = ebb ( c : cells ) print_42() end cells:foreach(do_print) @@ -124,8 +124,8 @@ cells:foreach(do_print) -------------- --Return val-- -------------- -local get_3 = liszt() return 3 end -local check_3 = liszt ( c : cells ) +local get_3 = ebb() return 3 end +local check_3 = ebb ( c : cells ) L.assert(get_3() == 3) end cells:foreach(check_3) @@ -135,7 +135,7 @@ cells:foreach(check_3) --check that recursion fails-- ------------------------------ test.fail_function(function() - local recurse = liszt() return recurse() end + local recurse = ebb() return recurse() end end, "variable 'recurse' is not defined") @@ -143,7 +143,7 @@ end, "variable 'recurse' is not defined") --check that return values are prohibited if mapped-- ----------------------------------------------------- test.fail_function(function() - local liszt t(c : cells) + local ebb t(c : cells) return 3 end cells:foreach(t) @@ -154,7 +154,7 @@ end, 'Functions executed over relations should not return values') --Test improper placement of return statement-- ----------------------------------------------- --test.fail_function(function() --- local bad_ret = liszt(num) +-- local bad_ret = ebb(num) -- if num-1 < 0 then return 0 else return num-1 end -- end --end, 'asdfasf') diff --git a/tests/global.t b/tests/global.t index 595f4e5..c5a3cfa 100644 --- a/tests/global.t +++ b/tests/global.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" require "tests/test" local R = L.NewRelation { name="R", size=5 } @@ -20,13 +20,13 @@ vb = L.Constant(L.vector(L.bool, 5), {true, false, true, false, true}) local two = 2 -- test vector codegen: -local f1 = liszt (r : R) sf3 += vf end -local f2 = liszt (r : R) si4 += -vi end -local f3 = liszt (r : R) sb5 and= vb end -local f4 = liszt (r : R) sf += 1 end -local f5 = liszt (r : R) si += -two end -local f6 = liszt (r : R) sb and= false end ---local f7 = liszt (r : R) sd /= 2.0 end +local f1 = ebb (r : R) sf3 += vf end +local f2 = ebb (r : R) si4 += -vi end +local f3 = ebb (r : R) sb5 and= vb end +local f4 = ebb (r : R) sf += 1 end +local f5 = ebb (r : R) si += -two end +local f6 = ebb (r : R) sb and= false end +--local f7 = ebb (r : R) sd /= 2.0 end R:foreach(f1) test.fuzzy_aeq(sf3:get(), {nr, 2*nr, 3*nr}) diff --git a/tests/gpu_multiblock_test.t b/tests/gpu_multiblock_test.t index eafa964..1e80565 100644 --- a/tests/gpu_multiblock_test.t +++ b/tests/gpu_multiblock_test.t @@ -1,10 +1,10 @@ -- This test actually doesn't need to run on the GPU, -- it's just designed to stress test GPU execution in particular -import 'ebb.liszt' +import 'ebb' -- A 17x17 grid will, at current settings, --- will force liszt to run the generated kernel +-- will force ebb to run the generated kernel -- on multiple GPU blocks local N=17 @@ -20,7 +20,7 @@ function main () local com = L.Global(L.vector(L.float, 2), {0, 0}) -- compute centroid - local sum_pos = liszt(c : grid.cells) + local sum_pos = ebb(c : grid.cells) com += c.center end grid.cells:foreach(sum_pos) diff --git a/tests/grid.t b/tests/grid.t index 9dc7ede..9c2b249 100644 --- a/tests/grid.t +++ b/tests/grid.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" require "tests/test" --error('NEED TO WRITE GRID TESTS; DO WHILE REWRITING GRID DOMAIN') @@ -49,7 +49,7 @@ test.rec_aeq(rel3.f3:DumpToList(),tbl3) rel3:NewField('f3func',L.double):Load(function(x,y,z) return 6*z + 3*y + x + 1 end) -local liszt f3consistency( r : rel3 ) +local ebb f3consistency( r : rel3 ) L.assert(r.f3 == r.f3func) end rel3:foreach(f3consistency) @@ -68,7 +68,7 @@ end) rel1:GroupBy('r2') -- and test that we can use the grouping in a function -local liszt group_k ( r2 : rel2 ) +local ebb group_k ( r2 : rel2 ) for r1 in L.Where(rel1.r2, r2) do L.assert(2*L.double(L.int(r1.v1) % 2) == r2.v2[0]) L.assert( L.double(L.int(r1.v1) / 2) == r2.v2[1]) @@ -84,13 +84,13 @@ end) rel3:NewField('a3',L.double):Load(function(x,y,z) return 3*x + 5*y end) -local liszt affinetest3to2 ( r3 : rel3 ) +local ebb affinetest3to2 ( r3 : rel3 ) var r2 = L.Affine(rel2, {{0,1,0,0}, {1,0,0,0}}, r3) L.assert(r3.a3 == r2.a2) end rel3:foreach(affinetest3to2) -local liszt affinetest2to3 ( r2 : rel2 ) +local ebb affinetest2to3 ( r2 : rel2 ) var r3 = L.Affine(rel3, {{0,1,0}, {1,0,0}, {0,0,0}}, r2) @@ -98,7 +98,7 @@ local liszt affinetest2to3 ( r2 : rel2 ) end rel2:foreach(affinetest2to3) -- this one shouldn't match almost at all -local liszt scramble2to3 ( r2 : rel2 ) +local ebb scramble2to3 ( r2 : rel2 ) var r3 = L.Affine(rel3, {{1,0,0}, {0,0,0}, {0,1,0}}, r2) @@ -114,7 +114,7 @@ local prel2 = L.NewRelation { periodic={true,true} } prel2:NewField('cid', L.vec2i):Load(function(x,y) return {x,y} end) -local liszt test_wrap ( r : prel2 ) +local ebb test_wrap ( r : prel2 ) var off = L.Affine(prel2, {{1,0,1}, {0,1,1}}, r) L.assert( (r.cid[0]+1) % 3 == off.cid[0] and diff --git a/tests/gridreduce.t b/tests/gridreduce.t index c1100c0..0919ca2 100644 --- a/tests/gridreduce.t +++ b/tests/gridreduce.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" require "tests/test" @@ -18,26 +18,26 @@ local glob_raw_count_1 = L.Global(L.int, 0) local glob_raw_count_2 = L.Global(L.int, 0) local glob_raw_count_3 = L.Global(L.int, 0) -local liszt count_one1 ( c : rel1 ) +local ebb count_one1 ( c : rel1 ) L.assert(c.ones == 1) glob_one_count_1 += c.ones end -local liszt count_one2 ( c : rel2 ) +local ebb count_one2 ( c : rel2 ) L.assert(c.ones == 1) glob_one_count_2 += c.ones end -local liszt count_one3 ( c : rel3 ) +local ebb count_one3 ( c : rel3 ) L.assert(c.ones == 1) glob_one_count_3 += c.ones end -local liszt count_raw1 ( c : rel1 ) +local ebb count_raw1 ( c : rel1 ) glob_raw_count_1 += 1 end -local liszt count_raw2 ( c : rel2 ) +local ebb count_raw2 ( c : rel2 ) glob_raw_count_2 += 1 end -local liszt count_raw3 ( c : rel3 ) +local ebb count_raw3 ( c : rel3 ) glob_raw_count_3 += 1 end diff --git a/tests/heattransfer.t b/tests/heattransfer.t index 04291bf..1be4cb0 100644 --- a/tests/heattransfer.t +++ b/tests/heattransfer.t @@ -1,4 +1,4 @@ -import 'ebb.liszt' +import 'ebb' local M = { vertices = L.NewRelation { name="vertices", size=8 }, @@ -34,7 +34,7 @@ M.vertices:NewField('flux', L.float):Load(0) M.vertices:NewField('jacobistep', L.float):Load(0) M.vertices:NewField('temperature', L.float):Load(init_temp) -local liszt compute_step (e : M.edges) +local ebb compute_step (e : M.edges) var v1 = e.head var v2 = e.tail var dp = L.vec3f(v1.position - v2.position) @@ -48,11 +48,11 @@ local liszt compute_step (e : M.edges) v2.jacobistep += step end -local liszt propagate_temp (p : M.vertices) +local ebb propagate_temp (p : M.vertices) p.temperature += L.float(.01) * p.flux / p.jacobistep end -local liszt clear (p : M.vertices) +local ebb clear (p : M.vertices) p.flux = 0 p.jacobistep = 0 end diff --git a/tests/insert_stmt.t b/tests/insert_stmt.t index deceeab..d3bc68b 100644 --- a/tests/insert_stmt.t +++ b/tests/insert_stmt.t @@ -1,6 +1,6 @@ --DISABLE-ON-LEGION -import "ebb.liszt" +import "ebb" require "tests/test" @@ -24,7 +24,7 @@ particles:NewField('pos', L.vec3d) -- block insertion into a relation we're mapping over test.fail_function(function() -- try to copy each particle - local liszt t( p : particles ) + local ebb t( p : particles ) insert { cell = L.UNSAFE_ROW( L.uint64(0), cells ), pos = {0.1,0.1,0.1} } into particles end particles:foreach(t) @@ -33,7 +33,7 @@ end, "Cannot insert into relation particles while mapping over it") -- TODO: this could be relaxed -- block insertion into a relation if we're accessing that relation's fields test.fail_function(function() - local liszt t( p : particles ) + local ebb t( p : particles ) insert { temperature = L.float(0.1) } into cells p.cell.temperature += L.float(0.25) end @@ -44,7 +44,7 @@ end, "Cannot insert into relation cells because it\'s not ELASTIC") -- not specifying the insert of all fields should fail test.fail_function(function() - local liszt t( c : cells ) + local ebb t( c : cells ) insert { cell = c } into particles end cells:foreach(t) @@ -53,7 +53,7 @@ end, "inserted record type does not match relation") -- specifying non-existant fields should fail test.fail_function(function() - local liszt t( c : cells ) + local ebb t( c : cells ) var pos = { L.double(L.id(c)), 0, 0 } insert { cell = c, pos = pos, diameter = 0.1 } into particles end @@ -68,7 +68,7 @@ grouped_rel:GroupBy('cell') -- A relation which is grouped can't be inserted into test.fail_function(function() - local liszt t( c : cells ) + local ebb t( c : cells ) insert { cell = c } into grouped_rel end cells:foreach(t) @@ -77,7 +77,7 @@ end, 'Cannot insert into relation grouped_rel because it\'s not ELASTIC') -- Inserting into something that isn't a relation local sum = L.Global(L.uint64, 0) test.fail_function(function() - local liszt t( c : cells ) + local ebb t( c : cells ) insert { cell = c } into sum end cells:foreach(t) @@ -86,7 +86,7 @@ end, 'Expected a relation to insert into') -- CANNOT insert twice into the same relation (do with a branch) test.fail_function(function() - local liszt t( c : cells ) + local ebb t( c : cells ) var pos = { L.double(L.id(c)), 0, 0 } if L.id(c)%2 == 0 then insert { cell = c, pos = pos } into particles @@ -108,16 +108,16 @@ end, 'Cannot insert into relation particles twice') test.eq(particles:Size(), 0) -- seed a particle in every cell -local seed_particles = liszt( c : cells ) +local seed_particles = ebb( c : cells ) var pos = { L.double(L.id(c) + 1), 0, 0 } insert { cell = c, pos = pos } into particles end -local post_insert_trivial = liszt( p : particles ) +local post_insert_trivial = ebb( p : particles ) L.assert(p.pos[0] > 0) end -local test_cell_id = liszt( p : particles ) +local test_cell_id = ebb( p : particles ) L.assert(L.id(p.cell) < 10) end @@ -131,7 +131,7 @@ particles:foreach(post_insert_trivial) -- reduce this over the particles local psum = L.Global(L.double, 0) -local liszt sumparticles( p : particles ) +local ebb sumparticles( p : particles ) psum += p.pos[0] end particles:foreach(sumparticles) diff --git a/tests/length.t b/tests/length.t index 156636e..88e6c23 100644 --- a/tests/length.t +++ b/tests/length.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" local assert = L.assert local dot = L.dot @@ -15,7 +15,7 @@ local sqrt = terralib.includec('math.h').sqrt local ans1 = sqrt(1 + 4 + 9) local ans2 = sqrt(4 + 16 + 36) -local liszt test_dot (r : R) +local ebb test_dot (r : R) assert(length(v1) == ans1) -- float(3) assert(length(v2) == ans1) -- int(3) assert(length(v3) == 7) -- float(1) diff --git a/tests/luabuiltins.t b/tests/luabuiltins.t index 646e29a..2a52057 100644 --- a/tests/luabuiltins.t +++ b/tests/luabuiltins.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" local print, assert, dot, cross, length = L.print, L.assert, L.dot, L.cross, L.length @@ -8,7 +8,7 @@ local R = L.NewRelation { name="R", size=6 } local v1 = L.Constant(L.vec3f, {1, 2, 3}) local v2 = L.Constant(L.vec3f, {5, 7, 11}) -R:foreach(liszt(r : R) +R:foreach(ebb(r : R) assert(true) print(42) assert(dot(v1, v2) == 52) diff --git a/tests/macro.t b/tests/macro.t index d914e5a..ccafb30 100644 --- a/tests/macro.t +++ b/tests/macro.t @@ -1,11 +1,11 @@ -import "ebb.liszt" +import "ebb" local R = L.NewRelation { size = 4, name = 'relation' } R:NewField("result", L. uint64) -- This macro emits a side effect every time it is evaluated local side_effect = L.NewMacro(function(x) - return liszt quote + return ebb quote L.print(L.id(x)) in x @@ -13,10 +13,10 @@ local side_effect = L.NewMacro(function(x) end) local test_macro = L.NewMacro(function (y) - return liszt `L.id(y)+ L.id(y) + return ebb `L.id(y)+ L.id(y) end) -local liszt test (r : R) +local ebb test (r : R) --side effect should only be evaluated once! r.result = test_macro(side_effect(r)) diff --git a/tests/math.t b/tests/math.t index 4320ab5..3474a6e 100644 --- a/tests/math.t +++ b/tests/math.t @@ -1,4 +1,4 @@ -import 'ebb.liszt' +import 'ebb' local R = L.NewRelation { size = 32, name = 'R' } R:NewField('sqrt', L.double):Load(0.0) @@ -6,7 +6,7 @@ R:NewField('cbrt', L.double):Load(0.0) R:NewField('sin', L.double):Load(0.0) R:NewField('cos', L.double):Load(0.0) -local root_test = liszt (r : R) +local root_test = ebb (r : R) r.cbrt = L.cbrt(L.id(r)) r.sqrt = L.sqrt(L.id(r)) end @@ -15,7 +15,7 @@ R:foreach(root_test) R.cbrt:print() R.sqrt:print() -local trig_test = liszt (r : R) +local trig_test = ebb (r : R) r.sin = L.sin(L.id(r)) r.cos = L.cos(L.id(r)) end diff --git a/tests/meshsum.t b/tests/meshsum.t index 3bde6e6..c2714bf 100644 --- a/tests/meshsum.t +++ b/tests/meshsum.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" local ioOff = require 'ebb.domains.ioOff' local mesh = ioOff.LoadTrimesh('tests/octa.off') @@ -7,11 +7,11 @@ mesh.vertices:NewField('count', L.float) mesh.vertices.count:LoadConstant(0) -local sum_count = liszt (e : mesh.edges) +local sum_count = ebb (e : mesh.edges) e.tail.count += 1 end -local check_count = liszt(v : mesh.vertices) +local check_count = ebb(v : mesh.vertices) var c = 0 for e in v.edges do c += 1 diff --git a/tests/minmax.t b/tests/minmax.t index 5150930..ea9be09 100644 --- a/tests/minmax.t +++ b/tests/minmax.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" require 'tests.test' local ioOff = require 'ebb.domains.ioOff' @@ -11,14 +11,14 @@ local max_pos = L.Global(L.vec3d, {-10, -10, -10}) local min_pos = L.Global(L.vec3d, { 10, 10, 10}) -- Test max reduction operator -local max_func = liszt (v : M.vertices) +local max_func = ebb (v : M.vertices) max_pos max= v.pos end M.vertices:foreach(max_func) test.aeq(max_pos:get(), {0.5,0.5,0.5}) -- Test min reduction operator -local min_func = liszt (v : M.vertices) +local min_func = ebb (v : M.vertices) min_pos min= v.pos end M.vertices:foreach(min_func) diff --git a/tests/nest.t b/tests/nest.t index f0ec59c..ed1b8b3 100644 --- a/tests/nest.t +++ b/tests/nest.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" local test = require('tests.test') @@ -9,7 +9,7 @@ mesh.vertices:NewField('field', L.float) mesh.vertices.field:Load(1) local count = L.Global(L.float, 0) -local test_for = liszt (v : mesh.vertices) +local test_for = ebb (v : mesh.vertices) for e in v.edges do count += 1 end diff --git a/tests/pathname.t b/tests/pathname.t index 1b5b16a..15821e3 100644 --- a/tests/pathname.t +++ b/tests/pathname.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" local test = require('tests.test') @@ -11,7 +11,7 @@ local testdir = Pathname.new('pathname_testdir') test.eq(Pathname.root:is_absolute(), true) test.eq(Pathname.root:is_root(), true) test.eq(Pathname.pwd:is_absolute(), true) -test.eq(Pathname.liszt_root:is_absolute(), true) +test.eq(Pathname.ebb_root:is_absolute(), true) test.eq(Pathname.root:basename(), '') diff --git a/tests/phase.t b/tests/phase.t index df34ec6..76acdca 100644 --- a/tests/phase.t +++ b/tests/phase.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" local test = require "tests/test" local ioOff = require 'ebb.domains.ioOff' @@ -8,7 +8,7 @@ M.vertices:NewField('field1', L.float):LoadConstant(0) M.vertices:NewField('field2', L.float):LoadConstant(0) test.fail_function(function() - local liszt write_neighbor (v : M.vertices) + local ebb write_neighbor (v : M.vertices) for nv in v.neighbors do nv.field1 = 3 end @@ -17,7 +17,7 @@ test.fail_function(function() end, 'Non%-Exclusive WRITE') test.fail_function(function() - local liszt read_write_conflict (v : M.vertices) + local ebb read_write_conflict (v : M.vertices) v.field1 = 3 var sum : L.float = 0 for nv in v.neighbors do @@ -28,7 +28,7 @@ test.fail_function(function() end, 'READ Phase is incompatible with.* EXCLUSIVE Phase') test.fail_function(function() - local liszt read_reduce_conflict (v : M.vertices) + local ebb read_reduce_conflict (v : M.vertices) var sum : L.float = 0 for nv in v.neighbors do nv.field1 += 1 @@ -39,7 +39,7 @@ test.fail_function(function() end, 'READ Phase is incompatible with.* REDUCE%(%+%) Phase') test.fail_function(function() - local liszt reduce_reduce_conflict (v : M.vertices) + local ebb reduce_reduce_conflict (v : M.vertices) var sum : L.float = 0 for nv in v.neighbors do nv.field1 += 1 @@ -50,7 +50,7 @@ test.fail_function(function() end, 'REDUCE%(%*%) Phase is incompatible with.* REDUCE%(%+%) Phase') -- writing and reducing exclusively should be fine -local liszt write_reduce_exclusive (v : M.vertices) +local ebb write_reduce_exclusive (v : M.vertices) v.field1 = 3 v.field1 += 1 end @@ -58,7 +58,7 @@ M.vertices:foreach(write_reduce_exclusive) -- two different reductions exclusively should be fine -local liszt reduce_reduce_exclusive (v : M.vertices) +local ebb reduce_reduce_exclusive (v : M.vertices) v.field1 += 2 v.field1 *= 2 end @@ -70,14 +70,14 @@ M.vertices:foreach(reduce_reduce_exclusive) local g1 = L.Global(L.float, 32) test.fail_function(function() - local liszt global_write_bad (v : M.vertices) + local ebb global_write_bad (v : M.vertices) g1 = v.field1 end M.vertices:foreach(global_write_bad) end, 'Cannot write to globals in functions') test.fail_function(function() - local liszt global_read_reduce_conflict (v : M.vertices) + local ebb global_read_reduce_conflict (v : M.vertices) var x = g1 g1 += 1 end @@ -86,7 +86,7 @@ end, 'REDUCE%(%+%) Phase for Global is incompatible with.*'.. 'READ Phase for Global') test.fail_function(function() - local liszt global_reduce_reduce_conflict (v : M.vertices) + local ebb global_reduce_reduce_conflict (v : M.vertices) g1 += v.field1 g1 *= v.field1 end diff --git a/tests/print.t b/tests/print.t index d365081..a3071b2 100644 --- a/tests/print.t +++ b/tests/print.t @@ -1,41 +1,41 @@ -import "ebb.liszt" +import "ebb" local R = L.NewRelation { name="R", size=6 } local v = L.Constant(L.vec3f, {1, 2, 3}) --- We break each print statement into its own liszt function, +-- We break each print statement into its own ebb function, -- since otherwise the order of the print statements is --- technically non-deterministic under Liszt's execution semantics +-- technically non-deterministic under Ebb's execution semantics -local liszt print_1 ( r : R ) +local ebb print_1 ( r : R ) L.print(true) end -local liszt print_2 ( r : R ) +local ebb print_2 ( r : R ) var m = { { 1.2, 0 }, { 0.4, 1 } } L.print(m) end -local liszt print_3 ( r : R ) +local ebb print_3 ( r : R ) L.print(4) end -local liszt print_4 ( r : R ) +local ebb print_4 ( r : R ) L.print(2.2) end -local liszt print_5 ( r : R ) +local ebb print_5 ( r : R ) L.print() end -local liszt print_6 ( r : R ) +local ebb print_6 ( r : R ) L.print(1,2,3,4,5,false,{3.3,3.3}) end -local liszt print_7 ( r : R ) +local ebb print_7 ( r : R ) var x = 2 + 3 L.print(x) end -local liszt print_8 ( r : R ) +local ebb print_8 ( r : R ) L.print(v) end -- cannot rely on order of execution ---local print_stuff = liszt(r : R) +--local print_stuff = ebb(r : R) -- L.print(L.id(f)) --end diff --git a/tests/record_types.t b/tests/record_types.t index bff72c8..bda037a 100644 --- a/tests/record_types.t +++ b/tests/record_types.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" require "tests/test" diff --git a/tests/reduce_complex.t b/tests/reduce_complex.t index 4ee8cc3..4c7f079 100644 --- a/tests/reduce_complex.t +++ b/tests/reduce_complex.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" require "tests.test" local Tetmesh = require 'devapps.fem.tetmesh' @@ -26,7 +26,7 @@ mesh.tetrahedra:NewField('F', L.mat3d):Load({ {0, 0, 0}, {0, 0, 0}, {0, 0, 0 mesh.tetrahedra:NewField('FinvT', L.mat3d):Load({ {0, 0, 0}, {0, 0, 0}, {0, 0, 0} }) mesh.tetrahedra:NewField('Fdet', L.double):Load(0) -liszt ComputeBAndW(t : mesh.tetrahedra) +local ebb ComputeBAndW(t : mesh.tetrahedra) var Dm : L.mat3d var x4 : L.vec3d = t.v[3].pos for j = 0,3 do @@ -40,7 +40,7 @@ liszt ComputeBAndW(t : mesh.tetrahedra) t.Bm = U.invertMatrix3d(Dm) end -liszt RecomputeAndResetTetTemporaries(t : mesh.tetrahedra) +local ebb RecomputeAndResetTetTemporaries(t : mesh.tetrahedra) -- recompute var Ds : L.mat3d = { { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } } var x4 = t.v[3].pos + t.v[3].q @@ -58,7 +58,7 @@ liszt RecomputeAndResetTetTemporaries(t : mesh.tetrahedra) t.Fdet = L.fabs(U.detMatrix3d(F)) end -local liszt dPdF(t, dF) +local ebb dPdF(t, dF) var dFT = U.transposeMatrix3(dF) var FinvT = t.FinvT var c1 = t.muLame - t.lambdaLame * L.log(t.Fdet) @@ -69,7 +69,7 @@ local liszt dPdF(t, dF) return dP end -liszt ComputeStiffnessMatrix(t : mesh.tetrahedra) +local ebb ComputeStiffnessMatrix(t : mesh.tetrahedra) var Bm : L.mat3d = t.Bm var BmT : L.mat3d = U.transposeMatrix3(t.Bm) var dFRow : L.mat4x3d = { { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } } @@ -99,7 +99,7 @@ liszt ComputeStiffnessMatrix(t : mesh.tetrahedra) end end -liszt ReduceStiffnessPrecision(e : mesh.edges) +local ebb ReduceStiffnessPrecision(e : mesh.edges) for i = 0,3 do for j = 0,3 do e.stiffrp[i,j] = L.floor(e.stiffness[i,j]/1000) diff --git a/tests/reduction_stress_test.t b/tests/reduction_stress_test.t index da36020..f37ca32 100644 --- a/tests/reduction_stress_test.t +++ b/tests/reduction_stress_test.t @@ -1,5 +1,5 @@ -import 'ebb.liszt' +import 'ebb' require 'tests.test' local N = 10000 @@ -8,7 +8,7 @@ local T = 5000 local vertices = L.NewRelation { size = N, name = 'vertices' } local gerr = L.Global(L.double, 0) -local liszt RunRed(v : vertices) +local ebb RunRed(v : vertices) gerr += 1 end diff --git a/tests/semant.t b/tests/semant.t index da96c5e..e6f3352 100644 --- a/tests/semant.t +++ b/tests/semant.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" require "tests/test" local lassert, lprint = L.assert, L.print @@ -44,7 +44,7 @@ a.b.c.d = 4 ------------------------------- -- Should fail b/c checkthis1 is not a global test.fail_function(function() - local liszt t(cell : R) + local ebb t(cell : R) checkthis1 = cell.f1 end R:foreach(t) @@ -53,7 +53,7 @@ end, "Illegal assignment: left hand side cannot be assigned") -- Should fail when we re-assign a new value to x, since it originally -- refers to a topological element test.fail_function(function() - local liszt t(cell : R) + local ebb t(cell : R) var x = cell x = cell end @@ -63,7 +63,7 @@ end, "Illegal assignment: variables of key type cannot be re%-assigned") -- Should fail because we do not allow assignments to fields -- (only to indexed fields, globals, and local vars) test.fail_function(function() - local fail3 = liszt(cell : R) + local fail3 = ebb(cell : R) R.f1 = 5 end R:foreach(fail3) @@ -72,14 +72,14 @@ end, "Illegal assignment: left hand side cannot be assigned") -- Should fail because we do not allow the user to alias fields, -- or any other entity that would confuse stencil generation, in the function test.fail_function(function() - local liszt t(cell : R) + local ebb t(cell : R) var z = R.f1 end R:foreach(t) end, "can only assign") test.fail_function(function() - local liszt t(cell : R) + local ebb t(cell : R) undefined = 3 end R:foreach(t) @@ -88,7 +88,7 @@ end, "variable 'undefined' is not defined") -- Can't assign a value of a different type to a variable that has already -- been initialized test.fail_function(function() - local liszt t(cell : R) + local ebb t(cell : R) var floatvar = 2 + 3.3 floatvar = true end @@ -97,7 +97,7 @@ end, "Could not coerce expression of type 'bool' into type 'double'") -- local8 is not in scope in the while loop test.fail_function(function() - local liszt t(cell : R) + local ebb t(cell : R) var local7 = 2.0 do var local8 = 2 @@ -113,7 +113,7 @@ test.fail_function(function() end, "variable 'local8' is not defined") test.fail_function(function() - local liszt t(cell : R) + local ebb t(cell : R) if 4 < 2 then var local8 = true -- Should fail here, since local8 is not defined in this scope @@ -129,7 +129,7 @@ test.fail_function(function() end, "variable 'local8' is not defined") test.fail_function(function() - local liszt t(cell : R) + local ebb t(cell : R) var local1 = 3.4 do var local1 = true @@ -140,7 +140,7 @@ test.fail_function(function() end, "Could not coerce expression of type 'double' into type 'bool'") test.fail_function(function() - local liszt t(cell : R) + local ebb t(cell : R) lassert(4 == true) -- binary op will fail here, type mismatch end R:foreach(t) @@ -148,21 +148,21 @@ end, "incompatible types: int and bool") local v = L.Constant(L.vec3f, {1, 1, 1}) test.fail_function(function() - local liszt t(cell : R) + local ebb t(cell : R) lassert(v) -- assert fail, comparison returns a vector of bools end R:foreach(t) end, "expected a boolean") test.fail_function(function() - local liszt t(cell : R) + local ebb t(cell : R) a.b = 12 end R:foreach(t) end, "Illegal assignment: left hand side cannot be assigned") test.fail_function(function() - local liszt t(cell : R) + local ebb t(cell : R) var v : L.bool if false then v = true @@ -174,21 +174,21 @@ end, "Could not coerce expression of type 'int' into type 'bool'") local tbl = {} test.fail_function(function() - local liszt t(cell : R) + local ebb t(cell : R) var x = 3 + tbl end R:foreach(t) end, "invalid types") test.fail_function(function() - local liszt t(cell : R) + local ebb t(cell : R) var x = tbl end R:foreach(t) end, "can only assign") test.fail_function(function() - local liszt t(cell : R) + local ebb t(cell : R) tbl.x = 4 end R:foreach(t) @@ -196,7 +196,7 @@ end, "lua table does not have member 'x'") local tbl = {x={}} test.fail_function(function() - local liszt t(cell : R) + local ebb t(cell : R) tbl.x.y = 4 end R:foreach(t) @@ -204,14 +204,14 @@ end, "lua table does not have member 'y'") tbl.x.z = 4 test.fail_function(function() - local liszt t(cell : R) + local ebb t(cell : R) var x = tbl.x end R:foreach(t) end, "can only assign") test.fail_function(function() - local liszt t(cell : R) + local ebb t(cell : R) for i = 1, 4, 1 do var x = 3 end @@ -222,14 +222,14 @@ end, "variable 'i' is not defined") test.fail_function(function() - local liszt badrel( cell : R ) + local ebb badrel( cell : R ) cell.f1 = 2 end otherR:foreach(badrel) -- should complain end, "The supplied relation did not match the parameter annotation") -- Nothing should fail in this function: -local good = liszt (cell : R) +local good = ebb (cell : R) cell.f1 = 3 var lc = 4.0 diff --git a/tests/shadow.t b/tests/shadow.t index ed24780..9ba931f 100644 --- a/tests/shadow.t +++ b/tests/shadow.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" require "tests/test" local cells = L.NewRelation { size = 10, name = 'cells' } @@ -9,13 +9,13 @@ cells:NewField('val', L.double):Load(5) -- a problem but some tricky ordering details in how envirnoments -- are managed in the compiler can cause errors -local center_shadow = liszt ( c : cells ) +local center_shadow = ebb ( c : cells ) var c = c L.assert(c.val == 5) end cells:foreach(center_shadow) -local center_other = liszt ( c : cells ) +local center_other = ebb ( c : cells ) var v = 25 var v = 2 end diff --git a/tests/simple.t b/tests/simple.t index 90665dd..4f75161 100644 --- a/tests/simple.t +++ b/tests/simple.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" local R = L.NewRelation { name="R", size=6 } @@ -14,7 +14,7 @@ local vv = L.Constant(L.vec3i, {1,2,3}) local luavalue_true = true -local liszt test_bool (r : R) +local ebb test_bool (r : R) var q = true var x = q -- Also, test re-declaring variables (symbols for 'x' should now be different) var z = not q @@ -31,7 +31,7 @@ local liszt test_bool (r : R) end R:foreach(test_bool) -local liszt test_decls (r : R) +local ebb test_decls (r : R) -- DeclStatement tests -- var c : L.int c = 12 @@ -63,7 +63,7 @@ end R:foreach(test_decls) -local liszt test_conditionals (r : R) +local ebb test_conditionals (r : R) -- IfStatement tests var q = true var x = 3 @@ -112,7 +112,7 @@ end R:foreach(test_conditionals) -local liszt test_arith(r : R) +local ebb test_arith(r : R) -- BinaryOp, UnaryOp, InitStatement, Number, Bool, and RValue codegen tests var x = 9 lassert(x == 9) @@ -157,7 +157,7 @@ local liszt test_arith(r : R) end R:foreach(test_arith) -local liszt test_while (r : R) +local ebb test_while (r : R) -- While Statement tests -- -- if either of these while statements doesn't terminate, then our codegen scoping is wrong! var a = true @@ -174,7 +174,7 @@ end R:foreach(test_while) -local liszt test_do (r : R) +local ebb test_do (r : R) var b = false var x = true var y = 3 @@ -195,7 +195,7 @@ end R:foreach(test_do) -local liszt test_repeat (r : R) +local ebb test_repeat (r : R) -- RepeatStatement tests -- var x = 0 var y = 0 @@ -215,7 +215,7 @@ end R:foreach(test_repeat) -local liszt test_for (r : R) +local ebb test_for (r : R) -- Numeric for tests: -- var x = true for i = 1, 5 do diff --git a/tests/simple2.t b/tests/simple2.t index ec1ba30..63e6228 100644 --- a/tests/simple2.t +++ b/tests/simple2.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" require "tests/test" local ioOff = require 'ebb.domains.ioOff' @@ -7,7 +7,7 @@ local com = L.Global(L.vector(L.float, 3), {0, 0, 0}) function center_of_mass () com:set({0,0,0}) - local sum_pos = liszt (v : mesh.vertices) + local sum_pos = ebb (v : mesh.vertices) com += L.vec3f(v.pos) end mesh.vertices:foreach(sum_pos) @@ -18,7 +18,7 @@ end local function displace_mesh (delta_x, delta_y, delta_z) local d = L.Constant(L.vec3d, {delta_x, delta_y, delta_z}) - local dk = liszt (v : mesh.vertices) + local dk = ebb (v : mesh.vertices) v.pos += d end mesh.vertices:foreach(dk) diff --git a/tests/small_matrix.t b/tests/small_matrix.t index dea7a91..c6b7000 100644 --- a/tests/small_matrix.t +++ b/tests/small_matrix.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" require 'tests/test' --local types = require "ebb.src.types" @@ -12,7 +12,7 @@ mesh.vertices:NewField('posmag', L.double) ------------------ -- Should pass: -- ------------------ -local populate_tensor = liszt (v : mesh.vertices) +local populate_tensor = ebb (v : mesh.vertices) var p = v.pos var tensor = { { p[0]*p[0], p[0]*p[1], p[0]*p[2] }, @@ -23,24 +23,24 @@ local populate_tensor = liszt (v : mesh.vertices) end mesh.vertices:foreach(populate_tensor) -local trace = liszt (v : mesh.vertices) +local trace = ebb (v : mesh.vertices) var tp = v.tensor_pos v.posmag = tp[0,0]*tp[0,0] + tp[1,1]*tp[1,1] + tp[2,2]*tp[2,2] end mesh.vertices:foreach(trace) -local k = liszt (v : mesh.vertices) +local k = ebb (v : mesh.vertices) var x = { { 5, 5, 5 }, { 4, 4, 4 }, { 5, 5, 5 } } v.tensor_pos += x + { { 1, 0, 0 }, { 0, 1, 0 }, { 0, 0, 1 } } end mesh.vertices:foreach(k) -local zero_corner = liszt(v : mesh.vertices) +local zero_corner = ebb(v : mesh.vertices) v.tensor_pos[0,2] = 0 end mesh.vertices:foreach(zero_corner) -local arith_test = liszt(v : mesh.vertices) +local arith_test = ebb(v : mesh.vertices) var id : L.mat3d = {{1,0,0},{0,1,0},{0,0,1}} var A : L.mat3d = {{2,2,2},{3,3,3},{4,4,4}} var B : L.mat3d = {{7,2,2},{3,8,3},{4,4,9}} @@ -48,7 +48,7 @@ local arith_test = liszt(v : mesh.vertices) end mesh.vertices:foreach(arith_test) -local unsym_mat = liszt(v : mesh.vertices) +local unsym_mat = ebb(v : mesh.vertices) var A : L.mat3x4i = { { 1, 2, 3, 4 }, { 5, 6, 7, 8 }, { 9, 10, 11, 12 } } A end @@ -59,7 +59,7 @@ mesh.vertices:foreach(unsym_mat) ------------------ test.fail_function(function() - local liszt t(v : mesh.vertices) + local ebb t(v : mesh.vertices) var m34 = L.mat3x4f({{1.1,0,2.3},{0.1,0,0},{0,5.2,0}}) var m33 = L.mat3f(m34) end @@ -68,14 +68,14 @@ end, 'Cannot cast between primitives, vectors, matrices of different dimensions') test.fail_function(function() - local liszt t(v : mesh.vertices) + local ebb t(v : mesh.vertices) var x = {{1, 2, 3},{true,false,true},{1,2,5}} end mesh.vertices:foreach(t) end, "must be of the same type") test.fail_function(function() - local liszt t(v : mesh.vertices) + local ebb t(v : mesh.vertices) var x = {{1,2}, {2,3}, {2,3,4}} end mesh.vertices:foreach(t) @@ -83,14 +83,14 @@ end, "matrix literals must contain vectors of the same size") idx = 3.5 test.fail_function(function() - local liszt t(v : mesh.vertices) + local ebb t(v : mesh.vertices) v.tensor_pos[idx,2] = 5 end mesh.vertices:foreach(t) end, "expected an integer") test.fail_function(function() - local liszt t(v : mesh.vertices) + local ebb t(v : mesh.vertices) v.tensor_pos[0] = 5 end mesh.vertices:foreach(t) @@ -98,7 +98,7 @@ end, "expected vector to index into, not Matrix") -- Parse error, so not safe to test this way --test.fail_function(function() --- local liszt t(v : mesh.vertices) +-- local ebb t(v : mesh.vertices) -- v.tensor_pos[0,0,1] = 5 -- end -- mesh.vertices:foreach(t) diff --git a/tests/statements.t b/tests/statements.t index 22ff98a..4a34026 100644 --- a/tests/statements.t +++ b/tests/statements.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" require "tests/test" local R = L.NewRelation { name="R", size=6 } @@ -8,7 +8,7 @@ R.val:LoadConstant(1) red = L.Global(L.float, 0.0) -- checking decl statement, if statement, proper scoping -local l = liszt (v : R) +local l = ebb (v : R) var y : L.float if v.val == 1.0f then y = 1.0f diff --git a/tests/strargs.t b/tests/strargs.t index a727779..72cde97 100644 --- a/tests/strargs.t +++ b/tests/strargs.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" require "tests/test" local cells = L.NewRelation { size = 10, name = 'cells' } @@ -18,20 +18,20 @@ local assert, length, print, dot = L.assert, L.length, L.print, L.dot -- Some Valid cases -- ---------------------- -local liszt check0(c : cells, field) +local ebb check0(c : cells, field) var fval = c[field] L.assert(fval == 0) end -local liszt check1(c : cells, field) +local ebb check1(c : cells, field) var fval = c[field] L.assert(fval == 1) end -local liszt copyfield(c : cells, fdst, fsrc) +local ebb copyfield(c : cells, fdst, fsrc) c[fdst] = c[fsrc] end -local liszt noargs(c : cells) end +local ebb noargs(c : cells) end cells:foreach(check0, 'temp') cells:foreach(check0, 'pres') @@ -66,7 +66,7 @@ end, "Function was expecting 0 arguments, but got 1") -- Disallow non-string arguments -- ----------------------------------- test.fail_function(function() - local liszt test(c : cells, val : L.double) + local ebb test(c : cells, val : L.double) c.temp = val end cells:foreach(test, 3) @@ -74,7 +74,7 @@ end, "Argument .* was expected to be a string; Secondary arguments to ".. "functions mapped over relations must be strings.") test.fail_function(function() - local liszt test(c : cells, val : L.double) + local ebb test(c : cells, val : L.double) c.temp = val end cells:foreach(test, 'temp') @@ -85,7 +85,7 @@ end, "Secondary string arguments to functions should be untyped arguments") -- Invalid indexing into a key -- --------------------------------- test.fail_function(function() - local liszt test(c : cells, field) + local ebb test(c : cells, field) c[0] = 2 end cells:foreach(test, 'temp') @@ -95,14 +95,14 @@ end, "Expecting string literal to index key") ----------------------------------- -- Indexing with string literals -- ----------------------------------- -local liszt checktemp0(c : cells) +local ebb checktemp0(c : cells) var fval = c['temp'] L.assert(fval == 0) end cells:foreach(checktemp0) local pres_str = 'pres' -local liszt checkpres0(c : cells) +local ebb checkpres0(c : cells) var fval = c[pres_str] L.assert(fval == 0) end @@ -112,24 +112,24 @@ cells:foreach(checkpres0) -- Assignment and nested calls with string args -- -------------------------------------------------- test.fail_function(function() - local liszt test(c : cells, field) + local ebb test(c : cells, field) var fcopy = field end cells:foreach(test, 'temp') end,'can only assign numbers, bools, or keys to local temporaries') -local liszt passthrough(c : cells, field) +local ebb passthrough(c : cells, field) check0(c, field) end cells:foreach(passthrough, 'temp') local m0check = L.NewMacro(function(c, f) - return liszt quote + return ebb quote L.assert(c[f] == 0) in 0 end end) -local liszt macropassthrough(c : cells, field) +local ebb macropassthrough(c : cells, field) m0check(c, field) end cells:foreach(macropassthrough, 'temp') diff --git a/tests/subsets.t b/tests/subsets.t index 118565c..d778546 100644 --- a/tests/subsets.t +++ b/tests/subsets.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" require "tests/test" -- Need a high N to test the index-based representation as well as boolmask @@ -23,11 +23,11 @@ cells:NewSubsetFromFunction('interior', function(i) end) -local test_boundary = liszt ( c : cells ) +local test_boundary = ebb ( c : cells ) L.assert(c.value == 0) end -local test_interior = liszt ( c : cells ) +local test_interior = ebb ( c : cells ) L.assert(c.value == 1) end @@ -55,10 +55,10 @@ gridcells:NewSubsetFromFunction('interior', function(xi,yi) return not(xi == 0 or xi == N-1 or yi == 0 or yi == N-1) end) -local liszt grid_test_boundary ( c : gridcells ) +local ebb grid_test_boundary ( c : gridcells ) L.assert(c.value == 0) end -local liszt grid_test_interior ( c : gridcells ) +local ebb grid_test_interior ( c : gridcells ) L.assert(c.value == 1) end diff --git a/tests/terrabridge.t b/tests/terrabridge.t index 535538c..dd92aa3 100644 --- a/tests/terrabridge.t +++ b/tests/terrabridge.t @@ -1,5 +1,5 @@ --DISABLE-ON-GPU (b/c standard lib functions can't be embedded in CUDA code) -import "ebb.liszt" +import "ebb" local assert = L.assert local R = L.NewRelation { name="R", size=6 } @@ -22,7 +22,7 @@ local terra square(val : int) return val * val end -local test_terra = liszt(r : R) +local test_terra = ebb(r : R) assert(square(5) == 25) -- call a user-defined Terra function assert(sqrt(5) == ans) -- call a built-in C function diff --git a/tests/types.t b/tests/types.t index 111e11d..78cf758 100644 --- a/tests/types.t +++ b/tests/types.t @@ -1,7 +1,7 @@ -------------------------------------------------------------------------------- --[[ Test implementation of type system for consistency ]]-- -------------------------------------------------------------------------------- -local L = require "ebb.liszt" +local L = require "ebb" local T = require "ebb.src.types" require "tests.test" @@ -18,7 +18,7 @@ for ttype, ltype in pairs(ptypes) do -- verify runtime type enum conversions assert(ltype:terraType() == ttype) - assert(T.terraToLisztType(ttype) == ltype) + assert(T.terraToEbbType(ttype) == ltype) -------------------------------- --[[ Test vector types: ]]-- -------------------------------- @@ -37,7 +37,7 @@ for ttype, ltype in pairs(ptypes) do assert(vtype:baseType() == ltype) assert(vtype:terraBaseType() == ttype) assert(vtype:terraType() == vector(ttype,i)) - assert(T.terraToLisztType(vector(ttype, i)) == vtype) + assert(T.terraToEbbType(vector(ttype, i)) == vtype) -- cannot call type constructor with a terra type local function fn() @@ -45,7 +45,7 @@ for ttype, ltype in pairs(ptypes) do end test.fail_function(fn, 'invalid type') - -- user-exposed type constructor should return the correct liszt type + -- user-exposed type constructor should return the correct ebb type assert(L.vector(ltype,i) == T.t.vector(ltype,i)) end end diff --git a/tests/usermacro.t b/tests/usermacro.t index 0a66ae2..ad768e4 100644 --- a/tests/usermacro.t +++ b/tests/usermacro.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" local ioOff = require 'ebb.domains.ioOff' local mesh = ioOff.LoadTrimesh('tests/octa.off') @@ -9,10 +9,10 @@ local assert, length, print, dot = L.assert, L.length, L.print, L.dot --Test ordinary (function-like) macro-- --------------------------------------- local square = L.NewMacro(function(x) - return liszt `x*x + return ebb `x*x end) -mesh.vertices:foreach(liszt(v : mesh.vertices) +mesh.vertices:foreach(ebb(v : mesh.vertices) assert(square(7) == 49) end) @@ -20,9 +20,9 @@ end) --Test stacked macro calls-- ---------------------------- local sum = L.NewMacro(function(x, y, z) - return liszt `x + y + z + return ebb `x + y + z end) -mesh.vertices:foreach(liszt(v : mesh.vertices) +mesh.vertices:foreach(ebb(v : mesh.vertices) assert(sum(square(1), square(2), square(3)) == 14) end) @@ -30,9 +30,9 @@ end) --Test macro that behaves like a field-- ---------------------------------------- mesh.vertices:NewFieldMacro('scaledpos', L.NewMacro(function(v) - return liszt `2*v.pos + return ebb `2*v.pos end)) -mesh.vertices:foreach(liszt(v : mesh.vertices) +mesh.vertices:foreach(ebb(v : mesh.vertices) assert(v.scaledpos == 2 * v.pos) end) @@ -40,9 +40,9 @@ end) --Combine normal and field macros-- ----------------------------------- local norm = L.NewMacro(function(v) - return liszt `dot(v, v) + return ebb `dot(v, v) end) -mesh.vertices:foreach(liszt(v : mesh.vertices) +mesh.vertices:foreach(ebb(v : mesh.vertices) var lensq = norm(v.scaledpos) var expected = 4.0 * length(v.pos) * length(v.pos) assert(square(lensq - expected) < 0.00005) @@ -52,14 +52,14 @@ end) --Test Macros Using Let-Style Quotes-- -------------------------------------- local sub1_but_non_neg = L.NewMacro(function(num) - return liszt quote + return ebb quote var result = num - 1 if result < 0 then result = 0 end in result end end) -mesh.vertices:foreach(liszt (v : mesh.vertices) +mesh.vertices:foreach(ebb (v : mesh.vertices) assert(sub1_but_non_neg(2) == 1) assert(sub1_but_non_neg(0) == 0) end) @@ -70,9 +70,9 @@ end) ----------------------------- mesh.vertices:NewField('temperature', L.double):Load(1.0) mesh.vertices:NewFieldMacro('__apply_macro', L.NewMacro(function(v, scale) - return liszt `scale * v.temperature + return ebb `scale * v.temperature end)) -mesh.vertices:foreach(liszt (v : mesh.vertices) +mesh.vertices:foreach(ebb (v : mesh.vertices) assert(v(1) == 1) assert(v(5) == 5) end) diff --git a/tests/vecindex.t b/tests/vecindex.t index b73afc0..4c33ad9 100644 --- a/tests/vecindex.t +++ b/tests/vecindex.t @@ -1,4 +1,4 @@ -import "ebb.liszt" +import "ebb" local test = require "tests/test" @@ -8,7 +8,7 @@ local mesh = ioOff.LoadTrimesh('tests/octa.off') ------------------ -- Should pass: -- ------------------ -local vk = liszt (v : mesh.vertices) +local vk = ebb (v : mesh.vertices) var x = {5, 4, 3} v.pos += x end @@ -17,10 +17,10 @@ mesh.vertices:foreach(vk) local x_out = L.Global(L.float, 0.0) local y_out = L.Global(L.float, 0.0) local y_idx = L.Global(L.int, 1) -local read_out_const = liszt(v : mesh.vertices) +local read_out_const = ebb(v : mesh.vertices) x_out += L.float(v.pos[0]) end -local read_out_var = liszt(v : mesh.vertices) +local read_out_var = ebb(v : mesh.vertices) y_out += L.float(v.pos[y_idx]) end mesh.vertices:foreach(read_out_const) @@ -36,7 +36,7 @@ test.fuzzy_eq(avgy, 4) ------------------ idx = 3.5 test.fail_function(function() - local liszt t(v : mesh.vertices) + local ebb t(v : mesh.vertices) v.pos[idx] = 5 end mesh.vertices:foreach(t) diff --git a/tests/veclit.t b/tests/veclit.t index ebbe16b..42b6f6e 100644 --- a/tests/veclit.t +++ b/tests/veclit.t @@ -1,18 +1,18 @@ -import "ebb.liszt" +import "ebb" require "tests/test" local ioOff = require 'ebb.domains.ioOff' local mesh = ioOff.LoadTrimesh('tests/octa.off') test.fail_function(function() - local liszt t(v : mesh.vertices) + local ebb t(v : mesh.vertices) var x = {1, 2, true} end mesh.vertices:foreach(t) end, "must be of the same type") test.fail_function(function() - local liszt t(v : mesh.vertices) + local ebb t(v : mesh.vertices) var x = {1, 2, {2, 3}} end mesh.vertices:foreach(t) diff --git a/tests/vector.t b/tests/vector.t index 05b68f7..e76b149 100644 --- a/tests/vector.t +++ b/tests/vector.t @@ -1,6 +1,6 @@ package.path = package.path .. ";./tests/?.lua;?.lua" local test = require "test" -import "ebb.liszt" +import "ebb" local types = require "ebb.src.types" @@ -17,7 +17,7 @@ local mesh = ioOff.LoadTrimesh('tests/octa.off') ------------------ -- Should pass: -- ------------------ -local k = liszt (v : mesh.vertices) +local k = ebb (v : mesh.vertices) var x = {5, 5, 5} v.pos += x + {0, 1, 1} end @@ -26,7 +26,7 @@ mesh.vertices:foreach(k) --[[ -- Additive reduction over doubles currently unsupported local s = L.Global(L.vector(L.double, 3), {0.0, 0.0, 0.0}) -local sum_pos = liszt(v : mesh.vertices) +local sum_pos = ebb(v : mesh.vertices) s += v.pos end mesh.vertices:foreach(sum_pos) @@ -40,7 +40,7 @@ test.fuzzy_aeq(f.data, {5, 6, 6}) ------------------ test.fail_function(function() - local liszt t(v : mesh.vertices) + local ebb t(v : mesh.vertices) var v3 = L.vec3f({1.1, 2.2, 3.3}) var v2 = L.vec2f(v3) end