To enable the auto-parallelizer, use the -parallel (Linux* and Mac OS* X) or /Qparallel (Windows*) option. This option detects parallel loops capable of being executed safely in parallel and automatically generates multi-threaded code for these loops.
You might need to set the KMP_STACKSIZE environment variable to an appropriately large size to enable parallelization with this option..
An example of the command using auto-parallelization is as follows:
Operating System |
Description |
---|---|
Linux and Mac OS X |
icc -c -parallel prog.cpp |
Windows |
icl /c /Qparallel prog.cpp |
Auto-parallelization uses the following OpenMP* environment variables.
OMP_NUM_THREADS
OMP_SCHEDULE
KMP_STACKSIZE
See OpenMP* Environment Variables for more information about the default settings and how to use these variables.