This argument can be entered in more than one way, usually using a line number or a pathname containing a file name, function name, and line number, each separated by
# characters (for example,
#file#line). If you omit parts of this specification, the CLI creates them for you. For more information, see “
Qualifying Symbol Names” in Chapter 13 of the
TotalView User Guide.
Identifies, using the width argument, any additional processes or threads to stop when stopping the thread that arrives at a barrier point.
The argument width may have one of the following three values:
Stops only the thread that hit the barrier; that is, the thread is held and all other threads continue running. If you apply this width to a process barrier breakpoint, TotalView stops the process that hit the breakpoint.
After all processes or threads reach the barrier, releases all processes and threads held at the barrier. (
Released means that these threads and processes can run.) Setting this option stops additional threads contained in the same
group or
process.
Use the width argument indicates other stopped processes or threads. You can enter one of the following three values:
Stops the processes that contain threads in the satisfaction set when the barrier is satisfied.
Stops the satisfaction set. For process barriers, process and
none have the same effect. This is the default if the
BARRIER_STOP_WHEN_DONE variable is
none.
If TotalView cannot find a location to set the barrier, adding this option creates the barrier anyway. As shared libraries are read, TotalView checks to see if it can be set in the newly loaded library. For more information on this option, see
dbreak.
The dbarrier command sets a process or thread barrier breakpoint that triggers when execution arrives at a location. This command returns the ID of the newly created breakpoint.
The dbarrier command is most often used to synchronize a set of threads. The P/T set defines which threads the barrier affects. When a thread reaches a barrier, it stops, just as it does for a breakpoint. The difference is that TotalView prevents—that is, holds—each thread that reaches the barrier from responding to resume commands (for example,
dstep,
dnext, and
dgo) until
all threads in the affected set arrive at the barrier. When all threads reach the barrier, TotalView considers the barrier to be
satisfied and releases these threads. Note that they are just
released, not continued. That is, TotalView leaves them stopped at the barrier. If you continue the process, those threads stopped at the barrier also run along with any other threads that were not participating with the barrier. After the threads are released, they can respond to resume commands.
TotalView determines the processes and threads that are part of the satisfaction set by taking the intersection of the share group with the focus set. (Barriers cannot extend beyond a share group.)
The –stop_when_hit option specifies if other threads should stop when a thread arrives at a barrier.
The –stop_when_done option controls the set of additional threads that are stopped when the barrier is finally satisfied. That is, you can also stop an additional collection of threads after the last expected thread arrives, and all the threads held at the barrier are released. Normally, you want to stop the threads contained in the control group.
If you omit a stop option, TotalView sets the default behavior by using the
BARRIER_STOP_ALL and
BARRIER_STOP_WHEN_DONE variables.
Use the none argument for these options to not stop additional threads.
The following example illustrates these differences. If you set a barrier with the focus set to a control group (the default), TotalView creates a process barrier. This means that the
–stop_when_hit value is set to
process even though you specified
thread.
Holds each thread in processes 1, 2, and 3 as it arrives at the first executable line in procedure
my_proc. After all threads arrive, the barrier is satisfied and TotalView releases all processes.
Sets a thread barrier at line 642 in the workers group. The process is continued automatically as each thread arrives at the barrier. That is, threads that are not at this line continue running.