Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29039 Discussions

VS IDE Debug how to view SAVE variables

jimdempseyatthecove
Honored Contributor III
576 Views

What is the syntax to view variables within a subroutine declared with the SAVE attribute?

(Program compiled with OpenMP)

subroutine FOO
real, save :: Array(100)
A=0.0
... (break here)
end subroutine FOO

Using the following does not work
Array
FOO::Array
::Array
FOO_mp_FOO::Array
Using call stack to migrate focus upwards

Jim

0 Kudos
7 Replies
Steven_L_Intel1
Employee
576 Views
There is no special syntax for such things - normally just the variable name should just work. I'm not sure if OpenMP complicates things. I do know that you can't currently view host-associated variables. Make sure that the Fortran debug support is working properly (the locals list should show Fortran types and not C types.)

If you can come up with a small but complete self-contained example showing a problem, please submit it to Intel Premier Support.
0 Kudos
jimdempseyatthecove
Honored Contributor III
576 Views

Steve,

The variable is declared as

real, save, allocatable :: OutputData(:)

Compilation is made with Debug and /Od
OutputData is allocated andused within the subroutine.
The subroutine is compiled with OpenMP enabled but is not inside the scope of !$OMP PARALLEL...

OutputData appears in the Locals window but reports as "Cannot view register variable"

As usual, it won't fail when making a small example :~(

The subroutine does declare a few unreferenced local variables (left overs) these too show up as "Cannot view register variable".

The name shows up in the Locals window therefore the variable name portion of the debug information is emitted, however, the lack of address information provides some indication that the code responsible for marking the symbol as being referenced (and at which location) has problems.

Does your compiler have an undocumented diagnostic option that would identify the debugger output process receiving a reference to a variable not declared (i.e. the token name or number on reference does not match that of a declared variable)?

Jim Dempsey

0 Kudos
Steven_L_Intel1
Employee
576 Views
I don't know of any such diagnostic option. When you can come up with a test case, please let us know at Intel Premier Support.
0 Kudos
Jeffrey_A_Intel
Employee
576 Views

What version of the compiler?

Can you build the application but with OpenMP disabled for this one subroutine? If so, can you view the variable then?

0 Kudos
jimdempseyatthecove
Honored Contributor III
576 Views

x32 V10.0.27 Without OpenMP shows array :)

x32 V10.0.27 With OpenMP shows "Cannot view register variable"

x64 V10.0.27 Without OpenMP shows array :)

x64 V10.0.27 With OpenMP shows "Cannot view register variable"

Haven't tried V10.1.013 (downloaded but not installed)

So it appears to be an OpenMP related thing common to both x32 and x64 versions of V10.0.027.

I am a little hesitant to upgrade since it occasionaly breaks code and it takes a while to find the problems and contrive a work around. Other than for this quirk the application is working fine for now using V10.0.027. I will experiment with V10.1.013 on the x32 computer.

.027 does have some problems but my code has work arounds installed. A few loops that were vectorized incorrectly so vectorization for those sections had to be turned off. There were a few other quirks which have been identified and worked around. With ~750 source files a new problem could pop-up just about anywhere.

Jim Dempsey

0 Kudos
Steven_L_Intel1
Employee
576 Views
You can install 10.1 and 10.0 side by side. In Visual Studio you can select the one you want under Tools > Options.
0 Kudos
jimdempseyatthecove
Honored Contributor III
576 Views

I chose to uninstall and install.

V10.1.013 can view the saved variables. (at least on the x32 system)

The application did not crash and the results seemed consistent with earlier version of the compiler. So I think I will upgrade the compiler on the x64 system.

Jim Dempsey

0 Kudos
Reply