- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Background: We are switching from ifort to ifx our simulation code of about 25000 Fortran routines, when we compile it with ifx using -O1, our non-regression tests work, but when we compile it with -O2, a few hundreds tests fail (out of 50000 tests), due to several causes, like crashes, or numerical errors.
It is really hard to investigate/debug where the errors are, because the numerical simulation tests could be quite large in terms of size or time. What we would like to do is to disable only the optimization flag(s) that are causing the problem. Just switching from -O2 to O1 is not an option due huge performance loss.
The question is: What are the optimization flags enabled in ifx when you use -O2 ? For both, Linux and Windows. Currently we are using ifx 2025.2.1. I searched the Intel documentation, but I couldn't find the specific list of flags.
We would like to try removing the optimization flags one by one until we find the one(s) that are causing the test to fail. We cannot isolate minimum code examples for bug reports, because our code is quite large and complex.
Thanks in advance.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You might try to find this out using the compiler_options() intrinsic function. The result may not be detailed, but it might work. If you were to use the gfortran compiler, you'd get a very long list. ifx and ifort give a trifle more compact answers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks a lot Arjen, I didn't know about this intrinsic. Unfortunately ifx doesn't give extra details.
program compiler
use iso_fortran_env
print '(4a)', 'This file was compiled by ',
& compiler_version(), ' using the options ',
& compiler_options()
end$ ifx -O2 -o compiler compiler.f
$ ./compiler
This file was compiled by Intel(R) Fortran Compiler for applications running on Intel(R) 64, Version 2025.2.1 Build 20250806 using the options -O2 -o compilerIndeed, gfortran gives more information:
$ gfortran -O2 -o compiler compiler.f
$ ./compiler
This file was compiled by GCC version 14.2.1 20250110 (Red Hat 14.2.1-13) using the options -ffixed-form -mtune=generic -march=x86-64-v2 -O2 -foffload-options=-l_GCC_gfortran -foffload-options=-l_GCC_m -fpre-include=/usr/include/finclude/math-vector-fortran.h
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please have a look at this main page from the compiler reference documentation:
You will find some interesting topics listed at the end.
For example:
- Optimization options (giving details about the -O2 level):
- Optimization report options:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you MarcGrodent,
I already checked these links. But for example, it says that -O2 enables 'dead-code elimination', but it doesn't say which flag controls it (maybe there is no flag). The list of optimization flags doesn't say which ones are enabled on -O1, nor -O2, nor -O3.
I would like to know specifically for -O2 to avoid recompiling the whole project so many times to test combinations of flags, and then run thousands of non-regression tests for each combination.
In particular we detected we are experiencing 'dead variable elimination' on some routines, but it's dificult to trace on which ones, at some point the program just gives incorrect results using ifx -O2.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page