-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathwarp_starter.sh
executable file
·68 lines (56 loc) · 1.78 KB
/
warp_starter.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/sh
# A script to start my WARP job -- probably something from the DDIP pipeline
# hacked up by Tomasz Malisiewicz ([email protected])
# Run like: ./warp_starter.sh script_name 10 2
# Above command will run matlab sript script_name repeated
# 10 times taking up 2 cores per instance
#Logs are written to /lustre/${USER}/outputs/
# $Id: warp_starter.sh,v 1.4 2009/04/06 23:06:19 tmalisie Exp $
# $Date: 2009/04/06 23:06:19 $
# $Author: tmalisie $
# $Revision: 1.4 $
# DO NOT DISTRIBUTE OR I WILL FIND YOU
if [ ! -n "$1" ]
then
echo "Usage: " $0 " script_to_run REPEAT=1 PPN=2"
echo " script_to_run is MANDTORY"
exit
else
PROCSTRING=$1
echo "Running: " $PROCSTRING
fi
#the REPEAT is the number of times we will run this script
if [ ! -n "$2" ]
then
REPEAT=1
echo "Defaulting REPEAT to ${REPEAT}"
else
REPEAT=$2
fi
#set number of cores reserved per process (a PBS variable)
if [ ! -n "$3" ]
then
PPN=2
echo "Defaulting PPN to ${PPN}"
else
PPN=$3
fi
#use PBS to start the job REPEAT times
#-N gives the name so that qstat and showq will display this name
#nodes=1 means we are handling parallelization at the high level and run non-MPI jobs
#-e and -o are the stderr and stdout logs
#-eo means that they are joined
#-v passes a command line argument into warp_driver.sh (so the driver knows what to execute!)
LOGDIR=/lustre/${USER}/outputs/
if [ ! -d ${LOGDIR} ]; then
echo "Directory ${LOGDIR} not present, creating it"
mkdir $LOGDIR
fi
#LOGSTRING="-e ${LOGDIR} -o ${LOGDIR} -j oe"
LOGSTRING="-e ${LOGDIR} -o ${LOGDIR} -j oe"
#disable logging to try to increase performance
#LOGSTRING="-o /dev/null"
for i in `seq 1 ${REPEAT}`;
do
qsub -N ${PROCSTRING} -l nodes=1:ppn=${PPN} ${LOGSTRING} -v PROCSTRING=${PROCSTRING} warp_driver.sh
done