Making progress with the Cell Broadband Engine

Changelog

Date Description
13-Feb-08 Basic instructions for running on CellBuzz; tutorial code.
30-Jan-08 Original posting

 

Introduction

Two STI Cell platforms are available in the course: The CellBuzz installation at the Georgia Institute of Technology, and a Sony PS3 known as Dark (dark.ucsd.edu), which is located in the CSE Department. To get an account on CellBuzz, go to the web site and fill in the on-line account request form. Contact Professor Baden if you need an account on Dark.

Getting started with CellBuzz

Login to the front end of CellBuzz at cell-user.cc.gt.atl.ga.us There is a User’s guide at http://wiki.cc.gatech.edu/cellbuzz/index.php/User_Guide

I’ve installed some code in ~baden/cse260_wi08, which used in a Cell workshop held at UCSD last May.

Not all the examples will compile on CellBuzz, but the following applications have been verified to run:

  • hello
  • SIMD (but versions 6 through 8 won’t yet compile)
  • Build the 3 versions of hello, and run: hello_ppu, hello_spu, hello_be1-sync as ./hello_ppu and so on. Run in interactive mode, which you enter by typing

    qsub -I

    Important: when you run in the interactive queue, you are locking down the resource for your exclusive use, so be mindful of others.

    To build the other applications, you’ll need to make a small patch to the last line of each Makefile (Be sure and look in the ppu and spu spu subdirectory). Replace the following line

    include $(CELL_TOP)/make.footer

    with the contents of the file ~baden/cse260_wi08/FixMakefile

    Some sample tutorial code is also located in

    /opt/ibm/cell-sdk/prototype/src/samples/tutorial/

    To get sdk materials compiling, you need to setup your ~/.cshrc, by making sure the first line is as follows. #!/bin/tcsh

    Also set up this enviroment variable

    setenv CELL_TOP /opt/ibm/cell-sdk/prototype/
    

    Lastly, do (or .tcshrc if you use tcsh).

    chmod +rx ~/.cshrc
    

    To get the simple tutorial running:

    cd ~
    mkdir tutorial
    cd tutorial
    cp -r /opt/ibm/cell-sdk/prototype/src/samples/tutorial/simple .
    cd simple
    

    Edit the Makefile and set

    INSTALL_DIR = ~/tutorial/simple
    

    Now, make should work.

    To run, start an interactive session by invoking qsub -I. Then cd into tutorial/simple and do ./simple

    There is a step by step spu-ization in /opt/ibm/cell-sdk/prototype/src/samples/tutorial/euler

    I’ve also installed a small application, Dot, that computes the dot product. This application illustrates the definition of control blocks, the use of DMA (with double buffering), vectorization, and various other details. Note that the Makefile includes references to the library and header file to libmisc which is needed to ensure that the aligned malloc and free are available.

    Examining the code, you’ll notice that spu threads are spawned a bit differently than in the provided examples. The control block is transmitted using mailboxes. Various other details differ as well. Choose a style that suits you. There are different ways of realizing the same goal.


    Where to look for documentation

    There is an extensive array of documentation, articles, and reading materials at the Cell Broadband Engine resource center (IBM). Within this site are two concise documents that will help you get started:

  • Programming the SPU in C/C++, handy article for getting the most out of the SPUs.
    Part 5 of the series Programming high-performance applications on the Cell BE processor.
  • 25 tips to optimal application performance, by Daniel Brokenshire.
  • Two other documents are also useful:

  • The Cell Primer is a handy document from MIT, with links to other resources.
  • Programming the Cell Processor, by Nicholas Blachford (2006), provides a high level view.
  • Lastly, here is a link to An introduction to the IDE for the Cell Broadband Engine SDK by Sean Curry at IBM.


    Other resources

  • Tutorial materials
  • IBM Cell Workshop, held at UC San Diego in May 2007. Slides and videos of the tutorials are also available for download.
  • Georgia Tech, Sony/Toshiba/IBM Workshop on Software and Applications for the Cell/B.E. processor, June 2007.
  • Additional resources from IBM include
  • The Cell project at IBM Research
  • "Cell Broadband Engine Technology and Systems", special issue of IBM J. of Research and Development, 51(5), 2007.
  • Programming the Cell Broadband Engine: Examples and Best Practices, a comprehensive "Red Book," (over 600 pages) with down-loadable example code
  • Cell Developer’s Corner
  • Cell Training Series (power.org)
  • Changes in libspe: How libspe2 affects Cell Broadband Engine programming (IBM Developerworks)

  • Using SDK3.0

    The current version of the Cell SDK is 3.0. CellBuzz runs with both 2.1 and 3.0; however, if you want to use 3.0 you must cross compile elsewhere and upload the executables to CellBuzz. A local installation has been set up on cseapel07.ucsd.edu. If you don’t have a CSE graduate student account, let me know.

    To run with 3.0 on Cellbuzz, specify the PBS argument -q cellq30. This will work interactively as well, i.e. qsub -I -q cellq30.

    Remember, you need to have a local installation of the SDK in order to compile.

    To determine which version of the SDK you are using, you must successfully run one of the commands:

    SDK2.x /opt/ibm/cell-sdk/prototype/cellsdk version
    SDK3.x /opt/cell/cellsdk --version

    Dark is currently running version 2.1, but we are in the process of upgrading it.


    Maintained by baden @ ucsd.
    edu   [ Wed Feb 13 22:17:13 PST 2008 ]