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

Automatic outputing of a watched variable to file

alan_marson
Beginner
754 Views

Is there a way to write the output from a watched variable to file during debugging?

I am trying to keep track of the entries in a large matrix, and rather than write additional statements into the code, it would be very handy if I could just dump the whole array into a file, or better yet Excel, during debugging.

Yes, I know. . .I could just write it to file during execution, but I'm wondering if there is a way to doit using the debugger and watch. :)

Thanks for your help,

Alan

I am currently using IVF9.1 and VS2005.

0 Kudos
3 Replies
Ron_Green
Moderator
754 Views

Array Visualizer might be able to do what you're looking for. If you have 9.1, you'll need to download AV and install it. If your compiler is 9.0 or older you may already have it installed.

In brief:

set a breakpoint.

Debug -> Start Debugging

when you reach your breakpoint, highlight your array.

menu, Debug -> View Array

or right-mouse, View Array

this brings up a mini viewer. Cool, but not quite there yet. In the left-hand column of this mini viewer, highlight your array name, right-mouse and "Viewer".

This will bring up the Array Viewer. From here you can save the array as HDF5 or AV XML.

enjoy

ron

0 Kudos
alan_marson
Beginner
754 Views

Thanks Ron, that does exactly what I needed.

Alan

0 Kudos
jimdempseyatthecove
Honored Contributor III
754 Views

Alan,

I use a slightly different technique.
Open the array of interest in the viewer
Click on the 1st cell as if you were to edit
Then type Ctrl-C
This places the XML text into the clipboard.
Next, open NotePad
Type Ctrl-V to paste the clipboard.
Now strip the XML header and footer information leaving
123, 456, ...999
Then use Find and Replace to replace "" with "" and "" with ""
This leaves a comma seperated list which is much cleaner to import into Excel.
If you do this a lot the you can write an AWK script or use your favorite macro text editor to strip the XML. My favorate macro text editoris TECO.

Jim Dempsey

0 Kudos
Reply