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

allocatable vs fixed array with ipo

tracyx
New Contributor I
570 Views
I am using ifort 11.0.069 on ubuntu 9.04/

I have a program where I use either fixed or allocatable arrays depending upon whether I define the array size at compile time via FPP or not.

Rightly or wrongly, I suspected that performance would be better when using fixed arrays. When compiling with -O3 optimizations this is indeed the case when there is a small performance increase with fixed array size.

However, if I add -ipo to the compiler options, both speed up, but the performance is now *much* quicker when using alloctable arrays compared to the previously quicker fixed arrays (about x2 as fast compared to using fixed arrays).

Is this normal?
0 Kudos
1 Reply
TimP
Honored Contributor III
570 Views
If there is a performance loss with allocatable arrays, a likely reason would be that the allocations and deallocations occur too often, inside a lower level function or loop. ipo might help with that, but your result does seem surprising.
0 Kudos
Reply