-
Notifications
You must be signed in to change notification settings - Fork 33
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
segfaults in ltinv_ctlad_mod with GCC 10.2 and 10.1 (related to OpenMP) #20
Comments
Thank you, we will investigate. |
I tried to reproduce with GCC 10.3 and GCC 11.2 but interestingly could not reproduce. Do you also see this? Perhaps the OpenMP pragma could be pre-processor guarded to be removed when GCC 10.1 or 10.2 is detected. |
@wdeconinck: same here: we don't see this issue with GCC10.3 (@xian22 tested yesterday), only 10.1 and 10.2. |
We could use something like this in the code, given that it seems to point at a bug in gcc 10.1 and 10.2:
Or, for simplicity, if we think that slowing down this one particular loop with all gcc 10.x versions won't be a show-stopper:
|
I think the first approach is preferred. Then at least the GNU 10.3 version which we have is not affected.
I would probably use |
Sounds good @shlyaeva and/or I will try this, and if it solves the problem we'll issue the PR. Thanks @wdeconinck ! |
I have tested the fix with GNU10.2 and it works. Thank you all very much! |
Is it possible to create a new release with this bug fix that we can point to? |
Sure, it is tagged with |
We see segfaults in calls to
ltinv_ctlad
when the code is built with GCC 10.2 or GCC 10.1.ectrans_test_adjoint
(or any code callingltinv_ctlad
) fails with a segfault with a following backtrace:The problem appears to be in how compiler deals with this OpenMP-parallelized loop:
ectrans/src/trans/internal/ltinv_ctlad_mod.F90
Lines 101 to 109 in 58fd28a
If the OpenMP directives are commented/removed, the calling code doesn't have any issues, the test succeeds. Trying to set explicitly
PRIVATE
orSHARED
directives for all the variables in the loop doesn't solve the issue.The same behavior is observed on a different system with GCC 10.1 (Maryam @mer-a-o ran the tests).
Any ideas on how this can be resolved would be greatly appreciated.
Log of all ectrans tests run on the system with GCC 10.2: LastTest.log
The text was updated successfully, but these errors were encountered: