2022-11-04 09:35:42 -07:00

25 lines
652 B
Fortran

! @@name: fpriv_sections.1
! @@type: F-free
! @@operation: run
! @@expect: success
! @@version: pre_omp_3.0
program section
use omp_lib
integer :: section_count = 0
integer, parameter :: NT = 4
call omp_set_dynamic(.false.)
call omp_set_num_threads(NT)
!$omp parallel
!$omp sections firstprivate ( section_count )
!$omp section
section_count = section_count + 1
! may print the number one or two
print *, 'section_count', section_count
!$omp section
section_count = section_count + 1
! may print the number one or two
print *, 'section_count', section_count
!$omp end sections
!$omp end parallel
end program section