Tuesday, 15 July 2014

Nested loop in Fortran with OPENMP -



Nested loop in Fortran with OPENMP -

my (fortran) code simple. filling big array, depends on 5 (independent!) variables. here brief example

= 1, imax j = 1, jmax k = 1, kmax array(i,j,k) = ! function of i,j,k end end end

i utilize different threads fill values of array in faster way.

i thought simplest way accomplish enclose loop in these commands

!$omp parallel do

!$omp parallel end

however, if different results serial case. apologize if question simple, couldn't find proper illustration help solve problem. can recommend solution or provide example?

i don't exatly know happening, race status or bad declaration of directives. seek , see if works

!replace ... variables constants in shared(a,b,c) !$omp parallel default(private) shared(...) i=1,imax j=1,jmax k=1,kmax array(i,j,k) = ! function of i,j,k end end end !$omp end parallel

loops fortran openmp

No comments:

Post a Comment