- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The following code (compiled on Windows with ifx 2026.0.0 and using the compiler option \Qopenmp) freezes after the first WRITE statement, usually after a small number of iterations on the loop index I. I can't figure out what is wrong here, and I am inclined to report this as a bug.
This is a showstopper for us, thus any alternative to the pattern shown here would be very much appreciated!
PROGRAM OMP_ATOMIC_TEST
USE OMP_LIB
IMPLICIT NONE
INTEGER :: I, ERROR
INTEGER, SAVE :: ERROR_LOCAL, ERROR_TEMP
!$OMP THREADPRIVATE(ERROR_LOCAL, ERROR_TEMP)
CALL OMP_SET_NUM_THREADS(10)
DO I = 1, 20 ! The purpose of this loop is to demonstrate the issue, it is unrelated
! to the following PARALLEL region. The code will freeze for some value
! of I, after having issued the first WRITE statement, and inside the
! ATOMIC UPDATE CAPTURE region.
!$OMP PARALLEL
IF (OMP_GET_THREAD_NUM() == 1) THEN
WRITE(*, *) 'Begin ATOMIC CAPTURE region ', I
!$OMP ATOMIC UPDATE CAPTURE
ERROR_TEMP = ERROR ! Capture
ERROR = 1 ! Update
!$OMP END ATOMIC
ERROR_LOCAL = ERROR_TEMP
WRITE(*, *) 'End ATOMIC CAPTURE region'
END IF
!$OMP END PARALLEL
END DO
END PROGRAM OMP_ATOMIC_TEST
Link Copied
0 Replies
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