Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28385 Discussions

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

DataScientist
Valued Contributor I
545 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
Honored Contributor III
534 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

0 Kudos
3 Replies
mecej4
Honored Contributor III
535 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.

0 Kudos
Barbara_P_Intel
Moderator
519 Views

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

 

DataScientist
Valued Contributor I
497 Views
0 Kudos
Reply