Auto-parallelization: Enabling, Options, Directives, and Environment Variables

To enable the auto-parallelizer, use the -parallel (Linux*) or /Qparallel (Windows*) option. This option detects parallel loops capable of being executed safely in parallel and automatically generates multithreaded code for these loops. An example of the command using auto-parallelization is as follows:

Platform

Description

Linux

icpc -c -parallel prog.cpp

Windows

icl /c /Qparallel prog.cpp

Auto-parallelization Options

The -parallel (Linux) or /Qparallel (Windows) option enables the auto-parallelizer if the -O2 or -O3 (Linux) or /O2 or /O3 (Windows) optimization option is also specified. This option detects parallel loops capable of being executed safely in parallel and automatically generates multithreaded code for these loops.

Windows

Linux

Description

/Qparallel

-parallel

Enables the auto-parallelizer.

/Qpar-threshold

-par-threshold

Controls the work threshold needed for auto-parallelization.

/Qpar-report

-par-report

Controls the diagnostic messages from the auto-parallelizer, see later subsection.

Note

See Parallelism Overview for more information about the options listed above. Intel® Itanium®-based systems: Specifying these options implies -opt-mem-bandwith1 (Linux) or /Qopt-mem-bandwidth1 (Windows).

Auto-parallelization Environment Variables

Option Variable

Default

Description

OMP_NUM_THREADS

Number of processors currently installed in the system while generating the executable

Controls the number of threads used.

OMP_SCHEDULE

Static

Specifies the type of run-time scheduling.