View stacks in parallel
You can use the Parallel Stack View to see the status of your program in one view.

To find out the location of a group’s processes, click on the group. The Parallel Stack View displays a tree of functions, merged from every process in the group (by default). If there is only one branch in this tree, one list of functions, then all your processes are at the same place.
If there are several branches, your group has split up and is in different parts of the code. Click on any branch to see its location in the Source Code viewer, or hover your mouse over it to view a list of the processes at that location in a popup. Right-click on any function in the list and select New Group to automatically gather the processes at that function together in a new group, labeled by the function’s own name.
The Parallel Stack View can be used to create groups, to display and select large numbers of processes based on their location in your code (this is invaluable when dealing with moderate to large numbers of processes), and watch what happens as you step processes through your code.
The Parallel Stack View takes over much of the work of the Current Stack display, but instead of just showing the current process, this view combines the call trees (commonly called stacks) from many processes and displays them together. The call tree of a process is the list of functions (strictly speaking frames or locations within a function) that lead to the current position in the source code.
For example, if main()
calls read_input()
, and read_input()
calls
open_file()
, and you stop the program inside open_file()
, then the
call tree looks like the following:
main()
read_input()
open_file()
If a function was compiled with debug information (typically using -g
),
extra information is added, displaying the exact source file and
line number that your code is on.
Any functions without debug information are grayed-out and are not shown by default. Functions without debug information are typically library calls or memory allocation subroutines and are not generally of interest. To see the entire list of functions, right-click on one and choose Show Children.
You can click on any function to select it as the ‘current’ function in Linaro DDT. If it was compiled with debug information, its source code is displayed in the main window, and its local variables and so on in the other windows.
One of the most important features of the Parallel Stack View is its ability to show the position of many processes at once. Right-click on the view to toggle between:
Viewing all the processes in your program at once.
Viewing all the processes in the current group at once (default).
Viewing only the current process.
The function that is currently displayed and being used for the variable views is highlighted in dark blue. If you click on another function in the Parallel Stack View this selects another frame for the source code and variable views. It also updates the Stack display, since these two controls are complementary. If the processes are at several different locations, only the location of the current process is displayed in dark blue. The locations of the other processes are displayed in light blue:

In the example above, the processes of the program are at two different
locations. One process is in the main
function, at line 147 of
hello.c
. The other 15 processes are inside a function called func1
,
at line 39 of hello.c
. To see the line of source code a function
corresponds to, and display any local variable in that stack frame,
click on the function.
There are two optional columns in the Parallel Stack View. Processes shows the number of processes at each location. Threads shows the number of threads at each location. By default, only the number of processes is shown. Right-click to turn these columns on and off. Note that in a normal, single-threaded MPI program, each process has one thread and these two columns will show identical information.
If you hover the mouse over any function in the Parallel Stack View this displays the full path of the filename, and a list of the process ranks that are at that location in the code:

Linaro DDT is at its most intuitive when each process group is a collection of processes doing a similar task. The Parallel Stack View is invaluable in creating and managing these groups.
To create a new process group that contains only the processes sharing that location in code, right-click on a function in the combined call tree and choose New Group. By default the name of the function is used for the group, or the name of the function with the file and line number if it is necessary to distinguish the group further.
The contents of the Parallel Stack View can be exported in CSV or XML format via the Right-click context menu, or copied to clipboard.