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.

Setting Breakpoints and Barriers<br />

This means that if you do not want to share breakpoints in children that<br />

use the same executable, dive into the breakpoints and set the breakpoint<br />

options.<br />

5 Select the Group > Go command.<br />

Example: Multi-process Breakpoint<br />

The following program excerpt illustrates the places where you can set<br />

breakpoints in a multi-process program:<br />

1 pid = fork();<br />

2 if (pid == –1)<br />

3 error ("fork failed");<br />

4 else if (pid == 0)<br />

5 children_play();<br />

6 else<br />

7 parents_work();<br />

The following table describes what happens when you set a breakpoint at<br />

different places:<br />

Line Number Result<br />

1 Stops the parent process before it forks.<br />

2 Stops both the parent and child processes.<br />

3 Stops the parent process if the fork() function failed.<br />

5 Stops the child process.<br />

7 Stops the parent process.<br />

Setting Barrier Points<br />

A barrier breakpoint is similar to a simple breakpoint, differing only in that<br />

it holds processes and threads that reach the barrier point. Other processes<br />

and threads continue to run. <strong>TotalView</strong> holds these processes or<br />

threads until all processes or threads defined in the barrier point reach this<br />

same place. When the last one reaches a barrier point, <strong>TotalView</strong> releases<br />

all the held processes or threads. In this way, barrier points let you synchronize<br />

your program’s execution.<br />

CLI: dbarrier<br />

Topics in this section are:<br />

� “About Barrier Breakpoint States” on page 363<br />

� “Setting a Barrier Breakpoint” on page 363<br />

� “Creating a Satisfaction Set” on page 364<br />

� “Hitting a Barrier Point” on page 365<br />

� “Releasing Processes from Barrier Points” on page 365<br />

� “Deleting a Barrier Point” on page 365<br />

� “Changing Settings and Disabling a Barrier Point” on page 365<br />

362 Chapter 16: Setting Action Points

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

Saved successfully!

Ooh no, something went wrong!