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.
29282 Discussions

...an array temporary was created...

jimdempseyatthecove
Honored Contributor III
867 Views

One of the diagnostics you have in IVF is to warn when an array temporary is created. This is great, as it informs you of potential performance issues. However, the warning message falls shortin that it tells you what was being called, butdoes not indicate where the call is located.

[plain]forrtl: warning (402): fort: (1): In call to GRAVITY, an array temporary was cre ated for argument #4 [/plain]The solution has 100's of files with 10's of calls to GRAVITY

It would help if the diagnostic message would list the line number and source of where the temporary was created.

Jim Dempsey

0 Kudos
5 Replies
Steven_L_Intel1
Employee
867 Views
Duly noted. Request ID is DPD200233252. I think a traceback should be issued in this case.
0 Kudos
jimdempseyatthecove
Honored Contributor III
867 Views
Also consider the following...

You have uninitialized variable support whereby you have a flag mechanism to inform the runtime check as to if the variable was initialized. Consider doing the same with the report of the ...an array temporary was created... IOW report each instance once. This way you can catch multiple instances in one debug run without having all the redundant reports scrolling off the screen buffer.

Jim Dempsey
0 Kudos
Steven_L_Intel1
Employee
867 Views
Interesting idea. I'll note that the compiler generates code to do run-time testing of contiguity (where it can't tell at compile-time), so there may be cases where some calls get a temp and some don't.
0 Kudos
jimdempseyatthecove
Honored Contributor III
867 Views
Steve,

I am making an assumption here...

At the place of the CALL (inlined or not) is where the current code emits the warning message. That call location can contain the one time flag (iow a hidden flag is created at each create temp). Pseudo code:

if(mustMakeTemp) then
if(thisScopeFirstTime) call ReportArrayTemp(__var__, __sub__, __from__, __line__)
thisScopeFirstTime = .false.
temp = arg
endif
call sub(...,arg,...)
if(tempWasCreated) then
arg = temp
endif

The above will not catch where a stride .ne. 1 array is passed several levels before the temp is created. The call trace will determine that, but for only the first instance of the multi-level call. This is ok, because the first instance of multi-level callcatched the occurance once with traceback. All single level instance are uniquely reported.

Jim
0 Kudos
Steven_L_Intel1
Employee
867 Views

In version 14, you can set the environment variable FOR_FORCE_STACK_TRACE to 1. This will force a traceback for all Fortran run-time diagnostics. There's a problem on 32-bit Windows only, where you get the traceback but no source, line or routine info - we're looking into that.

Maybe in a future version these diagnostics will always have a traceback.

0 Kudos
Reply