aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2019-10-26 14:11:25 +0200
committerAdrian Kummerlaender2019-10-26 14:11:25 +0200
commit769bc4c97d5686ab614bb134abddef87f3f41519 (patch)
tree49187c0f49194dc9d1ad9a36ebc1e6b60f962c0b
parent9ddfd0f54ddb95b181421c851826e0bb462c249d (diff)
downloadboltzgen-769bc4c97d5686ab614bb134abddef87f3f41519.tar
boltzgen-769bc4c97d5686ab614bb134abddef87f3f41519.tar.gz
boltzgen-769bc4c97d5686ab614bb134abddef87f3f41519.tar.bz2
boltzgen-769bc4c97d5686ab614bb134abddef87f3f41519.tar.lz
boltzgen-769bc4c97d5686ab614bb134abddef87f3f41519.tar.xz
boltzgen-769bc4c97d5686ab614bb134abddef87f3f41519.tar.zst
boltzgen-769bc4c97d5686ab614bb134abddef87f3f41519.zip
Add optional flag to disable CSE
-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)