Totalview® User Guide : PART IV Advanced Tools and Customization : Chapter 21 Group, Process, and Thread Control : Using P/T Set Operators
Using P/T Set Operators
At times, you do not want all of one type of group or process to be in the focus set. TotalView lets you use the following three operators to manage your P/T sets:
|
Creates a union; that is, all members of two sets.
-
Creates a difference; that is, all members of the first set that are not also members of the second set.
&
Creates an intersection; that is, all members of the first set that are also members of the second set.
For example, the following creates a union of two P/T sets:
p3 | L2
You can, apply these operations repeatedly; for example:
p2 | p3 & L2
This statement creates an intersection between p3 and L2, and then creates a union between p2 and the results of the intersection operation. You can directly specify the order by using parentheses; for example:
p2 | (p3 & pL2)
Typically, these three operators are used with the following P/T set functions:
breakpoint(ptset)
Returns a list of all threads that are stopped at a breakpoint.
comm(process, “comm_name”)
Returns a list containing the first thread in each process associated within a communicator within the named process. While process is a P/T set it is not expanded into a list of threads.
error(ptset)
Returns a list of all threads stopped due to an error.
existent(ptset)
Returns a list of all threads.
held(ptset)
Returns a list of all threads that are held.
nonexistent(ptset)
Returns a list of all processes that have exited or which, while loaded, have not yet been created.
running(ptset)
Returns a list of all running threads.
stopped(ptset)
Returns a list of all stopped threads.
unheld(ptset)
Returns a list of all threads that are not held.
watchpoint(ptset)
Returns a list of all threads that are stopped at a watchpoint.
The way in which you specify the P/T set argument is the same as the way that you specify a P/T set for the dfocus command. For example, watchpoint(L) returns all threads in the current lockstep group. The only operator that differs is comm, whose argument is a process.
The dot operator (.), which indicates the current set, can be helpful when you are editing an existing set.
The following examples clarify how you use these operators and functions. The P/T set a (all) is the argument to these operators.
f {breakpoint(a) | watchpoint(a)} dstatus
Shows information about all threads that are stopped at breakpoints and watchpoints. The a argument is the standard P/T set indicator for all.
f {stopped(a) - breakpoint(a)} dstatus
Shows information about all stopped threads that are not stopped at breakpoints.
f {. | breakpoint(a)} dstatus
Shows information about all threads in the current set, as well as all threads stopped at a breakpoint.
f {g.3 - p6} duntil 577
Runs thread 3 along with all other processes in the group to line 577. However, it does not run anything in process 6.
f {($PTSET) & p123}
Uses just process 123 in the current P/T set.