mpirun -np NN partree.exe Nbody_file Parameter_file Max_runtimewhere NN is the number of processors (must be 2^n i.e 1, 2, 4, 8, 16, 32 etc.)
On different systems, the number of processors may be specified in
different ways e.g. on the T3D, you would use
partree.exe -npes NN Nbody_file Parameter_file Max_runtimebut, on the T3E you would instead use
mpprun -nNN partree.exe etc.
The 3 command line arguments are:
Nbody_file - the nbody data for the run (see below)
Parameter_file - input parameters for the run (see below)
Max_runtime - maximum run time in seconds
After this time has elapsed the code will
finish the step its working on, output the data
and exit. This is useful on parallel batch
queues which have fixed time limits.
Max_runtime can be set to the time
limit minus 10 minutes or some other value so
the program will exit cleanly and dump the last
completed step before the time limit is reached.
fwrite(&m,sizeof(float),1,nbody_file_pointer);
fwrite(&x,sizeof(float),1,nbody_file_pointer);
fwrite(&y,sizeof(float),1,nbody_file_pointer);
fwrite(&z,sizeof(float),1,nbody_file_pointer);
fwrite(&vx,sizeof(float),1,nbody_file_pointer);
fwrite(&vy,sizeof(float),1,nbody_file_pointer);
fwrite(&vz,sizeof(float),1,nbody_file_pointer);
WARNING: On Dec Alpha’s and IBM’S the byte order for 4-byte IEEE floats is reversed (big_endian vs. little_endian or vice versa) so if you generate data on a DEC Alpha you will need to reverse the byte order from 1234 to 4321 for the data to be recognized on machines that use standard byte ordering for IEEE. The program swapbytes (src is swapbytes.c) will reorder the bytes for you, the NEMO program bswap does the same thing: bswap in=in_file out=out_file len=4
This file format is also rather simple. You are
allowed to assign different softening lengths to the particles if you wish.
The first nsoft1 particles get the length rsoft1, the second nsoft2
particles get rsoft2 etc. Here it is:
nparticles nsoftenings
nsoft1 rsoft1
nsoft2 rsoft2
nsoftn rsoftn
theta
nsteps stepnum
t dt dtout dtcheck
nbody_file_prefix
Where,
nparticles - number of particles
nsoftenings - number of particle softening lengths
nsofti - number of particles with the i’th softening length, rsofti
rsofti - the i’th softening length
theta - opening angle for the treecode
recommended values are 0.9 < theta < 1.2
smaller values give more accurate forces and longer runs
1.2 gives error in forces around 1%.
nsteps - number of steps
stepnum - current step number
t - current simulation time
dt - leapfrog timestep
dtout - output time interval
dtcheck - checkpoint output time interval (not used currently)
nbody_file_prefix - what it says
The file ‘‘Report’’ is also output and gives diagnostics of momentum and energy conservation of the code at each time step. Some sample output is
t 0 P -0.508763 0.808938 0.0532085 J 20.4152 -41.709 -113.745 be, ke, pe 2*ke/pe -19.8647
24.8928 -44.7575 -1.11234
t - current time
P - total system momentum (Px,Py,Pz)
J - total system angular momentum (Jx,Jy,Jz)
ke - total kinetic energy
pe - total potential energy
be - ke+pe - total binding energy - should be conserved
2*ke/pe - virial ratio - for virialized systems = -1.0
xx-mar-01 First Public Release within NEMO John Dubinski 26-apr-01 man page written for NEMO PJT