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