Closed cod3monk closed 7 years ago
Hi, I added the machine file as a parameter and forgot to update the example line. Something like this should work: python stempel.py bench 2d-5pt-iso-sym-var.c -m BroadwellEP_E5-2697_CoD.yml
The reason I did that is that I wanted some info from the machine file in case we need to compile directly the code. I am not sure if it is really needed so far, anyway it is like that now. What I realized is that I get an error while using a piece of code taken by kerncraft: compiler_args = self._machine.get_compiler() resulting in an AttributeError: 'MachineModel' object has no attribute 'get_compiler' but MachineModel is imported from kerncraft. Any idea?
I already had the machine file in the arguments. I now tried with your Broadwell example, but the same problem persists:
$ python stempel.py bench code.c -m BroadwellEP_E5-2697_CoD.yml
WARNING: yacc table file version is out of date
Traceback (most recent call last):
File "stempel.py", line 458, in <module>
main()
File "stempel.py", line 455, in main
args.func(args, parser)
File "stempel.py", line 422, in run_bench
c_code = kernel.as_code()
File "/Users/codemonk/Development/stempel/stempel/benchkernel.py", line 784, in as_code
mystring = str("size: %d time: %lf iter: %d MLUP/s: %lf\n").encode('string_escape')
LookupError: unknown encoding: string_escape
$
Are you using an a Kerncraft version prior to v0.5.0? That feature was introduced by RRZE-HPC/kerncraft@a1d32ea2642f05365e58778a1975e5a8a704fdef
By replacing string_escape
(which is no longer supported in python3) with unicode_escape
, a code is printed.
I misread your error. You get it because of the ".encode('string_escape')" that I use, which works for python 2.7. I guess you use Python 3 where the string_escape encoding is called unicode_escape.
Ok, using unicode_escape works also for Python 2.7.
I'll change it to unicode_escape, which fixes the issue.
Thanks
Issue persists:
$ python stempel.py bench code.c -m BroadwellEP_E5-2697_CoD.yml -b 32
WARNING: yacc table file version is out of date
foo
Traceback (most recent call last):
File "stempel.py", line 457, in <module>
main()
File "stempel.py", line 454, in main
args.func(args, parser)
File "stempel.py", line 421, in run_bench
c_code = kernel.as_code()
File "/Users/codemonk/Development/stempel/stempel/benchkernel.py", line 799, in as_code
mystring = mystring.encode('string_escape')
LookupError: unknown encoding: string_escape
$
sorry, there was another place where string_escape was called. Changed it to unicode_escape. Should be fine now
Going back to the other issue, once downloaded the new version of kerncraft, the call to machine.get_compiler() fails due to:
compiler, compiler_args = self._machine.get_compiler() File "/Applications/anaconda/lib/python2.7/site-packages/kerncraft/machinemodel.py", line 140, in get_compiler for c in self['compiler'].keys(): AttributeError: 'str' object has no attribute 'keys'
It worked now, so the issue is somehow solved
The second problem was due to the old machine description format, which changed along side with the introduction of get_compiler()
I tried to run
stempe.pyl bench
according to README with the code generated frompython stempel.py gen -D 3 -r 2 -s -i
, but it fails parsing(?):Here is the
code.c
file I generated: