I have a program that I have used openmp with a parallel sections:
!$OMP PARALLEL SECTIONS NUM_THREADS(2)
!$OMP END PARALLEL SECTIONS
All routines use the module:
TYPE(FilesList), allocatable :: fnl(:)
REAL, allocatable :: outbuffer(:)
This works fine in debug mode. The code runs and generates perfect output. But when I run in release mode it doesn't work. The NUMFILLED variable gets incremented in one thread, and I can see it happen. But the other thread never sees it get incremented. I added write statements and see it has different values in the two threads, always staying with zero in the thread where I look at the value. I know there are two threads running as I have written out the thread numbers too. I'm confused by why it works in debug and not in release. Any idea's of what to look for that could cause this issue?