- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page