Subsections

2.2 Compiling BigSim Applications

CHARM++ provides a compiler script charmc to compile all programs. As will be described in this subsection, there are three methods to write a BigSim application: (a) using the low level machine API, (b) using CHARM++ or (c) using AMPI. Methods (b) and (c) are essentially used to obtain traces from the BigSim Emulator, such that one can use those traces in a post-mortem simulation as explained in Section [*].

2.2.1 Writing a BigSim application using low level machine API

The original goal of the low level machine API was to mimic the BlueGene/C low level programming API. It is defined in section 3. Writing a program in the low level machine API, one just needs to link CHARM++'s BigSim emulator libraries, which provide the emulation of the machine API using Converse as the communication layer.

In order to link against the BigSim library, one must specify -language bigsim as an argument to the charmc command, for example:

charmc -o hello hello.C -language bigsim

Sample applications in low level machine API can be found in the directory charm/examples/bigsim/emulator/.

2.2.2 Writing a BigSim application in Charm++

One can write a normal CHARM++ application which can automatically run on the BigSim Emulator after compilation. CHARM++ implements an object-based message-driven execution model. In CHARM++ applications, there are collections of C++ objects, which communicate by remotely invoking methods on other objects via messages.

To compile a program written in CHARM++ on the BigSim Emulator, one specifies -language charm++ as an argument to the charmc command:

charmc -o hello hello.C -language charm++
This will link both CHARM++ runtime libraries and BigSim Emulator libraries.

Sample applications in CHARM++ can be found in the directory charm/examples/bigsim, specifically charm/examples/bigsim/emulator/littleMD.

2.2.3 Writing a BigSim application in MPI

One can also write an MPI application for the BigSim Emulator. Adaptive MPI, or AMPI, is implemented on top of Charm++, supporting dynamic load balancing and multithreading for MPI applications. Those are based on the user-level migrating threads and load balancing capabilities provided by the CHARM++ framework. This allows legacy MPI programs to run on top of BigSim CHARM++ and take advantage of the CHARM++'s virtualization and adaptive load balancing capability.

Currently, AMPI implements most features in the MPI version 1.0, with a few extensions for migrating threads and asynchronous reduction.

To compile an AMPI application for the BigSim Emulator, one needs to link against the AMPI library as well as the BigSim CHARM++ runtime libraries by specifying -language ampi as an argument to the charmc command:

charmc -o hello hello.C -language ampi

Sample applications in AMPI can be found in the directory charm/examples/ampi, specifically charm/examples/ampi/pingpong.

November 23, 2009
Charm Homepage