mirror of
https://github.com/OpenMP/Examples.git
synced 2025-04-07 23:22:11 +01:00
32 lines
767 B
Fortran
32 lines
767 B
Fortran
! @@name: task_dep.6f
|
|
! @@type: F-free
|
|
! @@compilable: yes
|
|
! @@linkable: yes
|
|
! @@expect: success
|
|
program example
|
|
integer :: a, b, c, d
|
|
!$omp parallel
|
|
!$omp single
|
|
!$omp task depend(out: c)
|
|
c = 1 ! Task T1
|
|
!$omp end task
|
|
!$omp task depend(out: a)
|
|
a = 2 ! Task T2
|
|
!$omp end task
|
|
!$omp task depend(out: b)
|
|
b = 3 ! Task T3
|
|
!$omp end task
|
|
!$omp task depend(in: a) depend(mutexinoutset: c)
|
|
c = c + a ! Task T4
|
|
!$omp end task
|
|
!$omp task depend(in: b) depend(mutexinoutset: c)
|
|
c = c + b ! Task T5
|
|
!$omp end task
|
|
!$omp task depend(in: c)
|
|
d = c ! Task T6
|
|
!$omp end task
|
|
!$omp end single
|
|
!$omp end parallel
|
|
print *, d
|
|
end program
|