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