mirror of
https://github.com/OpenMP/Examples.git
synced 2025-04-23 22:31:22 +01:00
27 lines
559 B
Fortran
27 lines
559 B
Fortran
! @@name: task_dep.12
|
|
! @@type: F-free
|
|
! @@operation: run
|
|
! @@expect: success
|
|
! @@version: omp_4.0
|
|
program example
|
|
integer :: x
|
|
x = 0
|
|
!$omp parallel
|
|
!$omp single
|
|
!... first explicit task
|
|
!$omp task shared(x) depend(out: x)
|
|
x = 1
|
|
!$omp end task
|
|
|
|
!... second explicit task
|
|
!$omp task shared(x) depend(inout: x) if(.false.)
|
|
x = 2
|
|
!$omp end task
|
|
|
|
!... statement executed by parent implicit task
|
|
! prints: x = 2
|
|
print*, "x = ", x
|
|
!$omp end single
|
|
!$omp end parallel
|
|
end program
|