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

Inlining problem

FlyingHermes
New Contributor I
206 Views

Hi,

I'm trying to take advantage of the optimization reports to improve performance.

However, I've got some issues with the use of the "-opt-report" options.

I think these issues are related to the directory structure of my source files.

Source files are stored in an nested directory tree, each directory having its own Makefile, as in the sample code attached to this post.

In order to compile the attached code, you first have to change the "DIR_HOME" variable in the "Make.inc" file to the path where the code is stored.

The creation of a library using the command

[bash]xiar -qopt-report -qopt-report-phase=ipo -qopt-report=3 [/bash]

generates the optimization report file "ipo_out.optrpt" in the directory "dir_1":

[bash]    Report from: Interprocedural optimizations [ipo]


IPO OPTIMIZATION REPORT:

  WHOLE PROGRAM (SAFE) [EITHER METHOD]: false
  WHOLE PROGRAM (SEEN) [TABLE METHOD]: false
  WHOLE PROGRAM (READ) [OBJECT READER METHOD]: false

INLINING OPTION VALUES:
  -inline-factor: 100
  -inline-min-size: 30
  -inline-max-size: 230
  -inline-max-total-size: 2000
  -inline-max-per-routine: disabled
  -inline-max-per-compile: disabled


Begin optimization report for: dir_1_file_2_module._

    Report from: Interprocedural optimizations [ipo]

INLINE REPORT: (dir_1_file_2_module._) [1/2=50.0%]

===========================================================================

Begin optimization report for: dir_1_file_2_module_mp_sub_5b_

    Report from: Interprocedural optimizations [ipo]

INLINE REPORT: (dir_1_file_2_module_mp_sub_5b_) [2/2=100.0%]
  -> dir_1_2_file_2_module_mp_sub_4_(EXTERN)
  -> dir_1_2_file_1_module_mp_sub_3_(EXTERN)
  -> dir_1_1_file_2_module_mp_sub_2_(EXTERN)
  -> dir_1_1_file_1_module_mp_sub_1_(EXTERN)

===========================================================================[/bash]

 

My first problem is that the optimization report only contains the info related to the last object file added to the lib, as if the report was overwritten.

The second problem is that none of the procedure are inlined, although they are "pure" procedures.

I guess that this is related to the fact that these procedures are found to be "EXTERN", which might be connected to the fact that the "WHOLE PROGRAM" indicator are all false.

What am I doing wrong ?

Thanks for your answer.

0 Kudos
2 Replies
FlyingHermes
New Contributor I
206 Views

I've attached a second version of the code in which all source files are stored in the same directory.

I'm still:

  1. not having whole program optimization
  2. not having any inlining
  3. overwriting the optimization report with the object file added to the lib.

 

 

0 Kudos
FlyingHermes
New Contributor I
206 Views

I managed to have the "whole program" optimization, which in turn, activated inlining across different source files.

For those who are interesed, the (rather simple) Makefiles for doing so are attached.

0 Kudos
Reply