You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
In w3wavemd there is a NMIN variable used in an OMP loop that is PRIVATE, but it is not initialised. This could lead to undefined behaviour when running with OMP threading.
Additional context
I have not observed any undefined behaviour in OMP running of the SMC grid, but this is an example something that could catch us out in the future.
There may be other cases where we should be using FIRSTPRIVATE on variables for OMP loops too.
Describe the bug
In
w3wavemd
there is aNMIN
variable used in an OMP loop that is PRIVATE, but it is not initialised. This could lead to undefined behaviour when running with OMP threading.Loop is here:
WW3/model/src/w3wavemd.F90
Lines 3668 to 3674 in 488e3c8
Use of potentially uninitialized value in the above loop is here:
WW3/model/src/w3wavemd.F90
Line 3692 in 488e3c8
Proposed solution
I believe the problem should be resolved by using
FIRSTPRIVATE(NMIN)
in the OMP directive for that loop, i.e.:Additional context
I have not observed any undefined behaviour in OMP running of the SMC grid, but this is an example something that could catch us out in the future.
There may be other cases where we should be using
FIRSTPRIVATE
on variables for OMP loops too.Related: #1017
The text was updated successfully, but these errors were encountered: