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

Array Sections

dbruceg
Beginner
297 Views

I've just finished converting a bunch of array section references to whole array references, using function calls where necessary, thereby eliminating a bunch of stack overflow problems and gaining a substantial increase in speed. Unfortunately, though, the readability of the code has suffered a bit. For example, the construct

gstf(:,:) = 0.0d0

is substantially more informative than

gstf = 0.0d0

which looks like a scalar assignment. At some point in the evolution of IFORT, though, I suspect the compiler will recognize the first expression as a whole array, and the two statements will become equivalent.

Currently,the documentation of array section handling is limited to the suggestion, "Use whole arrays whenever possible,"and that suggestion indeed appears to be good advice.Are there any plans to flesh out that documentation such that one can determinewhether or nota particular operation will generate a stack temporary?

Bruce

0 Kudos
1 Reply
Steven_L_Intel1
Employee
297 Views
What we'd rather do is eliminate unnecessary temps and optionally allocate temps on the heap. The latter is nearly done and should show up in a compiler near you over the next few months. The former we keep working on.

In general, any time you have all colons in the subscript, you can probably remove the subscript.
0 Kudos
Reply