forked from dmidk/Icepack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathicepack.batch.csh
executable file
·177 lines (152 loc) · 4.1 KB
/
icepack.batch.csh
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
#!/bin/csh -f
if ( $1 != "" ) then
echo "running icepack.batch.csh (creating ${1})"
else
echo "running icepack.batch.csh"
endif
source ./icepack.settings
source ${ICE_CASEDIR}/env.${ICE_MACHCOMP} || exit 2
set jobfile = $1
set ntasks = ${ICE_NTASKS}
set nthrds = ${ICE_NTHRDS}
set maxtpn = ${ICE_MACHINE_TPNODE}
set acct = ${ICE_ACCOUNT}
@ ncores = ${ntasks} * ${nthrds}
@ taskpernode = ${maxtpn} / $nthrds
@ nnodes = ${ntasks} / ${taskpernode}
if (${nnodes} * ${taskpernode} < ${ntasks}) @ nnodes = $nnodes + 1
set taskpernodelimit = ${taskpernode}
if (${taskpernodelimit} > ${ntasks}) set taskpernodelimit = ${ntasks}
@ corespernode = ${taskpernodelimit} * ${nthrds}
set ptile = $taskpernode
if ($ptile > ${maxtpn} / 2) @ ptile = ${maxtpn} / 2
set shortcase = `echo ${ICE_CASENAME} | cut -c1-15`
#==========================================
cat >! ${jobfile} << EOF0
#!/bin/csh -f
EOF0
#==========================================
if (${ICE_MACHINE} =~ cheyenne*) then
cat >> ${jobfile} << EOFB
#PBS -j oe
###PBS -m ae
#PBS -V
#PBS -q ${ICE_MACHINE_QUEUE}
#PBS -N ${ICE_CASENAME}
#PBS -A ${acct}
#PBS -l select=${nnodes}:ncpus=${corespernode}:mpiprocs=${taskpernodelimit}:ompthreads=${nthrds}
#PBS -l walltime=${ICE_RUNLENGTH}
EOFB
else if (${ICE_MACHINE} =~ hobart*) then
cat >> ${jobfile} << EOFB
#PBS -j oe
###PBS -m ae
#PBS -V
#PBS -q short
#PBS -N ${ICE_CASENAME}
#PBS -l nodes=1:ppn=24
EOFB
else if (${ICE_MACHINE} =~ izumi*) then
cat >> ${jobfile} << EOFB
#PBS -j oe
###PBS -m ae
#PBS -V
#PBS -q ${ICE_MACHINE_QUEUE}
#PBS -N ${ICE_CASENAME}
#PBS -l nodes=1:ppn=48
###PBS -l walltime=${ICE_RUNLENGTH}
### Give izumi a little more time for tests.
#PBS -l walltime=00:50:00
EOFB
else if (${ICE_MACHINE} =~ gordon* || ${ICE_MACHINE} =~ conrad* || ${ICE_MACHINE} =~ gaffney* || ${ICE_MACHINE} =~ koehr*) then
cat >> ${jobfile} << EOFB
#PBS -N ${shortcase}
#PBS -q ${ICE_MACHINE_QUEUE}
#PBS -A ${acct}
#PBS -l select=${nnodes}:ncpus=${maxtpn}:mpiprocs=${taskpernode}
#PBS -l walltime=${ICE_RUNLENGTH}
#PBS -j oe
###PBS -M username@domain.com
###PBS -m be
EOFB
else if (${ICE_MACHINE} =~ onyx*) then
cat >> ${jobfile} << EOFB
#PBS -N ${ICE_CASENAME}
#PBS -q ${ICE_MACHINE_QUEUE}
#PBS -A ${acct}
#PBS -l select=${nnodes}:ncpus=${maxtpn}:mpiprocs=${taskpernode}
#PBS -l walltime=${ICE_RUNLENGTH}
#PBS -j oe
###PBS -M username@domain.com
###PBS -m be
EOFB
else if (${ICE_MACHINE} =~ cori*) then
@ nthrds2 = ${nthrds} * 2
cat >> ${jobfile} << EOFB
#SBATCH -J ${ICE_CASENAME}
#SBATCH -A ${acct}
#SBATCH --qos shared
#SBATCH --ntasks ${ncores}
#SBATCH --time ${ICE_RUNLENGTH}
#SBATCH --cpus-per-task ${nthrds2}
#SBATCH --constraint haswell
###SBATCH -e filename
###SBATCH -o filename
###SBATCH --mail-type FAIL
###SBATCH --mail-user username@domain.com
EOFB
else if (${ICE_MACHINE} =~ compy*) then
cat >> ${jobfile} << EOFB
#SBATCH -J ${ICE_CASENAME}
#SBATCH -A ${acct}
#SBATCH --qos ${ICE_MACHINE_QUEUE}
#SBATCH --time ${ICE_RUNLENGTH}
#SBATCH --nodes ${nnodes}
#SBATCH --ntasks ${ntasks}
#SBATCH --cpus-per-task ${nthrds}
###SBATCH -e filename
###SBATCH -o filename
###SBATCH --mail-type FAIL
###SBATCH --mail-user username@domain.com
EOFB
else if (${ICE_MACHINE} =~ badger*) then
cat >> ${jobfile} << EOFB
#SBATCH -J ${ICE_CASENAME}
#SBATCH -t ${ICE_RUNLENGTH}
#SBATCH -A ${acct}
#SBATCH -N ${nnodes}
#SBATCH -e slurm%j.err
#SBATCH -o slurm%j.out
###SBATCH --mail-type END,FAIL
###SBATCH --mail-user=eclare@lanl.gov
#SBATCH --qos=standby
EOFB
else if (${ICE_MACHINE} =~ daley* || ${ICE_MACHINE} =~ banting* ) then
cat >> ${jobfile} << EOFB
#PBS -N ${ICE_CASENAME}
#PBS -j oe
#PBS -l select=${nnodes}:ncpus=${corespernode}:mpiprocs=${taskpernodelimit}:ompthreads=${nthrds}
#PBS -l walltime=${ICE_RUNLENGTH}
#PBS -W umask=022
EOFB
else if (${ICE_MACHINE} =~ high_Sierra*) then
cat >> ${jobfile} << EOFB
# nothing to do
EOFB
else if (${ICE_MACHINE} =~ testmachine*) then
cat >> ${jobfile} << EOFB
# nothing to do
EOFB
else if (${ICE_MACHINE} =~ travisCI*) then
cat >> ${jobfile} << EOFB
# nothing to do
EOFB
else if (${ICE_MACHINE} =~ conda*) then
cat >> ${jobfile} << EOFB
# nothing to do
EOFB
else
echo "${0} ERROR: ${ICE_MACHINE} unknown"
exit -1
endif
exit 0