30.01.2013 Views

TotalView Users Guide - CI Wiki

TotalView Users Guide - CI Wiki

TotalView Users Guide - CI Wiki

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Understanding Thread Width<br />

Stepping (Part I)<br />

When <strong>TotalView</strong> performs a stepping command, it decides what it steps<br />

based on the width. Using the toolbar, you specify width using the left-most<br />

pulldown. This pulldown has three items: Group, Process, and Thread.<br />

Stepping at thread width tells <strong>TotalView</strong> to only run that thread. It does not<br />

step other threads. In contrast, process width tells <strong>TotalView</strong> to run all<br />

threads in the process that are allowed to run while the TOI is stepped.<br />

While <strong>TotalView</strong> is stepping the thread, manager threads run freely.<br />

Stepping a thread isn’t the same as stepping a thread’s process, because a<br />

process can have more than one thread.<br />

Thread-stepping is not implemented on Sun platforms. On SGI platforms, thread-stepping<br />

is not available with pthread programs. If, however, your program’s parallelism is<br />

based on SGI’s sprocs, thread-stepping is available.<br />

Thread-level single-step operations can fail to complete if the TOI needs to<br />

synchronize with a thread that isn’t running. For example, if the TOI<br />

requires a lock that another held thread owns, and steps over a call that<br />

tries to acquire the lock, the primary thread can’t continue successfully.<br />

You must allow the other thread to run in order to release the lock. In this<br />

case, you use process-width stepping instead.<br />

Using Run To and duntil Commands<br />

The duntil and Run To commands differ from other step commands when<br />

you apply them to a process group. (These commands tell <strong>TotalView</strong> to<br />

execute program statements until it reaches the selected statement.) When<br />

used with a process group, <strong>TotalView</strong> identifies all processes in the group<br />

that already have a thread stopped at the goal. These are the matching processes.<br />

<strong>TotalView</strong> then runs only nonmatching processes. Whenever a<br />

thread arrives at the goal, <strong>TotalView</strong> stops its process. The command finishes<br />

when it has stopped all members of the group. This lets you synchronize<br />

all the processes in a group in preparation for group-stepping them.<br />

You need to know the following if you’re running at process width:<br />

Process group If the Thread of Interest (TOI) is already at the goal location,<br />

<strong>TotalView</strong> steps the TOI past the line before the<br />

process runs. This lets you use the Run To command<br />

repeatedly in loops.<br />

Thread group If any thread in the process is already at the goal,<br />

<strong>TotalView</strong> temporarily holds it while other threads in<br />

the process run. After all threads in the thread group<br />

reach the goal, <strong>TotalView</strong> stops the process. This lets<br />

you synchronize the threads in the POI at a source line.<br />

<strong>TotalView</strong> <strong>Users</strong> <strong>Guide</strong>: version 8.7 255

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!