MPI Code Implementing the Midpoint Method for N-Body Particle Simulations

by John L. Weatherwax.

Introduction
This is code I have written implementing the Midpoint method, a parallelization algorithm for particle simulations. This algorithm was introduced in the paper:

The midpoint method for parallelization of particle simulations
The Journal of Chemical Physics 124, 184109 (2006),
by Kevin J. Bowers, Ron O. Dror, and David E. Shaw.

As I worked on this algorithm I keep a simple document outlining any questions I had, their answers, and any additional information I felt helpful to record. This document also helped me to remember what coding still needed to be finished when, due to other commitments, there were gaps in the time I had to work on this project. You will find this document below.

midpoint_discussion.pdf

Note that the code below is ordered roughly in the order in which it is called in the algorithm's main loop.

MPI Code Implementing the Midpoint Method for Particle Simulations:
    Core Routines: Data Structures Etc:
    • global_grid.h: data structure definition of the virtual processor grid
    • sim_consts.h: definition of the structure that holds the simulation constants
    Auxiliary Routines:
    • parseInputArgs.c: to extract command line arguments
    • saveBoxes.c: save boxes to disk for visualization
    • sub2ind.c: C versions of the Matlab command of the same name
    • ind2sub.c: C versions of the Matlab command of the same name
    Algorithm Verification/Debugging Routines: Scripts:
    • r_ps.sh: script to easily run both the serial and parallel version of the code.
    • run_mdpt.sh: script to run the parallel version of the code.
    • cmp_algos.sh: script to easily compare the outputs of the parallel and serial version of the code.
    • cmp_all_ts.sh: script to easily compare the outputs of the parallel and serial version of the code for all timesteps.
    • cmp_forces.sh: script to easily compare the force calculation between the parallel and serial version of the code.
    • cmp_all_forces.sh: script to easily compare the force calculation between the parallel and serial version of the code for all timesteps.
    • cmp_update.sh: script to easily compare the position update between the parallel and serial version of the code.
    • run_speed_up_timings.py: script to run the parallel and serial codes comparing runtimes needed for calculating algorithm speedup.

John Weatherwax
Last modified: Fri Oct 13 17:00:41 EDT 2006