aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xboltzgen.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/boltzgen.py b/boltzgen.py
index 24a17b2..17509e7 100755
--- a/boltzgen.py
+++ b/boltzgen.py
@@ -1,8 +1,6 @@
#!/usr/bin/env python
import argparse
-import string
-
from boltzgen import *
argparser = argparse.ArgumentParser(
@@ -10,11 +8,13 @@ argparser = argparse.ArgumentParser(
argparser.add_argument('language', help = 'Target language (currently either "cl" or "cpp")')
-argparser.add_argument('--lattice', dest = 'lattice', required = True, help = 'Lattice type (D2Q9, D3Q7, D3Q19, D3Q27)')
-argparser.add_argument('--layout', dest = 'layout', required = True, help = 'Memory layout ("AOS" or "SOA")')
-argparser.add_argument('--precision', dest = 'precision', required = True, help = 'Floating precision ("single" or "double")')
-argparser.add_argument('--geometry', dest = 'geometry', required = True, help = 'Size of the block geometry ("x:y(:z)")')
-argparser.add_argument('--tau', dest = 'tau', required = True, help = 'BGK relaxation time')
+argparser.add_argument('--lattice', required = True, help = 'Lattice type (D2Q9, D3Q7, D3Q19, D3Q27)')
+argparser.add_argument('--layout', required = True, help = 'Memory layout ("AOS" or "SOA")')
+argparser.add_argument('--precision', required = True, help = 'Floating precision ("single" or "double")')
+argparser.add_argument('--geometry', required = True, help = 'Size of the block geometry ("x:y(:z)")')
+argparser.add_argument('--tau', required = True, help = 'BGK relaxation time')
+
+argparser.add_argument('--disable-cse', action = 'store_const', const = True, help = 'Disable common subexpression elimination')
args = argparser.parse_args()
@@ -23,8 +23,8 @@ lattice = eval("lbm.model.%s" % args.lattice)
lbm = LBM(lattice)
generator = Generator(
descriptor = lattice,
- moments = lbm.moments(),
- collision = lbm.bgk(f_eq = lbm.equilibrium(), tau = float(args.tau)))
+ moments = lbm.moments(optimize = not args.disable_cse),
+ collision = lbm.bgk(f_eq = lbm.equilibrium(), tau = float(args.tau), optimize = not args.disable_cse))
geometry = Geometry.parse(args.geometry)