[J3] Problem with contiguous

Toon Moene toon at moene.org
Wed Dec 12 13:36:34 EST 2018


On 12/11/18 8:57 AM, Bill Long via J3 wrote:

>> On Dec 10, 2018, at 4:49 PM, Van Snyder via J3 <j3 at mailman.j3-fortran.org> wrote:

... hundreds of work arrays (BRRR) ...

>> Then, they were automatic, local to that routine.
>>
> 
> Local automatic arrays are typically “allocated” on the stack, which is usually a low cost activity.  You might check compiler options to make sure you are using the stack and not the heap for the automatic arrays.

"Typically" is a nice euphemism here. Two well known compilers who do 
this differently:

Intel's fortran compiler (ifort): By default on the stack, unless you 
use -heap-arrays as a compiler option.
GNU fortran (gfortran: By default allocated on the heap, unless you use 
-fstack-arrays *or* -Ofast on the compiler invocation.

"If nothing else helps, read the instructions"

Kind regards,

-- 
Toon Moene - e-mail: toon at moene.org - phone: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
At home: http://moene.org/~toon/; weather: http://moene.org/~hirlam/
Progress of GNU Fortran: http://gcc.gnu.org/wiki/GFortran#news


More information about the J3 mailing list