comparison libgomp/testsuite/libgomp.fortran/pr27395-2.f90 @ 0:a06113de4d67

first commit
author kent <kent@cr.ie.u-ryukyu.ac.jp>
date Fri, 17 Jul 2009 14:47:48 +0900
parents
children 84e7813d76e9
comparison
equal deleted inserted replaced
-1:000000000000 0:a06113de4d67
1 ! PR fortran/27395
2 ! { dg-do run }
3
4 program pr27395_2
5 implicit none
6 integer, parameter :: n=10,m=1001
7 integer :: i
8 call foo(n,m)
9 end program pr27395_2
10
11 subroutine foo(n,m)
12 use omp_lib, only : omp_get_thread_num
13 implicit none
14 integer, intent(in) :: n,m
15 integer :: i,j
16 integer, dimension(n) :: sumarray
17 sumarray(:)=0
18 !$OMP PARALLEL DEFAULT(shared) NUM_THREADS(4)
19 !$OMP DO PRIVATE(j,i), REDUCTION(+:sumarray)
20 do j=1,m
21 do i=1,n
22 sumarray(i)=sumarray(i)+i
23 end do
24 end do
25 !$OMP END DO
26 !$OMP END PARALLEL
27 do i=1,n
28 if (sumarray(i).ne.m*i) call abort
29 end do
30 end subroutine foo