Educational N-body integrator with a shared but variable time step (the same for all particles but changing in time), using the Hermite integration scheme (Hut, P. & Makino, M, 2003 in The art of Computer Science). The source code has been adapted for a parallel ring algorithm using the MPI library.
Reader for nbody_sh1p a parallel direct N-body code
download latest source code of nbody_sh1p.tar.gzIf you use this code for your research we request you to refer to the following publication
Gualandris, A., Portegies Zwart, S., Tirado-Ramos, A., 2007, PARCO 33 159--173, Performance analysis of direct N-body algorithms for astrophysical sim ulations on distributed systems
nbody_sh1p.tar.gz contains the following files:
README This file Makefile Makefile (requires MPI) nbody_sh1p.C The main parallel N-body code. pipe.C Routines to circulate data around in a ring. This is all reasonably standard MPI In fact, it is standard MPE, but repeated here for consistency and independence (original version of pipe.C) pipe.h Header file for pipe.C n24body.in An example input file for a 24-particle system n24body.out Output for the example input file (run on a single processor).
Typical command line (generates : n24body.out)
% nbody_sh1p < n24body.in > n24body.out
28 November 2003
Simon Portegies Zwart
Version log:
Version 1.0: Initial development by Put & Makino on 1 Jan 2002
Version 2.0: Adopted for MPI by Portegies Zwart on 2 Okt 2003
Version 2.01: Added Comprehensible Makefile by Portegies Zwart on 25 July 2003
Initial performance and timing analysis.
![]()
Small timing test (perfomed by A. Gualandris) for 128, 256 and 512 particles with up to 32 processors on the Blue (Boewulf) linux cluster at SARA.
These tests were run for 10 N-body time units for a Plummer model and a King model with W0 = 12