"SAVE" Problem with IF9.0

"SAVE" Problem with IF9.0

I am currently modifying a library of engineering component simulations to run in the Mathworks Simulink environment. These simulations were most previously compiled with the CVF 6.6 compiler. When compiling with the IF 9.0 compiler, one of the component codes crashed and burned. On debugging this large code, I found that some variables were not persistent with multiple entries into some of the subroutines. Addition of "SAVE" statements in each subroutine seemed to fix some of the problems. Has something changed between CVF6.6 and IF9.0 with regard to the default for saving variables between multiple entries into scoping units. If so, can the SAVE be set as a global compile attribute, or does it need to be set in each scoping unit? When I compare the help files on this subject in the two compilers, I don't see any difference.

mglickstein

6 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Yes, it did change, but unfortunately did not find its way back into all the places in the documentation.

Intel Fortran does not apply default SAVE semantics to scalar variables. (It does to arrays.) You can compile with /Qsave to get implied SAVE for all appropriate variables.

Steve - Intel Developer Support

Thanks Steve,

I am compiling from Visual Studio 2003 GUI. Is there a way to set /Qsave, and compile from the graphic interface?

mglickstein

Yes - the Fortran property page for Data, Local Variable Storage, All Variables SAVE.

Steve - Intel Developer Support

Steve,

Thanks a million. That fixed the problem. I would be embarrassed to tell you how many days I spent chasing that problem.

Marv Glickstein

No need to feel embarassed - this is a difficult type of problem to track down. I'm somewhat annoyed that this change was made and we didn't explain it clearly. It was made to improve performance.

Of course, I will also say that you really should use SAVE on variables you want saved.

Steve - Intel Developer Support

Leave a Comment

Please sign in to add a comment. Not a member? Join today