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

compiling with -ipo takes too much time

utab
Beginner
722 Views

Dear all,

I am using the following compile line for my makefile however -ipo options takes far longer than without -ipo, what is the reason of this behavior?

ifort -ipo -prec-sqrt -prec-div -fp-model source -xHost -traceback -unroll4 -O3 -standard-semantics -assume protect_parens

Is this behavior normal? I am on a Linux x86-64 environment.

Best,

Umut

 

0 Kudos
4 Replies
utab
Beginner
722 Views

utab wrote:

Dear all,

I am using the following compile line for my makefile however -ipo options takes far longer than without -ipo, what is the reason of this behavior?

ifort -ipo -prec-sqrt -prec-div -fp-model source -xHost -traceback -unroll4 -O3 -standard-semantics -assume protect_parens

Is this behavior normal? I am on a Linux x86-64 environment.

Best,

Umut

 

 

Just some extra comments, I am compiling two target binaries which are compiled with 3 input files where one of them is a module file. For one of these targets, it takes 7 minutes to compile the code, and for the other one it takes 24 minutes to compile the code. For the second one, the compile time is more than that of the run time of the second binary.

0 Kudos
TimP
Honored Contributor III
722 Views

Assuming you are including the ipo link stage in your term "compile time," of course it takes longer when ipo is enabled.  When ipo is not enabled, that stage simply scans to see if there are any ipo objects. When it is enabled, the analysis may be complex and consume all available memory. The multi-file ipo should reduce the extra time in large builds.  ipo doesn't necessarily offer sufficient performance benefit.

0 Kudos
utab
Beginner
722 Views

Tim Prince wrote:

Assuming you are including the ipo link stage in your term "compile time," of course it takes longer when ipo is enabled.  When ipo is not enabled, that stage simply scans to see if there are any ipo objects. When it is enabled, the analysis may be complex and consume all available memory. The multi-file ipo should reduce the extra time in large builds.  ipo doesn't necessarily offer sufficient performance benefit.

Dear Tim,

Yes, my definition of compile time(a bit misused) also includes the link time which also gets the -ipo flag.

After reading a bit more, maybe only, I should use the -ipo flags on compile time, however, as you have mentioned maybe I should investigate if there is a performance benefit or not.

Best,

Umut

0 Kudos
Steven_L_Intel1
Employee
722 Views

-ipo effectively compiles all your sources together, including optimizing across all the sources. The "compilation" part, when -ipo is used, generates "intermediate code" only and is fairly quick. It is when you go to "link" that the compiler is again invoked to read in all the intermediate code and optimize it together. If the program is very large, this can consume a lot of resources. Also the linker may have issues with very large objects, which is why the -ipo switch has an optional "n" value to specify the number of objects to create. See also -ipo-jobs.

0 Kudos
Reply