Oracle® Solaris Studio 12.4: C User's Guide

Exit Print View

Updated: March 2015
 
 

3.3  Environment Variables

Some environment variables related to parallelized C are the following. There are additional environment variables defined by the OpenMP API specification and others that are specific to the Oracle Solaris Studio implementation. See the Oracle Solaris Studio OpenMP API User's Guide for descriptions of all parallelization related environment variables.

  • PARALLEL or OMP_NUM_THREADS

    Set the PARALLEL or OMP_NUM_THREADS environment variable to specify the number of threads to use for the program. Refer to the OpenMP API User's Guide for the default number of threads, if these environment variables are not set.

    You can use either PARALLEL or OMP_NUM_THREADS — they are equivalent.

  • SUNW_MP_THR_IDLE

    Controls the status of idle threads in an OpenMP program that are waiting at a barrier or waiting for new parallel regions to work on. See the Oracle Solaris Studio OpenMP API User's Guide for details.

  • SUNW_MP_WARN

    Set this environment variable to TRUE to print warning messages from OpenMP and other parallelization runtime-systems. See the Oracle Solaris Studio OpenMP API User's Guide for details.

  • STACKSIZE

    The executing program maintains a main memory stack for the master thread and a distinct stack for each slave thread. Stacks are temporary memory address spaces used to hold arguments and automatic variables during subprogram executions. The STACKSIZE environment variable can be used to control the size of the stack for a slave thread. Refer to the OpenMP API User's Guide for the default slave thread stack size, if this environment variable is not set.

    Note that the setting of the STACKSIZE environment variable has no effect on programs using the Oracle Solaris Pthreads API.

    Stack overflow might occur if the size of a thread's stack is too small, causing silent data corruption or a segmentation fault. See the -xcheck=stkovf compiler option for information about how to detect and diagnose stack overflow.