There are many responses on other posts related to the issue of stack space, OpenMP, and how to deal with it. However, I could not find information to truly understand why OpenMP adjusts the compiler options:
What is the reasoning behind why -fopenmp
in gfortran implies -frecursive
?
The documentation says:
Allow indirect recursion by forcing all local arrays to be allocated on the stack
However, I don't have the context to understand this. Why would parallelization require indirect recursion?
Why would parallelization want all local arrays to be on the stack?
I wish to understand so I know the consequences of overriding these options, say, with -fmax-stack-var-size=n
, to avoid issues with stack overflows.