- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Using the latest ifx compiler (2026.0.0) on Windows 11 in Debug mode, the following code hangs fairly regularly (even when running with a modest number of threads):
PROGRAM P
USE OMP_LIB
IMPLICIT NONE (TYPE, EXTERNAL)
INTEGER :: I, SUM, VERSION
! Check if the cancellation feature is activated (a requirement for the CANCEL construct to work).
IF (.NOT. OMP_GET_CANCELLATION()) THEN
WRITE(*, *) 'The CANCEL feature is not activated. Set the environment variable OMP_CANCELLATION to true.'
STOP
END IF
! This will fail (that is, the code will hang) randomly, when running the code
! multiple times.
!$OMP PARALLEL
WRITE(*, *) OMP_GET_THREAD_NUM(), '/', OMP_GET_NUM_THREADS()
!$OMP DO REDUCTION(+:SUM)
DO I = 1, 10000
SUM = SUM + I
!$OMP CANCEL DO IF (I == 5)
END DO
!$OMP END DO
!$OMP END PARALLEL
WRITE(*, *) SUM
END PROGRAM PI do not see any restrictions associated with the use of the REDUCTION clause with CANCEL constructs in the OpenMP specification. It does look like a bug.
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