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