Notes for Charm++/NAMD on the Cell

This document contains special notes regarding Charm++ on the Cell. Please note that the Cell ports of Charm++ and NAMD are still under heavy development. That said, enjoy...
Cell SDK
SDK Version 1.1
WARNING : No longer in use.

  • Download the SDK (v1.1) from IBM's website and follow the directions provided (under requirements).
  • Setup your PATH so it includes the compilers you wish to use.
  • SDK Version 1.0.1
    WARNING : No longer in use.

  • Download the SDK (v1.0.1) from IBM's website and follow the directions provided (under requirements).
  • Setup your PATH so it includes the compilers you wish to use.
  • The Offload API and Charm++ have been developed mainly using version 1.0.1 of the Cell Simulator (use this version or later). The following changes/fixes to the Cell SDK v1.0.1 have to be applied for the Offload API, and thus Charm++, to function correctly. Future versions of the Cell Simulator should have these fixes included.

     
  • Correction to "[cellSDKDir]/sysroot/usr/spu/include/stddef.h"

    Original Code New Code
    typedef char wchar_t; #ifndef __cplusplus
    typedef char wchar_t;
    #endif
  • Correction to "[cellSDKDir]/sysroot/usr/spu/include/stdio.h"

    Original Code New Code
    extern int rename(const char* old, const char* new); extern int rename(const char* src, const char* dest);
  • Correction to "[cellSDKDir]/src/lib/c/malloc_ls.c"... (make the correction and then do a make in the same directory as the file to apply the update to the libc library for the SPEs)

    Original Code New Code
    void malloc_ls_reinit()
    {
    int new_num_blocks;
    int i;

    /* recalculate the actual heap_size */
    heap_size = ...
    void malloc_ls_reinit()
    {
    int new_num_blocks;
    int i;

    if (is_first_time) {
    malloc_ls_init();
    return
    }

    /* recalculate the actual heap_size */
    heap_size = ...
  • If you are still having problems with the Cell SDK (in general), more notes are located on the Cell FAQ.
  • SDK Version 2.0 + 2.1
  • Download the SDK (v2.0) from IBM's website and follow the directions provided (under requirements).
  • Setup your PATH so it includes the compilers you wish to use.
  • Charm++
    The standard procedure for build Charm++ applies. Only the "charm++" target needs to be built for the Offload API to be compiled (not libs, etc.). The build process assumes that the specified compiler is located in your PATH.
  • The "Latest Version" of Charm++ source (updated nightly) can be downloaded here.
  • In [charmDir]/src/arch/net-linux-cell/conv-mach.sh, set CELL_SDK_DIR so it points to the location of your Cell SDK (that is, the directory containing the cbe_linux, sysroot, systemsim-cell-release, etc. directories).
  • Building Charm++: The target architecture is net-linux-cell.
    (Example build command: ./build charm++ net-linux-cell "-g" executed in [charmDir]. NOTE: The "-g" can be substituted for any compiler options supported by the specified compiler.)
  • Compiler Options: gcc (default), xlc (xlc is not fully implemented/tested yet)
    (example build command for xlc: ./build charm++ net-linux-cell xlc "-g")
  • The source code for example Charm++ programs are located under the [charmDir]/examples/charm++/cell directory. Currently, these Charm++ programs call the Offload API directly. To compile them, do so under [charmDir]/[targetArch]/examples/charm++/cell (where [targetArch] is the target architecture you built Charm++ with. i.e. - net-linux-cell).
  • Currently, the +netpoll option should be specified to charmrun when running Charm++ applications on multiple processors (for the net-linux-cell build). For example, use charmrun +p4 jacobi +netpoll to run the jacobi example program on four Cell processors.
  • ...Otherwise, follow normal directions for Charm++... Charm++ Website...
    NAMD
    WARNING : This is work in progress. These are mainly notes for myself at this point.
  • Target Architecture: Linux-Cell-g++, Linux-Cell-xlc (comming soon)
    (For the rest of these notes, it is assumed that Linux-Cell-g++ is the target architecture.)
  • In [namd2Dir]/arch/[targetArchitecture].arch, modify CELL_SDK_DIR to point to your Cell SDK directory (this directory should be the same as what it was for the Charm++ directions above).
  • In [namd2Dir]/Make.charm, set CHARMBASE to point to your Charm++ directory (this directory should match the location of [charmDir] in the directions for building Charm++ above).
  • Building FFTW:
  •   1) Get the FFTW v2.1.5 source code tar-file from the FFTW Website.
    (original link from here).
    2) Use the following configure command: ./configure --build=ppc --host=i386-linux --prefix=[fftwInstallDir] --enable-float --enable-type-prefix CC=ppu32-gcc
    (Note: This assumes the host you are building on has an x86 compatible processor and is running linux... otherwise, replace --host=i386-linux)
    3) Do a make install
    4) In [namd2Dir]/arch/Linux-Cell.fftw, set FFTDIR to point to the directory fftw was installed to (i.e. - what [fftwInstallDir] was set to in step 2 of "Building FFTW" above.
    ...Othewise, follow their directions...
  • Building TCL: (... comming soon ...)
  • Building NAMD: The configure command for Linux-Cell-g++ is ./config fftw Linux-Cell-g++ (executed in the [namd2Dir] directory).
  • Once configured, cd into the newly created [namd2]/Linux-Cell-g++ directory and do a make
  • ...Otherwise, follow normal directions... NAMD Website

    Last Updated: 1/12/2007 by David Kunzman