Use of Globals with Intel Fortan Compiler

Use of Globals with Intel Fortan Compiler

Аватар пользователя Rafael Silva

  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?

4 posts / 0 новое
Последнее сообщение
Пожалуйста, обратитесь к странице Уведомление об оптимизации для более подробной информации относительно производительности и оптимизации в программных продуктах компании Intel.
Аватар пользователя Rafael Silva

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?

Аватар пользователя Tim Prince

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.

Аватар пользователя Rafael Silva

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?

Зарегистрируйтесь, чтобы оставить комментарий.