To enable the auto-parallelizer, use the -parallel (Linux* and Mac OS*) 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 and Mac OS |
icc -c -parallel prog.cpp |
Windows |
icl /c /Qparallel prog.cpp |
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. |