devitocodes/opesci-fd

running model cgen problem

Opened this issue · 2 comments

I am unable to run the model eigenwave3d.py. I am getting the following message. Has it something t do with cgen?

python tests/eigenwave3d.py
Eigenwave3D example (mode=default)
domain size: (1.0, 1.0, 1.0)
grid size: (100, 100, 100)
approximation order: [2, 4, 4, 4]
dt: 0.002
tmax: 1.0
require dt < 0.00495
stress kernel AI
2.00, 2.00 (weighted), 60 ADD, 60 MUL, 9 LOAD, 6 STORE
velocity kernel AI
1.50, 1.50 (weighted), 36 ADD, 36 MUL, 9 LOAD, 3 STORE
overall algorithm AI
1.47, 1.46 (weighted)
Traceback (most recent call last):
File "tests/eigenwave3d.py", line 339, in
main()
File "tests/eigenwave3d.py", line 327, in main
pluto=args.pluto, tile=args.tile, fission=args.fission)
File "tests/eigenwave3d.py", line 190, in default
grid.generate(filename_p)
File "/home/marcos/Dropbox/opesci/opesci-fd-master/opesci-fd/opesci/grid.py", line 63, in generate
self.src_code = str(self.cgen_template.generate())
File "/home/marcos/Dropbox/opesci/opesci-fd-master/opesci-fd/opesci/templates/regular3d_tmpl.py", line 38, in generate
statements = [getattr(self, m)() for m in self._template_methods]
File "/home/marcos/Dropbox/opesci/opesci-fd-master/opesci-fd/opesci/templates/regular3d_tmpl.py", line 45, in execute
return cgen.FunctionBody(self.execute_function_signature(), self.execute_function_body())
File "/home/marcos/Dropbox/opesci/opesci-fd-master/opesci-fd/opesci/templates/regular3d_tmpl.py", line 55, in execute_function_body
statements += [self.grid.declare_fields]
File "/home/marcos/Dropbox/opesci/opesci-fd-master/opesci-fd/opesci/staggeredgrid.py", line 516, in declare_fields
result = super(StaggeredGrid, self).declare_fields
File "/home/marcos/Dropbox/opesci/opesci-fd-master/opesci-fd/opesci/regulargrid.py", line 489, in declare_fields
ifdef = cgen.IfDef('MSC_VER', [cgen.Assign(vec, '(%s) _aligned_malloc(%s_sizeof(%s), %s)' % (self.real_t, str(vsize), self.real_t, str(self.alignment)))],
AttributeError: 'module' object has no attribute 'IfDef'

@vinirn : This seems to be related to the version of cgen. Can you reinstall cgen from github (not PyPI), possibly in a clean python env, just to be sure the correct version of cgen is being used?

Thank you!
It worked by uninstalling cgen, which has been installed by "pip install cgen", and running 'pip install -r requirements.txt' one more time.