procedure pointers and openmp/threadprivate

Andrew Benson abenson@its.caltech.edu
Fri Sep 10 22:01:00 GMT 2010


I have a question about gfortran (and Fortran in general) relating to 
procedure pointers and the OpenMP threadprivate directive. I'm working on an 
OpenMP code compiled under gfortran 4.6 which attempts to use procedure 
pointers that are declared threadprivate so that each thread could have a 
pointer to a different procedure. My questions are (and I've tried to find 
answers online but haven't found anything definitive):

1) Is this allowable in the current gfortran 4.6?

2) Is it allowable in the Fortran 2003 standard? (I realize that the answer 
may be that it's simply undefined behavior.)

If this is allowed under gfortran 4.6 then I have either a bug in my code or 
the compiler (I've checked my code thoroughly.....). If it's not allowed then 
would it be possible/useful to have gfortran detect attempts to make a 
procedure pointer threadprivate and complain about them?

I can make a workaround in my current code, but I figured I'd try to 
understand this before moving on.

Thanks,
Andrew.

-- 

* Andrew Benson: http://www.tapir.caltech.edu/~abenson/contact.html

* Galacticus: http://sites.google.com/site/galacticusmodel



More information about the Fortran mailing list