#!/bin/sh
#
# A simple script to run the midpoint code with various 
# numbers of particles and processors and then to run the
# serial code computing the same thing
#
#-----

# the number of timesteps to run:
NTS=10
# the number of particles initialized in each processor: 
NP=1000

#--
# Run the parallel version:
#--

#clear

rm -f ParSimResults/*.dat ParSimResults/Binaries/*.dat

# A correct call to the function midpoint.out consists of:
# 
# mpirun -np NP ./midpoint.out Ms Ns NbPP Nts
#
# Ms = Ms number of processors in the Ms x Ns virtual processor grid
# Ns = Ns number of processors in the Ms x Ns virtual processor grid
# NbPP = number of bodies (particles) per processor
# Nts = number of timesteps

#mpirun -np 1 ./midpoint.out 1 1 10 1
#mpirun -np 2 ./midpoint.out 2 1 5 1
#mpirun -np 2 ./midpoint.out 1 2 100 1

#mpirun -np 4 ./midpoint.out 4 1 10 1
#mpirun -np 4 ./midpoint.out  1 4 10 1
#mpirun -np 4 ./midpoint.out  2 2 5000 5
mpirun -np 4 ./midpoint.out  2 2 $NP $NTS

#mpirun -np 9 ./midpoint.out  3 3 10 1

#--
# Run the serial version:
#--

rm -rf SerialVersion/SerSimResults/* SerialVersion/ParSimResults
cp -r ParSimResults SerialVersion/
cd SerialVersion
./sequential_short_range.out 4 $NTS


