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

broken -DOPENMP_REPRODUCIBLE=ON #528

Open
suvarchal opened this issue Nov 1, 2023 · 1 comment
Open

broken -DOPENMP_REPRODUCIBLE=ON #528

suvarchal opened this issue Nov 1, 2023 · 1 comment
Milestone

Comments

@suvarchal
Copy link
Collaborator

compilation is broken with flag OPENMP_REPRODUCIBLE flag on.
core issue is errors like this when reproducible is on:

  790 | !$OMP ORDERED
      |             ^
Error: 'ordered' region must be closely nested inside a loop region with an 'ordered' clause

fix for instance in code block example would be

fesom2/src/ice_fct.F90

Lines 864 to 899 in 231c416

!$OMP DO
#if !defined(DISABLE_OPENACC_ATOMICS)
!$ACC PARALLEL LOOP GANG VECTOR PRIVATE(elnodes) DEFAULT(PRESENT)
#else
!$ACC UPDATE SELF(m_snow, icefluxes)
#endif
do elem=1, myDim_elem2D
! if cavity cycle over
if(ulevels(elem)>1) cycle !LK89140
elnodes=elem2D_nodes(:,elem)
do q=1,3
n=elnodes(q)
#if defined(_OPENMP) && !defined(__openmp_reproducible)
call omp_set_lock (partit%plock(n))
#else
!$OMP ORDERED
#endif
#if !defined(DISABLE_OPENACC_ATOMICS)
!$ACC ATOMIC UPDATE
#endif
m_snow(n)=m_snow(n)+icefluxes(elem,q)
#if defined(_OPENMP) && !defined(__openmp_reproducible)
call omp_unset_lock(partit%plock(n))
#else
!$OMP END ORDERED
#endif
end do
end do
#if !defined(DISABLE_OPENACC_ATOMICS)
!$ACC END PARALLEL LOOP
#else
!$ACC UPDATE DEVICE(m_snow)
#endif
!$OMP END DO
end if

to add ordered to all clauses where we may use OMP_ORDERED like: !$OMP DO ordered.

@mandresm
Copy link
Collaborator

Same here. I was compiling in main to check if ./configure.sh -DDISABLE_MULTITHREADING=ON -DENABLE_OPENMP=ON -DOPENMP_REPRODUCIBLE=ON would work, to let know Mathias Campos if he will be able to use this feature once 2.6 is released.

@JanStreffing JanStreffing added this to the FESOM 2.6.1 milestone Aug 29, 2024
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

3 participants