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

Use of Globals with Intel Fortan Compiler

Rafael_Silva
Beginner
642 Views

  I've posted this on optimization forum, but  may be this is the best place to post. Sorry for this copy.

  I'm using Fortran compiler from intel and I'm getting performance issues when I use global variables (arrays). Basically, I have a four dimension array, and a loop processing all of its elements. When I pass these array as a parameter for the subroutine, I have an execution time. When I use it directly inside the routine as a global variable, the execution time is the double from previous one. I'm guessing the compiler disables some optimizations when I use a global variable. Is it the case? If yes, how can I enable it again? If no, does anyone have any idea why this slow down?

The arrays are declared on a global module like this:

real, allocatable, target :: ux(:,:,:,:), uy(:,:,:,:)

And allocated with:

allocate(ux(nmin1-4:nmax1+4+u_pad, nmin2-4:nmax2+4, nmin3-4:nmax3+4,-1:3))

Any idea what is happening?

0 Kudos
3 Replies
Rafael_Silva
Beginner
642 Views
I found when I use global variables the vectorization is disabled because the compiler consider there is a loop carried dependence, when I put the directive IVDEP, the vectorization is enabled again. My question now is: Why when I use global variables the compiler concludes there is loop carried dependence, and when I use local ones, its conclusion is there is no such depence? Does someone knows why this difference for globals, and how to change it?
0 Kudos
TimP
Honored Contributor III
642 Views
If I understood your earlier posts, when you said "global variables" you meant module variables. If you would give an actual working example, it might be possible to investigate whether the compiler's aliasing analysis is deficient.
0 Kudos
Rafael_Silva
Beginner
642 Views
Yes, I mean module variables. The example is in the other topic we discussed in optimization forum. Is it possible to move that discussion here? Or can I just copy?
0 Kudos
Reply