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

diag-enable sc / internal threshold was exceeded / very slow optimisation

Alexis_R_
New Contributor I
866 Views

One of my source files seems to be causing difficulties during optimisation.

  • compiling it with the following options takes an inordinate amount of time (~4 minutes of 100% CPU usage on a Xeon X5355 2.66GHz): -fpp -warn all -fpp -gen-interfaces -static -warn notruncated_source -assume realloc_lhs -heap-arrays -O3 -FR
  • compiling it with the same options, but with -diag-enable sc added only takes a fraction of a second, which is what I am used to. However, I get "An internal threshold was exceeded for routine mode_filament_startup_ and optimization level may be reduced. See HTTP://SOFTWARE.INTEL.COM/EN-US/ARTICLES/INTERNAL-THRESHOLD-WAS-EXCEEDED for more information and advice." (by the way that link is dead, it should point here instead)

In fact, I am not particularly interested in optimising the loops in this particular file, so I wonder:

  1. Can I selectively disable optimisation of the loops in that file with in-source instructions to the compiler?
  2. What is going on when -diag-enable sc is on? Why is the behaviour so different?
0 Kudos
2 Replies
TimP
Honored Contributor III
866 Views

!dir$ optimize:1

(for example) at the top of a subroutine would have the effect of setting -O1 for that subroutine. See the compiler docs section on OPTIMIZE and NOOPTIMIZE. This may not turn off analysis performed by -diag-enable sc.

When the compiler sets NOOPTIMIZE, the setting persists for the remainder of a source file, and this could have the result that setting -O3 produces -O0 from that point on. I guess you are hitting tresholds only for -diag-enable sc, which attempts to perform a great deal of additional analysis, and would take longer than the 4 minutes you quote, if you over-rode the threshold.

0 Kudos
Alexis_R_
New Contributor I
866 Views
Thanks a lot for the great pointers to yet another area of the documentation I hadn't explored!
0 Kudos
Reply