-qstacktemp

Category

Optimization and tuning

Purpose

Determines where to allocate certain XL Fortran compiler temporaries at run time.

Applicable compiler temporaries are the set of temporary variables created by the compiler for its own use when it determines it can safely apply these. Most typically, the compiler creates these kinds of temporaries to hold copies of XL Fortran arrays for array language semantics, especially in conjunction with calls to intrinsic functions or user subprograms.

Syntax

Read syntax diagramSkip visual syntax diagram
                      .-0-----.   
>>- -q--stacktemp--=--+- -1---+--------------------------------><
                      '-value-'   

@PROCESS:

@PROCESS STACKTEMP={0 | -1 | value}

Defaults

-qstacktemp=0

Parameters

The possible suboptions are:

0
Based on the target environment, the compiler determines whether it will allocate applicable temporaries on the heap or the stack. If this setting causes your program to run out of stack storage, try specifying a nonzero value instead, or try using the -qsmallstack option.
-1
Allocates applicable temporaries on the stack. Generally, this is the best performing setting but uses the most amount of stack storage.
value
Allocates applicable temporaries less than value on the stack and those greater than or equal to value on the heap. value is a positive integer. A value of 1 Mb has been shown to be a good compromise between stack storage and performance for many programs, but you may need to adjust this number based on your application's characteristics.

Usage

If you have programs that make use of large arrays, you may need to use this option to help prevent stack space overflow when running them. For example, for SMP or OpenMP applications that are constrained by stack space, you can use this option to move some compiler temporaries onto the heap from the stack.

The compiler cannot detect whether or not the stack limits will be exceeded when an application runs. You will need to experiment with several settings before finding the one that works for your application. To override an existing setting, you must specify a new setting.

The -qstacktemp option can take precedence over the -qsmallstack option for certain compiler-generated temporaries.

Related information