Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

OpenMP and libraries

Arjen_Markus
Honored Contributor I
247 Views
Hello,

I have run into a problem with OpenMP and libraries that are not compiled
for OpenMP. Unfortunately I have no demonstration of the problem yet, but
I can sketch it:

- The program uses a DO-loop that is OpenMP-enabled and uses a bunch of
subroutines that are not (explicitly) compiled with the OpenMP flag
nor do they use OpenMP-enabled DO-loops.
- These subroutines do use small local arrays to keep track of the
location within arrays that are passed as arguments.

I suspect that these local arrays are not taken from the stack and that therefore
a subroutine that is run by two threads at a time will not function properly.
(In my program the symptom is an access violation from time to time, not
reproducible.)

Am I correct in assuming that to use OpenMP in the program, all code that
gets possibly executed within a multithreaded part must be compiled with
OpenMP enabled?

Regards,

Arjen
0 Kudos
2 Replies
TimP
Honored Contributor III
247 Views
If you would refer to the posts where declaring the procedures RECURSIVE is advocated, you should find the answer confirmed:
In the absence of SAVE declarations, any of the following will have the effect of procedure-private allocation of local arrays:
compiler options -auto, -recursive, -openmp
procedure declaration RECURSIVE
0 Kudos
Arjen_Markus
Honored Contributor I
247 Views
Right, that is clear. I will change the compiler options and try again.

Regards,

Arjen
0 Kudos
Reply