source: palm/trunk/SCRIPTS/subjob @ 2147

Last change on this file since 2147 was 2147, checked in by scharf, 7 years ago

improved palmplot, added two imuk hosts, changed allocation of resources for lcbullhh and corrected land surface parameters

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