TotalView User Guide : Part V: Debugging : Examining Arrays : Displaying a Variable in all Processes or Threads

Displaying a Variable in all Processes or Threads
When you’re debugging a parallel program that is running many instances of the same executable, you usually need to view or update the value of a variable in all of the processes or threads at once.
Before displaying a variable’s value in all threads or processes, you must display an instance of the variable in a Variable Window. After TotalView displays this window, use one of the following commands:
*
View > Show Across > Process, displays the value of the variable in all processes.
*
View > Show Across > Thread, displays the value of a variable in all threads within a single process.
*
View > Show Across > None, returns the window to what it was before you used other Show Across commands.
*
After using one of these commands, the Variable Window switches to an array-like display of information, and displays the value of the variable in each process or thread. Figure 220 shows a simple, scalar variable in each of the processes in an OpenMP program.
When looking for a matching stack frame, TotalView matches frames starting from the top frame, and considers calls from different memory or stack locations to be different calls. For example, the following definition of recurse() contains two additional calls to recurse(). Each of these calls generates a nonmatching call frame.
void recurse(int i) {
if (i <= 0)
return;
if (i & 1)
recurse(i 1);
else
recurse(i 1);
}
If the variables are at different addresses in the different processes or threads, the field to the left of the Address field displays Multiple, and the unique addresses appear with each data item.
TotalView also lets you Show Across arrays and structures. When you Show Across an array, TotalView displays each element in the array across all processes. You can use a slice to select elements to be displayed in an “across” display. The following figure shows the result of applying a Show Across > Processes command to an array of structures.
 

Rogue Wave Software, Inc.
Voice: (303) 473-9118
rwonlinedocs@roguewave.com