source: palm/trunk/SCRIPTS/subjob @ 1281

Last change on this file since 1281 was 1280, checked in by raasch, 10 years ago

last commit documented

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