Search This Blog

Sunday, September 5, 2010

The Charm++ language

I chose Charm++ programming language as this week's subject for its distinct way on conciliate parallelism and object orientation. It's a parallel object-oriented programming language totally based on C++ and produced in the Parallel Programming Laboratory at the University of Illinois.

Charm++ has a message driven execution model based on concurrent objects called chares. These are distributed units of work that own data and methods to handle messages. Accessing remote data is an transparent action done in a "split-phase" manner. Instead of blocking while receiving a message, this approach is adopted to (when possible) simultaneously execute communication and computation.

Charm++ program's organization is different compared to C++. Modules define a program and each one is defined by a single file. It contains declarations and definitions of:
  • Messages
  • Chare classes
  • Branched chare classes
  • "Special" shared objects (Read-only, Write-once, Accumulator and Monotonic objects)
A message is a simple structure to hold data and possibly have two user-defined functions: pack and unpack. Chares are entities that act only when receive messages and for this reason no public member function is allowed. They are substituted by entry points that execute without interruption when a message is received by the object and cannot return values. The branched chare is almost as a chare replicated on every processor.

Here a simple example of a chare definition. An array of Hello objects compose hello module and has two entry points to act.

module hello {
array [1D] Hello {
entry Hello();
entry void sayHi(int);
};
};

After this brief summary we can discuss about some questions:

How chares are distributed?
A chare is created using the function new_chare(...) . The chare is initiated on some processor determined by a dynamic load balancing strategy. The programmer can choose different strategies or implement a new one.

Is it proper to HPC applications?
Even with a unusual computing model(message-driven) Charm++ gives opportunity to develop software with high parallelism. However, as discussed above load balancing is dynamic and automatic reducing control on distribution and possibly a bottleneck.

How messages are sent? Chare instantiation? And these "Special Objects"?
If you want to learn more about Charm++ take a look at this Tutorial.

See ya!

References
  1. L.V. Kale and Sanjeev Krishnan, CHARM++ : A Portable Concurrent Object Oriented System Based On C++, Proceedings of the Conference on Object Oriented Programming Systems, Languages and Applications, Sept-Oct 1993. ACM Sigplan Notes, Vol. 28, No. 10, pp. 91-108. (Also: Technical Report UIUCDCS-R-93-1796, March 1993, University of Illinois, Urbana, IL.) [Internal Report #93-2, March 93]

  2. L. V. Kale and Sanjeev Krishnan, Charm++: Parallel Programming with Message-Driven Objects, Book Chapter in "Parallel Programming using C++", by Gregory V. Wilson and Paul Lu. MIT Press, 1996. pp 175-213.

Friday, August 27, 2010

Parallel Object

Parallel Object. What this term may refer in the context of object-oriented programming languages?

A natural way to define a parallel object is to implicitly distribute parts of the object and give access to data without programmers' knowledge of its location, synchronization handled by the runtime system on a transparent way and in order to facilitate the programmer's experience its access syntax can be implemented as a shared-memory model on top of the underlying distributed system.

After this attempt to describe a parallel object a question arise: Is this definition proper to High Performance Computing(HPC)?

In my opinion, the answer is no. Spatial locality is critical on HPC applications. Reducing control beyond a certain level may reduce severely the expected performance and cause an almost invisible bottleneck. The programmer will need to know how the runtime execution distribute data and this "transparent" access will be useless at all. A different definition is needed...

This blog is an attempt to discuss about Parallel Object-Oriented Programming Languages. I will try to post something about this subject once a week. See ya.