- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In IVF 11, what kind of programming structure might fail with /Qsave or /Qauto but not the other two options for Local variable storage?
Some background: I am converting a number of dll projects from CVF to IVF 11. By default the Local variable storage is set to /Qsave. This has worked for all projects but one. In that case a subroutine fails. Trying all four options for Local variable storage I get:
Default local storage -- runs
All variables save (/Qsave) - subroutine fails
Scalar local variables automatic (/Qauto_scalar) - runs
Local variables automatic (/Qauto) -- fails.
Additional notes:
- No problems with CVF
- Failures happen with IVF /Qsave with both XP and Vista
- No variables are explicitly declared with Save or Automatic
- Array passed to the subroutine are allocatable and allocated before the subroutine call.
- Two arrays are allocated/deallocated within the subroutine
- Another project that calls the same subroutine does not fail with any of the settings for Local variable storage.
- Only Common variables are two pointers needed for calls to another dll. These are used in most of my projects with no problems.
Thanks in advance for your ideas.
Some background: I am converting a number of dll projects from CVF to IVF 11. By default the Local variable storage is set to /Qsave. This has worked for all projects but one. In that case a subroutine fails. Trying all four options for Local variable storage I get:
Default local storage -- runs
All variables save (/Qsave) - subroutine fails
Scalar local variables automatic (/Qauto_scalar) - runs
Local variables automatic (/Qauto) -- fails.
Additional notes:
- No problems with CVF
- Failures happen with IVF /Qsave with both XP and Vista
- No variables are explicitly declared with Save or Automatic
- Array passed to the subroutine are allocatable and allocated before the subroutine call.
- Two arrays are allocated/deallocated within the subroutine
- Another project that calls the same subroutine does not fail with any of the settings for Local variable storage.
- Only Common variables are two pointers needed for calls to another dll. These are used in most of my projects with no problems.
Thanks in advance for your ideas.
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What does "fails" mean here?
Do you have any allocatable arrays declared in a subroutine or function (not as a dummy argument?) A known issue with /Qsave is that it makes those SAVE too, which is incorrect.
That /Qauto also "fails" suggests that you have code that depends on an array being SAVEd.
Do you have any allocatable arrays declared in a subroutine or function (not as a dummy argument?) A known issue with /Qsave is that it makes those SAVE too, which is incorrect.
That /Qauto also "fails" suggests that you have code that depends on an array being SAVEd.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The best way to ensure CVF-type behavior in IVF is to go through your code and add explicit SAVE attributes to all those quantities which need to be preserved. As noted, /Qsave does not exactly restore the CVF behavior, and in fact introduces lots of other complications and unwanted effects.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve asked, "What does "fails" mean here?" I am calling an eigenanalysis subroutine. I generate an error code when the routine fails to converge on a solution after some number of iterations. This is what I mean by "fails." I know that this particular data set is no problem for eigenanalysis. The failure could mean any of a number of problems, such as a problem with the input array or a problem with some of the temporary storage arrays that I allocate within the routine. The routine is tried and true with numerous compilers. I was hoping to shortcut debugging this if I could figure out what the /Qsave was doing.
Steve, thanks for pointing out the problem with the use of /Qsave with the arrays with allocated arrays within the routine is a good reason not to use /Qsave. I am indeed allocating arrays within the routine.
I found that if I run the routine just once, no problem, but if I call it multiple times with /Qsave or /Qauto it fails.
Paul thanks for the suggestion of explicit SAVE. In this case I don't want the routine to save anything, but for future reference it sounds like using the SAVE attribute is much better than trying to use /Qsave.
Thanks again.
Steve, thanks for pointing out the problem with the use of /Qsave with the arrays with allocated arrays within the routine is a good reason not to use /Qsave. I am indeed allocating arrays within the routine.
I found that if I run the routine just once, no problem, but if I call it multiple times with /Qsave or /Qauto it fails.
Paul thanks for the suggestion of explicit SAVE. In this case I don't want the routine to save anything, but for future reference it sounds like using the SAVE attribute is much better than trying to use /Qsave.
Thanks again.

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