Retro68/gcc/libgomp/testsuite/libgomp.fortran/taskgroup1.f90

81 lines
1.5 KiB
Fortran
Raw Normal View History

2014-09-21 17:33:12 +00:00
integer :: v(16), i
do i = 1, 16
v(i) = i
end do
!$omp parallel num_threads (4)
!$omp single
!$omp taskgroup
do i = 1, 16, 2
!$omp task
!$omp task
v(i) = v(i) + 1
!$omp end task
!$omp task
v(i + 1) = v(i + 1) + 1
!$omp end task
!$omp end task
end do
!$omp end taskgroup
do i = 1, 16
2018-12-28 15:30:48 +00:00
if (v(i).ne.(i + 1)) STOP 1
2014-09-21 17:33:12 +00:00
end do
!$omp taskgroup
do i = 1, 16, 2
!$omp task
!$omp task
v(i) = v(i) + 1
!$omp endtask
!$omp task
v(i + 1) = v(i + 1) + 1
!$omp endtask
!$omp taskwait
!$omp endtask
end do
!$omp endtaskgroup
do i = 1, 16
2018-12-28 15:30:48 +00:00
if (v(i).ne.(i + 2)) STOP 2
2014-09-21 17:33:12 +00:00
end do
!$omp taskgroup
do i = 1, 16, 2
!$omp task
!$omp task
v(i) = v(i) + 1
!$omp end task
v(i + 1) = v(i + 1) + 1
!$omp end task
end do
!$omp taskwait
do i = 1, 16, 2
!$omp task
v(i + 1) = v(i + 1) + 1
!$omp end task
end do
!$omp end taskgroup
do i = 1, 16, 2
2018-12-28 15:30:48 +00:00
if (v(i).ne.(i + 3)) STOP 3
if (v(i + 1).ne.(i + 5)) STOP 4
2014-09-21 17:33:12 +00:00
end do
!$omp taskgroup
do i = 1, 16, 2
!$omp taskgroup
!$omp task
v(i) = v(i) + 1
!$omp end task
!$omp task
v(i + 1) = v(i + 1) + 1
!$omp end task
!$omp end taskgroup
2018-12-28 15:30:48 +00:00
if (v(i).ne.(i + 4).or.v(i + 1).ne.(i + 6)) STOP 5
2014-09-21 17:33:12 +00:00
!$omp task
v(i) = v(i) + 1
!$omp end task
end do
!$omp end taskgroup
do i = 1, 16
2018-12-28 15:30:48 +00:00
if (v(i).ne.(i + 5)) STOP 6
2014-09-21 17:33:12 +00:00
end do
!$omp end single
!$omp end parallel
end