Table of Contents

OpenMP

enable nested parallelism

environment variable OMP_NESTED=TRUE or call the runtime routine omp_set_nested() to

environment

Lilmit the number of Threads: environment variable OMP_NUM_THREADS

default thread stack size: OMP_STACKSIZE / GOMP_STACKSIZE (in kilobytes)

The variable should contain a space- or comma-separated list of CPUs/cores. GOMP_CPU_AFFINITY single CPU numbers, range of CPUs (M-N), or a range with some stride (M-N:S). CPU numbers are zero-based.

OS based parameters

Run a program only on selected cores (0 and 3):

taskset -c 0,3 a.out

You can also retrieve the CPU affinity of an existing task:

taskset -c -p pid

Or set it for a running program:

$ taskset -c -p list pid