HPCL / autoperf

MIT License
5 stars 2 forks source link

Error when running autoperf with examples #29

Open evaxeon opened 3 years ago

evaxeon commented 3 years ago

Hi! I get the following error while running autoperf with any of the examples from autoperf/examples directory: Traceback (most recent call last): File "/usr/local/bin/autoperf", line 299, in <module> main() File "/usr/local/bin/autoperf", line 294, in main autoperf = Autoperf() File "/usr/local/bin/autoperf", line 38, in __init__ if uname['system'] == 'Darwin': subdir = 'apple' TypeError: tuple indices must be integers or slices, not str

I use Python 3.5.2, Ubuntu 16.04, CMake 3.15.2.

brnorris03 commented 3 years ago

Hi there! Unfortunately, we haven't had a chance to convert autoperf to python3, so it still requires python 2.7. If you have that, you can give it a try. I will try to find time to get it converted in the next month or so.

evaxeon commented 3 years ago

Hi again! I've tried launching autoperf with python2.7, but the following syntax error shows up: File "/usr/local/bin/autoperf", line 125 def get_experiment_list(self, allow_duplicates: bool = True) -> list: ^ SyntaxError: invalid syntax

This is python3 syntax, therefore this led me back to using python3. I've fixed the os.uname() function calls (which returns a tuple):
uname = os.uname()
if uname.sysname == 'Darwin': subdir = 'apple'
else: subdir = uname.machine

Still, a new error shows up:

Traceback (most recent call last): 
File "/usr/local/bin/autoperf", line 299, in <module>                                                                    
    main()                                                                                                               
File "/usr/local/bin/autoperf", line 295, in main                                                                         
    autoperf.run()                                                                                                        
File "/usr/local/bin/autoperf", line 284, in run                                                                          
    self.run_experiments()                                                                                                
File "/usr/local/bin/autoperf", line 150, in run_experiments                                                             
    experiment = Experiment(self.config, exp)                                                                             
File "/usr/local/lib/python3.5/dist-packages/autoperf/experiment.py", line 74, in __init__                                
    self.is_mpi = self.config.getboolean("%s.mpi" % self.longname, False)                                                 
File "/usr/local/lib/python3.5/dist-packages/autoperf/utils/config.py", line 178, in getboolean                           
    return self.get(spec, default, "boolean")                                                                             
File "/usr/local/lib/python3.5/dist-packages/autoperf/utils/config.py", line 153, in get                                  
    return self._strip_comments(self.cfg_parser.getboolean(section, option))                                              
File "/usr/local/lib/python3.5/dist-packages/autoperf/utils/config.py", line 65, in _strip_comments                       
    if line.find(c) > 0:                                                                                                
AttributeError: 'bool' object has no attribute 'find'  

Not sure if the actual reason for this is not fully completed python3 conversion, but thought this might be helpful.