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

CVF to IVF, conditions for failure of Local variable storage = /Qsave

salbruce
Beginner
637 Views
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.
0 Kudos
3 Replies
Steven_L_Intel1
Employee
637 Views
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.
0 Kudos
Paul_Curtis
Valued Contributor I
637 Views
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.
0 Kudos
salbruce
Beginner
637 Views
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.




0 Kudos
Reply