next up previous contents
Next: Related Work Up: Converse: A Message-Driven Runtime Previous: Language Implementations   Contents


An Application of Multilingual Programming

NAMD [47] is a parallel molecular dynamics simulation program being developed in collaboration with the Theoretical Biophysics group at the University of Illinois. NAMD simulates the motions of biological molecules by repeatedly computing the forces exerted by individual atoms on one another, and integrating the motion due to these forces over time. The original version of the program, NAMD 1 [61], was built using a message-driven design. However, since it needed to use the DPMTA [67] library for long-range electrostatic force computation, it had to be implemented using PVM. This haphazard mix of SPMD and message-driven code reduced the readability of the program. NAMD 2 [38] was conceived as a rewrite of the core parallel code to increase scalability and modifiability. Our experience with NAMD 1 led us to conclude that a message-driven design was appropriate for the parallel core code, but that adding threads to the design would allow the integration loop to be expressed as a loop construct, with occasional thread suspension to wait for data. We also observed that much of the startup code was easier to write in an SPMD style. Converse supports all of these programming paradigms.

Figure 2.6: NAMD 2 Architecture
\includegraphics[width=4in]{figures/namd}

The case for multilingual programming is vividly made by our design for the integration logic that is the core of NAMD 2. The simulation space is divided into cubical regions called patches, each of which can be simulated in parallel, requiring only information from neighboring patches. Each patch has an associated object called a sequencer, which is responsible for integrating the equations of motion for the atoms owned by the patch. The sequencer contains the code that, for each time step, sends out atom positions, retrieves the forces calculated for those positions, and then computes the positions at the next time. Each Charm++ object initially creates a sequencer in its own Converse thread. First, the sequencer sends atom positions to compute objects, Charm++ objects that actually perform the force computations. Then the sequencer suspends its thread. The receipt of the force messages from the last compute object causes the sequencer thread to awaken, and the forces are used to update the positions for the patch. The author of a particular sequencer code writes the logic as a loop, and the only attention he must pay to the parallel nature of the code is to insert the thread suspend calls in the correct places. Thus, one can implement a new integration algorithm without having to understand details of the parallel code. NAMD 2 components and the programming paradigms used for them are shown is figure 2.6.

Increased sequential and parallel efficiency makes the program faster and much more scalable than NAMD 1, indicating that a multilingual Converse program pays little or no price for programming convenience. NAMD 2 supports all the features of NAMD 1, plus several significant features which were never part of the original program, providing evidence of the improved modifiability of its multilingual design.


next up previous contents
Next: Related Work Up: Converse: A Message-Driven Runtime Previous: Language Implementations   Contents
Milind Bhandarkar 2002-06-12