Intel® Fortran Compiler 16.0 User and Reference Guide

Setting Stack Size on Coprocessors

This topic only applies to Intel® Many Integrated Core Architecture (Intel® MIC Architecture).

Each CPU thread that offloads code executes the offloaded code in a coprocessor thread dedicated to that CPU thread. The default stack size for that coprocessor thread is fairly small, 2 MB.

To increase the stack size allocated to offloaded code, set the environment variable MIC_STACKSIZE to a size sufficient for the offloaded code. MIC_STACKSIZE is always honored. It does not require the variable MIC_ENV_PREFIX to be set.

Specify the value for MIC_STACKSIZE as follows:

integerB

A value, in bytes.

integerK

A value, in kilobytes.

integerM

A value, in megabytes.

integerG

A value, in gigabytes.

integerT

A value, in terabytes.

For example, the following shell BASH and C shell commands set the maximum stacksize for the main coprocessor thread to 50MB:

export MIC_STACKSIZE=50M    #(BASH shell)
setenv MIC_STACKSIZE  50M    #(C shell)

Note

OpenMP* runtime libraries have their own environment variables for adjusting the sizes of the stacks used by additional OpenMP threads. MIC_STACKSIZE does not apply to such threads. For example, to increase the available stack size for every OpenMP thread except the main thread to 3 MB using the BASH shell, enter: export OMP_STACKSIZE=3M (affects OpenMP threads on both host and coprocessor) or export MIC_ENV_PREFIX=ABC export ABC_OMP_STACKSIZE=3M (affects coprocessor OpenMP threads only).

See Also