Prism 6.0 User's Guide

Where Graph

In scalar Prism, choosing Where from the Debug menu displays the call stack for the program; see " Displaying and Moving Through the Call Stack". A message-passing program, however, can have multiple call stacks, one for each process. To show the relationships among these call stacks, MP Prism provides a Where graph; this window displays a snapshot of the dynamic call graph of the program. Information is displayed for all processes that are not running.

To display the Where graph:

where on dedicated

A window like the one shown in Figure 4-5 is displayed.

Figure 4-5 Where Graph

Graphic

The Where graph centers on the current process of the current pset--that is, the processes related to it are lined up in a single column. In Figure 4-1, process 0 is the current process. If you change the current process, the Where graph rearranges itself. The default zoom level of the Where graph shows the arguments for the current process.

At the bottom of each box are line numbers indicating where processes branch.

Shift-click in each function's box to display a pop-up window showing the numbers of the processes with this function in their call stack, along with their arguments.

Panning and Zooming in the Where Graph

As Figure 4-6 shows, the Where graph can get quite large, so MP Prism provides methods for panning through it and zooming in and out.

The white box in the navigator rectangle at the top of the window shows the position of the display area relative to the entire Where graph. You can either drag the box or click at a spot in the navigator. The box moves to that spot, and the window shows the Where graph in this area of the total display.

To display more of the Where graph at the same time, click on the Zoom down arrow to the right of the navigator. This reduces the size of the boxes representing the functions and removes information. Figure 4-6 shows the Where graph of Figure 4-5, zoomed out one level. Note that the information about the current process's arguments is gone.

Figure 4-6 Where Graph, Zoomed Out One Level

Graphic

Zooming out one more level removes the line numbers, and one more level after that removes the function names, leaving only boxes connected by lines. You can still shift-click on a box to display information about it.

Clicking on the Zoom up arrow increases the size of the function boxes and includes more information in them. Figure 4-7 shows the Where graph of Figure 4-5, zoomed in. In this case, the Where graph shows, for each function, the processes that have that function in their call stack. As in the Psets window, the processes are represented as bitmaps of cells, numbered starting at the upper left, increasing from left to right and then jumping to the next row.

Figure 4-7 Where Graph, Zoomed In

Graphic

Zooming in another level shows all arguments for all processes.

Shrinking Selected Portions of the Where Graph

You can shrink selected portions of the Where graph. This is useful if you want to see the overall structure of the graph, but in addition want to focus on certain functions.

Middle-click on a function to iconify it and all of its children. Middle-click on an iconified function to re-expand it and its children to the current zoom level.

Alternatively, you can click on the (De)iconify Node button next to the Zoom arrows at the top of the Where graph. This changes the mouse pointer to a target. You can then left-click on a function to iconify it and its children. If it is already iconified, left-clicking on it will re-expand it and its children. To cancel the operation, left-click anywhere outside of the boxes surrounding the functions.

Moving Through the Where Graph

When you first display the Where graph, the main function is highlighted. You can left-click on a function to highlight it. Or, you can move through the Where graph via the keyboard:

Making a Function the Current Pset

Pressing the spacebar while in the Where graph does the following:

Issuing the where Command in MP Prism

Issuing the where command by default displays (in the history region) the call stack consecutively for each process in the current set (or in the pset you specify via the pset qualifier).

Issuing the command

where on dedicated

displays the Where graph, as described above.

Issuing the command

where on snapshot

puts the history-region output into a window; it does not create a Where graph.