- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a program that I have used openmp with a parallel sections:
SUBROUTINE OPERI
USE PARALLELOUT
call poutinit
!$OMP PARALLEL SECTIONS NUM_THREADS(2)
CALL OPER
CALL ENDPOUTPUT
!$OMP SECTION
CALL POUTPUT
!$OMP END PARALLEL SECTIONS
RETURN
END
All routines use the module:
MODULE PARALLELOUT
LOGICAL DOOUTPUT
INTEGER NUMFILLED
INTEGER NUMOUT
LOGICAL DONEFilling
LOGICAL DONEWriting
TYPE::FilesList
sequence
CHARACTER*1024 filename
INTEGER numItems
INTEGER FirstItemPtr
end TYPE
TYPE(FilesList), allocatable :: fnl(:)
REAL, allocatable :: outbuffer(:)
INTEGER FreeLoc
End module
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?
Thanks,
Dave
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page