Charm++

From Wikipedia, the free encyclopedia
Jump to: navigation, search
Charm++
Paradigm(s) Message-driven parallel programming, migratable objects, Object-oriented
Designed by Laxmikant Kale
Developer Gengbin Zheng, Wennie Shu, Kevin Nomura, Laxmikant Kale, Parallel Programming Laboratory
Appeared in late 1980s (late 1980s)
Stable release 6.5.0 / March 29, 2013; 15 months ago (2013-03-29)
Implementation language C++, Python, Structured Dagger (for coordination),
Platform Cray XK6, Cray XE6, Cray XT6, Cray XT5, Blue Gene L/P/Q, Infiniband, TCP, UDP, MPI
OS Linux, Windows, OS X
Website http://charm.cs.uiuc.edu/software

Charm++ is a parallel object-oriented programming language based on C++ and developed in the Parallel Programming Laboratory at the University of Illinois. Charm++ is designed with the goal of enhancing programmer productivity by providing a high-level abstraction of a parallel program while at the same time delivering good performance on a wide variety of underlying hardware platforms. Programs written in Charm++ are decomposed into a number of cooperating message-driven objects called chares. When a programmer invokes a method on an object, the Charm++ runtime system sends a message to the invoked object, which may reside on the local processor or on a remote processor in a parallel computation. This message triggers the execution of code within the chare to handle the message asynchronously.

Chares may be organized into indexed collections called chare arrays and messages may be sent to individual chares within a chare array or to the entire chare array simultaneously.

The chares in a program are mapped to physical processors by an adaptive runtime system. The mapping of chares to processors is transparent to the programmer, and this transparency permits the runtime system to dynamically change the assignment of chares to processors during program execution to support capabilities such as measurement-based load balancing, fault tolerance, automatic checkpointing, and the ability to shrink and expand the set of processors used by a parallel program.

The molecular dynamics simulation packages NAMD and OpenAtom are implemented using Charm++.

Adaptive MPI (AMPI)[1] is an implementation of the Message Passing Interface standard on top of the Charm++ runtime system and provides the capabilities of Charm++ in a more traditional MPI programming model. AMPI encapsulates each MPI process within a user-level migratable thread implemented as a Charm++ object. By embedding each thread with a chare, AMPI programs can automatically take advantage of the features of the Charm++ runtime system with little or no changes to the underlying MPI program.

History[edit]

Charm++ was developed at the Parallel Programming Laboratory, University of Illinois, by Wennie Shu and Kevin Nomura working with Laxmikant Kale. The second prototype was called Chare Kernel(2.0) was written by Manish Gupta. Charm(3.0) had significant design changes and was developed by a team consisting of Attila Gürsoy, Balkrishna Ramkumar, Amitabh B. Sinha, and Laxmikant Kale. A new translator was written by Nimish Shah. Sanjeev Krishnan made the Charm++ implementation. Charm(4.0) included Charm++. It was released in fall 1993. Charm(4.5) was developed by Attila Gürsoy, Sanjeev Krishnan, Milind Bhandarkar, Joshua Yelon, Narain Jagathesan, and Laxmikant Kale. The same team also developed Charm(4.8) that included Converse, a parallel runtime system that allows interoperability among modules that were written using different paradigms within a single application. After that, the Charm++ runtime system was re-targeted at Converse. Syntactic extensions in Charm++ were dropped, and a simple interface translator was developed (by Sanjeev Krishnan and Jay DeSouza), which became the Charm++ language. The version is 5.8 Revision 1 includes

  1. completely rewritten runtime system and the interface translator (done by Milind Bhandarkar).
  2. several new features such as Chare Arrays (developed by Robert Brunner and Orion Lawlor), and
  3. various libraries (written by Terry Wilmarth, Gengbin Zheng, Laxmikant Kale, Zehra Sura, Milind Bhandarkar, Robert Brunner, and Krishnan Varadarajan.)

After that, a coordination language “Structured Dagger” has been implemented on top of Charm++ by Milind Bhandarkar that was included in this version. Several features have also been added to Converse. Dynamic seed-based load balancing has been implemented (Terry Wilmarth and Joshua Yelon), a client-server interface for Converse programs, and debugging support has been added (Parthasarathy Ramachandran, Jeff Wright, and Milind Bhandarkar). Converse has been ported to new platforms including ASCI Red (Joshua Yelon), Cray T3E (Robert Brunner), and SGI Origin2000 (Milind Bhandarkar). There exists also a test suite for Charm++ developed by Michael Lang, Jackie Wang, and Fang Hu. Projections, the performance visualization and analysis tool, was redesigned and rewritten using Java by Michael Denardo. Orion Lawlor, Gengbin Zheng, and Milind Bhandarkar are responsible for changes to the system since the last release.[2]

Example[edit]

Here is some Charm++ code for demonstration purposes:[3]

Header file (hello.h)
#ifndef __HELLO_H__
#define __HELLO_H__
 
class Hello : public CBase_Hello {
 
 public:
 
  /// Constructors ///
  Hello();
  Hello(CkMigrateMessage *msg);
 
  /// Entry Methods ///
  void sayHi(int from);
};
 
#endif //__HELLO_H__
Interface file (hello.ci)
module hello {
 
  array [1D] Hello {
    entry Hello();
    entry void sayHi(int);
  };
 
};
Source file (hello.C)
#include "hello.decl.h"
 
#include "hello.h"
#include "main.decl.h"
 
extern /* readonly */ CProxy_Main mainProxy;
extern /* readonly */ int numElements;
 
Hello::Hello() {
  // Nothing to do when the Hello chare object is created.
  // This is where member variables would be initialized
  // just like in a C++ class constructor.
}
 
// Constructor needed for chare object migration (ignore for now)
// NOTE: This constructor does not need to appear in the ".ci" file
Hello::Hello(CkMigrateMessage *msg) { }
 
void Hello ::sayHi(int from) {
 
  // Have this chare object say hello to the user.
  CkPrintf("\"Hello\" from Hello chare # %d on "
           "processor %d (told by %d).\n",
           thisIndex, CkMyPe(), from);
 
  // Tell the next chare object in this array of chare objects
  // to also say hello. If this is the last chare object in
  // the array of chare objects, then tell the main chare
  // object to exit the program.
  if (thisIndex < (numElements - 1))
    thisProxy[thisIndex + 1].sayHi(thisIndex);
  else
    mainProxy.done();
}
 
#include "hello.def.h"

See also[edit]

References[edit]

  1. ^ [1]
  2. ^ "Charm++ Programming Language Manual". http://cs.illinois.edu/: University of Illinois at Urbana-Champaign, Department of Computer Science. Retrieved 2011-08-12. 
  3. ^ "Array "Hello World": A Slightly More Advanced "Hello World" Program: Array "Hello World" Code". http://charm.cs.uiuc.edu/: PPL - UIUC PARALLEL PROGRAMMING LABORATORY. Retrieved 2011-08-12. 

External links[edit]