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