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