mirror of
https://github.com/OpenMP/Examples.git
synced 2025-04-10 16:32:11 +01:00
26 lines
528 B
Fortran
26 lines
528 B
Fortran
! @@name: tasking.8
|
|
! @@type: F-fixed
|
|
! @@operation: compile
|
|
! @@expect: success
|
|
! @@version: omp_3.0
|
|
module example
|
|
integer tp
|
|
!$omp threadprivate(tp)
|
|
integer var
|
|
end module
|
|
|
|
subroutine work
|
|
use example
|
|
!$omp parallel
|
|
! do work here
|
|
!$omp task
|
|
tp = tp + 1
|
|
! do work here
|
|
!$omp task
|
|
! do work here but don't modify tp
|
|
!$omp end task
|
|
var = tp ! value does not change after write above
|
|
!$omp end task
|
|
!$omp end parallel
|
|
end subroutine
|