Apologies if this is just terminology confusion on my part... For a variable that is referenced in a region, what data sharing attribute applies if a variable other than a module variable is "host associated" under Fortran?
- Code: Select all
! Could also be an external procedure or a module procedure.
INTEGER :: i
INTEGER :: host_associated
host_associated = 2
!$OMP PARALLEL DO
DO i = 1, 10
!$OMP END PARALLEL DO
! Is host_associated private or shared?
PRINT *, host_associated
END SUBROUTINE internal_procedure
END PROGRAM main_program
My reading of the spec:
- Local variables declared in called routines in the region and that have the save attribute or that are data initialised: host_associated does not have the save attribute.
- Variables belonging to common blocks or declared in modules: host_associated is neither.
- Dummy arguments of called routines that are passed by reference: host_associated is not a dummy argument.
- Cray pointees: n/a.
- Implied-do indices, forall indices and other local variables declared in called routines in the region: host_associated is not a local variable declared in a called routine (it is declared in the host).
(I assume "variables declared... in modules" refers to "variables declared in module specification parts", otherwise it would seem a little too inclusive.)
Thanks for any advice.