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.

Debugging UPC Programs<br />

Debugging UPC Programs<br />

<strong>TotalView</strong> lets you debug UPC programs that were compiled using the HP<br />

Compaq Alpha UPC 2.0 and the Intrepid (SGI gcc UPC) compilers. This section<br />

only discusses the UPC-specific features of <strong>TotalView</strong>. It is not an introduction<br />

to the UPC Language. For an introduction to the UPC language, go<br />

to http://www.gwu.edu/~upc.<br />

When debugging UPC code, <strong>TotalView</strong> requires help from a UPC assistant library that<br />

your compiler vendor provides. You need to include the location of this library in your<br />

LD_LIBRARY_PATH environment variable. <strong>TotalView</strong> Technologies also provides assistants<br />

that you can use. You can find these assistants at http://www.totalviewtech.com/Products/<strong>TotalView</strong>/developers/index.html.<br />

Topics in this section are:<br />

� “Invoking <strong>TotalView</strong>” on page 158<br />

� “Viewing Shared Objects” on page 158<br />

� “Displaying Pointer to Shared Variables” on page 160<br />

Invoking <strong>TotalView</strong><br />

The way in which you invoke <strong>TotalView</strong> on a UPC program is straight-forward.<br />

However, this procedure depends on the computer upon which the<br />

program is executing:<br />

� When running on an SGI system using the gcc UPC compiler, invoke<br />

<strong>TotalView</strong> on your UPC program in the same way as you would invoke it<br />

on most other programs; for example:<br />

totalview prog_upc -a prog_upc_args<br />

� When running on Linux and HP Compaq SC computers, debug UPC code<br />

in the same way that you would debug other kinds of parallel code; for<br />

example:<br />

totalview prun -a -n node_count prog_upc prog_upc_args<br />

Viewing Shared Objects<br />

<strong>TotalView</strong> displays UPC shared objects, and fetches data from the UPC<br />

thread with which it has an affinity. For example, <strong>TotalView</strong> always fetches<br />

shared scalar variables from thread 0.<br />

The upper-left screen in Figure 108 on page 159 displays elements of a<br />

large shared array. You can manipulate and examine shared arrays the same<br />

as any other array. For example, you can slice, filter, obtain statistical information,<br />

and so on. (For more information on displaying array data, see<br />

Chapter 15, “Examining Arrays,” on page 333.) The lower-right screen shows<br />

a slice of this array.<br />

158 Chapter 7: Setting Up Parallel Debugging Sessions

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

Saved successfully!

Ooh no, something went wrong!