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