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