Sun Studio 12: C User's Guide

2.13 Environment Variables

This section lists the environment variables that let you control the compilation and runtime environment.

2.13.1 OMP_DYNAMIC

Enable or disable dynamic adjustment of the number of threads.

2.13.2 OMP_NESTED

Enable or disable nested parallelism.

2.13.3 OMP_NUM_THREADS

Set the number of threads to use during execution.

2.13.4 OMP_SCHEDULE

Set the run-time schedule type and chunk size.

2.13.5 PARALLEL

(SPARC) Specifies the number of processors available to the program for multiprocessor execution. If the target machine has multiple processors, the threads can map to independent processors. Running the program leads to the creation of two threads that execute the parallelized portions of the program.

2.13.6 SUN_PROFDATA

Controls the name of the file in which the -xprofile=collect command stores execution-frequency data.

2.13.7 SUN_PROFDATA_DIR

Controls in which directory the -xprofile=collect command places the execution-frequency data-file.

2.13.8 SUNW_MP_THR_IDLE

Controls end-of-task status of each helper thread and can be set to spin ns, or sleep nms. The default is sleep. See the OpenMP API User’s Guide for details.

2.13.9 TMPDIR

cc normally creates temporary files in the directory /tmp. You can specify another directory by setting the environment variable TMPDIR to the directory of your choice. However, if TMPDIR is not a valid directory, cc uses /tmp. The -xtemp option has precedence over the TMPDIR environment variable.

If you use a Bourne shell, type:


$ TMPDIR=dir; export TMPDIR

If you use a C shell, type:


% setenv TMPDIR dir