Using Guided Auto Parallelism
The Guided Auto Parallelism feature of the Intel®
C++Compiler is a tool offering selective advice to improve the performance of serially-coded applications. The tool suggests changes that take advantage of the compiler's ability to automatically vectorize and parallelize code as well as improve the efficiency of data operations. The tool does not require that you implement threaded code to improve the execution performance of your code, nor does it require that your code is already threaded or parallel code.
To invoke this tool, use the compiler option
[=n]. Using this option causes the compiler to generate messages suggesting ways to optimize the performance of your application. You can also use more specific compiler options such as
[Q]guide-data-trans, to perform individual guided optimizations for vectorizing, parallelizing, and data transformation of your application.
When any guided auto parallelism option is used, the compiler provides only diagnostic advice. Object files or executables are not created in this mode. See the table below for descriptions of the options.
Allows you to set a level of guidance for auto-vectorization and data transformation analysis.
To obtain guidance for auto parallelism, you must use the
[Q]paralleloption along with the
Allows you to set a level of guidance only for auto parallelism analysis.
You must use the
[Q]paralleloption along with the
[Q]guide-paroption to get this advice.
Allows you to set a level of guidance for auto-vectorization analysis only.
Allows you to set a level of guidance for data transformation analysis only.
For all of the above options, the optional argument
nspecifies the level of guidance. The argument
ntakes the values
nis not specified, the default is
4. If you specify
2, a standard level of guidance is provided.
When you use
4, you may get advanced messages. For example, you may get messages about how to optimize a particular loop-nest or get a message on how exception-handling inside a loop-nest affects optimizations for that loop-nest. Or you may get a message on how to provide extra information to the compiler on cost-modeling (expected values of trip-counts, and so on).
If you simultaneously specify a level of guidance for the general
[Q]guideoption and also for one or more of the other specific guide options, the level of guidance (
n) for the specific guide option overrides the general
If you do not specify a level of guidance for the general
[Q]guideoption, but do set a level of guidance for one or more of the specific guide options, the
[Q]guideoption is set equal to the greatest value passed to the specific guide options.
Capturing Guidance Messages
The guided auto parallelism tool analyzes all of your serial code or individual parts of your code and generates advisory messages. By default, messages that are generated by the guided auto parallelism tool are output to
To capture messages in a file, use the options listed in the following table.
The options listed in the following table must be used with the
[Q]guide-data-transoptions. If not, they are ignored.
Gathers all messages generated during a guided auto-parallelization run into the specified file.
Allows you to specify the file into which all messages generated during a guided auto parallelism run should be appended.
For the above options, the
file_nameargument can also include a path. If a path is not specified, the file is created in the current working directory. If there is already a file named
file_name, it is overwritten when you use the
[Q]guide-fileoption. If you do not include an extension as part of the
file_name, the extension
Configuring Code Regions for GAP Messages
To limit guided auto parallelism analysis to specific regions (hotspots) in your application, use the option mentioned in the table below.
Allows you to analyze specified code elements, identified by
You must use the
[Q]guide-optsoption along with one of the guided auto parallelism options, such as
[Q]guide-data-trans. Use the
stringparameter to provide information about known areas of interest (hotspots). The
stringparameter takes one or more of the following variables:
range. The compiler parses the
stringparameter and generates syntax errors if there are any.
Follow these guidelines when using the
- Use only valid file names, routine names, and line numbers. The guided auto parallelism tool ignores invalid values and issues a diagnostic message stating what was ignored.
- Enclose routine names within single quotation marks. Specify original source names (demangled names) as routine names. A routine name alone may not always be sufficient to uniquely identify a routine. You may need to specify additional parameter information to uniquely identify the routine.For example:Linux* and:macOS*-guide-opts="foo.cpp,'CLHEP::StaticRandomSta::restore(std::basic_istream<char,std::char_traits<char>>&)'" -guide-opts="bar.f90,'module_1::routine_name`" -guide-opts="baz.c,'c_routine_name'"Windows*:/Qguide-opts:"foo.cpp,'CLHEP::StaticRandomSta::restore(std::basic_istream<char,std::char_traits<char>>&)'" /Qguide-opts:"bar.f90,'module_1::routine_name`" /Qguide-opts:"baz.c,'c_routine_name'"For any specified routine name, the GAP tool first tries to uniquely identify the routine using specified routine information. If that is not possible, then it selects all routines with the specified routine name. The GAP tool uses the parameter information, if specified, to narrow the selection.
- When inlining is involved, use the callee line numbers. The generated messages also use the callee line numbers.