[Omp] allocatable objects with OpenMP

YHe at lbl.gov YHe at lbl.gov
Tue Nov 30 12:44:21 PST 2004


We use allocatable objects in F90 code.  Do we have to declare "!$OMP threadprivate" for these variables?  In our simple test code, the answer is yes.  It is declared in the module that declares the allocatable array.  For example:

module foo
   real, pointer:: work(:)
   !$OMP threadprivate (work)
end module foo

Do we need to add "save work" before "!$OMP threadprivate?"

Now, suppose we have the following:
module foo
   type new
      real, pointer :: work(:)
   end type new
   type(new) new_type
end module

How do we declare threadprivate now?  We tried:
$!OMP threadprivate (new_type%work)
and it won't work.  Does OpenMP support this kind of feature in F90?

Thanks for your reply.

Helen








More information about the Omp mailing list