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