Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29229 Discussões

Very slow module compilation with O2

vanderwb
Novato
2.298 Visualizações

We're working with our modeling communities to get their codes working with ifx - the classic compilers have been a mainstay of our software builds for many years. Our CESM (climate) model software engineering group is looking at this now and finding a few issues. The one I'd like to report here revolves around compiling a relatively small Fortran module from one model component. I have attached the source file along with a Makefile in a tarball.

The issue is that compilation with ifx is much much slower than with ifort. This comparison uses 2024.2.1, but the ifx performance is similar with 2025:

Running: make ifort ; sleep 1 - Please wait...
ifort -c -ftz -assume realloc_lhs -fp-model source -O2 -no-fma mo_rxt_rates_conv.F90
ifort: remark #10448: Intel(R) Fortran Compiler Classic (ifort) is now deprecated and will be discontinued late 2024. Intel recommends that customers transition now to using the LLVM-based Intel(R) Fortran Compiler (ifx) for continued Windows* and Linux* support, new language support, new language features, and optimizations. Use '-diag-disable=10448' to disable this message.
derecho3 used memory in task 0: 1686MiB (+4MiB overhead). ExitStatus: 0. Signal: 0

real 4m13.924s
user 4m12.256s
sys 0m0.576s

vs:

Running: make ifx ; sleep 1 - Please wait...
ifx -c -ftz -assume realloc_lhs -fp-model source -O2 -no-fma mo_rxt_rates_conv.F90
derecho3 used memory in task 0: 7821MiB (+4MiB overhead). ExitStatus: 0. Signal: 0

real 59m19.807s
user 58m18.265s
sys 0m9.225s

So roughly 4 minutes for this module compared to 59 minutes. There are likely some changes that can be made to the code to improve both times, and we will pursue this, but this is a large degradation from ifort, so some improvement on the compiler side would be welcome too.

I'd also like to point out the significant difference in memory footprint - 1686MiB using ifort vs 7821MiB with ifx. We have seen similar results with a number of codes, and this is making it hard to allow our users to use OneAPI on our front-end login nodes. Again, some improvement here would be welcome.

Etiquetas (2)
5 Respostas
TobiasK
Moderador
2.218 Visualizações

@vanderwb


thanks for reporting this. I don't know yet when we can fix this, but if you like to modify the code, I guess replacing the assignments with function calls and do a single assignment in each call would fix the slow compilation. (not tested that myself for the moment though) or compile this unit with -O1


TobiasK
Moderador
2.005 Visualizações

@vanderwb 

Thanks again for reporting this!

I think it looks better now:

 

$ time make ifx

ifx -c -ftz -assume realloc_lhs -fp-model source -O2 -no-fma mo_rxt_rates_conv.F90

 

real 1m13.592s

user 1m13.031s

sys 0m0.510s

 

The fix is part of IFX 2025.2

BjörnTR
Novato
1.371 Visualizações

Hi, we are having the same or a similar problem with ICX, where ICL compiled just fine, however ICX takes far to long. I had found this thread before the summer, so was eagerly waiting for 2025.2. However it does not seem to have fixed the issue for us.

(Still takes about 30 minutes instead of 2 minutes.)

Was the fix that was implemented done only for IFX or also for ICX? If so, how can I test to check if this is the same problem or not?

vanderwb
Novato
1.987 Visualizações

@TobiasK- thanks for the update. That looks great! I'll be sure to test on our end once 2025.2 is released and confirm.

garraleta_fortran
1.353 Visualizações

Compiling with Intel(R) Visual Fortran Compiler XE 13.1.0.149 [Intel(R) 64]...
ifort /nologo /O2 /module:"x64\Release\\" /object:"x64\Release\\" /Fd"x64\Release\vc90.pdb" /libs:static /threads /c /Qvc9 /Qlocation,link,"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\\bin\amd64" "B:\INTEL_FORTRAN_FORO\SLOW_COMP_2013\mo_rxt_rates_conv.F90"

SLOW_COMP_2013 - 0 error(s), 0 warning(s)
Real Time 7 min. 20 seg.

---------------------------------------------------------------------------------
Compiling with Intel® Fortran Compiler 2025.2.0 [Intel(R) 64]...
ifx /nologo /O2 /module:"x64\Release\\" /object:"x64\Release\\" /libs:dll /threads /c /Qlocation,link,"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\bin\HostX64\x64" /Qm64 "B:\INTEL_FORTRAN_FORO\SLOW_COMP\mo_rxt_rates_conv.F90"
SLOW_COMP - 0 error(s), 0 warning(s)
Real Time 0 min. 52 seg.

-------------------------------------------------------------------------------------------
AMD Rizen 5 3600 6 core 3593 Mhz

Responder