-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathdistruns.sh
executable file
·157 lines (151 loc) · 5.02 KB
/
distruns.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
#!/bin/bash
dry="-"
nprocs="16 32 64 128 256"
nprocs="64"
cases=
trace="-"
op="potrf"
que="workq"; timelimit="06:00:00"
#que="debug"
if [ $# -eq 1 -o $# -eq 2 ]; then
cases=$1
if [ ! -f "$cases" ];then
echo "Cases file does not exist: $cases"
exit
else
. $cases
fi
if [ $# -eq 2 ]; then
dry=$2
fi
else
echo "Usage: $0 casesFile [dry]" 1>&2
exit
fi
cdir=`basename $PWD`
if [[ $cdir != "hicma-dev" ]]; then
echo "run this script in hicma-dev folder. The name of the current folder is: $cdir"
exit -1
fi
# numthreads=39 #skylake
numthreads=31 #shaheen
# numthreads="1 2 4 8 16 31" #shaheen
hn="$HOSTNAME"
if [[ "$hn" = xci* ]]; then
numthreads="16 32 60 61 62 63 64" #isambard
numthreads="63" #isambard
#numthreads="32 63" #isambard
fi
if [[ "$hn" = flamingo ]]; then
numthreads="55" #flamingo
fi
if [[ "$hn" = vulture ]]; then
numthreads="39" #flamingo
fi
if [[ "$hn" = shihab ]]; then
numthreads="35" #shihab
fi
if [[ "$hn" = jasmine ]]; then
numthreads="27" #jasmine
fi
if [[ "$hn" = kw60319 ]]; then
numthreads="27" #kw60319
fi
#que="debug"; timelimit="00:30:00"; echo "DEBUG DEBUG DEBUG DEBUG DEBUG "
for nodes in $nprocs; do
echo "#Number of nodes: $nodes ============================="
hn="$HOSTNAME"
if [[ "$hn" = xci* ]]; then
que="arm";
#cmdbatch="aprun -n $nodes -d 64 -j 1 "
cmdbatch="qsub -q $que -l select=$nodes -l walltime=$timelimit -j oe -N hicma-$nodes "
elif [[ "$hn" = flamingo ]]; then
cmdbatch=""
elif [[ "$hn" = shihab ]]; then
cmdbatch=""
elif [[ "$hn" = vulture ]]; then
cmdbatch=""
elif [[ "$hn" = jasmine ]]; then
cmdbatch=""
elif [[ "$hn" = kw60319 ]]; then
cmdbatch=""
else
cmdbatch="sbatch --parsable --nodes=$nodes --partition=$que --time=$timelimit --account=k1205 --job-name=hicma-$nodes " #shaheen
fi
echo "# $cmdbatch"
if [ "$dry" == "dry" ]; then
cmdbatch=""
fi
maxsubs[1]=500; minsubs[1]=250
maxsubs[2]=1000; minsubs[2]=500
maxsubs[3]=2000; minsubs[3]=1000
maxsubs[4]=4000; minsubs[4]=2000
maxsubs[5]=6000; minsubs[5]=3000
#for isub in 1 2 3 4 5;do
for isub in 0;do
#maxsub=${maxsubs[isub]}
#minsub=${minsubs[isub]}
sched="prio eager random ws lws dm dmda dmdar dmdas dmdasd heft pheft peager"
sched="prio"
#cases="exp/cases/cham32.txt"; startt=107; endt=108; step=200
#ids="`seq 1 5`"
#$cmdbatch exp/trial.sh $nodes $nodes 31 - cham - "$ids" $dry $cases "13:00:00" $que $sched $maxsub $minsub;continue
caseids=${allcaseids[$nodes]}
ncases=`echo "$caseids" | wc -w`
startt=0; endt=$((ncases-1));
echo -n "#`date` on $nodes nodes. $note - $prog - $cases "
echo -n \"$caseids\"
echo " $ncases ($startt-$endt-$step)"
ct=$startt
while [ $ct -le $endt ]; do
et=$((ct+step-1))
if [ $et -gt $endt ]; then
et=$endt
fi
#ids="`seq $ct $et`"
arrcaseids=($caseids)
ids=
for icase in `seq $ct $et`; do
ids="$ids ${arrcaseids[icase]}"
done
ct=$((ct+step))
echo "#case ids: $ids"
for nt in $numthreads; do
#if [[ "$hn" = xci* ]]; then
# cmdbatch2="$cmdbatch -o $PWD/exp/out/$prog-$nodes-$nt-$PBS_JOBID"
#fi
corespernode=$nt
maxsub=$((nodes*(corespernode+10)))
minsub=$((nodes*corespernode))
cmd="$PWD/exp/distmem.sh $nodes $nodes $nt $trace $prog - \"$ids\" $dry $PWD/$cases $timelimit $que $sched $maxsub $minsub $op"
if [ "$dry" == "dry" ]; then
eval $cmd
continue
fi
if [[ "$hn" = xci* ]]; then
cmd="$PWD/exp/distmem.sh $nodes $nodes $nt $trace $prog - \"$ids\" $dry $PWD/$cases $timelimit $que $sched $maxsub $minsub $op"
if [ "$dry" == "dry" ]; then
eval $cmd
continue
fi
jobid=$(echo $cmd | $cmdbatch)
echo "$jobid"
date=$(date '+%Y-%m-%d--%H-%M')
qalter -o $PWD/exp/out/$prog-$nodes-$nt--$date--$jobid $jobid
elif [[ "$hn" = flamingo ]]; then
eval $cmd
elif [[ "$hn" = shihab ]]; then
eval $cmd
elif [[ "$hn" = vulture ]]; then
eval $cmd
elif [[ "$hn" = jasmine ]]; then
eval $cmd
elif [[ "$hn" = kw60319 ]]; then
eval $cmd
else
$cmdbatch $PWD/exp/distmem.sh $nodes $nodes $nt $trace $prog - "$ids" $dry $cases $timelimit $que $sched $maxsub $minsub $op
fi
done
done
done
done