Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

Allocate

cria_ro
Beginner
551 Views
Does the use of allocate affect the speed of the program, compared to using static alloated matrices?
0 Kudos
2 Replies
Steven_L_Intel1
Employee
551 Views
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.
0 Kudos
jim_dempsey
Beginner
551 Views

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

0 Kudos
Reply