1 | #!/bin/bash |
---|
2 | |
---|
3 | # subjob - script for automatic generation and submission of batch-job files |
---|
4 | # for various batch queuing systems |
---|
5 | |
---|
6 | #--------------------------------------------------------------------------------# |
---|
7 | # This file is part of PALM. |
---|
8 | # |
---|
9 | # PALM is free software: you can redistribute it and/or modify it under the terms |
---|
10 | # of the GNU General Public License as published by the Free Software Foundation, |
---|
11 | # either version 3 of the License, or (at your option) any later version. |
---|
12 | # |
---|
13 | # PALM is distributed in the hope that it will be useful, but WITHOUT ANY |
---|
14 | # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
---|
15 | # A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
---|
16 | # |
---|
17 | # You should have received a copy of the GNU General Public License along with |
---|
18 | # PALM. If not, see <http://www.gnu.org/licenses/>. |
---|
19 | # |
---|
20 | # Copyright 1997-2014 Leibniz Universitaet Hannover |
---|
21 | #--------------------------------------------------------------------------------# |
---|
22 | # |
---|
23 | # Current revisions: |
---|
24 | # ------------------ |
---|
25 | # |
---|
26 | # |
---|
27 | # Former revisions: |
---|
28 | # ----------------- |
---|
29 | # $Id: subjob 2135 2017-02-02 07:35:41Z gronemeier $ |
---|
30 | # |
---|
31 | # 2134 2017-02-02 07:33:46Z raasch |
---|
32 | # option -E added to msub commands on HLRN-III machines to allow output of more |
---|
33 | # job informations in the job protocol files |
---|
34 | # |
---|
35 | # 1944 2016-06-15 06:29:00Z raasch |
---|
36 | # adjustments for using HLRN ssh-keys |
---|
37 | # |
---|
38 | # 1940 2016-06-14 05:15:20Z raasch |
---|
39 | # adjustments for lckiaps |
---|
40 | # |
---|
41 | # 1866 2016-04-15 06:50:59Z raasch |
---|
42 | # adjusted for lcocean |
---|
43 | # |
---|
44 | # 1841 2016-04-07 19:14:06Z raasch |
---|
45 | # script now running under bash |
---|
46 | # |
---|
47 | # 1701 2015-11-02 07:43:04Z maronga |
---|
48 | # Bugfix: added missing init_cmds for lccrayh/lccrayb |
---|
49 | # |
---|
50 | # 1621 2015-07-17 11:39:33Z heinze |
---|
51 | # adjustments for Mistral at DKRZ Hamburg (lcbullhh) |
---|
52 | # |
---|
53 | # 1575 2015-03-27 09:56:27Z raasch |
---|
54 | # mpp2-queues added to lccrayh |
---|
55 | # |
---|
56 | # 1547 2015-01-29 15:09:12Z witha |
---|
57 | # adjustments for ForWind computing cluster (lcflow) |
---|
58 | # |
---|
59 | # 1545 2015-01-29 06:52:23Z heinze |
---|
60 | # local host name for blizzard further specified |
---|
61 | # |
---|
62 | # 1480 2014-10-17 14:41:49Z raasch |
---|
63 | # adjustments for 2nd stage of HLRNIII |
---|
64 | # |
---|
65 | # 1468 2014-09-24 14:06:57Z maronga |
---|
66 | # Typo removed (addres->address) |
---|
67 | # Adjustments for lcxe6 |
---|
68 | # |
---|
69 | # 1452 2014-08-22 09:41:06Z heinze |
---|
70 | # local hosts for blizzard added |
---|
71 | # |
---|
72 | # 1450 2014-08-21 07:31:51Z heinze |
---|
73 | # HLRN-III (lccrayb): testq queue adjusted to mpp1testq |
---|
74 | # |
---|
75 | # 1442 2014-07-28 07:09:10Z raasch |
---|
76 | # HLRN-III (lccrayb/lccrayh) queues adjusted |
---|
77 | # |
---|
78 | # 1378 2014-04-28 06:04:58Z raasch |
---|
79 | # -et option added for lctit |
---|
80 | # |
---|
81 | # 1350 2014-04-04 13:01:30Z maronga |
---|
82 | # location of qsub updated for lcxe6 |
---|
83 | # |
---|
84 | # 1289 2014-03-04 07:12:34Z raasch |
---|
85 | # German comments translated to English |
---|
86 | # fimm-, necriam-, scirocco-, ibmy-, and sgi-specific code removed |
---|
87 | # |
---|
88 | # 1279 2014-01-28 12:10:14Z raasch |
---|
89 | # node calculation modified due to changes in mrun (tasks_per_node must not be |
---|
90 | # an integral divisor of numprocs any more) |
---|
91 | # |
---|
92 | # 1274 2014-01-09 13:14:54Z heinze |
---|
93 | # adjustments for lccrayh |
---|
94 | # |
---|
95 | # 1266 2013-12-11 12:07:34Z heinze |
---|
96 | # further adjustments for lccrayb (use msub instead of qsub) |
---|
97 | # |
---|
98 | # 1264 2013-12-09 12:46:09Z fricke |
---|
99 | # Bugfix: Using number of nodes instead of number of processors (lccrayb) |
---|
100 | # |
---|
101 | # 1262 2013-12-09 10:57:20Z fricke |
---|
102 | # further adjustments for lccrayb |
---|
103 | # |
---|
104 | # 1260 2013-12-04 12:48:04Z raasch |
---|
105 | # jaboticaba admitted |
---|
106 | # |
---|
107 | # 1255 2013-11-07 14:43:35Z raasch |
---|
108 | # further adjustments for lccrayb |
---|
109 | # |
---|
110 | # 1224 2013-09-16 07:27:23Z raasch |
---|
111 | # first adjustments for lccrayb |
---|
112 | # |
---|
113 | # 1202 2013-07-10 16:22:07Z witha |
---|
114 | # adjustments for Forwind cluster (lcflow) |
---|
115 | # |
---|
116 | # 1199 2013-07-05 14:52:22Z raasch |
---|
117 | # adjustments for CSC Helsinki (lccrayf) |
---|
118 | # |
---|
119 | # use of cluster/express queue enabled (ibmh) |
---|
120 | # vinessa added (imuk) |
---|
121 | # |
---|
122 | # 1103 2013-02-20 02:15:53Z raasch |
---|
123 | # bash compatibility adjustments (usage of OPTIND, output formatting with printf |
---|
124 | # instead typeset -L/R), |
---|
125 | # further adjustments for lckyuh |
---|
126 | # |
---|
127 | # 2013-02-10 01:47:43Z raasch |
---|
128 | # adjustments for Kyushu-Univeristy computing center (lckyuh - hayaka) |
---|
129 | # and for Forwind cluster (lcflow) |
---|
130 | # |
---|
131 | # 1094 2013-02-03 01:52:12Z raasch |
---|
132 | # new option -P for explicit setting of ssh/scp port, |
---|
133 | # decalpha parts (yonsei) removed |
---|
134 | # |
---|
135 | # 2013-02-02 07:06:13Z raasch |
---|
136 | # adjustments for Kyushu-University computing center (lckyut - tatara) |
---|
137 | # old changelog messages removed |
---|
138 | # |
---|
139 | # 1046 2012-11-09 14:38:45Z maronga |
---|
140 | # code put under GPL (PALM 3.9) |
---|
141 | # |
---|
142 | # 08/07/94 - Siggi - first version finished |
---|
143 | # 29/06/94 - Siggi - script development started |
---|
144 | #--------------------------------------------------------------------------------# |
---|
145 | # subjob - script for automatic generation and submission of batch-job files |
---|
146 | # for various batch queuing systems |
---|
147 | #--------------------------------------------------------------------------------# |
---|
148 | |
---|
149 | |
---|
150 | # VARIABLE-DECLARATIONS AND DEFAULT VALUES |
---|
151 | delete_dayfile=false |
---|
152 | email_notification=none |
---|
153 | group_number=none |
---|
154 | locat=normal |
---|
155 | no_default_queue=none |
---|
156 | no_submit=false |
---|
157 | job_catalog="~/job_queue" |
---|
158 | job_name=none |
---|
159 | local_user=$LOGNAME |
---|
160 | node_usage=shared |
---|
161 | numprocs=0 |
---|
162 | punkte="..........................................................." |
---|
163 | submcom=qsub |
---|
164 | queue=default |
---|
165 | remote_host=none |
---|
166 | remote_user="" |
---|
167 | verify=true |
---|
168 | |
---|
169 | typeset -i cputime=0 memory=0 Memory=0 minuten resttime sekunden stunden |
---|
170 | typeset -i numprocs mpi_tasks=0 nodes=0 processes_per_node=0 tasks_per_node=0 threads_per_task=1 |
---|
171 | |
---|
172 | |
---|
173 | |
---|
174 | # ERROR HANDLING |
---|
175 | # IN CASE OF EXIT: |
---|
176 | trap 'if [[ $locat != normal ]] |
---|
177 | then |
---|
178 | case $locat in |
---|
179 | (option) printf "\n --> available optios can be displayed" |
---|
180 | printf " by typing:" |
---|
181 | printf "\n \"subjob ?\" \n";; |
---|
182 | (ftpcopy|parameter|scp|verify) printf "\n";; |
---|
183 | (*) printf "\n +++ unknown error" |
---|
184 | printf "\n please inform S. Raasch!\n" |
---|
185 | esac |
---|
186 | [[ -f $job_to_send ]] && rm $job_to_send |
---|
187 | printf "\n\n+++ SUBJOB killed \n\n" |
---|
188 | fi' exit |
---|
189 | |
---|
190 | |
---|
191 | # IN CASE OF TERMINAL-BREAK: |
---|
192 | trap '[[ -f $job_to_send ]] && rm $job_to_send |
---|
193 | printf "\n\n+++ SUBJOB killed \n\n" |
---|
194 | exit |
---|
195 | ' 2 |
---|
196 | |
---|
197 | |
---|
198 | # DETERMINE NAME OF LOCAL HOST |
---|
199 | local_host=$(hostname) |
---|
200 | |
---|
201 | # SET HOST-SPECIFIC VARIABLES VEREINBAREN (CHECK, IF LOCAL HOST |
---|
202 | # IS ADMITTED AT ALL) |
---|
203 | # NOTE: ONE OF THE ENTRIES FOR "lck" OR "lckordi" ALWAYS HAS TO BE |
---|
204 | # COMMENT OUT, BECAUSE THE HOSTNAME (node*) IS SAME FOR BOTH MACHINES |
---|
205 | case $local_host in |
---|
206 | (ambiel-lx) local_address=134.106.74.48; local_host=lcfor;; |
---|
207 | (atmos) local_address=172.20.25.35; local_host=lcide;; |
---|
208 | (austru) local_address=130.75.105.128; local_host=lcmuk;; |
---|
209 | (autan) local_address=130.75.105.57; local_host=lcmuk;; |
---|
210 | (bora) local_address=130.75.105.103; local_host=lcmuk;; |
---|
211 | (b04*) local_address=133.5.4.33; local_host=lckyuh;; |
---|
212 | (blizzard1|p0*|p1*|p2*|p3*|p4*|p5*|p6*|p7*|p8*|p9*) local_address=136.172.40.15; local_host=ibmh;; |
---|
213 | (blizzard2|p0*|p1*|p2*|p3*|p4*|p5*|p6*|p7*|p8*|p9*) local_address=136.172.40.16; local_host=ibmh;; |
---|
214 | (blogin*|bxc*) local_address=130.73.233.1; local_host=lccrayb;; |
---|
215 | (hlogin*|hxc*) local_address=130.75.4.1; local_host=lccrayh;; |
---|
216 | (breva) local_address=130.75.105.98; local_host=lcmuk;; |
---|
217 | (buran) local_address=130.75.105.58; local_host=lcmuk;; |
---|
218 | (caurus) local_address=130.75.105.19; local_host=lcmuk;; |
---|
219 | (climate*) local_address=165.132.26.68; local_host=lcyon;; |
---|
220 | (clogin*) local_address=86.50.166.21; local_host=lccrayf;; |
---|
221 | (cs*) local_address=136.172.44.131; local_host=nech;; |
---|
222 | (elephanta) local_address=130.75.105.6; local_host=lcmuk;; |
---|
223 | (flow01) local_address=10.141.255.71; local_host=lcflow;; |
---|
224 | (flow02) local_address=10.141.255.72; local_host=lcflow;; |
---|
225 | (node*) local_address=165.132.26.61 local_host=lck;; |
---|
226 | # (node*) local_address=210.219.61.8 local_host=lckordi;; |
---|
227 | (gaia*) local_address=150.183.146.24; local_host=ibmkisti;; |
---|
228 | (gallego) local_address=130.75.105.10; local_host=lcmuk;; |
---|
229 | (gregale) local_address=130.75.105.109; local_host=lcmuk;; |
---|
230 | (hababai) local_address=130.75.105.108; local_host=lcmuk;; |
---|
231 | (hayaka*) local_address=133.5.4.33; local_host=lckyuh;; |
---|
232 | (hexagon.bccs.uib.no) local_address=129.177.20.113; local_host=lcxe6;; |
---|
233 | (hx*) local_address=133.3.51.11; local_host=lckyoto;; |
---|
234 | (inferno) local_address=130.75.105.5; local_host=lcmuk;; |
---|
235 | (irifi) local_address=130.75.105.104; local_host=lcmuk;; |
---|
236 | (jaboticaba) local_address=150.163.25.181; local_host=lcbr;; |
---|
237 | (sno) local_address=130.75.105.113; local_host=lcmuk;; |
---|
238 | (levanto) local_address=130.75.105.45; local_host=lcmuk;; |
---|
239 | (login*) local_address=118.128.66.201; local_host=lckiaps;; |
---|
240 | (maestro) local_address=130.75.105.2; local_host=lcmuk;; |
---|
241 | (meller) local_address=134.106.74.155; local_host=lcfor;; |
---|
242 | (meteo-login*) local_address=193.166.211.144;local_host=lcxt5m;; |
---|
243 | (mlogin1*|m1*) local_address=136.172.50.13; local_host=lcbullhh;; |
---|
244 | (hexagon*) local_address=129.177.20.113; local_host=lcxe6;; |
---|
245 | (nobel*) local_address=150.183.5.101; local_host=ibms;; |
---|
246 | (ocean) local_address="ocean"; local_host=lcocean;; |
---|
247 | (orkan) local_address=130.75.105.3; local_host=lcmuk;; |
---|
248 | (ostria) local_address=130.75.105.106; local_host=lcmuk;; |
---|
249 | (paesano) local_address=130.75.105.46; local_host=lcmuk;; |
---|
250 | (pcj*) local_address=172.31.120.1; local_host=lckyut;; |
---|
251 | (pingui) local_address=134.106.74.118; local_host=lcfor;; |
---|
252 | (quanero) local_address=130.75.105.107; local_host=lcmuk;; |
---|
253 | (rte*) local_address=133.5.185.60; local_host=lcrte;; |
---|
254 | (schultzl-Latitude-E6540) local_address="schultzl-Latitude-E6540"; local_host=lcsch;; |
---|
255 | (shiokaze-lx) local_address=134.106.74.123; local_host=lcfor;; |
---|
256 | (sisu-login*) local_address=86.50.166.21; local_host=lccrayf;; |
---|
257 | (solano) local_address=130.75.105.110; local_host=lcmuk;; |
---|
258 | (sugoka*) local_address=172.31.120.1; local_host=lckyut;; |
---|
259 | (tc*) local_address="ocean"; local_host=lcocean;; |
---|
260 | (t2a*) local_address=10.1.6.165; local_host=lctit;; |
---|
261 | (urban*) local_address=147.46.30.151 local_host=lcsb;; |
---|
262 | (vinessa) local_address=130.75.105.112; local_host=lcmuk;; |
---|
263 | (vorias) local_address=172.20.25.43; local_host=lcmuk;; |
---|
264 | (*.cc.kyushu-u.ac.jp) local_address=133.5.4.129; local_host=ibmku;; |
---|
265 | (*) printf "\n +++ \"$local_host\" unknown"; |
---|
266 | printf "\n please contact the PALM group at IMUK"; |
---|
267 | locat=parameter; exit;; |
---|
268 | esac |
---|
269 | |
---|
270 | |
---|
271 | |
---|
272 | # BY DEFAULT, THE REMOTE HOST IS THE LOCAL HOST |
---|
273 | remote_host=$local_host |
---|
274 | |
---|
275 | |
---|
276 | |
---|
277 | |
---|
278 | # READ THE SHELLSCRIPT-OPTIONS |
---|
279 | while getopts :c:dDe:g:h:m:n:N:O:P:q:t:T:u:vX: option |
---|
280 | do |
---|
281 | case $option in |
---|
282 | (c) job_catalog=$OPTARG;; |
---|
283 | (d) delete_dayfile=true;; |
---|
284 | (D) no_submit=true;; |
---|
285 | (e) email_notification=$OPTARG;; |
---|
286 | (g) group_number=$OPTARG;; |
---|
287 | (h) remote_host=$OPTARG;; |
---|
288 | (m) memory=$OPTARG;; |
---|
289 | (n) job_name=$OPTARG;; |
---|
290 | (N) node_usage=$OPTARG;; |
---|
291 | (O) threads_per_task=$OPTARG;; |
---|
292 | (P) scp_port=$OPTARG;; |
---|
293 | (q) no_default_queue=$OPTARG;; |
---|
294 | (t) cputime=$OPTARG;; |
---|
295 | (T) tasks_per_node=$OPTARG;; |
---|
296 | (u) remote_user=$OPTARG;; |
---|
297 | (v) verify=false;; |
---|
298 | (X) numprocs=$OPTARG;; |
---|
299 | (\?) printf "\n +++ Option $OPTARG unknown \n"; |
---|
300 | locat=option; exit;; |
---|
301 | esac |
---|
302 | done |
---|
303 | |
---|
304 | |
---|
305 | # GET THE NAME OF THE JOBFILE AS NEXT ARGUMENT |
---|
306 | (( to_shift = $OPTIND - 1 )) |
---|
307 | shift $to_shift; file_to_send=$1 |
---|
308 | |
---|
309 | |
---|
310 | # OUTPUT OF SHORT DESCRIPTION OF SCRIPT-OPTIONS |
---|
311 | if [ "$1" = "?" ] |
---|
312 | then |
---|
313 | (printf "\n *** subjob can be called as follows:\n" |
---|
314 | printf "\n subjob -c.. -d -D -h.. -m.. -q.. -t.. -u.. -v <jobfile>\n" |
---|
315 | printf "\n Description of available options:\n" |
---|
316 | printf "\n Option Description Default-Value" |
---|
317 | printf "\n -c job-input- and output-catalog ~/job_queue" |
---|
318 | printf "\n -d no job-protocol will be created ---" |
---|
319 | printf "\n -D only the job-file will be created ---" |
---|
320 | printf "\n -h execution host, available hosts: $remote_host" |
---|
321 | printf "\n ibm, ibmh, ibmkisti, ibmku, ibms, lc...," |
---|
322 | printf "\n lckiaps, lctit, nech" |
---|
323 | printf "\n -m memory demand per process in MByte ---" |
---|
324 | printf "\n -n jobname <jobdatei>" |
---|
325 | printf "\n -O threads per task (for OpenMP usage) 1" |
---|
326 | printf "\n -P ssh/scp port default port" |
---|
327 | printf "\n -q job-queue to be used default" |
---|
328 | printf "\n -t allowed cpu-time in seconds ---" |
---|
329 | printf "\n -T tasks per node (on parallel hosts) ---" |
---|
330 | printf "\n -u username on execution host from .netrc" |
---|
331 | printf "\n -v no prompt for confirmation ---" |
---|
332 | printf "\n -X # of processors (on parallel hosts) 1" |
---|
333 | printf "\n " |
---|
334 | printf "\n The only possible positional parameter is <jobfile>:" |
---|
335 | printf "\n The complete NQS-job must be provided here." |
---|
336 | printf "\n <jobfile>=? creates this outline\n\n") | more |
---|
337 | exit |
---|
338 | fi |
---|
339 | |
---|
340 | |
---|
341 | |
---|
342 | # CHECK, IF JOB-FILE HAS BEEN GIVEN AS ARGUMENT AND IF THE FILE ITSELF EXISTS |
---|
343 | if [[ "$file_to_send" = "" ]] |
---|
344 | then |
---|
345 | printf "\n +++ job-file missing" |
---|
346 | locat=parameter; exit |
---|
347 | else |
---|
348 | if [[ -f $file_to_send ]] |
---|
349 | then |
---|
350 | true |
---|
351 | else |
---|
352 | printf "\n +++ job-file: " |
---|
353 | printf "\n $file_to_send" |
---|
354 | printf "\n does not exist" |
---|
355 | locat=parameter; exit |
---|
356 | fi |
---|
357 | fi |
---|
358 | |
---|
359 | |
---|
360 | |
---|
361 | # IF NO JOBNAME HAS BEEN GIVEN, JOBNAME IS SET TO THE NAME OF THE JOB-FILE, |
---|
362 | # PROVIDED THAT THE JOB-FILE NAME DOES NOT CONTAIN ANY PATH |
---|
363 | if [[ $job_name = none ]] |
---|
364 | then |
---|
365 | job_name=$file_to_send |
---|
366 | fi |
---|
367 | if [[ $(echo $job_name | grep -c "/") != 0 ]] |
---|
368 | then |
---|
369 | printf "\n +++ job-file name: " |
---|
370 | printf "\n $job_name" |
---|
371 | printf "\n must not contain \"/\"-characters" |
---|
372 | locat=parameter; exit |
---|
373 | fi |
---|
374 | |
---|
375 | |
---|
376 | |
---|
377 | |
---|
378 | # SET HOST-SPECIFIC QUANTITIES, OR TERMINATE IN CASE OF UNKNOWN HOST, |
---|
379 | # OR IF NO HOST HAS BEEN GIVEN |
---|
380 | if [[ $remote_host = none ]] |
---|
381 | then |
---|
382 | printf "\n +++ host missing" |
---|
383 | locat=option; exit |
---|
384 | else |
---|
385 | case $remote_host in |
---|
386 | (ibm) queue=p690_standard; remote_address=134.76.99.81; submcom=/usr/lpp/LoadL/full/bin/llsubmit;; |
---|
387 | (ibmh) queue=cluster; remote_address=136.172.40.15; submcom=/usr/lpp/LoadL/full/bin/llsubmit;; |
---|
388 | (ibmkisti) queue=class.32plus; remote_address=150.183.146.24; submcom=/usr/lpp/LoadL/full/bin/llsubmit;; |
---|
389 | (ibmku) queue=s4; remote_address=133.5.4.129; submcom=/usr/local/bin/llsubmit;; |
---|
390 | (ibms) queue=p_normal; remote_address=150.183.5.101; submcom=/usr/lpp/LoadL/full/bin/llsubmit;; |
---|
391 | (lcbullhh) queue=compute; remote_address=136.172.50.13; submcom=/usr/bin/sbatch;; |
---|
392 | (lccrayb) queue=mpp1testq; remote_address=130.73.233.1; submcom="/opt/moab/default/bin/msub -E";; |
---|
393 | (lccrayh) queue=mpp1testq; remote_address=130.75.4.1; submcom="/opt/moab/default/bin/msub -E";; |
---|
394 | (lccrayf) queue=small; remote_address=86.50.166.21; submcom=/opt/slurm/default/bin/sbatch;; |
---|
395 | (lcflow) remote_address=10.140.1.72; submcom=qsub;; |
---|
396 | (lckyoto) remote_address=133.3.51.11; submcom=/thin/local/bin/qsub;; |
---|
397 | (lck) remote_address=165.132.26.61; submcom=/usr/torque/bin/qsub;; |
---|
398 | (lckiaps) remote_address=118.128.66.201; submcom=/opt/pbs/default/bin/qsub;; |
---|
399 | (lckordi) remote_address=210.219.61.8; submcom=/usr/torque/bin/qsub;; |
---|
400 | (lckyuh) remote_address=133.5.4.33; submcom=/usr/bin/pjsub;; |
---|
401 | (lckyut) remote_address=133.5.4.37; submcom=/usr/bin/pjsub;; |
---|
402 | (lcocean) remote_address="ocean"; submcom=qsub;; |
---|
403 | (lcsb) remote_address=147.46.30.151; submcom=/usr/torque/bin/qsub;; |
---|
404 | (lctit) queue=S; remote_address=10.1.6.165; submcom=/opt/pbs/tools/bin/t2sub;; |
---|
405 | (lcxe6) remote_address=129.177.20.113; submcom=/opt/torque/default/bin/qsub;; |
---|
406 | (lcxt5m) remote_address=193.166.211.144; submcom=/opt/pbs/10.1.0.91350/bin/qsub;; |
---|
407 | (lcyon) remote_address=165.132.26.68; submcom=/usr/torque/bin/qsub;; |
---|
408 | (nech) qsubmem=memsz_job; qsubtime=cputim_job; remote_address=136.172.44.147; submcom="/usr/local/bin/qsub";; |
---|
409 | (*) printf "\n +++ hostname \"$remote_host\" not allowed"; |
---|
410 | locat=parameter; exit;; |
---|
411 | esac |
---|
412 | fi |
---|
413 | |
---|
414 | |
---|
415 | # CHECK, IF A VALID QUEUE HAS BEEN GIVEN |
---|
416 | if [[ $no_default_queue != none ]] |
---|
417 | then |
---|
418 | error=false |
---|
419 | ndq=$no_default_queue |
---|
420 | case $remote_host in |
---|
421 | (ibm) case $ndq in |
---|
422 | (p690_express|p690_standard|p690_long) error=false;; |
---|
423 | (*) error=true;; |
---|
424 | esac;; |
---|
425 | (ibmh) case $ndq in |
---|
426 | (cluster|express) error=false;; |
---|
427 | (*) error=true;; |
---|
428 | esac;; |
---|
429 | (ibmkisti) case $ndq in |
---|
430 | (class.32plus|class.1-2|class.2-32) error=false;; |
---|
431 | (*) error=true;; |
---|
432 | esac;; |
---|
433 | (ibmku) case $ndq in |
---|
434 | (sdbg1|sdbg2|sdbg4|s4|s16|s32|s32-s) error=false;; |
---|
435 | (*) error=true;; |
---|
436 | esac;; |
---|
437 | (ibms) case $ndq in |
---|
438 | (express|normal|p_express|p_normal|p_normal_1.3|p_normal_1.7|grand) error=false;; |
---|
439 | (*) error=true;; |
---|
440 | esac;; |
---|
441 | (lcbullhh) case $ndq in |
---|
442 | (compute|shared) error=false;; |
---|
443 | (*) error=true;; |
---|
444 | esac;; |
---|
445 | (lccrayb) case $ndq in |
---|
446 | (dataq|mpp1q|mpp1testq|mpp2q|mpp2testq|smp1q|smp1testq|specialm1q) error=false;; |
---|
447 | (*) error=true;; |
---|
448 | esac;; |
---|
449 | (lccrayh) case $ndq in |
---|
450 | (dataq|mpp1q|mpp1testq|mpp2q|mpp2testq|smp1q|smp1testq|specialm1q) error=false;; |
---|
451 | (*) error=true;; |
---|
452 | esac;; |
---|
453 | (lccrayf) case $ndq in |
---|
454 | (usup|test*|small|large) error=false;; |
---|
455 | (*) error=true;; |
---|
456 | esac;; |
---|
457 | (lcflow) case $ndq in |
---|
458 | (cfd_lom_long.q|cfd_him_long.q|cfd_lom_serl.q|cfd_lom_shrt.q|cfd_him_shrt.q|cfd_ivy_shrt.q) error=false;; |
---|
459 | (*) error=true;; |
---|
460 | esac;; |
---|
461 | (lckiaps) case $ndq in |
---|
462 | (express|normal|normal20|quickq) error=false;; |
---|
463 | (*) error=true;; |
---|
464 | esac;; |
---|
465 | (lckyoto) case $ndq in |
---|
466 | (eh|ph) error=false;; |
---|
467 | (*) error=true;; |
---|
468 | esac;; |
---|
469 | (lckyuh) case $ndq in |
---|
470 | (fx-dbg|fx-single|fx-small|fx-middle|fx-large) error=false;; |
---|
471 | (*) error=true;; |
---|
472 | esac;; |
---|
473 | (lckyut) case $ndq in |
---|
474 | (cx-dbg|cx-single|cx-small|cx-middle|cx-large) error=false;; |
---|
475 | (*) error=true;; |
---|
476 | esac;; |
---|
477 | (lctit) case $ndq in |
---|
478 | (G|L128|L256|L512H|S|S96|V) error=false;; |
---|
479 | (*) error=true;; |
---|
480 | esac;; |
---|
481 | (t3eb) case $ndq in |
---|
482 | (berte|p50|p100|p392|forfree|p25himem) error=false;; |
---|
483 | (*) error=true;; |
---|
484 | esac;; |
---|
485 | (t3eh) case $ndq in |
---|
486 | (para_t3e|em|k|l|lm|comp_t3e|c|p|ht) error=false;; |
---|
487 | (*) error=true;; |
---|
488 | esac;; |
---|
489 | (t3ej2|t3ej5) case $ndq in |
---|
490 | (low|normal|high) error=false;; |
---|
491 | (*) error=true;; |
---|
492 | esac;; |
---|
493 | (t3es) case $ndq in |
---|
494 | (batch|serial-4|pe4|p48|pe16|pe32|pe64|pe128) error=false;; |
---|
495 | (*) error=true;; |
---|
496 | esac;; |
---|
497 | esac |
---|
498 | if [[ $error = true ]] |
---|
499 | then |
---|
500 | printf "\n +++ queue \"$no_default_queue\" on host \"$remote_host\" not allowed" |
---|
501 | locat=parameter; exit |
---|
502 | else |
---|
503 | queue=$no_default_queue |
---|
504 | fi |
---|
505 | fi |
---|
506 | |
---|
507 | |
---|
508 | |
---|
509 | # CHECK THE CPU-TIME |
---|
510 | # SPLIT TIME INTO HOURS, MINUTES, AND SECONDS |
---|
511 | done=false |
---|
512 | while [[ $done = false ]] |
---|
513 | do |
---|
514 | if (( $cputime <= 0 )) |
---|
515 | then |
---|
516 | printf "\n +++ wrong cpu-time or cpu-time missing" |
---|
517 | printf "\n >>> Please type cpu-time in seconds as INTEGER:" |
---|
518 | printf "\n >>> " |
---|
519 | read cputime 1>/dev/null 2>&1 |
---|
520 | else |
---|
521 | done=true |
---|
522 | fi |
---|
523 | done |
---|
524 | if [[ $remote_host = nech ]] |
---|
525 | then |
---|
526 | if (( tasks_per_node != 0 )) |
---|
527 | then |
---|
528 | (( cputime = cputime * tasks_per_node )) |
---|
529 | elif [[ $numprocs != 0 ]] |
---|
530 | then |
---|
531 | (( cputime = cputime * numprocs )) |
---|
532 | fi |
---|
533 | fi |
---|
534 | (( stunden = cputime / 3600 )) |
---|
535 | (( resttime = cputime - stunden * 3600 )) |
---|
536 | (( minuten = resttime / 60 )) |
---|
537 | (( sekunden = resttime - minuten * 60 )) |
---|
538 | timestring=${stunden}:${minuten}:${sekunden} |
---|
539 | |
---|
540 | |
---|
541 | |
---|
542 | # CHECK THE MEMORY DEMAND |
---|
543 | done=false |
---|
544 | while [[ $done = false ]] |
---|
545 | do |
---|
546 | if (( memory <= 0 )) |
---|
547 | then |
---|
548 | printf "\n +++ wrong memory demand or memory demand missing" |
---|
549 | printf "\n >>> Please type memory in MByte per process as INTEGER:" |
---|
550 | printf "\n >>> " |
---|
551 | read memory 1>/dev/null 2>&1 |
---|
552 | else |
---|
553 | done=true |
---|
554 | fi |
---|
555 | done |
---|
556 | |
---|
557 | if [[ $remote_host = nech ]] |
---|
558 | then |
---|
559 | if (( tasks_per_node != 0 )) |
---|
560 | then |
---|
561 | (( Memory = memory * tasks_per_node / 1000 )) |
---|
562 | elif [[ $numprocs != 0 ]] |
---|
563 | then |
---|
564 | (( Memory = memory * numprocs / 1000 )) |
---|
565 | else |
---|
566 | (( Memory = memory / 1000 )) |
---|
567 | fi |
---|
568 | elif [[ $remote_host = lctit ]] |
---|
569 | then |
---|
570 | (( Memory = memory * tasks_per_node / 1000 )) |
---|
571 | fi |
---|
572 | |
---|
573 | |
---|
574 | # MEMORY DEMAND IN CASE OF OPENMP-USAGE ON IBM-SYSTEMS |
---|
575 | if [[ $(echo $remote_host | cut -c1-3) = ibm ]] |
---|
576 | then |
---|
577 | (( memory = memory * threads_per_task )) |
---|
578 | fi |
---|
579 | |
---|
580 | |
---|
581 | # CALCULATE NUMBER OF REQUIRED NODES |
---|
582 | if (( tasks_per_node != 0 )) |
---|
583 | then |
---|
584 | (( nodes = ( numprocs - 1 ) / ( tasks_per_node * threads_per_task ) + 1 )) |
---|
585 | fi |
---|
586 | |
---|
587 | |
---|
588 | # CALCULATE NUMBER OF PROCESSES PER NODE |
---|
589 | (( processes_per_node = tasks_per_node * threads_per_task )) |
---|
590 | |
---|
591 | |
---|
592 | # CALCULATE NUMBER OF MPI TASKS |
---|
593 | (( mpi_tasks = numprocs / threads_per_task )) |
---|
594 | |
---|
595 | |
---|
596 | # SET PORT NUMBER OPTION FOR CALLS OF ssh/scp, subjob AND batch_scp SCRIPTS |
---|
597 | if [[ "$scp_port" != "" ]] |
---|
598 | then |
---|
599 | PORTOPT="-P $scp_port" |
---|
600 | SSH_PORTOPT="-p $scp_port" |
---|
601 | fi |
---|
602 | |
---|
603 | |
---|
604 | # HEADER-OUTPUT |
---|
605 | if [[ $verify = true ]] |
---|
606 | then |
---|
607 | printf "\n\n" |
---|
608 | printf "#--------------------------------------------------------------# \n" |
---|
609 | spalte1=SUBJOB;spalte2=$(date) |
---|
610 | printf "| %-20s%40s | \n" "$spalte1" "$spalte2" |
---|
611 | printf "| | \n" |
---|
612 | printf "| values of parameters/options: | \n" |
---|
613 | spalte1=$(echo local_host$punkte | cut -c-20) |
---|
614 | spalte2=$punkte$local_host |
---|
615 | printf "| %-20s%40s | \n" "$spalte1" "${spalte2: -40}" |
---|
616 | spalte1=$(echo remote_host$punkte | cut -c-20) |
---|
617 | spalte2=$punkte$remote_host |
---|
618 | printf "| %-20s%40s | \n" "$spalte1" "${spalte2: -40}" |
---|
619 | spalte1=$(echo queue$punkte | cut -c-20) |
---|
620 | spalte2=$punkte$queue |
---|
621 | printf "| %-20s%40s | \n" "$spalte1" "${spalte2: -40}" |
---|
622 | spalte1=$(echo memory$punkte | cut -c-20) |
---|
623 | spalte2="$punkte$memory mb" |
---|
624 | printf "| %-20s%40s | \n" "$spalte1" "${spalte2: -40}" |
---|
625 | spalte1=$(echo cputime$punkte | cut -c-20) |
---|
626 | spalte2="$punkte$cputime sec" |
---|
627 | printf "| %-20s%40s | \n" "$spalte1" "${spalte2: -40}" |
---|
628 | spalte1=$(echo job_name$punkte | cut -c-20) |
---|
629 | spalte2="$punkte$job_name" |
---|
630 | printf "| %-20s%40s | \n" "$spalte1" "${spalte2: -40}" |
---|
631 | printf "#--------------------------------------------------------------# \n\n" |
---|
632 | |
---|
633 | |
---|
634 | # QUERY CHECK |
---|
635 | antwort="dummy" |
---|
636 | while [[ $antwort != y && $antwort != Y && $antwort != n && $antwort != N ]] |
---|
637 | do |
---|
638 | read antwort?" >>> continue (y/n) ? " |
---|
639 | done |
---|
640 | if [[ $antwort = n || $antwort = N ]] |
---|
641 | then |
---|
642 | locat=verify; exit |
---|
643 | fi |
---|
644 | printf "\n" |
---|
645 | fi |
---|
646 | |
---|
647 | # GENERATE RANDOM IDENTIFIER, AND DETERMINE THE JOBNAME ON THE TARGET HOST |
---|
648 | identifier=$RANDOM |
---|
649 | job_on_remhost=${job_name}_${identifier}_$local_host |
---|
650 | job_to_send=job_to_send_$identifier |
---|
651 | if [[ $delete_dayfile = false ]] |
---|
652 | then |
---|
653 | remote_dayfile=${local_host}_${job_name}_result_$identifier |
---|
654 | local_dayfile=${remote_host}_${job_name} |
---|
655 | else |
---|
656 | remote_dayfile=/dev/null |
---|
657 | fi |
---|
658 | |
---|
659 | |
---|
660 | # GENERATE THE BATCH-JOB SCRIPTS (FOR QUEUEING-SYSTEMS qsub/msub/LoadLeveler) |
---|
661 | if [[ $(echo $remote_host | cut -c1-3) = ibm && $numprocs != 0 ]] |
---|
662 | then |
---|
663 | |
---|
664 | # GENERAL LOADLEVELER SETTINGS |
---|
665 | execute_in_shell="#!/bin/ksh" |
---|
666 | use_shell="# @ shell = /bin/ksh" |
---|
667 | consumable_memory="ConsumableMemory($memory mb)" |
---|
668 | class="# @ class = $queue" |
---|
669 | environment="# @ environment = OMP_NUM_THREADS=$threads_per_task; MP_SHARED_MEMORY=yes" |
---|
670 | network_to_use="# @ network.mpi = sn_all,shared,us" |
---|
671 | data_limit="# @ data_limit = 1.76gb" |
---|
672 | image_size="# @ image_size = 50" |
---|
673 | wall_clock_limit="# @ wall_clock_limit = ${timestring},$timestring" |
---|
674 | |
---|
675 | if [[ $email_notification = none ]] |
---|
676 | then |
---|
677 | notify_user="" |
---|
678 | else |
---|
679 | notify_user="# @ notify_user = $email_notification" |
---|
680 | if [[ $delete_dayfile = true ]] |
---|
681 | then |
---|
682 | notification='# @ notification = never' |
---|
683 | fi |
---|
684 | fi |
---|
685 | |
---|
686 | if [[ $remote_host = ibmh ]] |
---|
687 | then |
---|
688 | data_limit="" |
---|
689 | network_to_use="" |
---|
690 | class="# @ class = $queue" |
---|
691 | environment="" |
---|
692 | rset="# @ rset = RSET_MCM_AFFINITY" |
---|
693 | task_affinity="# @ task_affinity = core(1)" |
---|
694 | elif [[ $remote_host = ibmkisti ]] |
---|
695 | then |
---|
696 | network_to_use="# @ network.MPI = sn_all,shared,US" |
---|
697 | wall_clock_limit="# @ wall_clock_limit = $timestring" |
---|
698 | if [[ $threads_per_task = 1 ]] |
---|
699 | then |
---|
700 | rset="# @ rset = RSET_MCM_AFFINITY" |
---|
701 | mcm_affinity_options="# @ mcm_affinity_options = mcm_mem_pref mcm_sni_none mcm_distribute" |
---|
702 | fi |
---|
703 | environment="" |
---|
704 | use_shell="" |
---|
705 | data_limit="" |
---|
706 | image_size="" |
---|
707 | elif [[ $remote_host = ibmku ]] |
---|
708 | then |
---|
709 | execute_in_shell="#!/usr/bin/ksh" |
---|
710 | use_shell="# @ shell = /usr/bin/ksh" |
---|
711 | consumable_memory="" |
---|
712 | environment="" |
---|
713 | network_to_use="# @ network.mpi = sn_all,shared,us" |
---|
714 | data_limit="" |
---|
715 | image_size="" |
---|
716 | elif [[ $remote_host = ibms ]] |
---|
717 | then |
---|
718 | network_to_use="# @ network.mpi = csss,shared,us" |
---|
719 | fi |
---|
720 | |
---|
721 | cat > $job_to_send << %%END%% |
---|
722 | $execute_in_shell |
---|
723 | $use_shell |
---|
724 | |
---|
725 | # @ job_type = parallel |
---|
726 | # @ job_name = $job_name |
---|
727 | # @ resources = ConsumableCpus($threads_per_task) $consumable_memory |
---|
728 | # @ output = $remote_dayfile |
---|
729 | # @ error = $remote_dayfile |
---|
730 | $wall_clock_limit |
---|
731 | $image_size |
---|
732 | $class |
---|
733 | $environment |
---|
734 | $network_to_use |
---|
735 | $data_limit |
---|
736 | $rset |
---|
737 | $mcm_affinity_options |
---|
738 | $task_affinity |
---|
739 | $notification |
---|
740 | $notify_user |
---|
741 | |
---|
742 | %%END%% |
---|
743 | |
---|
744 | if (( nodes > 0 )) |
---|
745 | then |
---|
746 | |
---|
747 | if [[ $remote_host != ibmkisti ]] |
---|
748 | then |
---|
749 | |
---|
750 | cat >> $job_to_send << %%END%% |
---|
751 | # @ node = $nodes |
---|
752 | # @ tasks_per_node = $processes_per_node |
---|
753 | # @ node_usage = $node_usage |
---|
754 | # @ queue |
---|
755 | |
---|
756 | %%END%% |
---|
757 | |
---|
758 | else |
---|
759 | |
---|
760 | cat >> $job_to_send << %%END%% |
---|
761 | # @ total_tasks = $mpi_tasks |
---|
762 | # @ blocking = unlimited |
---|
763 | # @ queue |
---|
764 | |
---|
765 | %%END%% |
---|
766 | |
---|
767 | fi |
---|
768 | |
---|
769 | else |
---|
770 | |
---|
771 | cat >> $job_to_send << %%END%% |
---|
772 | # @ blocking = unlimited |
---|
773 | # @ total_tasks = $numprocs |
---|
774 | # @ node_usage = $node_usage |
---|
775 | # @ queue |
---|
776 | |
---|
777 | %%END%% |
---|
778 | |
---|
779 | fi |
---|
780 | |
---|
781 | # WORKAROUND BECAUSE OF SILLY JOB FILTER ON ibmkisti |
---|
782 | if [[ $remote_host = ibmkisti && $threads_per_task != 1 ]] |
---|
783 | then |
---|
784 | echo "export OMP_NUM_THREADS=$threads_per_task" >> $job_to_send |
---|
785 | fi |
---|
786 | |
---|
787 | elif [[ $(echo $remote_host | cut -c1-3) = ibm && $numprocs = 0 ]] |
---|
788 | then |
---|
789 | |
---|
790 | cat > $job_to_send << %%END%% |
---|
791 | #!/bin/ksh |
---|
792 | |
---|
793 | # @ job_type = serial |
---|
794 | # @ node_usage = $node_usage |
---|
795 | # @ job_name = palm |
---|
796 | # @ wall_clock_limit = ${timestring},$timestring |
---|
797 | # @ resources = ConsumableCpus(1) ConsumableMemory(1 gb) |
---|
798 | # @ output = $remote_dayfile |
---|
799 | # @ error = $remote_dayfile |
---|
800 | $class |
---|
801 | $notification |
---|
802 | |
---|
803 | # @ queue |
---|
804 | |
---|
805 | %%END%% |
---|
806 | |
---|
807 | elif [[ $remote_host = lcbullhh ]] |
---|
808 | then |
---|
809 | if [[ $numprocs != 0 ]] |
---|
810 | then |
---|
811 | cat > $job_to_send << %%END%% |
---|
812 | #!/bin/bash -l |
---|
813 | #SBATCH -J $job_name |
---|
814 | #SBATCH -t $timestring |
---|
815 | #SBATCH -N $nodes |
---|
816 | #SBATCH --ntasks-per-node=$processes_per_node |
---|
817 | #SBATCH -p $queue |
---|
818 | #SBATCH -o $remote_dayfile |
---|
819 | #SBATCH -e $remote_dayfile |
---|
820 | #SBATCH -A $project_account |
---|
821 | |
---|
822 | $init_cmds |
---|
823 | $module_calls |
---|
824 | |
---|
825 | %%END%% |
---|
826 | |
---|
827 | else |
---|
828 | cat > $job_to_send << %%END%% |
---|
829 | #!/bin/bash -l |
---|
830 | #SBATCH -J $job_name |
---|
831 | #SBATCH -t $timestring |
---|
832 | #SBATCH -l ncpus=1 |
---|
833 | #SBATCH -l pmem=${memory}mb |
---|
834 | #SBATCH -m abe |
---|
835 | #SBATCH -o $remote_dayfile |
---|
836 | #SBATCH -e $remote_dayfile |
---|
837 | #SBATCH -A $project_account |
---|
838 | |
---|
839 | $init_cmds |
---|
840 | $module_calls |
---|
841 | |
---|
842 | %%END%% |
---|
843 | |
---|
844 | fi |
---|
845 | |
---|
846 | elif [[ $remote_host = lccrayb || $remote_host = lccrayh ]] |
---|
847 | then |
---|
848 | |
---|
849 | if [[ "$feature" != "" ]] |
---|
850 | then |
---|
851 | featuredir="#PBS -l feature=$feature" |
---|
852 | fi |
---|
853 | |
---|
854 | if [[ $numprocs != 0 ]] |
---|
855 | then |
---|
856 | cat > $job_to_send << %%END%% |
---|
857 | #!/bin/bash |
---|
858 | #PBS -N $job_name |
---|
859 | #PBS -l walltime=$timestring |
---|
860 | #PBS -l nodes=$nodes:ppn=$processes_per_node |
---|
861 | #PBS -o $remote_dayfile |
---|
862 | #PBS -j oe |
---|
863 | #PBS -q $queue |
---|
864 | $featuredir |
---|
865 | |
---|
866 | $init_cmds |
---|
867 | $module_calls |
---|
868 | |
---|
869 | %%END%% |
---|
870 | |
---|
871 | else |
---|
872 | |
---|
873 | continue |
---|
874 | |
---|
875 | fi |
---|
876 | |
---|
877 | elif [[ $remote_host = lccrayf ]] |
---|
878 | then |
---|
879 | |
---|
880 | if [[ $numprocs != 0 ]] |
---|
881 | then |
---|
882 | cat > $job_to_send << %%END%% |
---|
883 | #!/bin/bash -l |
---|
884 | #SBATCH -J $job_name |
---|
885 | #SBATCH -t $timestring |
---|
886 | #SBATCH -N $nodes |
---|
887 | #SBATCH --ntasks-per-node=$processes_per_node |
---|
888 | #SBATCH -p $queue |
---|
889 | #SBATCH -o $remote_dayfile |
---|
890 | #SBATCH -e $remote_dayfile |
---|
891 | |
---|
892 | $init_cmds |
---|
893 | $module_calls |
---|
894 | |
---|
895 | %%END%% |
---|
896 | |
---|
897 | else |
---|
898 | cat > $job_to_send << %%END%% |
---|
899 | #!/bin/bash -l |
---|
900 | #SBATCH -J $job_name |
---|
901 | #SBATCH -t $timestring |
---|
902 | #SBATCH -l ncpus=1 |
---|
903 | #SBATCH -l pmem=${memory}mb |
---|
904 | #SBATCH -m abe |
---|
905 | #SBATCH -o $remote_dayfile |
---|
906 | #SBATCH -e $remote_dayfile |
---|
907 | |
---|
908 | $init_cmds |
---|
909 | $module_calls |
---|
910 | |
---|
911 | %%END%% |
---|
912 | |
---|
913 | fi |
---|
914 | |
---|
915 | elif [[ $remote_host = lcflow ]] |
---|
916 | then |
---|
917 | if [[ $numprocs != 0 ]] |
---|
918 | then |
---|
919 | pe_set="#$ -pe impi $numprocs" |
---|
920 | else |
---|
921 | pe_set="#$ -pe impi 1" |
---|
922 | fi |
---|
923 | if [[ $queue = default ]] |
---|
924 | then |
---|
925 | queue_set="" |
---|
926 | else |
---|
927 | queue_set="#$ -q $queue" |
---|
928 | fi |
---|
929 | [[ "$disc_space" = "" ]] && disc_space=50 |
---|
930 | |
---|
931 | cat > $job_to_send << %%END%% |
---|
932 | #!/bin/bash |
---|
933 | #$ -S /bin/bash |
---|
934 | #$ -N $job_name |
---|
935 | #$ -cwd |
---|
936 | #$ -l h_rt=$timestring |
---|
937 | #$ -l h_vmem=${memory}M |
---|
938 | #$ -o $remote_dayfile |
---|
939 | #$ -j y |
---|
940 | $pe_set |
---|
941 | #$ -R y |
---|
942 | #$ -l h_fsize=${disc_space}G |
---|
943 | $queue_set |
---|
944 | |
---|
945 | %%END%% |
---|
946 | |
---|
947 | elif [[ $remote_host = lck || $remote_host = lckordi || $remote_host = lcsb ]] |
---|
948 | then |
---|
949 | |
---|
950 | if [[ $numprocs != 0 ]] |
---|
951 | then |
---|
952 | cat > $job_to_send << %%END%% |
---|
953 | #!/bin/ksh |
---|
954 | #PBS -N $job_name |
---|
955 | #PBS -l walltime=$timestring |
---|
956 | #PBS -l ncpus=$numprocs |
---|
957 | #PBS -l pmem=${memory}mb |
---|
958 | #PBS -o $remote_dayfile |
---|
959 | #PBS -l nodes=$nodes:ppn=${processes_per_node} |
---|
960 | #PBS -j oe |
---|
961 | |
---|
962 | mpd & |
---|
963 | |
---|
964 | %%END%% |
---|
965 | |
---|
966 | else |
---|
967 | cat > $job_to_send << %%END%% |
---|
968 | #!/bin/ksh |
---|
969 | #PBS -N $job_name |
---|
970 | #PBS -l walltime=$timestring |
---|
971 | #PBS -l ncpus=1 |
---|
972 | #PBS -l pmem=${memory}mb |
---|
973 | #PBS -o $remote_dayfile |
---|
974 | #PBS -j oe |
---|
975 | |
---|
976 | %%END%% |
---|
977 | |
---|
978 | fi |
---|
979 | |
---|
980 | elif [[ $remote_host = lckiaps ]] |
---|
981 | then |
---|
982 | |
---|
983 | if [[ $numprocs != 0 ]] |
---|
984 | then |
---|
985 | cat > $job_to_send << %%END%% |
---|
986 | #!/bin/bash |
---|
987 | #PBS -N $job_name |
---|
988 | #PBS -l walltime=$timestring |
---|
989 | #PBS -l select=1:ncpus=$numprocs |
---|
990 | #PBS -l pmem=${memory}mb |
---|
991 | #PBS -q $queue |
---|
992 | #PBS -o $remote_dayfile |
---|
993 | #PBS -j oe |
---|
994 | #PBS -V |
---|
995 | |
---|
996 | %%END%% |
---|
997 | |
---|
998 | else |
---|
999 | cat > $job_to_send << %%END%% |
---|
1000 | #!/bin/bash |
---|
1001 | #PBS -N $job_name |
---|
1002 | #PBS -l walltime=$timestring |
---|
1003 | #PBS -l ncpus=1 |
---|
1004 | #PBS -l pmem=${memory}mb |
---|
1005 | #PBS -o $remote_dayfile |
---|
1006 | #PBS -j oe |
---|
1007 | |
---|
1008 | %%END%% |
---|
1009 | |
---|
1010 | fi |
---|
1011 | |
---|
1012 | elif [[ $remote_host = lcyon ]] |
---|
1013 | then |
---|
1014 | |
---|
1015 | if [[ $numprocs != 0 ]] |
---|
1016 | then |
---|
1017 | cat > $job_to_send << %%END%% |
---|
1018 | #!/bin/ksh |
---|
1019 | #PBS -N $job_name |
---|
1020 | #PBS -l walltime=$timestring |
---|
1021 | #PBS -l ncpus=$numprocs |
---|
1022 | #PBS -l pmem=${memory}mb |
---|
1023 | #PBS -o $remote_dayfile |
---|
1024 | #PBS -j oe |
---|
1025 | |
---|
1026 | %%END%% |
---|
1027 | |
---|
1028 | else |
---|
1029 | cat > $job_to_send << %%END%% |
---|
1030 | #!/bin/ksh |
---|
1031 | #PBS -N $job_name |
---|
1032 | #PBS -l walltime=$timestring |
---|
1033 | #PBS -l ncpus=1 |
---|
1034 | #PBS -l pmem=${memory}mb |
---|
1035 | #PBS -o $remote_dayfile |
---|
1036 | #PBS -j oe |
---|
1037 | |
---|
1038 | %%END%% |
---|
1039 | |
---|
1040 | fi |
---|
1041 | |
---|
1042 | elif [[ $remote_host = lcxe6 ]] |
---|
1043 | then |
---|
1044 | |
---|
1045 | if [[ $numprocs != 0 ]] |
---|
1046 | then |
---|
1047 | cat > $job_to_send << %%END%% |
---|
1048 | #!/bin/ksh |
---|
1049 | #PBS -S /bin/ksh |
---|
1050 | #PBS -N $job_name |
---|
1051 | #PBS -A $project_account |
---|
1052 | #PBS -j oe |
---|
1053 | #PBS -l walltime=$timestring |
---|
1054 | #PBS -l mppwidth=${numprocs} |
---|
1055 | #PBS -l mppnppn=${processes_per_node} |
---|
1056 | #PBS -m abe |
---|
1057 | #PBS -o $remote_dayfile |
---|
1058 | $email_directive |
---|
1059 | |
---|
1060 | $init_cmds |
---|
1061 | $module_calls |
---|
1062 | |
---|
1063 | %%END%% |
---|
1064 | |
---|
1065 | else |
---|
1066 | cat > $job_to_send << %%END%% |
---|
1067 | #!/bin/ksh |
---|
1068 | #PBS -S /bin/ksh |
---|
1069 | #PBS -N $job_name |
---|
1070 | #PBS -A $project_account |
---|
1071 | #PBS -j oe |
---|
1072 | #PBS -l walltime=$timestring |
---|
1073 | #PBS -l ncpus=1 |
---|
1074 | #PBS -l pmem=${memory}mb |
---|
1075 | #PBS -m abe |
---|
1076 | $email_directive |
---|
1077 | #PBS -o $remote_dayfile |
---|
1078 | |
---|
1079 | $init_cmds |
---|
1080 | $module_calls |
---|
1081 | |
---|
1082 | %%END%% |
---|
1083 | |
---|
1084 | fi |
---|
1085 | |
---|
1086 | elif [[ $remote_host = lckyoto ]] |
---|
1087 | then |
---|
1088 | |
---|
1089 | cat > $job_to_send << %%END%% |
---|
1090 | #!/bin/ksh |
---|
1091 | # @\$-o $remote_dayfile |
---|
1092 | # @\$-eo -oi |
---|
1093 | # @\$-lP 16 |
---|
1094 | # @\$-lp 1 |
---|
1095 | # @\$-lm 28gb -llm unlimited -ls unlimited |
---|
1096 | # @\$-q $queue |
---|
1097 | # @\$-Pvn abs_pack |
---|
1098 | ##for intel? @\$-Pvn abs_unpack -Pvs unpack -Pvc unpack |
---|
1099 | #. /thin/local/etc/setprofile/intel-11.0.sh |
---|
1100 | #. /thin/local/etc/setprofile/mvapich2-1.4+intel-11.0.sh |
---|
1101 | . ~/.myprofile |
---|
1102 | #. /home2/t/t51254/palm/current_version/myprofile |
---|
1103 | #. /thin/apps/pgi/mpi.sh |
---|
1104 | # |
---|
1105 | env |
---|
1106 | # |
---|
1107 | set -x |
---|
1108 | |
---|
1109 | %%END%% |
---|
1110 | |
---|
1111 | elif [[ $remote_host = lcxt5m ]] |
---|
1112 | then |
---|
1113 | |
---|
1114 | if [[ $numprocs != 0 ]] |
---|
1115 | then |
---|
1116 | cat > $job_to_send << %%END%% |
---|
1117 | #!/bin/ksh |
---|
1118 | #PBS -S /bin/ksh |
---|
1119 | #PBS -N $job_name |
---|
1120 | #PBS -j oe |
---|
1121 | #PBS -l walltime=$timestring |
---|
1122 | #PBS -l mppwidth=${numprocs} |
---|
1123 | #PBS -l mppnppn=${processes_per_node} |
---|
1124 | #PBS -m abe |
---|
1125 | #PBS -o $remote_dayfile |
---|
1126 | |
---|
1127 | $init_cmds |
---|
1128 | $module_calls |
---|
1129 | |
---|
1130 | %%END%% |
---|
1131 | |
---|
1132 | else |
---|
1133 | cat > $job_to_send << %%END%% |
---|
1134 | #!/bin/ksh |
---|
1135 | #PBS -S /bin/ksh |
---|
1136 | #PBS -N $job_name |
---|
1137 | #PBS -j oe |
---|
1138 | #PBS -l walltime=$timestring |
---|
1139 | #PBS -l ncpus=1 |
---|
1140 | #PBS -l pmem=${memory}mb |
---|
1141 | #PBS -m abe |
---|
1142 | #PBS -o $remote_dayfile |
---|
1143 | |
---|
1144 | $init_cmds |
---|
1145 | $module_calls |
---|
1146 | |
---|
1147 | %%END%% |
---|
1148 | |
---|
1149 | fi |
---|
1150 | |
---|
1151 | elif [[ $remote_host = lckyuh ]] |
---|
1152 | then |
---|
1153 | cat > $job_to_send << %%END%% |
---|
1154 | #!/bin/bash |
---|
1155 | #PJM -L "rscgrp=$queue" |
---|
1156 | #PJM -L "node=$nodes" |
---|
1157 | #PJM --mpi "proc=$numprocs" |
---|
1158 | #PJM -L "elapse=$timestring" |
---|
1159 | #PJM -o $remote_dayfile |
---|
1160 | #PJM -j |
---|
1161 | #PJM -X |
---|
1162 | #PJM --no-stging |
---|
1163 | |
---|
1164 | export LANG=en_US.UTF-8 |
---|
1165 | %%END%% |
---|
1166 | |
---|
1167 | elif [[ $remote_host = lckyut ]] |
---|
1168 | then |
---|
1169 | cat > $job_to_send << %%END%% |
---|
1170 | #!/bin/bash |
---|
1171 | #PJM -L "rscgrp=$queue" |
---|
1172 | #PJM -L "vnode=$numprocs" |
---|
1173 | #PJM -L "vnode-core=1" |
---|
1174 | #PJM -L "elapse=$timestring" |
---|
1175 | #PJM --mpi proc=$numprocs |
---|
1176 | #PJM -o $remote_dayfile |
---|
1177 | #PJM -j |
---|
1178 | #PJM -X |
---|
1179 | #PJM --no-stging |
---|
1180 | |
---|
1181 | export LANG=en_US.UTF-8 |
---|
1182 | %%END%% |
---|
1183 | |
---|
1184 | elif [[ $remote_host = lcocean ]] |
---|
1185 | then |
---|
1186 | cat > $job_to_send << %%END%% |
---|
1187 | #!/bin/bash |
---|
1188 | #$ -cwd |
---|
1189 | #$ -V |
---|
1190 | #$ -N $job_name |
---|
1191 | #$ -pe orte $numprocs |
---|
1192 | #$ -o $remote_dayfile |
---|
1193 | #$ -j y |
---|
1194 | #$ -R y |
---|
1195 | $init_cmds |
---|
1196 | $module_calls |
---|
1197 | |
---|
1198 | %%END%% |
---|
1199 | |
---|
1200 | elif [[ $remote_host = nech ]] |
---|
1201 | then |
---|
1202 | |
---|
1203 | if (( nodes > 1 )) |
---|
1204 | then |
---|
1205 | cat > $job_to_send << %%END%% |
---|
1206 | #!/bin/ksh |
---|
1207 | #PBS -l cpunum_prc=$processes_per_node,cputim_job=$cputime |
---|
1208 | #PBS -l ${qsubmem}=${Memory}gb |
---|
1209 | #PBS -b $nodes |
---|
1210 | #PBS -o $remote_dayfile |
---|
1211 | #PBS -N palm |
---|
1212 | #PBS -j o |
---|
1213 | #PBS -T mpisx |
---|
1214 | |
---|
1215 | %%END%% |
---|
1216 | |
---|
1217 | elif [[ $numprocs != 0 ]] |
---|
1218 | then |
---|
1219 | cat > $job_to_send << %%END%% |
---|
1220 | #!/bin/ksh |
---|
1221 | #PBS -l cpunum_prc=$processes_per_node,cputim_job=$cputime |
---|
1222 | #PBS -l ${qsubmem}=${Memory}gb |
---|
1223 | #PBS -o $remote_dayfile |
---|
1224 | #PBS -N palm |
---|
1225 | #PBS -j o |
---|
1226 | |
---|
1227 | %%END%% |
---|
1228 | |
---|
1229 | else |
---|
1230 | cat > $job_to_send << %%END%% |
---|
1231 | #!/bin/ksh |
---|
1232 | #PBS -l ${qsubmem}=${Memory}gb,${qsubtime}=$cputime |
---|
1233 | #PBS -o $remote_dayfile |
---|
1234 | #PBS -j o |
---|
1235 | |
---|
1236 | %%END%% |
---|
1237 | |
---|
1238 | fi |
---|
1239 | |
---|
1240 | elif [[ $remote_host = lctit ]] |
---|
1241 | then |
---|
1242 | cat > $job_to_send << %%END%% |
---|
1243 | #!/bin/ksh |
---|
1244 | $init_cmds |
---|
1245 | $module_calls |
---|
1246 | |
---|
1247 | %%END%% |
---|
1248 | |
---|
1249 | # SET OPTIONS FOR SUBMIT-COMMAND |
---|
1250 | if [[ $tasks_per_node != $processes_per_node ]] |
---|
1251 | then |
---|
1252 | submcom="$submcom -W group_list=$group_number -N $job_name -l walltime=$timestring -l select=$nodes:ncpus=$processes_per_node:mpiprocs=$tasks_per_node:mem=${Memory}gb -o $remote_dayfile -j oe -et 1 -q $queue " |
---|
1253 | else |
---|
1254 | submcom="$submcom -W group_list=$group_number -N $job_name -l walltime=$timestring -l select=$nodes:ncpus=$processes_per_node:mpiprocs=$tasks_per_node:mem=${Memory}gb -l place=scatter -o $remote_dayfile -j oe -et 1 -q $queue " |
---|
1255 | fi |
---|
1256 | |
---|
1257 | else |
---|
1258 | |
---|
1259 | cat > $job_to_send << %%END%% |
---|
1260 | # @\$-q ${queue} |
---|
1261 | # @\$-l${qsubtime} $timestring |
---|
1262 | # @\$-l${qsubmem} ${memory}mb |
---|
1263 | # @\$-o $remote_dayfile |
---|
1264 | # @\$-eo |
---|
1265 | |
---|
1266 | %%END%% |
---|
1267 | |
---|
1268 | fi |
---|
1269 | |
---|
1270 | |
---|
1271 | # IN CASE OF JOBS EXECUTING ON REMOTE-HOSTS, THE TRANSFER OF THE DAYFILES |
---|
1272 | # TO THE LOCAL HOSTS WILL BE INITIATED BY TRAP ON EXIT |
---|
1273 | # NO TRANSFER POSSIBLE ON IBM IN SEOUL |
---|
1274 | if [[ $delete_dayfile = false && $remote_host != $local_host ]] |
---|
1275 | then |
---|
1276 | echo "set +vx" >> $job_to_send |
---|
1277 | echo "trap '" >> $job_to_send |
---|
1278 | echo "set +vx" >> $job_to_send |
---|
1279 | if [[ $(echo $remote_host | cut -c1-3) = ibm || $remote_host = lcbullhh || $remote_host = lccrayb || $remote_host = lccrayh || $(echo $remote_host | cut -c1-3) = nec || $remote_host = lcflow || $remote_host = lckiaps || $remote_host = lckyu* || $remote_host = lcxe6 || $remote_host = lcocean ]] |
---|
1280 | then |
---|
1281 | if [[ $remote_host = ibmh ]] |
---|
1282 | then |
---|
1283 | return_queue=c1 |
---|
1284 | elif [[ $remote_host = ibmkisti ]] |
---|
1285 | then |
---|
1286 | return_queue=class.1-2 |
---|
1287 | elif [[ $remote_host = ibmku ]] |
---|
1288 | then |
---|
1289 | return_queue=sdbg2 |
---|
1290 | elif [[ $remote_host = ibms ]] |
---|
1291 | then |
---|
1292 | return_queue=p_normal |
---|
1293 | elif [[ $remote_host = lcbullhh ]] |
---|
1294 | then |
---|
1295 | return_queue=shared |
---|
1296 | elif [[ $remote_host = lccrayb || $remote_host = lccrayh ]] |
---|
1297 | then |
---|
1298 | return_queue=dataq |
---|
1299 | elif [[ $remote_host = lcxe6 ]] |
---|
1300 | then |
---|
1301 | return_queue=debug |
---|
1302 | elif [[ $remote_host = lckiaps ]] |
---|
1303 | then |
---|
1304 | return_queue=express |
---|
1305 | elif [[ $remote_host = lckyuh ]] |
---|
1306 | then |
---|
1307 | return_queue=cx-single |
---|
1308 | elif [[ $remote_host = lckyut ]] |
---|
1309 | then |
---|
1310 | return_queue=cx-single |
---|
1311 | else |
---|
1312 | return_queue=unknown |
---|
1313 | fi |
---|
1314 | |
---|
1315 | if [[ $(echo $remote_host | cut -c1-3) = ibm ]] |
---|
1316 | then |
---|
1317 | |
---|
1318 | if [[ $remote_host = ibmku ]] |
---|
1319 | then |
---|
1320 | echo "echo \"#!/usr/bin/ksh\" >> scpjob.$identifier" >> $job_to_send |
---|
1321 | echo "echo \"# @ shell = /usr/bin/ksh\" >> scpjob.$identifier" >> $job_to_send |
---|
1322 | else |
---|
1323 | echo "echo \"#!/bin/ksh\" >> scpjob.$identifier" >> $job_to_send |
---|
1324 | fi |
---|
1325 | echo "echo \"# @ job_type = serial\" >> scpjob.$identifier" >> $job_to_send |
---|
1326 | echo "echo \"# @ job_name = transfer\" >> scpjob.$identifier" >> $job_to_send |
---|
1327 | echo "echo \"# @ resources = ConsumableCpus(1) ConsumableMemory(1 gb)\" >> scpjob.$identifier" >> $job_to_send |
---|
1328 | echo "echo \"# @ wall_clock_limit = 00:10:00,00:10:00\" >> scpjob.$identifier " >> $job_to_send |
---|
1329 | echo "echo \"# @ output = job_queue/last_job_transfer_protocol\" >> scpjob.$identifier" >> $job_to_send |
---|
1330 | echo "echo \"# @ error = job_queue/last_job_transfer_protocol\" >> scpjob.$identifier" >> $job_to_send |
---|
1331 | if [[ $host != "ibmh" ]] |
---|
1332 | then |
---|
1333 | echo "echo \"# @ class = $return_queue\" >> scpjob.$identifier" >> $job_to_send |
---|
1334 | fi |
---|
1335 | echo "echo \"# @ image_size = 10\" >> scpjob.$identifier" >> $job_to_send |
---|
1336 | echo "echo \"# @ notification = never\" >> scpjob.$identifier" >> $job_to_send |
---|
1337 | |
---|
1338 | echo "echo \"# @ queue\" >> scpjob.$identifier" >> $job_to_send |
---|
1339 | echo "echo \" \" >> scpjob.$identifier" >> $job_to_send |
---|
1340 | |
---|
1341 | echo "echo \"set -x\" >> scpjob.$identifier" >> $job_to_send |
---|
1342 | echo "echo \"batch_scp $PORTOPT -d -w 10 -u $local_user $local_address ${job_catalog}/$remote_dayfile \\\"$job_catalog\\\" $local_dayfile\" >> scpjob.$identifier" >> $job_to_send |
---|
1343 | if [[ $remote_host = ibmku ]] |
---|
1344 | then |
---|
1345 | echo "echo \"rm scpjob.$identifier\" >> scpjob.$identifier" >> $job_to_send |
---|
1346 | fi |
---|
1347 | echo "echo \"exit\" >> scpjob.$identifier" >> $job_to_send |
---|
1348 | |
---|
1349 | elif [[ $remote_host = nech ]] |
---|
1350 | then |
---|
1351 | echo "cd /pf/b/${remote_user}/job_queue" >> $job_to_send |
---|
1352 | echo "cat > scpjob.$identifier << %%END%%" >> $job_to_send |
---|
1353 | echo "#PBS -l ${qsubmem}=1GB,${qsubtime}=100" >> $job_to_send |
---|
1354 | echo "#PBS -o last_job_transfer_protocol" >> $job_to_send |
---|
1355 | echo "#PBS -j o" >> $job_to_send |
---|
1356 | echo " " >> $job_to_send |
---|
1357 | echo "set -x" >> $job_to_send |
---|
1358 | echo "cd /pf/b/${remote_user}/job_queue" >> $job_to_send |
---|
1359 | echo "batch_scp $PORTOPT -d -w 10 -u $local_user $local_address $remote_dayfile \"$job_catalog\" $local_dayfile" >> $job_to_send |
---|
1360 | echo "[[ \"\$for_subjob_to_do\" != \"\" ]] && eval \$for_subjob_to_do" >> $job_to_send |
---|
1361 | echo "%%END%%" >> $job_to_send |
---|
1362 | |
---|
1363 | elif [[ $remote_host = lcbullhh ]] |
---|
1364 | then |
---|
1365 | echo "cat > scpjob.$identifier << %%END%%" >> $job_to_send |
---|
1366 | echo "#!/bin/bash" >> $job_to_send |
---|
1367 | echo "#SBATCH --job-name=job_protocol_transfer" >> $job_to_send |
---|
1368 | echo "#SBATCH -t 00:20:00" >> $job_to_send |
---|
1369 | echo "#SBATCH -N 1" >> $job_to_send |
---|
1370 | echo "#SBATCH -n 1" >> $job_to_send |
---|
1371 | echo "#SBATCH -o \$HOME/job_queue/last_job_transfer_protocol" >> $job_to_send |
---|
1372 | echo "#SBATCH -o $remote_dayfile" >> $job_to_send |
---|
1373 | echo "#SBATCH -e $remote_dayfile" >> $job_to_send |
---|
1374 | echo "#SBATCH -A $project_account" >> $job_to_send |
---|
1375 | echo "#SBATCH -p $return_queue" >> $job_to_send |
---|
1376 | echo " " >> $job_to_send |
---|
1377 | echo "set -x" >> $job_to_send |
---|
1378 | echo "batch_scp $PORTOPT -d -w 10 -u $local_user $local_address ${job_catalog}/$remote_dayfile \"$job_catalog\" $local_dayfile" >> $job_to_send |
---|
1379 | echo "[[ \"\$for_subjob_to_do\" != \"\" ]] && eval \$for_subjob_to_do" >> $job_to_send |
---|
1380 | echo "%%END%%" >> $job_to_send |
---|
1381 | |
---|
1382 | elif [[ $remote_host = lckyuh ]] |
---|
1383 | then |
---|
1384 | echo "cat > scpjob.$identifier << %%END%%" >> $job_to_send |
---|
1385 | echo "#!/bin/bash" >> $job_to_send |
---|
1386 | echo "#PJM -L \"node=1\"" >> $job_to_send |
---|
1387 | echo "#PJM -L \"rscgrp=$return_queue\"" >> $job_to_send |
---|
1388 | echo "#PJM --no-stging" >> $job_to_send |
---|
1389 | echo "#PJM -L \"elapse=30:00\"" >> $job_to_send |
---|
1390 | echo "#PJM -o \$HOME/job_queue/last_job_transfer_protocol" >> $job_to_send |
---|
1391 | echo "#PJM -j" >> $job_to_send |
---|
1392 | echo " " >> $job_to_send |
---|
1393 | echo "export LANG=en_US.UTF-8" >> $job_to_send |
---|
1394 | echo "set -x" >> $job_to_send |
---|
1395 | echo "batch_scp $PORTOPT -d -w 10 -u $local_user $local_address $remote_dayfile \"$job_catalog\" $local_dayfile" >> $job_to_send |
---|
1396 | echo "[[ \"\$for_subjob_to_do\" != \"\" ]] && eval \$for_subjob_to_do" >> $job_to_send |
---|
1397 | echo "%%END%%" >> $job_to_send |
---|
1398 | |
---|
1399 | elif [[ $remote_host = lckyut ]] |
---|
1400 | then |
---|
1401 | echo "cat > scpjob.$identifier << %%END%%" >> $job_to_send |
---|
1402 | echo "#!/bin/bash" >> $job_to_send |
---|
1403 | echo "#PJM -L \"vnode=1\"" >> $job_to_send |
---|
1404 | echo "#PJM -L \"rscgrp=$return_queue\"" >> $job_to_send |
---|
1405 | echo "#PJM --no-stging" >> $job_to_send |
---|
1406 | echo "#PJM -L \"elapse=30:00\"" >> $job_to_send |
---|
1407 | echo "#PJM -o \$HOME/job_queue/last_job_transfer_protocol" >> $job_to_send |
---|
1408 | echo "#PJM -j" >> $job_to_send |
---|
1409 | echo " " >> $job_to_send |
---|
1410 | echo "export LANG=en_US.UTF-8" >> $job_to_send |
---|
1411 | echo "set -x" >> $job_to_send |
---|
1412 | echo "batch_scp $PORTOPT -d -w 10 -u $local_user $local_address $remote_dayfile \"$job_catalog\" $local_dayfile" >> $job_to_send |
---|
1413 | echo "[[ \"\$for_subjob_to_do\" != \"\" ]] && eval \$for_subjob_to_do" >> $job_to_send |
---|
1414 | echo "%%END%%" >> $job_to_send |
---|
1415 | |
---|
1416 | elif [[ $remote_host = lccrayb || $remote_host = lccrayh ]] |
---|
1417 | then |
---|
1418 | echo "cat > scpjob.$identifier << %%END%%" >> $job_to_send |
---|
1419 | echo "#!/bin/bash" >> $job_to_send |
---|
1420 | echo "#PBS -N job_protocol_transfer" >> $job_to_send |
---|
1421 | echo "#PBS -l walltime=00:30:00" >> $job_to_send |
---|
1422 | echo "#PBS -l nodes=1:ppn=1" >> $job_to_send |
---|
1423 | echo "#PBS -o \$HOME/job_queue/last_job_transfer_protocol" >> $job_to_send |
---|
1424 | echo "#PBS -j oe" >> $job_to_send |
---|
1425 | echo " " >> $job_to_send |
---|
1426 | echo "set -x" >> $job_to_send |
---|
1427 | echo "batch_scp $PORTOPT -d -w 10 -u $local_user $local_address ${job_catalog}/$remote_dayfile \"$job_catalog\" $local_dayfile" >> $job_to_send |
---|
1428 | echo "[[ \"\$for_subjob_to_do\" != \"\" ]] && eval \$for_subjob_to_do" >> $job_to_send |
---|
1429 | echo "%%END%%" >> $job_to_send |
---|
1430 | |
---|
1431 | elif [[ $remote_host = lcocean ]] |
---|
1432 | then |
---|
1433 | echo "cat > scpjob.${identifier}.tmp << %%END%%" >> $job_to_send |
---|
1434 | echo "#!/bin/bash" >> $job_to_send |
---|
1435 | echo "SGEPREFIX -S /bin/bash" >> $job_to_send |
---|
1436 | echo "SGEPREFIX -N transfer_$job_name" >> $job_to_send |
---|
1437 | echo "SGEPREFIX -cwd" >> $job_to_send |
---|
1438 | echo "SGEPREFIX -j y" >> $job_to_send |
---|
1439 | echo "SGEPREFIX -o ${local_host}_${job_name}_scpjob_$identifier" >> $job_to_send |
---|
1440 | echo " " >> $job_to_send |
---|
1441 | echo "set -x" >> $job_to_send |
---|
1442 | echo "export PALM_BIN=$PALM_BIN" | sed -e 's:'$HOME':$HOME:' >> $job_to_send |
---|
1443 | echo "export PATH=\$PATH:\$PALM_BIN" >> $job_to_send |
---|
1444 | echo "" >> $job_to_send |
---|
1445 | echo "batch_scp $PORTOPT -d -w 10 -u $local_user $local_address ${job_catalog}/$remote_dayfile \"$job_catalog\" $local_dayfile" >> $job_to_send |
---|
1446 | echo "[[ \"\$for_subjob_to_do\" != \"\" ]] && eval \$for_subjob_to_do" >> $job_to_send |
---|
1447 | echo "rm -f scpjob.${identifier}" >> $job_to_send |
---|
1448 | echo "%%END%%" >> $job_to_send |
---|
1449 | echo "sed -e 's/SGEPREFIX/#$/g' scpjob.${identifier}.tmp > scpjob.${identifier}" >> $job_to_send |
---|
1450 | echo "rm -f scpjob.${identifier}.tmp" >> $job_to_send |
---|
1451 | |
---|
1452 | elif [[ $remote_host = lcflow ]] |
---|
1453 | then |
---|
1454 | echo "cat > scpjob.${identifier}.tmp << %%END%%" >> $job_to_send |
---|
1455 | echo "#!/bin/bash" >> $job_to_send |
---|
1456 | echo "SGEPREFIX -S /bin/bash" >> $job_to_send |
---|
1457 | echo "SGEPREFIX -N transfer_$job_name" >> $job_to_send |
---|
1458 | echo "SGEPREFIX -cwd" >> $job_to_send |
---|
1459 | echo "SGEPREFIX -l h_rt=01:00:00" >> $job_to_send |
---|
1460 | echo "SGEPREFIX -l h_vmem=500M" >> $job_to_send |
---|
1461 | echo "SGEPREFIX -j y" >> $job_to_send |
---|
1462 | echo "SGEPREFIX -o ${local_host}_${job_name}_scpjob_$identifier" >> $job_to_send |
---|
1463 | echo " " >> $job_to_send |
---|
1464 | echo "set -x" >> $job_to_send |
---|
1465 | echo "export PALM_BIN=$PALM_BIN" | sed -e 's:'$HOME':$HOME:' >> $job_to_send |
---|
1466 | echo "export PATH=\$PATH:\$PALM_BIN" >> $job_to_send |
---|
1467 | echo "" >> $job_to_send |
---|
1468 | echo "batch_scp $PORTOPT -d -w 10 -u $local_user $local_address ${job_catalog}/$remote_dayfile \"$job_catalog\" $local_dayfile" >> $job_to_send |
---|
1469 | echo "[[ \"\$for_subjob_to_do\" != \"\" ]] && eval \$for_subjob_to_do" >> $job_to_send |
---|
1470 | echo "rm -f scpjob.${identifier}" >> $job_to_send |
---|
1471 | echo "%%END%%" >> $job_to_send |
---|
1472 | echo "sed -e 's/SGEPREFIX/#$/g' scpjob.${identifier}.tmp > scpjob.${identifier}" >> $job_to_send |
---|
1473 | echo "rm -f scpjob.${identifier}.tmp" >> $job_to_send |
---|
1474 | elif [[ $remote_host = lcxe6 ]] |
---|
1475 | then |
---|
1476 | echo "cat > scpjob.${identifier} << %%END%%" >> $job_to_send |
---|
1477 | echo "#!/bin/ksh" >> $job_to_send |
---|
1478 | echo "#PBS -N job_protocol_transfer" >> $job_to_send |
---|
1479 | echo "#PBS -l walltime=00:30:00" >> $job_to_send |
---|
1480 | echo "#PBS -A $project_account" >> $job_to_send |
---|
1481 | echo "#PBS -l mppwidth=1" >> $job_to_send |
---|
1482 | echo "#PBS -l mppnppn=1" >> $job_to_send |
---|
1483 | echo "#PBS -o \$HOME/job_queue/last_job_transfer_protocol" >> $job_to_send |
---|
1484 | echo "#PBS -j oe" >> $job_to_send |
---|
1485 | echo " " >> $job_to_send |
---|
1486 | echo "set -x" >> $job_to_send |
---|
1487 | echo "batch_scp $PORTOPT -d -w 10 -u $local_user $local_address ${job_catalog}/$remote_dayfile \"$job_catalog\" $local_dayfile" >> $job_to_send |
---|
1488 | echo "[[ \"\$for_subjob_to_do\" != \"\" ]] && eval \$for_subjob_to_do" >> $job_to_send |
---|
1489 | echo "%%END%%" >> $job_to_send |
---|
1490 | else |
---|
1491 | |
---|
1492 | echo "cat > scpjob.$identifier << %%END%%" >> $job_to_send |
---|
1493 | echo "# @\\\$-q $return_queue" >> $job_to_send |
---|
1494 | echo "# @\\\$-l${qsubtime} 10" >> $job_to_send |
---|
1495 | echo "# @\\\$-l${qsubmem} 10mb" >> $job_to_send |
---|
1496 | if [[ $remote_host = t3ej2 || $remote_host = t3ej5 || $remote_host = t3es ]] |
---|
1497 | then |
---|
1498 | echo "# @\$-l mpp_p=0" >> $job_to_send |
---|
1499 | fi |
---|
1500 | echo '# @\$-lF 10mb' >> $job_to_send |
---|
1501 | echo '# @\$-o job_queue/last_job_transfer_protocol' >> $job_to_send |
---|
1502 | echo '# @\\\$-eo' >> $job_to_send |
---|
1503 | echo " " >> $job_to_send |
---|
1504 | if [[ $remote_host = t3ej2 || $remote_host = t3ej5 ]] |
---|
1505 | then |
---|
1506 | echo "set +vx" >> $job_to_send |
---|
1507 | echo ". .profile" >> $job_to_send |
---|
1508 | fi |
---|
1509 | echo "set -x" >> $job_to_send |
---|
1510 | echo "batch_scp $PORTOPT -d -w 10 -u $local_user $local_address ${job_catalog}/$remote_dayfile \"$job_catalog\" $local_dayfile > /dev/null" >> $job_to_send |
---|
1511 | echo "[[ \"\$for_subjob_to_do\" != \"\" ]] && eval \$for_subjob_to_do" >> $job_to_send |
---|
1512 | echo "%%END%%" >> $job_to_send |
---|
1513 | |
---|
1514 | fi |
---|
1515 | |
---|
1516 | if [[ $(echo $remote_host | cut -c1-3) = ibm ]] |
---|
1517 | then |
---|
1518 | echo "llsubmit scpjob.$identifier" >> $job_to_send |
---|
1519 | elif [[ $remote_host = lcbullhh ]] |
---|
1520 | then |
---|
1521 | echo "sbatch scpjob.$identifier" >> $job_to_send |
---|
1522 | elif [[ $remote_host = lccrayb || $remote_host = lccrayh ]] |
---|
1523 | then |
---|
1524 | echo "msub -E -q $return_queue scpjob.$identifier" >> $job_to_send |
---|
1525 | elif [[ $remote_host = t3eb || $remote_host = t3eh || $remote_host = t3ej2 || $remote_host = t3ej5 ]] |
---|
1526 | then |
---|
1527 | echo "qsub -J n scpjob.$identifier" >> $job_to_send |
---|
1528 | elif [[ $remote_host = t3es ]] |
---|
1529 | then |
---|
1530 | echo "qsub -J n -s /bin/ksh scpjob.$identifier" >> $job_to_send |
---|
1531 | elif [[ $remote_host = lckiaps ]] |
---|
1532 | then |
---|
1533 | echo "mv scpjob.$identifier $job_catalog" >> $job_to_send |
---|
1534 | echo "ssh $SSH_PORTOPT ${remote_username}@${remote_address} \"$submcom ${job_catalog}/scpjob.$identifier\" " >> $job_to_send |
---|
1535 | echo "rm ${job_catalog}/scpjob.$identifier" >> $job_to_send |
---|
1536 | elif [[ $remote_host = lckyu* ]] |
---|
1537 | then |
---|
1538 | echo "scp $PORTOPT scpjob.$identifier ${remote_username}@${remote_address}:job_queue" >> $job_to_send |
---|
1539 | echo "ssh $SSH_PORTOPT ${remote_username}@${remote_address} \"cd job_queue; $submcom scpjob.$identifier; rm scpjob.$identifier\" " >> $job_to_send |
---|
1540 | elif [[ $remote_host = lcflow || $remote_host = lcocean ]] |
---|
1541 | then |
---|
1542 | echo "mv scpjob.$identifier $job_catalog" >> $job_to_send |
---|
1543 | echo "/usr/bin/ssh ${remote_username}@${remote_address} \"$init_cmds $module_calls cd $job_catalog; $submcom scpjob.$identifier\" " >> $job_to_send |
---|
1544 | else |
---|
1545 | echo "$submcom scpjob.$identifier" >> $job_to_send |
---|
1546 | fi |
---|
1547 | if [[ $remote_host != ibmku && $remote_host != lckiaps ]] |
---|
1548 | then |
---|
1549 | echo "rm scpjob.$identifier" >> $job_to_send |
---|
1550 | fi |
---|
1551 | if [[ $remote_host = nech ]] |
---|
1552 | then |
---|
1553 | echo "cd -" >> $job_to_send |
---|
1554 | fi |
---|
1555 | else |
---|
1556 | # echo "ftpcopy -d $local_address ${job_catalog}/$remote_dayfile \"$job_catalog\" $local_dayfile" >> $job_to_send |
---|
1557 | # ??? funktioniert das ÃŒberhaupt noch ??? |
---|
1558 | echo "nohup ftpcopy -d -w 15 $local_address ${job_catalog}/$remote_dayfile \"$job_catalog\" $local_dayfile > /dev/null &" >> $job_to_send |
---|
1559 | fi |
---|
1560 | echo "set -x" >> $job_to_send |
---|
1561 | echo " ' exit" >> $job_to_send |
---|
1562 | echo "set -x" >> $job_to_send |
---|
1563 | fi |
---|
1564 | |
---|
1565 | |
---|
1566 | # APPEND THE JOB-FILE (CREATE BY mrun) TO THE JOB-DIRECTIVES GENERATED ABOVE |
---|
1567 | cat $file_to_send >> $job_to_send |
---|
1568 | |
---|
1569 | if [[ $remote_host = ibm ]] |
---|
1570 | then |
---|
1571 | echo " " >> $job_to_send |
---|
1572 | echo "exit" >> $job_to_send |
---|
1573 | fi |
---|
1574 | |
---|
1575 | # REMOVE JOB-FILE |
---|
1576 | if [[ $remote_host = lctit || $remote_host = ibmku || $remote_host = lcflow ]] |
---|
1577 | then |
---|
1578 | echo " " >> $job_to_send |
---|
1579 | echo "rm ~/job_queue/$job_on_remhost" >> $job_to_send |
---|
1580 | fi |
---|
1581 | |
---|
1582 | |
---|
1583 | # TRANSFER JOB TO THE TARGET HOST (JOB-DIRECTORY) |
---|
1584 | if [[ $no_submit = false ]] |
---|
1585 | then |
---|
1586 | if [[ $remote_host != $local_host ]] |
---|
1587 | then |
---|
1588 | [[ $verify = true ]] && printf "\n >>> transfering job to \"$remote_host\"..." |
---|
1589 | if [[ $remote_host = ibms ]] # ssh on ibms cannot handle "~/" |
---|
1590 | then |
---|
1591 | job_catalog_save=$job_catalog |
---|
1592 | job_catalog=job_queue |
---|
1593 | elif [[ $remote_host = nech ]] |
---|
1594 | then |
---|
1595 | job_catalog_save=$job_catalog |
---|
1596 | job_catalog=/hpf/b/${remote_user}/job_queue |
---|
1597 | fi |
---|
1598 | if [[ $remote_host = nech ]] |
---|
1599 | then |
---|
1600 | # FILES CAN ONLY BE TRANSFERED VIA DKRZ'S ARCHIVE-SERVER |
---|
1601 | scp $PORTOPT $job_to_send ${remote_user}@136.172.44.205:${job_catalog}/$job_on_remhost |
---|
1602 | else |
---|
1603 | scp $ssh_key $PORTOPT $job_to_send ${remote_user}@${remote_address}:${job_catalog}/$job_on_remhost |
---|
1604 | fi |
---|
1605 | if [[ $? = 1 ]] |
---|
1606 | then |
---|
1607 | locat=scp; exit |
---|
1608 | fi |
---|
1609 | if [[ $remote_host = ibms ]] |
---|
1610 | then |
---|
1611 | job_catalog=$job_catalog_save |
---|
1612 | fi |
---|
1613 | [[ $verify = true ]] && printf "\n >>> finished\n" |
---|
1614 | else |
---|
1615 | eval job_catalog=$job_catalog |
---|
1616 | cp $job_to_send ${job_catalog}/$job_on_remhost |
---|
1617 | fi |
---|
1618 | |
---|
1619 | |
---|
1620 | |
---|
1621 | # START NQS- / LOADLEVELER-JOB |
---|
1622 | if [[ $remote_host != $local_host ]] |
---|
1623 | then |
---|
1624 | [[ $verify = true ]] && printf "\n >>> submitting job using \"qsub\"...\n" |
---|
1625 | |
---|
1626 | if [[ $remote_host = ibmku ]] |
---|
1627 | then |
---|
1628 | ssh $SSH_PORTOPT $remote_address -l $remote_user "cd $job_catalog; $submcom $job_on_remhost" |
---|
1629 | elif [[ $remote_host = lcflow ]] |
---|
1630 | then |
---|
1631 | /usr/bin/ssh $SSH_PORTOPT $remote_address -l $remote_user "$init_cmds $module_calls cd $job_catalog; $submcom $job_on_remhost" |
---|
1632 | else |
---|
1633 | ssh $ssh_key $SSH_PORTOPT $remote_address -l $remote_user "cd $job_catalog; $submcom $job_on_remhost; rm $job_on_remhost" |
---|
1634 | fi |
---|
1635 | |
---|
1636 | [[ $verify = true ]] && printf " >>> o.k.\n" |
---|
1637 | else |
---|
1638 | cd $job_catalog |
---|
1639 | if [[ $(echo $local_host | cut -c1-3) = ibm || $(echo $local_host | cut -c1-6) = lccray ]] |
---|
1640 | then |
---|
1641 | eval $submcom $job_on_remhost |
---|
1642 | elif [[ $local_host = lctit || $localhost = lcxe6 || $localhost = lck || $localhost = lckordi || $localhost = lcyon || $localhost = lcsb || $localhost = lckyu* ]] |
---|
1643 | then |
---|
1644 | chmod u+x $job_on_remhost |
---|
1645 | eval $submcom $job_on_remhost |
---|
1646 | elif [[ $local_host = nech ]] |
---|
1647 | then |
---|
1648 | if [[ $queue = default ]] |
---|
1649 | then |
---|
1650 | eval $submcom $job_on_remhost |
---|
1651 | else |
---|
1652 | eval $submcom -q $queue $job_on_remhost |
---|
1653 | fi |
---|
1654 | elif [[ $local_host = lcbullhh ]] |
---|
1655 | then |
---|
1656 | if [[ $queue = default ]] |
---|
1657 | then |
---|
1658 | eval $submcom $job_on_remhost |
---|
1659 | fi |
---|
1660 | else |
---|
1661 | qsub $job_on_remhost |
---|
1662 | fi |
---|
1663 | |
---|
1664 | # JOBFILE MUST NOT BE DELETED ON lctit/ibmku/lcflow. THIS WILL BE DONE |
---|
1665 | # AT THE END OF THE JOB |
---|
1666 | if [[ $local_host != lctit && $local_host != ibmku && $local_host != lcflow ]] |
---|
1667 | then |
---|
1668 | rm $job_on_remhost |
---|
1669 | fi |
---|
1670 | cd - > /dev/null |
---|
1671 | fi |
---|
1672 | fi |
---|
1673 | |
---|
1674 | # FINAL ACTIONS |
---|
1675 | if [[ $no_submit = false ]] |
---|
1676 | then |
---|
1677 | rm -f $job_to_send |
---|
1678 | fi |
---|
1679 | [[ $verify = true ]] && printf "\n\n *** SUBJOB finished \n\n" |
---|