mirror of
https://github.com/OpenMP/Examples.git
synced 2025-04-07 23:22:11 +01:00
27 lines
511 B
Fortran
27 lines
511 B
Fortran
! @@name: tasking.7f
|
|
! @@type: F-fixed
|
|
! @@compilable: yes
|
|
! @@linkable: no
|
|
! @@expect: success
|
|
module example
|
|
integer tp
|
|
!$omp threadprivate(tp)
|
|
integer var
|
|
contains
|
|
subroutine work
|
|
use globals
|
|
!$omp task
|
|
! do work here
|
|
!$omp task
|
|
tp = 1
|
|
! do work here
|
|
!$omp task
|
|
! no modification of tp
|
|
!$omp end task
|
|
var = tp ! value of var can be 1 or 2
|
|
!$omp end task
|
|
tp = 2
|
|
!$omp end task
|
|
end subroutine
|
|
end module
|