3 ! Test tasks with detach clause. Each thread spawns off a chain of tasks,
4 ! that can then be executed by any available thread. Each thread uses
5 ! taskwait to wait for the child tasks to complete.
10 integer (kind
=omp_event_handle_kind
) :: detach_event1
, detach_event2
11 integer :: x
= 0, y
= 0, z
= 0
12 integer :: thread_count
14 !$omp parallel private (detach_event1, detach_event2)
16 thread_count
= omp_get_num_threads()
19 !$omp task detach (detach_event1) untied
24 !$omp task detach (detach_event2) untied
27 call omp_fulfill_event (detach_event1
)
33 call omp_fulfill_event (detach_event2
)
39 if (x
/= thread_count
) stop 1
40 if (y
/= thread_count
) stop 2
41 if (z
/= thread_count
) stop 3