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