[1] | 1 | #!/bin/ksh |
---|
[82] | 2 | # subjob - Plot-Shellskript Version: @(#)SUBJOB 1.0 |
---|
[66] | 3 | # $Id: subjob 54 2007-03-08 00:00:02Z raasch $ |
---|
[1] | 4 | |
---|
| 5 | # Prozedur zum automatischen Generieren von Batch-Jobs, die unter NQS |
---|
| 6 | # laufen sollen und deren Ergebnis (Dayfile) zum Job-generierenden |
---|
| 7 | # Host zurueckgeschickt werden sollen |
---|
| 8 | |
---|
| 9 | |
---|
| 10 | # letzte Aenderung: |
---|
| 11 | # 29/06/94 - Siggi - Beginn mit Erstellung der Originalversion |
---|
| 12 | # 08/07/94 - Siggi - Originalversion abgeschlossen (Version 1.0) |
---|
| 13 | # 06/02/98 - Siggi - berte validiert |
---|
| 14 | # 27/01/01 - Siggi - ground.yonsei.ac.kr validiert, Jobs zur T3E in Korea |
---|
| 15 | # moeglich |
---|
| 16 | # 08/02/01 - Siggi - alle subjob-Meldungen ins englische uebersetzt |
---|
| 17 | # 25/05/02 - Siggi - Unterstuetzung des LoadLeveler |
---|
| 18 | # 30/05/02 - Siggi - Validierung fuer ibm-Rechner in Seoul (nobel) sowie |
---|
| 19 | # allgemeine Anpassungen fuer ibm-Rechner |
---|
| 20 | # 15/10/02 - Siggi - Neue Default-Jobklasse (p_normal) fuer IBM in Seoul |
---|
| 21 | # Ruecktransfer des Jobprotokolls fuer diese |
---|
| 22 | # Maschine abgeschaltet |
---|
| 23 | # 31/10/02 - Siggi - berni validiert |
---|
| 24 | # 06/11/02 - Siggi - Neue Jobklassen auf ibmb und ibmh |
---|
| 25 | # 08/11/02 - Siggi - quanero validiert |
---|
| 26 | # 11/12/02 - Siggi - Notification fuer Transfer-Jobs abgeschaltet |
---|
| 27 | # 23/01/03 - Siggi - hostname nobel changed to nobela |
---|
| 28 | # 06/02/03 - Siggi - gregale validated |
---|
| 29 | # 12/02/03 - Siggi - orkan and maestro validated |
---|
| 30 | # 21/02/03 - Siggi - all nobel nodes in Seoul validated |
---|
| 31 | # 12/03/03 - Siggi - nec at DKRZ validated |
---|
| 32 | # 13/03/03 - Siggi - new nqs resource variable Memory |
---|
| 33 | # 07/04/03 - Siggi - processor request option -c on nech needs tasks per |
---|
| 34 | # node |
---|
| 35 | # 11/04/03 - Siggi - network on ibms has attribute "shared" |
---|
| 36 | # 31/07/03 - Siggi - nqs2 on nech implemented (provisional: -h nech2) |
---|
| 37 | # cxxl added to ibmh |
---|
| 38 | # 29/08/03 - Siggi - changes in job queues and communication system on |
---|
| 39 | # ibms |
---|
| 40 | # 24/10/03 - Siggi - using alternate hanni address 130.75.4.2 |
---|
| 41 | # 30/10/03 - Siggi - nech is not supported any more |
---|
| 42 | # 10/11/03 - Siggi - nech2 renamed to nech |
---|
| 43 | # 20/11/03 - Siggi - submit command on nech changed from qsub.test to qsub |
---|
| 44 | # 29/03/04 - Siggi - ground not supported any more, gfdl3 validated |
---|
| 45 | # 31/03/04 - Siggi - new option -N for node usage |
---|
| 46 | # 12/04/04 - Siggi - scp2 instead of scp used for transfer from decalpha |
---|
| 47 | # due to error in ssh installation (otherwise a prompt |
---|
| 48 | # for the password appears) |
---|
| 49 | # 23/07/04 - Siggi - changes due to the new berni configuration |
---|
| 50 | # (federation switch) |
---|
| 51 | # 01/09/04 - Gerald new job-classes on hanni |
---|
| 52 | # 08/09/04 - Siggi - hanni IP address changed to 130.75.4.10 |
---|
| 53 | # 23/11/04 - Siggi - new job class cdata on hanni and berni |
---|
| 54 | # 03/12/04 - Siggi - notification on ibm switched of in case of |
---|
| 55 | # delete_dayfile = true, node usage in cdev set to |
---|
| 56 | # shared |
---|
| 57 | # 16/02/05 - Gerald hababai validated |
---|
| 58 | # 29/03/05 - Micha - new job class channi on hanni |
---|
| 59 | # 11/05/05 - Siggi - ConsumableMemory is now required as resource keyword |
---|
| 60 | # on ibms |
---|
| 61 | # 24/05/05 - Siggi - Default queue on ibms changed from p_normal_1.3 to |
---|
| 62 | # p_normal |
---|
| 63 | # 30/06/05 - Siggi - network changed for queue cdev from "us" to "ip" |
---|
| 64 | # 12/07/05 - Siggi - in network.mpi on ibmh/ibmb "csss" changed to |
---|
| 65 | # "sn_all", new job class cexp |
---|
| 66 | # 08/09/05 - Siggi - IP-address of gfdl3 changed |
---|
| 67 | # 31/10/05 - Siggi - new job class pp on hurricane, serial jobs on |
---|
| 68 | # hurricane (with -X0) |
---|
| 69 | # 01/11/05 - Siggi - missing queue for jobs submitted on nech (for nech) |
---|
| 70 | # added |
---|
| 71 | # 30/12/05 - Siggi - change of IP adresses in subnet 130.75.105 |
---|
| 72 | # 09/02/06 - Siggi - ibmy admitted |
---|
| 73 | # 10/02/06 - Siggi - scp2 changed to /bin/scp on decalpha |
---|
| 74 | # 13/04/06 - Siggi - ostria admitted |
---|
| 75 | # 18/04/06 - Siggi - new option -O for OpenMP usage |
---|
| 76 | # 24/05/06 - Siggi - lctit admitted, ftpjob renamed scpjob |
---|
| 77 | # 25/07/06 - Siggi - gfdl5 (ibmy) admitted for submitting jobs |
---|
| 78 | # 27/09/06 - Siggi - breg/hreg extended with berni/hanni |
---|
| 79 | # 25/10/06 - Siggi - data_limit set to 1.76 GByte on hanni and berni |
---|
| 80 | # 28/11/06 - Siggi - levanto admitted |
---|
[5] | 81 | # 13/02/07 - Siggi - hpmuk releated code removed |
---|
[35] | 82 | # 01/03/07 - Siggi - adjustments for RIAM machines gate and NEC-SX8 (n-sx) |
---|
[82] | 83 | # 12/04/07 - Siggi - option -f (filetransfer protocol) removed, scp only |
---|
[1] | 84 | |
---|
| 85 | |
---|
| 86 | # VARIABLENVEREINBARUNGEN + DEFAULTWERTE |
---|
| 87 | delete_dayfile=false |
---|
| 88 | locat=normal |
---|
| 89 | no_default_queue=none |
---|
| 90 | no_submit=false |
---|
| 91 | job_catalog="~/job_queue" |
---|
| 92 | job_name=none |
---|
| 93 | local_user=$LOGNAME |
---|
| 94 | node_usage=shared |
---|
| 95 | numprocs=1 |
---|
| 96 | punkte="..........................................................." |
---|
| 97 | submcom=qsub |
---|
| 98 | queue=default |
---|
| 99 | remote_host=none |
---|
| 100 | remote_user="" |
---|
| 101 | verify=true |
---|
| 102 | |
---|
| 103 | typeset -i cputime=0 memory=0 Memory=0 minuten resttime sekunden stunden |
---|
| 104 | typeset -i inumprocs nodes=0 tasks_per_node=0 threads_per_task=1 |
---|
| 105 | typeset -L20 spalte1 |
---|
| 106 | typeset -R40 spalte2 |
---|
| 107 | typeset -L60 spalte3 |
---|
| 108 | |
---|
| 109 | |
---|
| 110 | |
---|
| 111 | # FEHLERBEHANDLUNG |
---|
| 112 | # BEI EXIT: |
---|
| 113 | trap 'if [[ $locat != normal ]] |
---|
| 114 | then |
---|
| 115 | case $locat in |
---|
| 116 | (option) printf "\n --> available optios can be displayed" |
---|
| 117 | printf " by typing:" |
---|
| 118 | printf "\n \"subjob ?\" \n";; |
---|
| 119 | (ftpcopy|parameter|scp|verify) printf "\n";; |
---|
| 120 | (*) printf "\n +++ unknown error" |
---|
| 121 | printf "\n please inform S. Raasch!\n" |
---|
| 122 | esac |
---|
| 123 | [[ -f $job_to_send ]] && rm $job_to_send |
---|
| 124 | printf "\n\n+++ SUBJOB killed \n\n" |
---|
| 125 | fi' exit |
---|
| 126 | |
---|
| 127 | |
---|
| 128 | # BEI TERMINAL-BREAK: |
---|
| 129 | trap '[[ -f $job_to_send ]] && rm $job_to_send |
---|
| 130 | printf "\n\n+++ SUBJOB killed \n\n" |
---|
| 131 | exit |
---|
| 132 | ' 2 |
---|
| 133 | |
---|
| 134 | |
---|
| 135 | |
---|
| 136 | |
---|
| 137 | # LOKALEN HOSTNAMEN FESTSTELLEN |
---|
| 138 | local_host=$(hostname) |
---|
| 139 | |
---|
| 140 | |
---|
| 141 | |
---|
| 142 | # HOSTSPEZIFISCHE VARIABLEN VEREINBAREN BZW. PRUEFEN, OB LOKALER HOST |
---|
| 143 | # UEBERHAUPT ZULAESSIG IST |
---|
| 144 | case $local_host in |
---|
| 145 | (atmos) local_addres=172.20.25.35; local_host=lcide;; |
---|
[5] | 146 | (bora) local_addres=130.75.105.103; local_host=lcmuk;; |
---|
[1] | 147 | (breg*-en0|berni*-en0) local_addres=130.73.230.10; local_host=ibmb;; |
---|
[12] | 148 | (breva) local_addres=130.75.105.98; local_host=lcmuk;; |
---|
[1] | 149 | (cs*) local_addres=136.172.44.131; local_host=nech;; |
---|
[5] | 150 | (elephanta) local_addres=130.75.105.6; local_host=lcmuk;; |
---|
[101] | 151 | (gallego) local_addres=130.75.105.10; local_host=lcmuk;; |
---|
[35] | 152 | (gate|n-sx) local_addres=133.5.178.11; local_host=neck;; |
---|
[1] | 153 | (gfdl5) local_addres=165.132.26.58; local_host=ibmy;; |
---|
| 154 | (gfdl3.yonsei.ac.kr) local_addres=165.132.26.56; local_host=decalpha;; |
---|
[5] | 155 | (gregale) local_addres=130.75.105.109; local_host=lcmuk;; |
---|
| 156 | (hababai) local_addres=130.75.105.108; local_host=lcmuk;; |
---|
[1] | 157 | (hreg*-en0|hanni*-en0) local_addres=130.75.4.10; local_host=ibmh;; |
---|
[5] | 158 | (irifi) local_addres=130.75.105.104; local_host=lcmuk;; |
---|
| 159 | (levanto) local_addres=130.75.105.45; local_host=lcmuk;; |
---|
| 160 | (maestro) local_addres=130.75.105.2; local_host=lcmuk;; |
---|
[1] | 161 | (nobel*) local_addres=150.183.5.101; local_host=ibms;; |
---|
[5] | 162 | (orkan) local_addres=130.75.105.3; local_host=lcmuk;; |
---|
| 163 | (ostria) local_addres=130.75.105.106; local_host=lcmuk;; |
---|
| 164 | (quanero) local_addres=130.75.105.107; local_host=lcmuk;; |
---|
[1] | 165 | (scirocco) local_addres=172.20.25.41; local_host=lcmuk;; |
---|
| 166 | (sun1|sun2) local_addres=130.75.6.1; local_host=unics;; |
---|
| 167 | (tgg*) local_addres=172.17.75.161; local_host=lctit;; |
---|
| 168 | (vorias) local_addres=172.20.25.43; local_host=lcmuk;; |
---|
| 169 | (*) printf "\n +++ \"$local_host\" unknown"; |
---|
| 170 | printf "\n please inform S. Raasch!"; |
---|
| 171 | locat=parameter; exit;; |
---|
| 172 | esac |
---|
| 173 | |
---|
| 174 | |
---|
| 175 | |
---|
| 176 | # REMOTE HOST DEFAULTMAESSIG = LOCAL HOST SETZEN |
---|
| 177 | remote_host=$local_host |
---|
| 178 | |
---|
| 179 | |
---|
| 180 | |
---|
| 181 | |
---|
| 182 | # PROZEDUROPTIONEN EINLESEN |
---|
[82] | 183 | while getopts :c:dDh:m:n:N:O:q:t:T:u:vX: option |
---|
[1] | 184 | do |
---|
| 185 | case $option in |
---|
| 186 | (c) job_catalog=$OPTARG;; |
---|
| 187 | (d) delete_dayfile=true;; |
---|
| 188 | (D) no_submit=true;; |
---|
| 189 | (h) remote_host=$OPTARG;; |
---|
| 190 | (m) memory=$OPTARG;; |
---|
| 191 | (n) job_name=$OPTARG;; |
---|
| 192 | (N) node_usage=$OPTARG;; |
---|
| 193 | (O) threads_per_task=$OPTARG;; |
---|
| 194 | (q) no_default_queue=$OPTARG;; |
---|
| 195 | (t) cputime=$OPTARG;; |
---|
| 196 | (T) tasks_per_node=$OPTARG;; |
---|
| 197 | (u) remote_user=$OPTARG;; |
---|
| 198 | (v) verify=false;; |
---|
| 199 | (X) numprocs=$OPTARG;; |
---|
| 200 | (\?) printf "\n +++ Option $OPTARG unknown \n"; |
---|
| 201 | locat=option; exit;; |
---|
| 202 | esac |
---|
| 203 | done |
---|
| 204 | |
---|
| 205 | |
---|
| 206 | # JOBDATEINAMEN ALS NAECHSTES ARGUMENT HOLEN |
---|
| 207 | shift OPTIND-1; file_to_send=$1 |
---|
| 208 | |
---|
| 209 | |
---|
| 210 | # KURZE AUFRUFBESCHREIBUNG WIRD HIER AUSGEGEBEN |
---|
| 211 | if [ "$1" = "?" ] |
---|
| 212 | then |
---|
| 213 | (printf "\n *** subjob can be called as follows:\n" |
---|
| 214 | printf "\n subjob -c.. -d -D -h.. -m.. -q.. -t.. -u.. -v <jobfile>\n" |
---|
| 215 | printf "\n Description of available options:\n" |
---|
| 216 | printf "\n Option Description Default-Value" |
---|
| 217 | printf "\n -c job-input- and output-catalog ~/job_queue" |
---|
| 218 | printf "\n -d no job-protocol will be created ---" |
---|
| 219 | printf "\n -D only the job-file will be created ---" |
---|
| 220 | printf "\n -h execution host, available hosts: $remote_host" |
---|
[5] | 221 | printf "\n ibm, ibmb, ibmh, ibms, ibmy, lcmuk," |
---|
[35] | 222 | printf "\n lctit, nech, neck, unics" |
---|
[1] | 223 | printf "\n -m memory demand per process in MByte ---" |
---|
| 224 | printf "\n -n jobname <jobdatei>" |
---|
| 225 | printf "\n -O threads per task (for OpenMP usage) 1" |
---|
| 226 | printf "\n -q job-queue to be used default" |
---|
| 227 | printf "\n -t allowed cpu-time in seconds ---" |
---|
| 228 | printf "\n -T tasks per node (on parallel hosts) ---" |
---|
| 229 | printf "\n -u username on execution host from .netrc" |
---|
| 230 | printf "\n -v no prompt for confirmation ---" |
---|
| 231 | printf "\n -X # of processors (on parallel hosts) 1" |
---|
| 232 | printf "\n " |
---|
| 233 | printf "\n The only possible positional parameter is <jobfile>:" |
---|
| 234 | printf "\n The complete NQS-job must be provided here." |
---|
| 235 | printf "\n <jobfile>=? creates this outline\n\n") | more |
---|
| 236 | exit |
---|
| 237 | fi |
---|
| 238 | |
---|
| 239 | |
---|
| 240 | |
---|
| 241 | # PRUEFEN, OB JOBDATEI ANGEGEBEN WURDE UND OB SIE AUCH EXISTIERT |
---|
| 242 | if [[ "$file_to_send" = "" ]] |
---|
| 243 | then |
---|
| 244 | printf "\n +++ job-file missing" |
---|
| 245 | locat=parameter; exit |
---|
| 246 | else |
---|
| 247 | if [[ -f $file_to_send ]] |
---|
| 248 | then |
---|
| 249 | true |
---|
| 250 | else |
---|
| 251 | printf "\n +++ job-file: " |
---|
| 252 | printf "\n $file_to_send" |
---|
| 253 | printf "\n does not exist" |
---|
| 254 | locat=parameter; exit |
---|
| 255 | fi |
---|
| 256 | fi |
---|
| 257 | |
---|
| 258 | |
---|
| 259 | |
---|
| 260 | # FALLS KEIN JOBNAME ANGEGEBEN WURDE, WIRD JOBNAME = JOBDATEINAME |
---|
| 261 | # GESETZT. VORAUSSETZUNG: JOBDATEINAME BEINHALTET KEINE PFADE |
---|
| 262 | if [[ $job_name = none ]] |
---|
| 263 | then |
---|
| 264 | job_name=$file_to_send |
---|
| 265 | fi |
---|
| 266 | if [[ $(echo $job_name | grep -c "/") != 0 ]] |
---|
| 267 | then |
---|
| 268 | printf "\n +++ job-file name: " |
---|
| 269 | printf "\n $job_name" |
---|
| 270 | printf "\n must not contain \"/\"-characters" |
---|
| 271 | locat=parameter; exit |
---|
| 272 | fi |
---|
| 273 | |
---|
| 274 | |
---|
| 275 | |
---|
| 276 | |
---|
| 277 | # HOSTSPEZIFISCHE GROESSEN VEREINBAREN BZW. ABBRUCH BEI UNZULAESSIGEM HOST |
---|
| 278 | # ODER WENN HOST NICHT ANGEGEBEN WURDE |
---|
| 279 | if [[ $remote_host = none ]] |
---|
| 280 | then |
---|
| 281 | printf "\n +++ host missing" |
---|
| 282 | locat=option; exit |
---|
| 283 | else |
---|
| 284 | case $remote_host in |
---|
| 285 | (ibm) queue=p690_standard; remote_addres=134.76.99.81; submcom=/usr/lpp/LoadL/full/bin/llsubmit;; |
---|
| 286 | (ibmb) queue=cpar; remote_addres=130.73.230.10; submcom=/usr/lpp/LoadL/full/bin/llsubmit;; |
---|
| 287 | (ibmh) queue=cpar; remote_addres=130.75.4.10; submcom=/usr/lpp/LoadL/full/bin/llsubmit;; |
---|
| 288 | (ibms) queue=p_normal; remote_addres=150.183.5.101; submcom=/usr/lpp/LoadL/full/bin/llsubmit;; |
---|
| 289 | (ibmy) queue=parallel; remote_addres=165.132.26.58; submcom=/usr/lpp/LoadL/full/bin/llsubmit;; |
---|
[69] | 290 | (lctit) queue=default; remote_addres=172.17.75.161; submcom=/n1ge/TITECH_GRID/tools/bin/n1ge;; |
---|
[1] | 291 | (nech) qsubmem=memsz_job; qsubtime=cputim_job; remote_addres=136.172.44.147; submcom="/usr/local/bin/qsub";; |
---|
[35] | 292 | (neck) qsubmem=memsz_job; qsubtime=cputim_job; remote_addres=133.5.178.11; submcom="/usr/bin/nqsII/qsub";; |
---|
[1] | 293 | (vpp) qsubmem=m; qsubtime=t; queue=vpp; remote_addres=130.75.4.130;; |
---|
| 294 | (unics) qsubmem=d; qsubtime=t; queue=unics; remote_addres=130.75.6.1;; |
---|
| 295 | (*) printf "\n +++ hostname \"$remote_host\" not allowed"; |
---|
| 296 | locat=parameter; exit;; |
---|
| 297 | esac |
---|
| 298 | fi |
---|
| 299 | |
---|
| 300 | |
---|
| 301 | # EVTL. PRUEFEN, OB ANGEGEBENE QUEUE ZULAESSIG IST |
---|
| 302 | if [[ $no_default_queue != none ]] |
---|
| 303 | then |
---|
| 304 | error=false |
---|
| 305 | ndq=$no_default_queue |
---|
| 306 | case $remote_host in |
---|
| 307 | (ibm) case $ndq in |
---|
| 308 | (p690_express|p690_standard|p690_long) error=false;; |
---|
| 309 | (*) error=true;; |
---|
| 310 | esac;; |
---|
| 311 | (ibmb) case $ndq in |
---|
| 312 | (cdata|cdev|cexp|c1|cshare|csolo|cspec) error=false;; |
---|
| 313 | (*) error=true;; |
---|
| 314 | esac;; |
---|
| 315 | (ibmh) case $ndq in |
---|
| 316 | (cdata|cdev|cexp|channi|cxxl|c1|cshare|csolo|cspec) error=false;; |
---|
| 317 | (*) error=true;; |
---|
| 318 | esac;; |
---|
| 319 | (ibms) case $ndq in |
---|
| 320 | (express|normal|p_express|p_normal|p_normal_1.3|p_normal_1.7|grand) error=false;; |
---|
| 321 | (*) error=true;; |
---|
| 322 | esac;; |
---|
| 323 | (ibmy) case $ndq in |
---|
| 324 | (parallel) error=false;; |
---|
| 325 | (*) error=true;; |
---|
| 326 | esac;; |
---|
| 327 | (lctit) case $ndq in |
---|
[69] | 328 | (default|high|bes1|bes2|sla1|sla2) error=false;; |
---|
[1] | 329 | (*) error=true;; |
---|
| 330 | esac;; |
---|
| 331 | (t3eb) case $ndq in |
---|
| 332 | (berte|p50|p100|p392|forfree|p25himem) error=false;; |
---|
| 333 | (*) error=true;; |
---|
| 334 | esac;; |
---|
| 335 | (t3eh) case $ndq in |
---|
| 336 | (para_t3e|em|k|l|lm|comp_t3e|c|p|ht) error=false;; |
---|
| 337 | (*) error=true;; |
---|
| 338 | esac;; |
---|
| 339 | (t3ej2|t3ej5) case $ndq in |
---|
| 340 | (low|normal|high) error=false;; |
---|
| 341 | (*) error=true;; |
---|
| 342 | esac;; |
---|
| 343 | (t3es) case $ndq in |
---|
| 344 | (batch|serial-4|pe4|p48|pe16|pe32|pe64|pe128) error=false;; |
---|
| 345 | (*) error=true;; |
---|
| 346 | esac;; |
---|
| 347 | (unics) case $ndq in |
---|
| 348 | (unics|ht) error=false;; |
---|
| 349 | (*) error=true;; |
---|
| 350 | esac;; |
---|
| 351 | esac |
---|
| 352 | if [[ $error = true ]] |
---|
| 353 | then |
---|
| 354 | printf "\n +++ queue \"$no_default_queue\" on host \"$remote_host\" not allowed" |
---|
| 355 | locat=parameter; exit |
---|
| 356 | else |
---|
| 357 | queue=$no_default_queue |
---|
| 358 | fi |
---|
| 359 | fi |
---|
| 360 | |
---|
| 361 | |
---|
| 362 | |
---|
| 363 | # KNOTENNUTZUNG IN ENTWICKLERQUEUE MUSS SHARED SEIN |
---|
| 364 | if [[ $node_usage != shared && $queue = cdev ]] |
---|
| 365 | then |
---|
| 366 | node_usage=shared |
---|
| 367 | fi |
---|
| 368 | |
---|
| 369 | |
---|
| 370 | |
---|
| 371 | # PRUEFEN DER CPU-ZEIT, ZEIT NACH STUNDEN, MINUTEN UND SEKUNDEN |
---|
| 372 | # AUFTEILEN |
---|
| 373 | done=false |
---|
| 374 | while [[ $done = false ]] |
---|
| 375 | do |
---|
| 376 | if (( $cputime <= 0 )) |
---|
| 377 | then |
---|
| 378 | printf "\n +++ wrong cpu-time or cpu-time missing" |
---|
| 379 | printf "\n >>> Please type cpu-time in seconds as INTEGER:" |
---|
| 380 | printf "\n >>> " |
---|
| 381 | read cputime 1>/dev/null 2>&1 |
---|
| 382 | else |
---|
| 383 | done=true |
---|
| 384 | fi |
---|
| 385 | done |
---|
| 386 | if [[ $remote_host = nech ]] |
---|
| 387 | then |
---|
| 388 | if (( tasks_per_node != 0 )) |
---|
| 389 | then |
---|
| 390 | (( cputime = cputime * tasks_per_node )) |
---|
| 391 | elif [[ $numprocs != 0 ]] |
---|
| 392 | then |
---|
| 393 | (( cputime = cputime * numprocs )) |
---|
| 394 | fi |
---|
| 395 | fi |
---|
| 396 | (( stunden = cputime / 3600 )) |
---|
| 397 | (( resttime = cputime - stunden * 3600 )) |
---|
| 398 | (( minuten = resttime / 60 )) |
---|
| 399 | (( sekunden = resttime - minuten * 60 )) |
---|
| 400 | timestring=${stunden}:${minuten}:${sekunden} |
---|
| 401 | |
---|
| 402 | |
---|
| 403 | |
---|
| 404 | # PRUEFEN DER KERNSPEICHERANFORDERUNG |
---|
| 405 | done=false |
---|
| 406 | while [[ $done = false ]] |
---|
| 407 | do |
---|
| 408 | if (( memory <= 0 )) |
---|
| 409 | then |
---|
| 410 | printf "\n +++ wrong memory demand or memory demand missing" |
---|
| 411 | printf "\n >>> Please type memory in MByte per process as INTEGER:" |
---|
| 412 | printf "\n >>> " |
---|
| 413 | read memory 1>/dev/null 2>&1 |
---|
| 414 | else |
---|
| 415 | done=true |
---|
| 416 | fi |
---|
| 417 | done |
---|
| 418 | |
---|
[35] | 419 | if [[ $remote_host = nech || $remote_host = neck ]] |
---|
[1] | 420 | then |
---|
| 421 | if (( tasks_per_node != 0 )) |
---|
| 422 | then |
---|
| 423 | (( Memory = memory * tasks_per_node / 1000 )) |
---|
| 424 | elif [[ $numprocs != 0 ]] |
---|
| 425 | then |
---|
| 426 | (( Memory = memory * numprocs / 1000 )) |
---|
| 427 | else |
---|
| 428 | (( Memory = memory / 1000 )) |
---|
| 429 | fi |
---|
| 430 | fi |
---|
| 431 | |
---|
| 432 | |
---|
| 433 | # SPEICHERBERECHNUNG BEI OPENMP-NUTZUNG |
---|
| 434 | if [[ $(echo $remote_host | cut -c1-3) = ibm ]] |
---|
| 435 | then |
---|
| 436 | (( memory = memory * threads_per_task )) |
---|
| 437 | fi |
---|
| 438 | |
---|
| 439 | |
---|
| 440 | # BERECHNUNG DER ANZAHL DER ZU VERWENDENDEN KNOTEN |
---|
| 441 | if (( tasks_per_node != 0 )) |
---|
| 442 | then |
---|
| 443 | (( nodes = numprocs / ( tasks_per_node * threads_per_task ) )) |
---|
| 444 | fi |
---|
| 445 | |
---|
| 446 | |
---|
| 447 | |
---|
| 448 | # HEADER-AUSGABE |
---|
| 449 | if [[ $verify = true ]] |
---|
| 450 | then |
---|
| 451 | printf "\n\n" |
---|
| 452 | printf "#--------------------------------------------------------------# \n" |
---|
| 453 | spalte1=SUBJOB;spalte2=$(date) |
---|
| 454 | printf "| $spalte1$spalte2 | \n" |
---|
| 455 | printf "| | \n" |
---|
| 456 | printf "| values of parameters/options: | \n" |
---|
| 457 | spalte1=local_host$punkte; spalte2=$punkte$local_host |
---|
| 458 | printf "| $spalte1$spalte2 | \n" |
---|
| 459 | spalte1=remote_host$punkte; spalte2=$punkte$remote_host |
---|
| 460 | printf "| $spalte1$spalte2 | \n" |
---|
| 461 | spalte1=queue$punkte; spalte2=$punkte$queue |
---|
| 462 | printf "| $spalte1$spalte2 | \n" |
---|
| 463 | spalte1=memory$punkte; spalte2="$punkte$memory mb" |
---|
| 464 | printf "| $spalte1$spalte2 | \n" |
---|
| 465 | spalte1=cputime$punkte; spalte2="$punkte$cputime sec" |
---|
| 466 | printf "| $spalte1$spalte2 | \n" |
---|
| 467 | spalte1=job_name$punkte; spalte2="$punkte$job_name" |
---|
| 468 | printf "| $spalte1$spalte2 | \n" |
---|
| 469 | printf "#--------------------------------------------------------------# \n\n" |
---|
| 470 | |
---|
| 471 | |
---|
| 472 | # KONTROLLABFRAGE, OB ALLES O.K. |
---|
| 473 | antwort="dummy" |
---|
| 474 | while [[ $antwort != y && $antwort != Y && $antwort != n && $antwort != N ]] |
---|
| 475 | do |
---|
| 476 | read antwort?" >>> continue (y/n) ? " |
---|
| 477 | done |
---|
| 478 | if [[ $antwort = n || $antwort = N ]] |
---|
| 479 | then |
---|
| 480 | locat=verify; exit |
---|
| 481 | fi |
---|
| 482 | printf "\n" |
---|
| 483 | fi |
---|
| 484 | |
---|
| 485 | |
---|
| 486 | |
---|
| 487 | # ZUFALLSKENNUNG GENERIEREN UND JOBNAMEN AUF ZIELRECHNER BESTIMMEN |
---|
| 488 | kennung=$RANDOM |
---|
| 489 | job_on_remhost=${job_name}_${kennung}_$local_host |
---|
| 490 | job_to_send=job_to_send_$kennung |
---|
| 491 | if [[ $delete_dayfile = false ]] |
---|
| 492 | then |
---|
| 493 | remote_dayfile=${local_host}_${job_name}_result_$kennung |
---|
| 494 | local_dayfile=${remote_host}_${job_name} |
---|
| 495 | else |
---|
| 496 | remote_dayfile=/dev/null |
---|
| 497 | if [[ $(echo $remote_host | cut -c1-3) = ibm ]] |
---|
| 498 | then |
---|
| 499 | notification='# @ notification = never' |
---|
| 500 | fi |
---|
| 501 | fi |
---|
| 502 | |
---|
| 503 | |
---|
| 504 | |
---|
| 505 | # QSUB- ODER LL-KOMMANDOS BZW. SKRIPTE GENERIEREN |
---|
| 506 | if [[ $(echo $remote_host | cut -c1-3) = ibm && $numprocs != 0 ]] |
---|
| 507 | then |
---|
| 508 | |
---|
| 509 | if [[ $remote_host = ibmy ]] |
---|
| 510 | then |
---|
| 511 | consumable_memory="" |
---|
| 512 | else |
---|
| 513 | consumable_memory="ConsumableMemory($memory mb)" |
---|
| 514 | fi |
---|
| 515 | if [[ $queue = cdev ]] |
---|
| 516 | then |
---|
| 517 | data_limit="# @ data_limit = 1.76gb" |
---|
| 518 | network_to_use="# @ network.mpi = sn_all,shared,ip" |
---|
| 519 | else |
---|
| 520 | if [[ $remote_host = ibms ]] |
---|
| 521 | then |
---|
| 522 | network_to_use="# @ network.mpi = csss,shared,us" |
---|
| 523 | elif [[ $remote_host = ibmy ]] |
---|
| 524 | then |
---|
| 525 | network_to_use="" |
---|
| 526 | else |
---|
| 527 | network_to_use="# @ network.mpi = sn_all,shared,us" |
---|
| 528 | data_limit="# @ data_limit = 1.76gb" |
---|
| 529 | fi |
---|
| 530 | fi |
---|
| 531 | |
---|
| 532 | cat > $job_to_send << %%END%% |
---|
| 533 | #!/bin/ksh |
---|
| 534 | |
---|
| 535 | # @ job_type = parallel |
---|
| 536 | # @ job_name = palm |
---|
| 537 | # @ wall_clock_limit = ${timestring},$timestring |
---|
| 538 | # @ resources = ConsumableCpus($threads_per_task) $consumable_memory |
---|
| 539 | # @ output = $remote_dayfile |
---|
| 540 | # @ error = $remote_dayfile |
---|
| 541 | # @ image_size = 50 |
---|
| 542 | # @ class = $queue |
---|
| 543 | # @ environment = OMP_NUM_THREADS=$threads_per_task; MP_SHARED_MEMORY=yes |
---|
| 544 | $network_to_use |
---|
| 545 | $data_limit |
---|
| 546 | $notification |
---|
| 547 | |
---|
| 548 | %%END%% |
---|
| 549 | |
---|
| 550 | if (( nodes > 0 )) |
---|
| 551 | then |
---|
| 552 | |
---|
| 553 | cat >> $job_to_send << %%END%% |
---|
| 554 | # @ node = $nodes |
---|
| 555 | # @ tasks_per_node = $tasks_per_node |
---|
| 556 | # @ node_usage = $node_usage |
---|
| 557 | # @ queue |
---|
| 558 | |
---|
| 559 | %%END%% |
---|
| 560 | |
---|
| 561 | else |
---|
| 562 | |
---|
| 563 | if [[ $remote_host != ibmy ]] |
---|
| 564 | then |
---|
| 565 | |
---|
| 566 | cat >> $job_to_send << %%END%% |
---|
| 567 | # @ blocking = unlimited |
---|
| 568 | # @ total_tasks = $numprocs |
---|
| 569 | # @ node_usage = $node_usage |
---|
| 570 | # @ queue |
---|
| 571 | |
---|
| 572 | %%END%% |
---|
| 573 | |
---|
| 574 | else |
---|
| 575 | |
---|
| 576 | cat >> $job_to_send << %%END%% |
---|
| 577 | # @ node = 1 |
---|
| 578 | # @ total_tasks = $numprocs |
---|
| 579 | # @ queue |
---|
| 580 | |
---|
| 581 | %%END%% |
---|
| 582 | |
---|
| 583 | fi |
---|
| 584 | |
---|
| 585 | fi |
---|
| 586 | |
---|
| 587 | elif [[ $(echo $remote_host | cut -c1-3) = ibm && $numprocs = 0 ]] |
---|
| 588 | then |
---|
| 589 | |
---|
| 590 | cat > $job_to_send << %%END%% |
---|
| 591 | #!/bin/ksh |
---|
| 592 | |
---|
| 593 | # @ job_type = serial |
---|
| 594 | # @ node_usage = $node_usage |
---|
| 595 | # @ job_name = palm |
---|
| 596 | # @ wall_clock_limit = ${timestring},$timestring |
---|
| 597 | # @ resources = ConsumableCpus(1) ConsumableMemory(1 gb) |
---|
| 598 | # @ output = $remote_dayfile |
---|
| 599 | # @ error = $remote_dayfile |
---|
| 600 | # @ class = $queue |
---|
| 601 | $notification |
---|
| 602 | |
---|
| 603 | # @ queue |
---|
| 604 | |
---|
| 605 | %%END%% |
---|
| 606 | |
---|
| 607 | elif [[ $remote_host = nech ]] |
---|
| 608 | then |
---|
| 609 | |
---|
| 610 | if (( nodes > 1 )) |
---|
| 611 | then |
---|
| 612 | cat > $job_to_send << %%END%% |
---|
| 613 | #!/bin/ksh |
---|
| 614 | #PBS -l cpunum_prc=$tasks_per_node,cputim_job=$cputime |
---|
| 615 | #PBS -l ${qsubmem}=${Memory}gb |
---|
| 616 | #PBS -b $nodes |
---|
| 617 | #PBS -o $remote_dayfile |
---|
| 618 | #PBS -N palm |
---|
| 619 | #PBS -j o |
---|
| 620 | #PBS -T mpisx |
---|
| 621 | |
---|
| 622 | %%END%% |
---|
| 623 | |
---|
| 624 | elif [[ $numprocs != 0 ]] |
---|
| 625 | then |
---|
| 626 | cat > $job_to_send << %%END%% |
---|
| 627 | #!/bin/ksh |
---|
| 628 | #PBS -l cpunum_prc=$tasks_per_node,cputim_job=$cputime |
---|
| 629 | #PBS -l ${qsubmem}=${Memory}gb |
---|
| 630 | #PBS -o $remote_dayfile |
---|
| 631 | #PBS -N palm |
---|
| 632 | #PBS -j o |
---|
| 633 | |
---|
| 634 | %%END%% |
---|
| 635 | |
---|
| 636 | else |
---|
| 637 | cat > $job_to_send << %%END%% |
---|
| 638 | #!/bin/ksh |
---|
| 639 | #PBS -l ${qsubmem}=${Memory}gb,${qsubtime}=$cputime |
---|
| 640 | #PBS -o $remote_dayfile |
---|
| 641 | #PBS -j o |
---|
| 642 | |
---|
| 643 | %%END%% |
---|
| 644 | |
---|
| 645 | fi |
---|
| 646 | |
---|
[35] | 647 | elif [[ $remote_host = neck ]] |
---|
| 648 | then |
---|
| 649 | |
---|
| 650 | if (( nodes > 1 )) |
---|
| 651 | then |
---|
| 652 | cat > $job_to_send << %%END%% |
---|
| 653 | #!/bin/ksh |
---|
| 654 | #PBS -l cpunum_prc=$tasks_per_node,cputim_job=$cputime |
---|
| 655 | #PBS -l ${qsubmem}=${Memory}gb |
---|
| 656 | #PBS -b $nodes |
---|
| 657 | #PBS -o $remote_dayfile |
---|
| 658 | #PBS -N palm |
---|
| 659 | #PBS -j o |
---|
| 660 | #PBS -T mpisx |
---|
| 661 | |
---|
| 662 | %%END%% |
---|
| 663 | |
---|
| 664 | elif [[ $numprocs != 0 ]] |
---|
| 665 | then |
---|
| 666 | cat > $job_to_send << %%END%% |
---|
| 667 | #!/bin/ksh |
---|
| 668 | #PBS -q ${queue} |
---|
| 669 | #PBS -l cpunum_prc=$tasks_per_node,cputim_job=$cputime |
---|
| 670 | #PBS -l ${qsubmem}=${Memory}gb |
---|
| 671 | #PBS -o $remote_dayfile |
---|
| 672 | #PBS -N palm |
---|
| 673 | #PBS -j o |
---|
| 674 | #PBS -T mpisx |
---|
| 675 | |
---|
| 676 | %%END%% |
---|
| 677 | |
---|
| 678 | else |
---|
| 679 | cat > $job_to_send << %%END%% |
---|
| 680 | #!/bin/ksh |
---|
| 681 | #PBS -l ${qsubmem}=${Memory}gb,${qsubtime}=$cputime |
---|
| 682 | #PBS -o $remote_dayfile |
---|
| 683 | #PBS -j o |
---|
| 684 | |
---|
| 685 | %%END%% |
---|
| 686 | |
---|
| 687 | fi |
---|
| 688 | |
---|
[1] | 689 | elif [[ $remote_host = lctit ]] |
---|
| 690 | then |
---|
| 691 | cat > $job_to_send << %%END%% |
---|
| 692 | #!/bin/bash |
---|
| 693 | #$ -S /bin/bash |
---|
| 694 | cd $job_catalog |
---|
[69] | 695 | export PATH=$PALM_BIN:\$PATH |
---|
| 696 | echo \$PATH |
---|
[1] | 697 | |
---|
| 698 | %%END%% |
---|
| 699 | |
---|
| 700 | # OPTIONEN FUER SUBMIT-KOMMANDO ZUSAMMENSTELLEN |
---|
| 701 | submcom="$submcom -N $job_name -sgeout $remote_dayfile -q default" |
---|
| 702 | |
---|
| 703 | else |
---|
| 704 | |
---|
| 705 | cat > $job_to_send << %%END%% |
---|
| 706 | # @\$-q ${queue} |
---|
| 707 | # @\$-l${qsubtime} $timestring |
---|
| 708 | # @\$-l${qsubmem} ${memory}mb |
---|
| 709 | # @\$-o $remote_dayfile |
---|
| 710 | # @\$-eo |
---|
| 711 | |
---|
| 712 | %%END%% |
---|
| 713 | |
---|
| 714 | fi |
---|
| 715 | |
---|
| 716 | |
---|
| 717 | # BEI RECHNUNG AUF REMOTE-MASCHINEN RUECKTRANSFER DES DAYFILES PER TRAP |
---|
| 718 | # BEI EXIT VERANLASSEN |
---|
| 719 | # VEKTORRECHNER MUSS EIGENEN JOB STARTEN, DA DORT NOHUP NICHT FUNKTIONIERT |
---|
| 720 | # AUF IBM IN SEOUL IST RUECKTRANSFER ZUR ZEIT GENERELL NICHT MOEGLICH |
---|
| 721 | if [[ $delete_dayfile = false && $remote_host != $local_host ]] |
---|
| 722 | then |
---|
| 723 | echo "set +vx" >> $job_to_send |
---|
| 724 | echo "trap '" >> $job_to_send |
---|
| 725 | echo "set +vx" >> $job_to_send |
---|
[35] | 726 | if [[ $(echo $remote_host | cut -c1-3) = ibm || $(echo $remote_host | cut -c1-3) = nec || $remote_host = lctit ]] |
---|
[1] | 727 | then |
---|
| 728 | if [[ $remote_host = ibmb || $remote_host = ibmh ]] |
---|
| 729 | then |
---|
| 730 | return_queue=c1 |
---|
| 731 | elif [[ $remote_host = ibms ]] |
---|
| 732 | then |
---|
| 733 | return_queue=p_normal |
---|
| 734 | elif [[ $remote_host = ibmy ]] |
---|
| 735 | then |
---|
| 736 | return_queue=serial |
---|
| 737 | elif [[ $remote_host = lctit ]] |
---|
| 738 | then |
---|
| 739 | return_queue=default |
---|
[35] | 740 | elif [[ $remote_host = neck ]] |
---|
[1] | 741 | then |
---|
[35] | 742 | return_queue=S |
---|
[1] | 743 | else |
---|
| 744 | return_queue=unknown |
---|
| 745 | fi |
---|
| 746 | |
---|
| 747 | if [[ $(echo $remote_host | cut -c1-3) = ibm ]] |
---|
| 748 | then |
---|
| 749 | |
---|
| 750 | echo "echo \"#!/bin/ksh\" >> scpjob.$kennung" >> $job_to_send |
---|
| 751 | echo "echo \"# @ job_type = serial\" >> scpjob.$kennung" >> $job_to_send |
---|
| 752 | echo "echo \"# @ job_name = transfer\" >> scpjob.$kennung" >> $job_to_send |
---|
| 753 | echo "echo \"# @ resources = ConsumableCpus(1) ConsumableMemory(1 gb)\" >> scpjob.$kennung" >> $job_to_send |
---|
| 754 | echo "echo \"# @ wall_clock_limit = 00:10:00,00:10:00\" >> scpjob.$kennung " >> $job_to_send |
---|
| 755 | echo "echo \"# @ output = job_queue/last_job_transfer_protocol\" >> scpjob.$kennung" >> $job_to_send |
---|
| 756 | echo "echo \"# @ error = job_queue/last_job_transfer_protocol\" >> scpjob.$kennung" >> $job_to_send |
---|
| 757 | echo "echo \"# @ class = $return_queue\" >> scpjob.$kennung" >> $job_to_send |
---|
| 758 | echo "echo \"# @ image_size = 10\" >> scpjob.$kennung" >> $job_to_send |
---|
| 759 | echo "echo \"# @ notification = never\" >> scpjob.$kennung" >> $job_to_send |
---|
| 760 | |
---|
| 761 | echo "echo \"# @ queue\" >> scpjob.$kennung" >> $job_to_send |
---|
| 762 | echo "echo \" \" >> scpjob.$kennung" >> $job_to_send |
---|
| 763 | |
---|
| 764 | echo "echo \"set -x\" >> scpjob.$kennung" >> $job_to_send |
---|
| 765 | echo "echo \"batch_scp -d -w 10 -u $local_user $local_addres ${job_catalog}/$remote_dayfile \\\"$job_catalog\\\" $local_dayfile\" >> scpjob.$kennung" >> $job_to_send |
---|
| 766 | echo "echo \"exit\" >> scpjob.$kennung" >> $job_to_send |
---|
| 767 | |
---|
| 768 | elif [[ $remote_host = nech ]] |
---|
| 769 | then |
---|
| 770 | echo "cd /pf/b/${remote_user}/job_queue" >> $job_to_send |
---|
| 771 | echo "cat > scpjob.$kennung << %%END%%" >> $job_to_send |
---|
| 772 | echo "#PBS -l ${qsubmem}=1GB,${qsubtime}=100" >> $job_to_send |
---|
| 773 | echo "#PBS -o last_job_transfer_protocol" >> $job_to_send |
---|
| 774 | echo "#PBS -j o" >> $job_to_send |
---|
| 775 | echo " " >> $job_to_send |
---|
| 776 | echo "set -x" >> $job_to_send |
---|
| 777 | echo "cd /pf/b/${remote_user}/job_queue" >> $job_to_send |
---|
| 778 | echo "batch_scp -d -w 10 -u $local_user $local_addres $remote_dayfile \"$job_catalog\" $local_dayfile" >> $job_to_send |
---|
| 779 | echo "[[ \"\$for_subjob_to_do\" != \"\" ]] && eval \$for_subjob_to_do" >> $job_to_send |
---|
| 780 | echo "%%END%%" >> $job_to_send |
---|
| 781 | |
---|
[35] | 782 | elif [[ $remote_host = neck ]] |
---|
| 783 | then |
---|
| 784 | echo "cat > scpjob.$kennung << %%END%%" >> $job_to_send |
---|
| 785 | echo "#PBS -q $return_queue" >> $job_to_send |
---|
| 786 | echo "#PBS -l ${qsubmem}=1GB,${qsubtime}=100" >> $job_to_send |
---|
| 787 | echo "#PBS -o last_job_transfer_protocol" >> $job_to_send |
---|
| 788 | echo "#PBS -j o" >> $job_to_send |
---|
| 789 | echo " " >> $job_to_send |
---|
| 790 | echo "set -x" >> $job_to_send |
---|
| 791 | echo "batch_scp -d -w 10 -u $local_user $local_addres $remote_dayfile \"$job_catalog\" $local_dayfile" >> $job_to_send |
---|
| 792 | echo "[[ \"\$for_subjob_to_do\" != \"\" ]] && eval \$for_subjob_to_do" >> $job_to_send |
---|
| 793 | echo "%%END%%" >> $job_to_send |
---|
| 794 | |
---|
[1] | 795 | elif [[ $remote_host = lctit ]] |
---|
| 796 | then |
---|
| 797 | echo "cat > scpjob.$kennung << %%END%%" >> $job_to_send |
---|
| 798 | echo "set -x" >> $job_to_send |
---|
| 799 | echo "PATH=\$PATH:$job_catalog/../pub" >> $job_to_send |
---|
| 800 | echo "cd $job_catalog" >> $job_to_send |
---|
| 801 | echo "batch_scp -d -w 10 -u $local_user $local_addres $remote_dayfile \"$job_catalog\" $local_dayfile" >> $job_to_send |
---|
| 802 | echo "[[ \"\$for_subjob_to_do\" != \"\" ]] && eval \$for_subjob_to_do" >> $job_to_send |
---|
| 803 | echo "%%END%%" >> $job_to_send |
---|
| 804 | |
---|
| 805 | else |
---|
| 806 | |
---|
| 807 | echo "cat > scpjob.$kennung << %%END%%" >> $job_to_send |
---|
| 808 | echo "# @\\\$-q $return_queue" >> $job_to_send |
---|
| 809 | echo "# @\\\$-l${qsubtime} 10" >> $job_to_send |
---|
| 810 | echo "# @\\\$-l${qsubmem} 10mb" >> $job_to_send |
---|
| 811 | if [[ $remote_host = t3ej2 || $remote_host = t3ej5 || $remote_host = t3es ]] |
---|
| 812 | then |
---|
| 813 | echo "# @\$-l mpp_p=0" >> $job_to_send |
---|
| 814 | fi |
---|
| 815 | echo '# @\$-lF 10mb' >> $job_to_send |
---|
| 816 | # echo '# @\$-o /dev/null' >> $job_to_send |
---|
| 817 | echo '# @\$-o job_queue/last_job_transfer_protocol' >> $job_to_send |
---|
| 818 | echo '# @\\\$-eo' >> $job_to_send |
---|
| 819 | echo " " >> $job_to_send |
---|
| 820 | if [[ $remote_host = t3ej2 || $remote_host = t3ej5 ]] |
---|
| 821 | then |
---|
| 822 | echo "set +vx" >> $job_to_send |
---|
| 823 | echo ". .profile" >> $job_to_send |
---|
| 824 | fi |
---|
| 825 | echo "set -x" >> $job_to_send |
---|
| 826 | echo "batch_scp -d -w 10 -u $local_user $local_addres ${job_catalog}/$remote_dayfile \"$job_catalog\" $local_dayfile > /dev/null" >> $job_to_send |
---|
| 827 | echo "[[ \"\$for_subjob_to_do\" != \"\" ]] && eval \$for_subjob_to_do" >> $job_to_send |
---|
| 828 | echo "%%END%%" >> $job_to_send |
---|
| 829 | fi |
---|
| 830 | |
---|
| 831 | if [[ $(echo $remote_host | cut -c1-3) = ibm ]] |
---|
| 832 | then |
---|
| 833 | echo "llsubmit scpjob.$kennung" >> $job_to_send |
---|
| 834 | elif [[ $remote_host = lctit ]] |
---|
| 835 | then |
---|
| 836 | echo "chmod u+x scpjob.$kennung" >> $job_to_send |
---|
| 837 | echo "rm -rf ${job_catalog}/last_job_transfer_protocol" >> $job_to_send |
---|
| 838 | echo "n1ge -N jobtransfer -q $return_queue -sgeout ${job_catalog}/last_job_transfer_protocol scpjob.$kennung" >> $job_to_send |
---|
| 839 | echo "sleep 10" >> $job_to_send |
---|
| 840 | elif [[ $remote_host = t3eb || $remote_host = t3eh || $remote_host = t3ej2 || $remote_host = t3ej5 ]] |
---|
| 841 | then |
---|
| 842 | echo "qsub -J n scpjob.$kennung" >> $job_to_send |
---|
| 843 | elif [[ $remote_host = t3es ]] |
---|
| 844 | then |
---|
| 845 | echo "qsub -J n -s /bin/ksh scpjob.$kennung" >> $job_to_send |
---|
| 846 | else |
---|
| 847 | echo "qsub scpjob.$kennung" >> $job_to_send |
---|
| 848 | fi |
---|
| 849 | echo "rm scpjob.$kennung" >> $job_to_send |
---|
| 850 | if [[ $remote_host = nech ]] |
---|
| 851 | then |
---|
| 852 | echo "cd -" >> $job_to_send |
---|
| 853 | fi |
---|
| 854 | else |
---|
| 855 | # echo "ftpcopy -d $local_addres ${job_catalog}/$remote_dayfile \"$job_catalog\" $local_dayfile" >> $job_to_send |
---|
| 856 | echo "nohup ftpcopy -d -w 15 $local_addres ${job_catalog}/$remote_dayfile \"$job_catalog\" $local_dayfile > /dev/null &" >> $job_to_send |
---|
| 857 | fi |
---|
| 858 | echo "set -x" >> $job_to_send |
---|
| 859 | echo " ' exit" >> $job_to_send |
---|
| 860 | echo "set -x" >> $job_to_send |
---|
| 861 | fi |
---|
| 862 | |
---|
| 863 | |
---|
| 864 | |
---|
| 865 | # EIGENTLICHE JOB-DATEI AN QSUB-KOMMANDOS ANHAENGEN |
---|
| 866 | cat $file_to_send >> $job_to_send |
---|
[69] | 867 | |
---|
[1] | 868 | if [[ $remote_host = ibm ]] |
---|
| 869 | then |
---|
| 870 | echo " " >> $job_to_send |
---|
| 871 | echo "exit" >> $job_to_send |
---|
| 872 | fi |
---|
[69] | 873 | if [[ $remote_host = lctit ]] |
---|
| 874 | then |
---|
| 875 | echo " " >> $job_to_send |
---|
| 876 | echo "rm ~/job_queue/$job_on_remhost" >> $job_to_send |
---|
| 877 | fi |
---|
[1] | 878 | |
---|
| 879 | |
---|
| 880 | |
---|
| 881 | # USER-NAME AUF ZIELRECHNER AUS .NETRC-DATEI ERMITTELN |
---|
| 882 | if [[ -z $remote_user ]] |
---|
| 883 | then |
---|
| 884 | if [[ $remote_host = t3eb || $remote_host = t3eh || $remote_host = t3ej2 || $remote_host = t3ej5 || $remote_host = t3es || $remote_host = vpp ]] |
---|
| 885 | then |
---|
| 886 | grep $remote_addres ~/.netrc | read dum dum dum remote_user dum dum |
---|
| 887 | fi |
---|
| 888 | fi |
---|
| 889 | |
---|
| 890 | |
---|
| 891 | |
---|
| 892 | # JOB AUF ZIELRECHNER TRANSFERIEREN BZW. INS JOBVERZEICHNIS KOPIEREN |
---|
| 893 | if [[ $no_submit = false ]] |
---|
| 894 | then |
---|
| 895 | if [[ $remote_host != $local_host ]] |
---|
| 896 | then |
---|
| 897 | [[ $verify = true ]] && printf "\n >>> transfering job to \"$remote_host\"..." |
---|
[82] | 898 | if [[ $remote_host = ibms || $remote_host = ibmy ]] # ssh on ibms cannot handle "~/" |
---|
[1] | 899 | then |
---|
[82] | 900 | job_catalog_save=$job_catalog |
---|
| 901 | job_catalog=job_queue |
---|
| 902 | elif [[ $remote_host = nech ]] |
---|
| 903 | then |
---|
| 904 | job_catalog_save=$job_catalog |
---|
| 905 | job_catalog=/hpf/b/${remote_user}/job_queue |
---|
| 906 | fi |
---|
| 907 | if [[ $local_host = decalpha ]] |
---|
| 908 | then |
---|
| 909 | # VERWENDUNG VON SCP AUF DECALPHA FRAGT FEHLERHAFTERWEISE |
---|
| 910 | # PASSWORT AB |
---|
| 911 | /bin/scp $job_to_send ${remote_user}@${remote_addres}:${job_catalog}/$job_on_remhost |
---|
| 912 | elif [[ $remote_host = nech ]] |
---|
| 913 | then |
---|
| 914 | # DATEIEN KOENNEN NUR UEBER DEN ARCHIVE-SERVER DES DKRZ |
---|
| 915 | # TRANSFERIERT WERDEN |
---|
| 916 | scp $job_to_send ${remote_user}@136.172.44.205:${job_catalog}/$job_on_remhost |
---|
[1] | 917 | else |
---|
[82] | 918 | scp $job_to_send ${remote_user}@${remote_addres}:${job_catalog}/$job_on_remhost |
---|
[1] | 919 | fi |
---|
[82] | 920 | if [[ $? = 1 ]] |
---|
| 921 | then |
---|
| 922 | locat=scp; exit |
---|
| 923 | fi |
---|
| 924 | if [[ $remote_host = ibms ]] |
---|
| 925 | then |
---|
| 926 | job_catalog=$job_catalog_save |
---|
| 927 | fi |
---|
[1] | 928 | [[ $verify = true ]] && printf "\n >>> finished\n" |
---|
| 929 | else |
---|
| 930 | eval job_catalog=$job_catalog |
---|
| 931 | cp $job_to_send ${job_catalog}/$job_on_remhost |
---|
| 932 | fi |
---|
| 933 | |
---|
| 934 | |
---|
| 935 | |
---|
| 936 | # NQS- BZW. LOADLEVELER-JOB STARTEN |
---|
| 937 | if [[ $remote_host != $local_host ]] |
---|
| 938 | then |
---|
| 939 | [[ $verify = true ]] && printf "\n >>> submitting job using \"qsub\"...\n" |
---|
[82] | 940 | if [[ $remote_host != lctit ]] |
---|
[1] | 941 | then |
---|
[82] | 942 | ssh $remote_addres -l $remote_user "cd $job_catalog; $submcom $job_on_remhost; rm $job_on_remhost" |
---|
[1] | 943 | else |
---|
[82] | 944 | # TIT ERLAUBT NUR DIE AUSFÜHRUNG GANZ BESTIMMTER KOMMANDOS |
---|
| 945 | # MIT SSH, DESHALB AUFRUF PER PIPE |
---|
| 946 | # UEBERGANGSWEISE CHECK, OB N1GE ENVIRONMENT WIRKLICH VERFUEGBAR |
---|
| 947 | print "cd $job_catalog; chmod u+x $job_on_remhost" | ssh $remote_addres -l $remote_user > /dev/null 2>&1 |
---|
| 948 | echo "first try" > send_protocol |
---|
| 949 | while [[ $(cat send_protocol | grep -c "Forwarding to N1GE") = 0 ]] |
---|
| 950 | do |
---|
| 951 | if [[ $(cat send_protocol | grep -c "first try") = 1 ]] |
---|
| 952 | then |
---|
| 953 | printf "\n trying to submit job to TIT cluster..." |
---|
| 954 | else |
---|
| 955 | printf "\n +++ failed ... trying to submit again ..." |
---|
| 956 | fi |
---|
| 957 | print "cd $job_catalog; $submcom $job_on_remhost" | ssh $remote_addres -l $remote_user > send_protocol 2>&1 |
---|
| 958 | cat send_protocol |
---|
| 959 | done |
---|
| 960 | sleep 10 |
---|
| 961 | print "cd $job_catalog; rm $job_on_remhost" | ssh $remote_addres -l $remote_user > /dev/null 2>&1 |
---|
| 962 | echo "$submcom $job_on_remhost" |
---|
| 963 | rm send_protocol |
---|
| 964 | fi |
---|
[1] | 965 | |
---|
| 966 | [[ $verify = true ]] && printf " >>> o.k.\n" |
---|
| 967 | else |
---|
| 968 | cd $job_catalog |
---|
| 969 | if [[ $(echo $local_host | cut -c1-3) = ibm ]] |
---|
| 970 | then |
---|
| 971 | eval $submcom $job_on_remhost |
---|
| 972 | elif [[ $local_host = lctit ]] |
---|
| 973 | then |
---|
| 974 | eval $submcom $job_on_remhost |
---|
| 975 | echo "$submcom $job_on_remhost" |
---|
| 976 | chmod u+x $job_on_remhost |
---|
| 977 | elif [[ $local_host = nech ]] |
---|
| 978 | then |
---|
| 979 | if [[ $queue = default ]] |
---|
| 980 | then |
---|
| 981 | eval $submcom $job_on_remhost |
---|
| 982 | else |
---|
| 983 | eval $submcom -q $queue $job_on_remhost |
---|
| 984 | fi |
---|
| 985 | else |
---|
| 986 | qsub $job_on_remhost |
---|
| 987 | fi |
---|
[69] | 988 | # JOBFILE DARF AUF LCTIT NICHT GELOESCHT WERDEN!! GESCHIEHT ERST AM JOBENDE |
---|
| 989 | [[ $local_host != lctit ]] && rm $job_on_remhost |
---|
[1] | 990 | cd - > /dev/null |
---|
| 991 | fi |
---|
| 992 | fi |
---|
| 993 | |
---|
| 994 | |
---|
| 995 | |
---|
| 996 | # ABSCHLUSSARBEITEN |
---|
| 997 | |
---|
| 998 | if [[ $no_submit = false ]] |
---|
| 999 | then |
---|
| 1000 | rm $job_to_send |
---|
| 1001 | fi |
---|
| 1002 | [[ $verify = true ]] && printf "\n\n *** SUBJOB finished \n\n" |
---|