- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Locate in your code where (you suspect) the erronious I/O statement is located. Insert some diagnostic code
!$OMP CRITICAL
WRITE(*,*) 'Debug IO ', omp_get_thread_num()
bSomeError = .false.
(your I/O statement(s) here)
goto 12345
(your I/O error code here)
bSomeError = .true.
12345 continue
!$OMP END CRITICAL
if(bSomeError) goto (your error lable here)
Jim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Along the same lines as Jim's suggestion, you should make sure that you are linking to the threadsafe version of the Fortran RTL. This should happen automatically if you use the compiler driver to link and have -openmp on the link line. But if you link to the OpenMP library explicitly, then you may need to put -threads on the link line, or link to libifcoremt instead of libifcore.
- 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
Does your I/O statement(s) within the parallel region(s) attept to transfer outside the parallel region (on error, eof, ...)?
It is not valid to do so. (place these branch targets inside the parallel region)
The compiler should warn of this coding error.
Jim Dempsey
- 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
!$OMP PARALLEL
...
READ(YourInUnit, 100, err=999, end=888) arglist
100 FORMAT(...)
...
GOTO 12345
! error label
! *** MUST reside within sameparallel region of READ(..., err=label)
999ErrorFlag = .true.
GOTO 12345 ! to label at end of parallel region
! *** MUST reside within sameparallel region of READ(..., end=label)
888 EndFlag = .true.
GOTO 12345
...
12345 CONTINUE
!$OMP END PARALLEL
if(ErrorFlag) GOTO 9999
if(EndFlag) GOTO 8888
...
The labels 999 and 888 are dispatched to froma READ statementwithin the parallel region and therefore must reside within the same parallel region. Following the exit of the parallel region, test for end and/or error conditions.
"A structured block of code is a collection of one or more executable statements with a single point of entry at the top and a single point of exit at the bottom."
I hope this clears up the issue.
Jim Dempsey
- 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