OpenMP-Examples/directives/sources/directive_syntax_F_free_comment.1.f90
2022-11-04 09:35:42 -07:00

35 lines
912 B
Fortran

! @@name: directive_syntax_F_free_comment.1
! @@type: F-free
! @@operation: run
! @@expect: success
! @@version: pre_omp_3.0
program main
use omp_lib
integer,parameter :: NT = 4
!$omp parallel do num_threads(NT) !DIR 1
do i = 1,NT
write(*,'("thrd no", i2)') omp_get_thread_num()
end do
!$omp parallel do & !continue line !DIR 2
!$omp num_threads(NT) !or !$omp&
do i = 1,NT
write(*,'("thrd no", i2)') omp_get_thread_num()
end do
!$omp parallel num_threads(NT) !DIR 3
!$omp do !DIR 4
do i = 1,NT
write(*,'("thrd no", i2)') omp_get_thread_num()
end do
!$omp end parallel
end program
! repeated 3 times, any order
! OUTPUT: thrd no 0
! OUTPUT: thrd no 1
! OUTPUT: thrd no 2
! OUTPUT: thrd no 3