30.01.2013 Views

TotalView Users Guide - CI Wiki

TotalView Users Guide - CI Wiki

TotalView Users Guide - CI Wiki

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Debugging IBM Cell Broadband Engine Programs<br />

the PPU and each SPU separately. For example, you can switch from one to<br />

another by diving on it in the Root Window.<br />

The PPU<br />

When debugging Cell programs, you need to be aware of the two different<br />

architectures as they have different behaviors. The PPU is a standard IBM<br />

Linux PowerPC. You interact with programs running on the PPU in exactly<br />

the same way as you interact with standard Linux PowerPC programs.<br />

As it is typical to run multiple Cell machines together, each PPU process<br />

running the same program is placed in one share group. If more than one<br />

executable is being run, each set of identical programs is placed in its own<br />

share group. All of these share groups are contained within one control<br />

group. The way in which <strong>TotalView</strong> groups processes and threads is identical<br />

to how it groups them on all other architectures.<br />

The SPU<br />

The programs running on the SPU are handled in a slightly different way. On<br />

other architectures, a share group only contains processes. On the Cell,<br />

<strong>TotalView</strong> places SPU threads that are running the same executable into<br />

separate share groups. That is, on SPUs, a share group contains threads,<br />

not processes. SPU share groups can contain SPU threads running on other<br />

Cells, and these Cells can be within the same blade or within blades in a<br />

cluster.<br />

Cell Programing<br />

While there are several ways to program the Cell, the primary method uses<br />

the front-end PPU to load programs into the SPUs.<br />

The SPU image can be embedded within the same executable that contains<br />

the PPU executable or it can be contained within shared libraries.<br />

PPU and SPU Executable Organization<br />

Typically, a Cell executable file is usually organized in one of the following<br />

ways:<br />

� The PPU executable file contains all code that runs on the PPU and SPUs.<br />

That is, the SPU executables are embedded within a PPU executable file<br />

or shared library.<br />

� The PPU executable file only contains the code that runs on the PPU. The<br />

SPU executable file opened at runtime by a PPU thread using a libspe/<br />

libspe2 function. The opened file is then loaded into the SPU using the<br />

same functions that load an embedded SPU image.<br />

� A combination of the previous two methods.<br />

In general, executing an SPU thread is a multi-step process. The PPU begins<br />

by create an SPE context. This context can be thought of as being a thread<br />

that is not running: it has an address space, registers, MFC state, and so<br />

on.) This thread has all memory, registers, and the like set to zero.<br />

140 Chapter 7: Setting Up Parallel Debugging Sessions

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

Saved successfully!

Ooh no, something went wrong!