The ipo flag, using the intel ifort compiler

87 views
Skip to first unread message

Jon Elvar Wallevik

unread,
Aug 24, 2021, 10:32:12 AM8/24/21
to claw-users
Dear all

I wanted to try out the Intel ifort compiler. For the Makefile, I tried
FC ?= ifort
FFLAGS ?= -Ofast -qopenmp
...which works great, except that its performance is the same as for gfortran.
I have tried
FFLAGS ?= -integer-size 64 -Ofast -qopenmp
FFLAGS ?= -Ofast -qopenmp -static-intel
...and many more... without any performance boost.

There is however a flag called -ipo, which is very interesting. To use it, I have tried
FFLAGS ?= -ipo -Ofast -qopenmp

I have also tried to add linking info like
LFLAGS += -ffat-lto-objects
...or... LFLAGS += -fno-fat-lto-objects
...or... LFLAGS += $(FFLAGS) -ffat-lto-objects
...or... LFLAGS += $(FFLAGS) -fno-fat-lto-objects
as explained at intel.com

However, the problem with the -ipo, regardless what I try, is that the corresponding binary appears to be generated by missing half of the geoclaw code and just produce rubbish (the resulting output seems to only AMR level 1, (going by memory here, since everything is at home and I am at work now)).

Does anybody have experience using the -ipo flag in the ifort compiler?

Cheers,...
Jon

P.s. you can download a "free" Intel compiler for testing. You do it by modify your repo info as explained at intel.com and thereafter do something like sudo dnf/yum/apt install ifort.

P.s2.. I am using 5.7.1, and the ifort is the newest version.
Ps3. I also tried the beta version of ifx, without any apparent performance boost. But I need to test it more to be sure

Kyle Mandli

unread,
Aug 24, 2021, 8:57:58 PM8/24/21
to claw-...@googlegroups.com
Hi Jon,

I just tried to use the flag `ipo` on my local linux cluster and got it to work fine with geoclaw and the 2020 intel compiler and using the master branch of Clawpack (although I doubt that probably is making a difference).  The gfortran vs. intel compiler difference has narrowed more and more lately but it does depend on the chip quite a bit.  We have also found that some of the automatic vectorization/parallelization directives can also make a great deal of difference.

As to the `ipo` problem I do not seem to be able to replicate it on my local linux machines.  It is a linker time option given that it is a "inter-procedure optimization" routine.  If the linker somehow is not seeing all the object files I suppose it could be getting confused?  I am not sure how the AMR would involved in the compilation though.

In terms of the intel compiler though you are correct, for linux the intel compiler suite is free.  You can also request the intel compilers as an academic for the other platforms.

Kyle
--
You received this message because you are subscribed to the Google Groups "claw-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to claw-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/claw-users/6854a410-5476-4339-8654-48b053ee684dn%40googlegroups.com.

Jon Elvar Wallevik

unread,
Aug 25, 2021, 8:39:43 AM8/25/21
to claw-users
OK thanks for the info Kyle
I think I will continue a bit with my ifort experimentation and see what I can figure out.
P.s. have you tried the new (beta) ifx compile? In my (few) experiments, I found no real difference between the two.

Cheers,...
Jon

Kyle Mandli

unread,
Aug 25, 2021, 9:05:32 AM8/25/21
to claw-users
I have not tried out the LLVM compiler at all yet.  Good to know that there's no performance difference.  Have you seen any debugging advantages?

Kyle

Jon Elvar Wallevik

unread,
Aug 25, 2021, 9:14:53 AM8/25/21
to claw-users
I haven't tried ifx that much to see any. Just tested on code where everything is OK... something I should compare with ifort and gfortran
Frankly, I didn't know that ifx was based on LLVM,... good to know.
cheers,...
Jon

Kyle Mandli

unread,
Aug 25, 2021, 9:23:57 AM8/25/21
to claw-users
I just heard about it recently but do not have access to it yet as it was only included in the 2021 version of the intel compiler suite (it's in beta still).  In principle it should allow better optimizations and debugging but my guess is that it probably is only being brought up to par with the older internals with the front end remaining the same.

Kyle
Reply all
Reply to author
Forward
0 new messages