[Omp] schedule clause vs. default(none)
Tobias Burnus
burnus at net-b.de
Thu Sep 20 10:28:02 PDT 2007
Hi all,
> > Is [...] supposed to compile (note default(none) and no shared(s) or [...]
And what about the following example, which has also default(none) but
which has this time a shared(arr) ? Is this any different or not?
program OMP_program
integer, parameter :: nt=4
double precision :: s,tmp
double precision :: ARR(100)
integer :: fsize,i
call omp_set_num_threads(nt)
s = 0.d0
arr = 1.0d0
tmp = 4.d0*atan(1.d0)
fsize = int(sin(-0.25*tmp)*10.0)
!$omp parallel do default(none) shared(arr) private(i) reduction(+:s) schedule(static,fsize)
do i=1,100
s = s + arr(i)
end do
!$omp end parallel do
print *,'s =', s
end program OMP_program
(I'm asking since openf95 which rejected both other invalid examples is
accepting this one; ifort and sunf95 also accept this example, but ifort
accepted also the invalid examples - as does sunf95 unless do and
parallel are in different !$OMP lines. gfortran is rejecting all
examples incl. this one.)
Tobias
More information about the Omp
mailing list