cancel and dependent tasks

Discuss the OpenMP 4.5 API Specifications released November 2015
Forum rules
The OpenMP Forums are now closed to new posts. Please visit Stack Overflow if you are in need of help: https://stackoverflow.com/questions/tagged/openmp
Locked
jhogg
Posts: 1
Joined: Sat Sep 10, 2016 8:20 am

cancel and dependent tasks

Post by jhogg »

So my understanding is that if I have the following:

Code: Select all

!$OMP TASKGROUP
!$OMP    SINGLE
!$OMP       TASK depend(inout:a(1:1))
                   print *, "Hello from Task 1"
                   ! Do something with a(:)
!$OMP          CANCEL TASKGROUP
!$OMP       END TASK
!$OMP       TASK depend(inout:a(1:1))
                   print *, "Hello from Task 2
!$OMP        END TASK
!$OMP    END SINGLE
!$OMP END TASKGROUP
Then Task 2 may or may not run, as there is no implicit cancellation point at the start of a task (certainly this is how the intel compiler behaves).

This seems like a nasty trap for the unwary programmer, and not terribly useful. Can we suggest adding an implicit cancellation point at the start of a task?
Or at least a phrase guaranteeing that dependent tasks of a task that executes a cancel will not execute?

Locked