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
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 |
-parallel_threshold{1-100} | Controls the work threshold needed for auto-parallelization, see later subsection. |
-par_report{1|2|3} | Controls the diagnostic messages from the auto-parallelizer, see later subsection. |
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 |