-
Notifications
You must be signed in to change notification settings - Fork 12
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
Fix SccAnnotate when existing acc pragmas declare a copy category more than once #409
Conversation
Documentation for this branch can be viewed at https://sites.ecmwf.int/docs/loki/409/index.html |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #409 +/- ##
==========================================
+ Coverage 95.57% 96.02% +0.44%
==========================================
Files 201 197 -4
Lines 39833 38986 -847
==========================================
- Hits 38071 37435 -636
+ Misses 1762 1551 -211
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Build appears to be clean, so this is ready for a look. I haven't run ecphys, yet, though. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks sensible. GTG from me.
assert driver_loops[0].pragma[0].content == 'parallel loop gang private(other_var) vector_length(nlon)' | ||
assert driver_loops[0].pragma[0].content in ( | ||
'parallel loop gang private(other_var, more_var) vector_length(nlon)', | ||
'parallel loop gang private(more_var, other_var) vector_length(nlon)' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[no action] Curious, why would the ordering go off here? Should this not be deterministic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well spotted! 🦅 - 👁️
I was wondering the same and I suspect it is here:
private_arrays = ', '.join(set(v.name for v in arrays if not v.name_parts[0].lower() in acc_vars)) |
We could replace this by
private_arrays = ', '.join(dict.from_keys(v.name for v in arrays if not v.name_parts[0].lower() in acc_vars))
to have a stable sort but unique list. But didn't want to piggy-back this in this hotfix PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahhh yes. I think I've fixed this in one of my dev branches. Not urgent now, this will happen one way or another, I think.
PR #389 introduced a regression in ecphys. There we have an ACC statement like this:
Now, the ACC statements are checked for existing offload directives. For that,
get_pragma_parameters
is used to extract offload "categories". However, for situations where a key exists more than once, the values are provided as a list, i.e., for the above we obtainWhere previously a simple
str.split(',')
was used to build a list of variables of each category, we need to be careful to accomodate for the above situation where not a simple string constitutes the value. This PR expands the test to include the above case and fixes the transformation accordingly.