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

Allocate

cria_ro
Einsteiger
718Aufrufe
Does the use of allocate affect the speed of the program, compared to using static alloated matrices?
0 Kudos
2 Antworten
Steven_L_Intel1
Mitarbeiter
718Aufrufe
It can, but a lot will depend on the program. Many programs won't see a difference. The major issue is what information the compiler can see about the bounds of the array, and where it has to get it from. We've done a lot of work to optimize this, so I would not hesitate to use allocatable arrays where they make sense.
jim_dempsey
Einsteiger
718Aufrufe

It will affect some types of coding practices but not others. Many large-ish applications have dozens or hundreds of program modules. These modules are typicaly passed references to an array or to a portion of an array.

The call may suffer a tiny hit but if the subroutine performs a lot of work then it is dereferencing the dummy argument and these should work as fast as they did before (unless DIMENSION'ed with (*)).

Jim Dempsey

Antworten