-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsubmitanalysis
More file actions
executable file
·89 lines (80 loc) · 1.99 KB
/
Copy pathsubmitanalysis
File metadata and controls
executable file
·89 lines (80 loc) · 1.99 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# Bash executable
#!/bin/bash
# submitanalysis.sh submits all the analysis jobs to the cluster.
# First, it runs SetUpAnalysisMaster which creates all the analysis directories
# under the name AnalyzeMe*. Once the job it submitted, it moves them to
# Analyzed*. An Analyzed folder can in a running or finished state.
RunDirPath=/scratch/Users/mist7261/McHydro
HomeDir=`pwd`
# Pick out all the dirs that begin with 'AnalyzeMe'
DirStrName='AnalyzeMe'
LengthDirStr=${#DirStrName}
NewDirName='Analyzed'
### Display the job context
echo Running on host `hostname`
echo Time is `date`
echo Directory is `pwd`
# Variables from inputs
if [ $# -le 0 ]
then
echo "no jobname or mail flag given"
jobFlag=0;
mailFlag=0;
jobName=ab;
elif [ $# -eq 1 ]
then
jobFlag=1;
mailFlag=0;
jobName=$1;
echo "jobname is $jobName"
echo "no mail flag given"
else
jobFlag=1;
jobName=$1;
mailFlag=$2;
# Make sure you don't duplicate directories
echo "jobname is $jobName"
echo "mail flag=$mailFlag;"
fi
echo "Starting run"
echo "In dir `pwd` "
echo "Making all directories"
# Run matlab program
module load matlab_R2015b
matlab -nodesktop -nosplash \
-r "try, SetUpAnalyzeMaster, catch, exit(1), end, exit(0);"\
2>&1 | tee analdir.out
echo "Made Analysis dirs. Matlab exit code: $?"
cd $RunDirPath
echo "In dir `pwd` "
echo "Submitting jobs"
# For all the files that start with RunMe
for i in `ls | grep ^${DirStrName}`; do
# Get the file identifier
indstr=${i:${LengthDirStr}}
# Set new name
newname=${NewDirName}_${jobName}_${indstr}
# Move file
mv ./$i ./$newname
# cd in and submit
cd ${newname}
echo "In dir `pwd` "
# submit!
if [ $jobFlag -eq 1 ]
then
if [ $mailFlag -eq 0 ]
then
echo "qsub -N $jobName abPBSpando.sh"
qsub -N $jobName abPBSpando.sh
else
echo "qsub -N $jobName abMailPBSpando.sh"
qsub -N $jobName abMailPBSpando.sh
fi
else
echo "qsub abPBSpando.sh"
qsub abPBSpando.sh
fi
cd ../
done
echo "Submitted all jobs"
exit