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