- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
According to OpenMP 4.5, a Fortran STOP statement is allowed inside a structured block. The code below works (as expected) when only one coarray image is used; but it hangs if more than 1 coarray image is executed.
Now, if ERROR STOP is used instead of STOP, the code works as expected. Am I missing something (or doing something illicit) here?
SUBROUTINE S(I) IMPLICIT NONE INTEGER :: I,J REAL(KIND=8) R IF (I==20) THEN STOP ! This causes the code to hang... !ERROR STOP ! This works... ELSE R = 0. DO J=100*I,5000000 R = COS(R+J*COS(R)) END DO WRITE(*,*) I,R END IF END SUBROUTINE S PROGRAM MAIN IMPLICIT NONE INTEGER :: I !$OMP PARALLEL DEFAULT(NONE) PRIVATE(I) !$OMP DO ORDERED SCHEDULE(MONOTONIC:STATIC,1) DO I=1,500 CALL S(I) END DO !$OMP END DO !$OMP END PARALLEL WRITE(*,*) THIS_IMAGE() END PROGRAM MAIN
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OpenMP has nothing to do with it. If you want a clean shutdown of a coarray program, use ERROR STOP. If you just use STOP the other images may not properly detect that the failed image has exited. This is something we're hoping to improve in the future.

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