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

Turn off optimizations for specific functions

Intel_C_Intel
Employee
1,447 Views
Hello,
Is there an equivalent of C compilers #pragma optimize("", off) in Fortran?
If not, is there any way to achieve the same effect?
thanks & regards,
Kalyan
0 Kudos
2 Replies
TimP
Honored Contributor III
1,447 Views
There have been requests for ability to plant compiler options by subroutine in the source file, but no action. That C pragma has limited usefulness. You're welcome to submit a premier.intel.com feature request.
I've adopted the fsplit/f90split method. You could set up the Makefile to split the functions automatically and apply options to individual files as necessary. If you do this in a separate directory, it's easy to recombine them into a library, or possibly an object file. Some say that the overall build process is faster this way; it does reduce memory requirement. Evidently, it eliminatescompile-time interprocedural analysis.
0 Kudos
TimP
Honored Contributor III
1,447 Views
Along a line similar to what you asked are the command line options
ifort -from_rtn 1 -to_rtn 9 file.f
which applies optimization only to the first 9 functions in the file. The primary use of that is for debugging. prefix -Q for windows, just - for linux. This does not necessarily shut the other functions all the way down to -O0 or /Od, but it does shut off back-end optimizations.
0 Kudos
Reply