Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
26729 Discussions

The meaning and purpose of "qopt-subscript-in-range" Intel compiler flag

A__King
New Contributor III
217 Views

Greetings Fortran forum members,

When compiling a Fortran source code, I see compiler -parallel optimization suggestions like the following,

remark #30533: (LOOP) Compile with the -opt-subscript-in-range option to vectorize and/or parallelize the loop at line 354. [VERIFY] Make sure that no loop in the program contains or generates very large integers (typically very large integers >= 2^30).

 

What are the perils of using this flag with a code that has large integers? Specifically, does the large integer criterion apply to exclusively the loop indices or any KIND of integer in any loops, or any KIND of integer anywhere in the program? For example, is 2^31 for an int64 considered large according to this definition?

0 Kudos
1 Solution
mecej4
Black Belt
206 Views

The description of this option in the output of the command ifort  /? on Windows is 

/Qopt-subscript-in-range[-]
assumes no overflows in the intermediate computation of the subscripts

Unless you use those DO indices that you mention as subscripts in your code, I don't see why this option should affect the treatment of those variables in other contexts.

Note that the type of the expression 2^31 is default integer; if that is a 4-byte integer (i.e., unless compiler options or directives have been used to change the default integer), this expression will cause integer overflow.

View solution in original post

3 Replies
mecej4
Black Belt
207 Views

The description of this option in the output of the command ifort  /? on Windows is 

/Qopt-subscript-in-range[-]
assumes no overflows in the intermediate computation of the subscripts

Unless you use those DO indices that you mention as subscripts in your code, I don't see why this option should affect the treatment of those variables in other contexts.

Note that the type of the expression 2^31 is default integer; if that is a 4-byte integer (i.e., unless compiler options or directives have been used to change the default integer), this expression will cause integer overflow.

View solution in original post

Barbara_P_Intel
Moderator
191 Views

There are a few more details in the Fortran Developer Guide.  This option is only available with ifort.

 

A__King
New Contributor III
169 Views
Reply