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