Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More informative Fparser wrapping #316

Open
piotrows opened this issue May 14, 2024 · 0 comments
Open

More informative Fparser wrapping #316

piotrows opened this issue May 14, 2024 · 0 comments

Comments

@piotrows
Copy link

If the Fortran source processed by Loki contains unknown keyword or bug, the error message is not pointing to the file that is being processed by Fparser. The error message could look like:

[ 64%] [Loki] Pre-processing: command=convert mode=scc directive=openacc frontend=fp
...
[Loki] Batch-processing source files using config: /ec/res4/hpcperm/napz/Gpu/ifs-bundle-gwwms-spp/source/ifs_dp/arpifs/loki_physics.config
[Loki::Sourcefile] Constructed from /ec/res4/hpcperm/napz/Gpu/ifs-bundle-gwwms-spp/source/ifs_dp/arpifs/module/yomphyder.F90 in 0.35s
....
[Loki::Sourcefile] Constructed from /ec/res4/hpcperm/napz/Gpu/ifs-bundle-gwwms-spp/build-nvhpc-scc/ifs_dp/arpifs/module/ecphys_surface_type_mod.F90 in 2.47s
[Loki::Scheduler] Built SGraph from seed in 29.40s
[Loki::Scheduler] Performed initial source scan in 62.35s
[Loki::Sourcefile] Finished constructing from /lus/h2resw01/hpcperm/napz/Gpu/ifs-bundle-gwwms-spp/source/ifs-source/surf/module/cotwo_mod.F90 in 0.29s
.... 
[Loki::Sourcefile] Finished constructing from /lus/h2resw01/hpcperm/napz/Gpu/ifs-bundle-gwwms-spp/source/ifs-source/arpifs/phys_ec/vdfmain.F90 in 0.27s
[Loki::Scheduler] Performed full source parse in 40.20s
Traceback (most recent call last):
  File "/lus/h2resw01/hpcperm/napz/Gpu/ifs-bundle-gwwms-spp/build-nvhpc-scc/loki/loki_env/lib/python3.8/site-packages/fparser/two/Fortran2003.py", line 267, in __new__
    return Base.__new__(cls, string)
  File "/lus/h2resw01/hpcperm/napz/Gpu/ifs-bundle-gwwms-spp/build-nvhpc-scc/loki/loki_env/lib/python3.8/site-packages/fparser/two/utils.py", line 501, in __new__
    raise NoMatchError(errmsg)
fparser.two.utils.NoMatchError: at line 710
>>><<<<<<< HEAD

The to-date solution is to search for ">>><<<<<<< HEAD" string in the source directory, however, with the lengthy output it may be hard to notice that this is actually the source of the problem. Therefore it would be handy if Loki reports on the filename currently being parsed by Fparser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant