[Omp] shared memory strange behaviour

Miguel Óscar Bernabeu i Llinares mbernabeu at dsic.upv.es
Fri Jun 9 03:16:15 PDT 2006


Hello,

i'm getting contradictory results when executing the following piece of
code. It consist on the inicialisation of arrays sigma, fh and con with
a F77 subroutine ddsti. Then a parallel region is created and these
arrays are defined shared. 

The weird thing is that all the threads read sigma correctly, while some
threads read the initialised state of con and others not. Note that
sigma is explicitly defined, while con is an allocatable array
(allocated before calling ddsti).

Any idea or suggestion??

---------------------------------------------------------------
(....)

! Inicializing table of sines and cosines
call ddsti(n, sigma(2*n+2), m, fh, con) 
        
print *, 'outside con', con(:10)
print *, 'sigma', sigma(:10)

!$OMP PARALLEL private (i, work,tin1,tin2, aux_perm) shared(sigma, fh,
con)

print *, 'inside con', omp_get_thread_num(), con(:10)
print *, 'sigma', sigma(:10)

(....)
-----------------------------------------------------------------------




More information about the Omp mailing list