Hello,
I notice an intersting inline optimization option in the ifort manual: -ipo enable multi-file IP optimizations (between files)
I'm not sure what is the difference between IP optimizations and inlining. Is it possible this optimization allows inlining functions from separate object files? What is the range of the argument?
Whether or not it is possible to do inline optimization between object files, is it possible to do inline optimization between functions in the same file, but separate modules? For the sake of compilation speed, I like to split my projects into separate objects. But for the final version, I guess it would be useful to concatenate all the files together so that ifort can most effectively optimize the code; is that correct?
Paul
I notice an intersting inline optimization option in the ifort manual: -ipo
I'm not sure what is the difference between IP optimizations and inlining. Is it possible this optimization allows inlining functions from separate object files? What is the range of the
Whether or not it is possible to do inline optimization between object files, is it possible to do inline optimization between functions in the same file, but separate modules? For the sake of compilation speed, I like to split my projects into separate objects. But for the final version, I guess it would be useful to concatenate all the files together so that ifort can most effectively optimize the code; is that correct?
Paul
連結已複製
5 回應
Quoting - plediii
Hello,
I notice an intersting inline optimization option in the ifort manual: -ipo enable multi-file IP optimizations (between files)
I'm not sure what is the difference between IP optimizations and inlining. Is it possible this optimization allows inlining functions from separate object files? What is the range of the argument?
Whether or not it is possible to do inline optimization between object files, is it possible to do inline optimization between functions in the same file, but separate modules? For the sake of compilation speed, I like to split my projects into separate objects. But for the final version, I guess it would be useful to concatenate all the files together so that ifort can most effectively optimize the code; is that correct?
Paul
I notice an intersting inline optimization option in the ifort manual: -ipo
I'm not sure what is the difference between IP optimizations and inlining. Is it possible this optimization allows inlining functions from separate object files? What is the range of the
Whether or not it is possible to do inline optimization between object files, is it possible to do inline optimization between functions in the same file, but separate modules? For the sake of compilation speed, I like to split my projects into separate objects. But for the final version, I guess it would be useful to concatenate all the files together so that ifort can most effectively optimize the code; is that correct?
Paul
-ip (from memory, this is on by default for -O2, -O3) inlines code on a single file
-ipo does multifile optimization
Documentation sources:
The Fortran compiler manual:
Compiler Options: Alphabetical Compiler Options
Optimising Applications: Using Interprocedural Optimization
will tell you almost all you need to know.
-opt-report -opt-report-phase=ipo
will give reports on what the compiler has done.
regards
MIke
Quoting - Mike Rezny
-ip (from memory, this is on by default for -O2, -O3) inlines code on a single file
-ipo does multifile optimization
Documentation sources:
The Fortran compiler manual:
Compiler Options: Alphabetical Compiler Options
Optimising Applications: Using Interprocedural Optimization
Thank you. The opt-report output in particular looks useful. Is there is more information on the opt-report output? Specifically, I wonder why some functions are not being inlined. And also, why do I only get inlining reports if I do *not* use the -ipo option?
Specifically, I see lines like this in the INLINE REPORT for each function:
-> types_mp_for_non_bond_pairs_(11) (isz = 177) (sz = 184 (63+121))
I have tried to decipher it using the "Intel Fortran Compiler User and Reference Guides." I didn't see any details about the profile report in the other sources you pointed to.
In the Reference Guides it says "If a function is inlined, the function line has the prefix "-> INLINE: _" Since that function does not have that prefix (and some others do) I assume the function wasn't inlined, but since there is no (EXTERN) or (ARGS_IN_REGS), I don't know why it was not inlined. Nor do I know what the meaning of the optimized size, isz, is for. In what way was it optimized if not inlined?
Quoting - Mike Rezny
Specifically, I see lines like this in the INLINE REPORT for each function:
-> types_mp_for_non_bond_pairs_(11) (isz = 177) (sz = 184 (63+121))
I have tried to decipher it using the "Intel Fortran Compiler User and Reference Guides." I didn't see any details about the profile report in the other sources you pointed to.
In the Reference Guides it says "If a function is inlined, the function line has the prefix "-> INLINE: _" Since that function does not have that prefix (and some others do) I assume the function wasn't inlined, but since there is no (EXTERN) or (ARGS_IN_REGS), I don't know why it was not inlined. Nor do I know what the meaning of the optimized size, isz, is for. In what way was it optimized if not inlined?
Quoting - Mike Rezny
-ip (from memory, this is on by default for -O2, -O3) inlines code on a single file
-ipo does multifile optimization
Documentation sources:
The Fortran compiler manual:
Compiler Options: Alphabetical Compiler Options
Optimising Applications: Using Interprocedural Optimization
will tell you almost all you need to know.
-opt-report -opt-report-phase=ipo
will give reports on what the compiler has done.
regards
MIke
Quoting - plediii
Hi,
The compiler uses some heuristics to determine whether it is effective to perform inlining.
Inlining does not always improve the performance of an application.
You might want to read the Fortran Compiler Documentation:
Optimizing Applications: Using Interprocedural Optimization (IPO): Inline Expansion of Functions
Also, look at the documentation for all the -inline type compiler options, there are nine of them.
Also look at the documentation for the compiler directive to force inlining:
CDEC$ ATTRIBUTE FORCEINLINE
in A to Z Reference: A to B: ATTRIBUTES
regards
Mike
