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

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.

Note

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 Environment Variables

Auto-parallelization uses the following OpenMP* environment variables.

See OpenMP* Environment Variables for more information about the default settings and how to use these variables.