IBM / NOVIA

NOVIA ontology toolset for discovery of unconventional inline accelerators
7 stars 4 forks source link

Problem with automated analysis script #1

Closed sei-cabidi closed 1 year ago

sei-cabidi commented 1 year ago

Hi there, I've successfully followed the Docker Install and Docker Run steps as outlined in the README. However, I run into issues with the automated analysis scripts when running the examples. It seems that the formatting of source.log creates errors when being parsed by preanalysis.py.

For each example, except for incremental, I see the following error during the Pre-merge Report:

Traceback (most recent call last):
  File "/opt/NOVIA/fusion/analysis/scripts/preanalysis.py", line 59, in <module>
    main(sys.argv[1:])
  File "/opt/NOVIA/fusion/analysis/scripts/preanalysis.py", line 30, in main
    funcs = re.search("\[.*\]",line).group(0)[1:-2].split(';')
AttributeError: 'NoneType' object has no attribute 'group'

I see that the first line,Original, from source.log is being searched for brackets. re.search("\[.*\]","Original") returns NoneType, which prompts the error AttributeError: 'NoneType' object has no attribute 'group'. Within preanalysis.py at line 30, would skipping lines that do not have these brackets permanently solve this issue without breaking the pipeline? Modifying lines 27-32 of preanalysis.py as such appears to work for me:

for num, line in enumerate(fsource, 1):
    if str(fstats['BB'][i]) in line:
        start = num
        if re.search("\[.*\]", line) is not None:
            funcs = re.search("\[.*\]",line).group(0)[1:-2].split(';')
            if(funcs[0] != ''):

Thank you for the help! NOVIA is quite a neat tool 😁

Edit: I've opened a pull request with this fix.

dtrilla commented 1 year ago

Hi Collin! Sorry I thought I had the notifications on, but I missed this. I see you already found a solution. Just not to leave you hanging, I'll look at it in the following hours and accept your pull if it looks good to me.

Thanks for looking into this!

dtrilla commented 1 year ago

Addressed in commit ba972a1. See https://github.com/IBM/NOVIA/pull/3#issuecomment-1355823035 for clarification.