Auto-parallelization: Enabling, Options, and Environment Variables

To enable the auto-parallelizer, use the -parallel option. The -parallel 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 follows:

prompt>icpc -c -parallel prog.cpp

Auto-parallelization Options

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

Option Description
-parallel Enables the auto-parallelizer
-par_threshold{1-100} Controls the work threshold needed for auto-parallelization. Default: n=100.
-par_report{1|2|3} Controls the diagnostic messages from the auto-parallelizer.

Auto-parallelization Environment Variables

Variable Description Default
OMP_NUM_THREADS Controls the number of threads used. Number of processors currently installed in the system while generating the executable
OMP_SCHEDULE Specifies the type of runtime scheduling. static