#!/bin/sh
#
# A simple script to run the MIDPOINT code with various 
# numbers of particles and processors
# 
# Written by:
# -- 
# John L. Weatherwax                2006-11-13
# 
# email: wax@alum.mit.edu
# 
# Please send comments and especially bug reports to the
# above email address.
# 
#-----

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

#clear

# insure that the premissions of id_rsh are "secure enough":
chmod 600 /home/gridsan/wax/.ssh/id_rsa

# copy simulation run times into another directory for analysis: 
mv ParSimResults/parallel_timing_*.dat TimingResults/

# clean up the data directories: 
rm -f par_output.txt ParSimResults/*.dat ParSimResults/Binaries/*.dat

# A correct call to this function 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

# WWX: was last running this one ... 
#$$$ mpirun -np 4 ./midpoint.out  2 2 $NP $NT

# For MPIRUN:
#
#mpirun -np 9 ./midpoint.out 3 3 $NP $NT

# For the LLGrid scheduler:
#    
#bsub -a mpichp4_wrapper -n 4 mpirun.lsf "/home/gridsan/wax/Parallel_MD/Code/midpoint.out 2 2 $NP $NT"

#bsub -a mpichp4 -eo par_output.txt -n 4 mpirun.lsf "/home/gridsan/wax/Parallel_MD/Code/midpoint.out 2 2 27900 $NT"

#bsub -a mpichp4 -eo par_output.txt -n 9 mpirun.lsf "/home/gridsan/wax/Parallel_MD/Code/midpoint.out 3 3 12000 10"

#bsub -a mpichp4 -eo par_output.txt -n 16 mpirun.lsf "/home/gridsan/wax/Parallel_MD/Code/midpoint.out 4 4 6750 10"

bsub -a mpichp4 -eo par_output.txt -n 25 mpirun.lsf "/home/gridsan/wax/Parallel_MD/Code/midpoint.out 5 5 4320 10"

# too many processors requested: 
#bsub -a mpichp4 -eo par_output.txt -n 36 mpirun.lsf "/home/gridsan/wax/Parallel_MD/Code/midpoint.out 6 6 450 10"
#bsub -a mpichp4 -eo par_output.txt -n 49 mpirun.lsf "/home/gridsan/wax/Parallel_MD/Code/midpoint.out 7 7 450 10"
#bsub -a mpichp4 -eo par_output.txt -n 64 mpirun.lsf "/home/gridsan/wax/Parallel_MD/Code/midpoint.out 8 8 450 10"
#bsub -a mpichp4 -eo par_output.txt -n 81 mpirun.lsf "/home/gridsan/wax/Parallel_MD/Code/midpoint.out 9 9 450 10"
#bsub -a mpichp4 -eo par_output.txt -n 100 mpirun.lsf "/home/gridsan/wax/Parallel_MD/Code/midpoint.out 10 10 450 10"



