CoMD
A Mini-app for Co-Design of Classical Molecular Dynamics.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Optimization Targets

Computation

The computational effort of classical MD is usually highly focused in the force kernel. The two force kernels supplied by CoMD are eamForce() and ljForce(). Both kernels are fundamentally loops over pairs of atoms with significant opportunity to exploit high levels of concurrency. One potential challenge when reordering or parallelizing the pair loop structure is preventing race conditions that result if two concurrent pair evaluations try to simultaneously increment the forces and energies on the same atom.

The supplied EAM kernel uses interpolation from tabular data to evaluate functions. Hence the interpolate() function is another potential optimization target. Note that the two potential files distributed with CoMD have very different sizes. The Adams potential (Cu_u6.eam) has 500 points per function in the table while the Mishin potential (Cu01.eam.alloy) has 10,000 points per function. This difference could potentially impact important details such as cache miss rates.

Communication

As the number of atoms per MPI rank decreases, the communication routines will start to require a significant fraction of the run time. The main communication routine in CoMD is haloExchange(). The halo exchange is simple nearest neighbor, point-to-point communication so it should scale well to practically any number of nodes.

The halo exchange in CoMD 1.1 is a very simple 6-direction structured halo exchange (see haloExchange.c). Other exchange algorithms can be implemented without much difficulty.

The halo exchange function is called in two very different contexts. The main usage is to exchange halo particle information (see initAtomHaloExchange()). This process is coordinated by the redistributeAtoms() function.

In addition to the atom exchange, when using the EAM potential, a halo exchange is performed in the force routine (see initForceHaloExchange()).