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