1 | #!/bin/ksh |
---|
2 | |
---|
3 | ##!/home/DSRC/NC/tatuyama/pub/ksh NEEDED ON NEC AT RIAM !!!!!!!!!! |
---|
4 | |
---|
5 | # mrun - Plot-Shellskript Version: @(#)MRUN 1.8 10/02/07 |
---|
6 | |
---|
7 | # Prozedur zum Starten von Modellaeufen |
---|
8 | |
---|
9 | # letzte Aenderung: |
---|
10 | # 03/03/94 - Siggi - Entwicklungsbeginn |
---|
11 | # 21/03/94 - Siggi - Entwicklungsabschluss (Version 1.0) |
---|
12 | # 09/12/94 - Siggi - allexport unterbunden; statt dessen werden jetzt ein- |
---|
13 | # zelne Variable exportiert. Dies ist noetig, weil an- |
---|
14 | # sonsten irgendein Speicher ueberlaeuft und von mrun |
---|
15 | # aufgerufene Programme (z.B. stageout) mit Fehlern |
---|
16 | # abbrechen (too many arguments) |
---|
17 | # 20/06/95 - Siggi - noclobber muss explizit abgeschaltet, da jetzt |
---|
18 | # defaultmaessig im RRZN-Profile eingeschaltet |
---|
19 | # 10/06/97 - Siggi - Zusaetzliche Option -C bei cpp, damit // nicht |
---|
20 | # wegfallen |
---|
21 | # 25/04/00 - Siggi - Version 1.5 |
---|
22 | # remote_addres und remote_user in return_addres bzw. |
---|
23 | # return_username umbenannt, return_username wird dem |
---|
24 | # mrun-Aufruf im Job ueber Option -U mitgegeben. |
---|
25 | # Neue Variable remote_username, die beim interaktiven |
---|
26 | # mrun-Aufruf zwingend ueber die neue Option -u oder |
---|
27 | # in der Konfigurationsdatei angegeben werden muss. |
---|
28 | # 08/02/01 - Siggi - Alle mrun-Meldungen ins englische uebersetzt, |
---|
29 | # Version 1.7 |
---|
30 | # 05/05/02 - Siggi - Uebersetzungen mittels make-Mechanismus moeglich |
---|
31 | # 21/11/02 - Siggi - ENV-Variable XLFRTEOPTS wird vor Ausfuehrung auf |
---|
32 | # IBM gesetzt, um Record-Laenge der NAMELIST-Dateien, |
---|
33 | # zu bestimmen; Praeprozessoroptionen haben nun alle |
---|
34 | # die Form -Dtext=text, weil auf IBM sonst text durch |
---|
35 | # die leere Zeichenkette ersetzt wird |
---|
36 | # 01/08/03 - Siggi - Test of implementing dvrp+1PE on ibm |
---|
37 | # 07/01/04 - Siggi - additional preprocessor directive for ibm included |
---|
38 | # (-D$OMP=OMP) in order to avoid problems with |
---|
39 | # OMP_NUM_THREADS |
---|
40 | # 04/01/05 - Siggi - archiving on hanni and berni is done in separate |
---|
41 | # tar files, one for each node used |
---|
42 | # 07/01/04 - Siggi - old code for t3e, vpp and hpcs eliminated |
---|
43 | # 09/01/05 - Siggi - workaround for getting the IP address on gfdl3 |
---|
44 | # 17/01/05 - Siggi - job for data transfer to local machine now within |
---|
45 | # job class c1 (HLRN) |
---|
46 | # 27/01/05 - Siggi - IP address workaround for gfdl3 removed |
---|
47 | # 28/01/05 - Siggi - tar-filenames on $PERM (HLRN) now include the |
---|
48 | # base filename and cycle number |
---|
49 | # 16/02/05 - Gerald - hababai validated |
---|
50 | # 14/03/05 - Siggi - abort on NEC after first runtime error (F_ERRCNT) |
---|
51 | # 29/03/05 - Marcus - berni*-en0 validated |
---|
52 | # 21/04/05 - Siggi - transfer-job-protocol for avs-data is no more stored |
---|
53 | # 24/04/05 - Siggi - netcdf support on lcmuk |
---|
54 | # 25/04/05 - Siggi - netcdf support on gfld3 (decalpha) |
---|
55 | # 11/05/05 - Siggi - files with non-numeric extensions (.xxx after cycle |
---|
56 | # number) can now be used within interactive runs |
---|
57 | # 12/05/05 - Siggi - netcdf support on ibm |
---|
58 | # 13/05/05 - Siggi - error in tar-filenames on $PERM (HLRN) removed |
---|
59 | # 18/05/05 - Siggi - netcdf support on nec |
---|
60 | # 24/05/05 - Siggi - netcdf support on ibms |
---|
61 | # 14/06/05 - Siggi - sleep interval after submit of restart job increased |
---|
62 | # to 30 seconds |
---|
63 | # 28/06/05 - Siggi - bora adjusted to new intel compiler (LD_LIBRARY_ |
---|
64 | # PATH is temporarily set) |
---|
65 | # 07/09/05 - Siggi - setting of MP_EAGER_LIMIT switched off because it |
---|
66 | # caused warnings in the job protocol |
---|
67 | # 20/10/05 - Siggi - update of netcdf-version on decalpha (gfdl3) |
---|
68 | # 25/10/05 - Siggi - error in listing files for getting the cycle number |
---|
69 | # removed |
---|
70 | # 26/10/05 - Siggi - new paths for dvrp-library, transfer of catalogs |
---|
71 | # realized by file attribute trpe |
---|
72 | # 28/10/05 - Siggi - if existing, the file extension is output in case |
---|
73 | # of missing input file - no job abort in case of |
---|
74 | # missing input files with file extensions |
---|
75 | # (preliminary solution) |
---|
76 | # 31/10/05 - Siggi - data transfer from nech now within seperate job |
---|
77 | # 04/11/05 - Siggi - netcdf 3.6.0-p1 on ibmh/ibmb |
---|
78 | # 07/12/05 - Siggi - gallego and elephanta admitted |
---|
79 | # 30/12/05 - Siggi - gfdl5 (ibmy) admitted |
---|
80 | # 10/01/06 - Siggi - cpp directive for NetCDF 64bit support |
---|
81 | # 20/01/06 - Siggi - cpp directive for ibmy |
---|
82 | # 09/02/06 - Siggi - ibmy admitted for batch mode |
---|
83 | # 13/04/06 - Siggi - ostria admitted |
---|
84 | # 18/04/06 - Siggi - usage of OpenMP implemented (additional option -O) |
---|
85 | # 10/05/06 - Siggi - environment variable XLSMPOPTS set on IBM for |
---|
86 | # optimization of OpenMP runs (option stacksize is |
---|
87 | # necessary for large gridpoint numbers because |
---|
88 | # otherwise a segmentation fault occurs) |
---|
89 | # 23/05/05 - Siggi - lctit (SUN Fire X4600) admitted |
---|
90 | # 21/08/06 - Siggi - standard mrun path on scirocco is as on bora |
---|
91 | # 23/08/06 - Siggi - netcdf support for scirocco (notebook) |
---|
92 | # 20/09/06 - Marcus - add DVRP library on nech |
---|
93 | # 24/10/06 - Siggi - Environment variables for PALM steering are written |
---|
94 | # on local NAMELIST file ENVPAR |
---|
95 | # 24/11/06 - Siggi - levanto admitted, maestro switched to ifc 9.1 |
---|
96 | # 28/11/06 - Siggi - call to interpret_config.x_levanto because of SuSe 10 |
---|
97 | # 06/02/07 - Siggi - add DVRP library on lcmuk |
---|
98 | # 07/02/07 - Siggi - revision of source code handling, source code is |
---|
99 | # now expected in directory given by source_path and |
---|
100 | # not in the current working directory, source code |
---|
101 | # files provided in add_source_path are allways |
---|
102 | # compiled, source code to be compiled is allways |
---|
103 | # sampled in SOURCES_FOR_RUN_$fname which is a |
---|
104 | # subdirectory of the current working directory, |
---|
105 | # -s TEST changed to -s WRITE_PERMIT or -s WP, |
---|
106 | # adapted for RIAM (neck) |
---|
107 | # bugfix for cycle number of output file (extout) |
---|
108 | # all hpmuk-related code removed |
---|
109 | |
---|
110 | |
---|
111 | |
---|
112 | |
---|
113 | # VARIABLENVEREINBARUNGEN + DEFAULTWERTE |
---|
114 | |
---|
115 | set +o allexport # SICHERHEITSHALBER UNTERBINDEN, DA SONST EVTL. STAGEOUT |
---|
116 | # NICHT LAUEFT (TOO MANY ARGUMENTS - PROBLEM) |
---|
117 | set +o noclobber # EXISTIERENDE DATEIEN DUERFEN UEBERSCHRIEBEN WERDEN |
---|
118 | |
---|
119 | AddFilenames="" |
---|
120 | additional_conditions="" |
---|
121 | add_source_path="" |
---|
122 | afname="" |
---|
123 | archive_save=true |
---|
124 | archive_system=none |
---|
125 | compiler_name="" |
---|
126 | cond1="" |
---|
127 | cond2="" |
---|
128 | config_file=.mrun.config |
---|
129 | cpp_opts="" |
---|
130 | cpumax=0 |
---|
131 | cpurest=0 |
---|
132 | delete_temporary_catalog=true |
---|
133 | do_batch=false |
---|
134 | do_compile=true |
---|
135 | do_remote=false |
---|
136 | do_stagein=true |
---|
137 | do_stageout=true |
---|
138 | do_trace=false |
---|
139 | email_notification="" |
---|
140 | exclude="" |
---|
141 | executable="" |
---|
142 | execution_error=false |
---|
143 | filetransfer_protocol="" |
---|
144 | fname=test |
---|
145 | fromhost="" |
---|
146 | host="" |
---|
147 | host_file="" |
---|
148 | hp="" |
---|
149 | ignore_archive_error=false |
---|
150 | input_list="" |
---|
151 | interpreted_config_file="" |
---|
152 | job_on_file="" |
---|
153 | keep_data_from_previous_run=false |
---|
154 | localhost_realname=$(hostname) |
---|
155 | local_compile=false |
---|
156 | locat=normal |
---|
157 | mainprog="" |
---|
158 | makefile="" |
---|
159 | mc=$0 |
---|
160 | while [[ $(echo $mc | grep -c "/") != 0 ]] |
---|
161 | do |
---|
162 | mc=`echo $mc | cut -f2- -d"/"` |
---|
163 | done |
---|
164 | module_files="" |
---|
165 | MODULE_OPTIONS="" |
---|
166 | mrun_script_name=$mc |
---|
167 | netcdf_support=false |
---|
168 | node_usage=default |
---|
169 | numprocs="" |
---|
170 | OOPT="" |
---|
171 | openmp=false |
---|
172 | output_list="" |
---|
173 | package_list="" |
---|
174 | punkte="..........................................................." |
---|
175 | queue=none |
---|
176 | read_from_config="" |
---|
177 | restart_run=false |
---|
178 | return_addres=$(nslookup `hostname` 2>&1 | grep "Address:" | tail -1 | awk '{print $2}') |
---|
179 | if [[ $return_addres = 130.75.105.158 ]] |
---|
180 | then |
---|
181 | return_addres=172.20.25.41 |
---|
182 | echo "+++ WARNING: return_addres changed to $return_addres !!!!!" |
---|
183 | fi |
---|
184 | # if [[ $return_addres = 210.117.65.1 ]] |
---|
185 | # if [[ $(nslookup `hostname` 2>&1 | grep -c 210.117.65.1) = 1 ]] |
---|
186 | # then |
---|
187 | # [[ $localhost_realname = gfdl3.yonsei.ac.kr ]] && return_addres=165.132.26.56 |
---|
188 | # fi |
---|
189 | return_password="" |
---|
190 | return_username=$LOGNAME |
---|
191 | remotecall=false |
---|
192 | remote_username="" |
---|
193 | run_mode="" |
---|
194 | scirocco=false |
---|
195 | store_on_archive_system=true |
---|
196 | striche=" ----------------------------------------------------------------------------" |
---|
197 | silent=false |
---|
198 | source_list="" |
---|
199 | source_path=SOURCE |
---|
200 | tasks_per_node="" |
---|
201 | threads_per_task=1 |
---|
202 | tmpcreate=false |
---|
203 | tmp_data_catalog="" |
---|
204 | transfer_problems=false |
---|
205 | usern=$LOGNAME |
---|
206 | use_makefile="" |
---|
207 | working_directory=`pwd` |
---|
208 | TOPT="" |
---|
209 | XOPT="" |
---|
210 | zeit=$( date | cut -c 12-19 ) |
---|
211 | |
---|
212 | typeset -i iec=0 iic=0 iin=0 ioc=0 iout=0 memory=0 stagein_anz=0 stageout_anz=0 |
---|
213 | typeset -i cputime i ii icycle inode ival jobges jobsek maxcycle minuten nodes pes sekunden tp1 |
---|
214 | |
---|
215 | typeset -R40 calltime |
---|
216 | typeset -L20 spalte1 |
---|
217 | typeset -L40 spalte2 |
---|
218 | typeset -L60 spalte3 |
---|
219 | typeset -L35 string1=`date` |
---|
220 | typeset -L12 string2=$usern |
---|
221 | typeset -L12 string3=$localhost_realname |
---|
222 | typeset -L12 string4 |
---|
223 | typeset -L12 string5 |
---|
224 | typeset -L20 version="MRUN 1.8" |
---|
225 | |
---|
226 | |
---|
227 | |
---|
228 | # EINZELNE VARIABLE FUER HAUPTPROGRAMM EXPORTIEREN |
---|
229 | export cpurest fname host localhost return_addres return_username remotecall tasks_per_node |
---|
230 | |
---|
231 | # FOLGENDE VARIABLEN MUESSEN FUER DIE INTERPRETATION DER KONFIGURATIONSDATEI |
---|
232 | # EXPORTIERT WERDEN |
---|
233 | export afname config_file cpp_opts cpumax do_batch do_trace fname fromhost |
---|
234 | export input_list memory numprocs output_list queue run_mode |
---|
235 | |
---|
236 | |
---|
237 | |
---|
238 | # FEHLERBEHANDLUNG |
---|
239 | # BEI EXIT: |
---|
240 | trap 'if [[ $locat != localhost ]] |
---|
241 | then |
---|
242 | if [[ ! -f ${mrun_path}/statistik/mrun_statistik ]] |
---|
243 | then |
---|
244 | cat > ${mrun_path}/statistik/mrun_statistik << %STATEND% |
---|
245 | MRUN-calls on $localhost |
---|
246 | |
---|
247 | date and time user localhost remotehost termination mrun-command |
---|
248 | -------------------------------------------------------------------------------------------------------------------- |
---|
249 | %STATEND% |
---|
250 | chmod 666 ${mrun_path}/statistik/mrun_statistik |
---|
251 | fi |
---|
252 | |
---|
253 | # EINTRAG IN DIE STATISTIK-DATEI |
---|
254 | string4=$host |
---|
255 | string5=$locat |
---|
256 | if [[ "$job_on_file" = "" && $locat != control_c && $locat != user_abort ]] |
---|
257 | then |
---|
258 | if [[ $do_batch = true ]] |
---|
259 | then |
---|
260 | printf "$string1$string2$string3$string4$string5$mrun_com \n" >> ${mrun_path}/statistik/mrun_statistik |
---|
261 | else |
---|
262 | printf "$string1$string2$string3$string4$string5$mc \n" >> ${mrun_path}/statistik/mrun_statistik |
---|
263 | fi |
---|
264 | fi |
---|
265 | fi |
---|
266 | |
---|
267 | if [[ $locat != normal && $locat != control_c && $locat != local_compile ]] |
---|
268 | then |
---|
269 | |
---|
270 | # EVENTUELLE ERROR-KOMMANDOS ABARBEITEN |
---|
271 | (( i = 0 )) |
---|
272 | while (( i < iec )) |
---|
273 | do |
---|
274 | (( i = i + 1 )) |
---|
275 | printf "\n *** Execution of ERROR-command:\n" |
---|
276 | printf " >>> ${err_command[$i]}\n" |
---|
277 | eval ${err_command[$i]} |
---|
278 | done |
---|
279 | if [[ -n $interpreted_config_file ]] then |
---|
280 | rm -rf $interpreted_config_file |
---|
281 | fi |
---|
282 | if [[ $tmpcreate = true ]] |
---|
283 | then |
---|
284 | printf "\n *** Contents of \"$TEMPDIR\":\n" |
---|
285 | ls -al; cd |
---|
286 | [[ $delete_temporary_catalog = true ]] && rm -rf $TEMPDIR |
---|
287 | fi |
---|
288 | if [[ -f ~/job_queue/JOBINFO.$QSUB_REQID ]] |
---|
289 | then |
---|
290 | rm -rf ~/job_queue/JOBINFO.$QSUB_REQID |
---|
291 | fi |
---|
292 | printf "\n\n+++ MRUN killed \n\n" |
---|
293 | elif [[ $locat != control_c ]] |
---|
294 | then |
---|
295 | printf "\n\n --> all actions finished\n\n" |
---|
296 | printf " Bye, bye $usern !!\n\n" |
---|
297 | fi' exit |
---|
298 | |
---|
299 | |
---|
300 | # BEI TERMINAL-BREAK: |
---|
301 | trap '[[ $tmpcreate = true ]] && (cd; rm -rf $TEMPDIR) |
---|
302 | if [[ -f ~/job_queue/JOBINFO.$QSUB_REQID ]] |
---|
303 | then |
---|
304 | rm -rf ~/job_queue/JOBINFO.$QSUB_REQID |
---|
305 | fi |
---|
306 | printf "\n+++ MRUN killed by \"^C\" \n\n" |
---|
307 | locat=control_c |
---|
308 | exit |
---|
309 | ' 2 |
---|
310 | |
---|
311 | |
---|
312 | # EVTL. NAMEN DES LOKALEN RECHNERS MIT UEBERGREIFENDEM NAMEN VERSEHEN |
---|
313 | case $localhost_realname in |
---|
314 | (atmos) mrun_path=/home/siggi/pub |
---|
315 | localhost=lcide;; |
---|
316 | (bora|breva|elephanta|gallego|gregale|hababai|irifi|levanto|maestro|orkan|ostria|poniente|quanero|scirocco|vorias) mrun_path=/home/raasch/pub |
---|
317 | localhost=lcmuk;; |
---|
318 | (breg*-en0|berni*-en0) mrun_path=/home/b/niksiraa/pub |
---|
319 | localhost=ibmb; archive_system=tivoli;; |
---|
320 | (cs*) mrun_path=/pf/b/b323011/pub |
---|
321 | localhost=nech; archive_system=ut;; |
---|
322 | (gate|n-sx) mrun_path=/home/DSRC/NC/tatuyama/pub |
---|
323 | PATH=$PATH:/usr/bin/nqsII:$mrun_path |
---|
324 | localhost=neck;; |
---|
325 | (ground.yonsei.ac.kr) mrun_path=/usr/users/raasch/pub |
---|
326 | localhost=decalpha;; |
---|
327 | (gfdl3.yonsei.ac.kr) mrun_path=/usr2/users/raasch/pub |
---|
328 | localhost=decalpha;; |
---|
329 | (gfdl5) mrun_path=/usr1/users/raasch/pub |
---|
330 | localhost=ibmy;; |
---|
331 | (gwdk081.gwdg.de|gwdk082.gwdg.de|gwdk083.gwdg.de) mrun_path=/usr/users/sraasch/pub |
---|
332 | localhost=ibm;; |
---|
333 | (hreg*-en0|hanni*-en0) mrun_path=/home/h/niksiraa/pub |
---|
334 | localhost=ibmh; archive_system=tivoli;; |
---|
335 | (nobel*) mrun_path=/edun/z051nyg/pub |
---|
336 | localhost=ibms;; |
---|
337 | (sun1|sun2) mrun_path=/home/nhbksira/pub/ |
---|
338 | localhost=unics;; |
---|
339 | (tgg*) mrun_path=/home2/usr5/mkanda/pub |
---|
340 | localhost=lctit;; |
---|
341 | (*) printf "\n +++ Host \"$localhost_realname\" not admitted for mrun \n" |
---|
342 | locat=localhost; exit;; |
---|
343 | esac |
---|
344 | |
---|
345 | [[ $localhost_realname = scirocco ]] && scirocco=true |
---|
346 | |
---|
347 | |
---|
348 | |
---|
349 | # SHELLSCRIPT-OPTIONEN EINLESEN UND KOMMANDO NEU ZUSAMMENSETZEN, FALLS ES |
---|
350 | # FUER FOLGEJOBS BENOETIGT WIRD |
---|
351 | while getopts :a:AbBc:Cd:D:f:Fh:H:i:IkK:m:M:n:o:Op:P:q:r:R:s:St:T:u:U:vxX: option |
---|
352 | do |
---|
353 | case $option in |
---|
354 | (a) afname=$OPTARG;; |
---|
355 | (A) store_on_archive_system=false; mc="$mc -A";; |
---|
356 | (b) do_batch=true; mc="$mc -b";; |
---|
357 | (B) delete_temporary_catalog=false; mc="$mc -B";; |
---|
358 | (c) config_file=$OPTARG; mc="$mc -c$OPTARG";; |
---|
359 | (C) restart_run=true; mc="$mc -C";; |
---|
360 | (d) fname=$OPTARG; mc="$mc -d$OPTARG";; |
---|
361 | (D) cpp_opts="$cpp_opts $OPTARG"; mc="$mc -D$OPTARG";; |
---|
362 | (f) filetransfer_protocol=$OPTARG; mc="$mc -f$OPTARG";; |
---|
363 | (F) job_on_file="-D"; mc="$mc -F";; |
---|
364 | (h) host=$OPTARG; mc="$mc -h$OPTARG";; |
---|
365 | (H) fromhost=$OPTARG; mc="$mc -H$OPTARG";; |
---|
366 | (i) input_list=$OPTARG; mc="$mc -i'$OPTARG'";; |
---|
367 | (I) ignore_archive_error=true; mc="$mc -I";; |
---|
368 | (k) keep_data_from_previous_run=true; mc="$mc -k";; |
---|
369 | (K) additional_conditions="$OPTARG"; mc="$mc -K$OPTARG";; |
---|
370 | (m) memory=$OPTARG; mc="$mc -m$OPTARG";; |
---|
371 | (M) makefile=$OPTARG; mc="$mc -M$OPTARG";; |
---|
372 | (n) node_usage=$OPTARG; mc="$mc -n$OPTARG";; |
---|
373 | (o) output_list=$OPTARG; mc="$mc -o'$OPTARG'";; |
---|
374 | (O) use_openmp=true; mc="$mc -O";; |
---|
375 | (p) package_list=$OPTARG; mc="$mc -p'$OPTARG'";; |
---|
376 | (P) return_password=$OPTARG; mc="$mc -P$OPTARG";; |
---|
377 | (q) queue=$OPTARG; mc="$mc -q$OPTARG";; |
---|
378 | (r) run_mode=$OPTARG; mc="$mc -r'$OPTARG'";; |
---|
379 | (R) remotecall=true;return_addres=$OPTARG; mc="$mc -R$OPTARG";; |
---|
380 | (s) source_list=$OPTARG; mc="$mc -s'$OPTARG'";; |
---|
381 | (S) read_from_config=false; mc="$mc -S";; |
---|
382 | (t) cpumax=$OPTARG; mc="$mc -t$OPTARG";; |
---|
383 | (T) tasks_per_node=$OPTARG; mc="$mc -T$OPTARG";; |
---|
384 | (u) remote_username=$OPTARG; mc="$mc -u$OPTARG";; |
---|
385 | (U) return_username=$OPTARG; mc="$mc -U$OPTARG";; |
---|
386 | (v) silent=true; mc="$mc -v";; |
---|
387 | (x) do_trace=true;set -x; mc="$mc -x";; |
---|
388 | (X) numprocs=$OPTARG; mc="$mc -X$OPTARG";; |
---|
389 | (\?) printf "\n +++ unknown option $OPTARG \n" |
---|
390 | printf "\n --> type \"$0 ?\" for available options \n" |
---|
391 | locat=parameter;exit;; |
---|
392 | esac |
---|
393 | done |
---|
394 | |
---|
395 | |
---|
396 | # EVTL. POSITIONSPARAMETER EINLESEN |
---|
397 | # ZUR ZEIT GIBT ES NUR DEN PARAMETER ? (=KURZINFO) |
---|
398 | shift OPTIND-1 |
---|
399 | |
---|
400 | |
---|
401 | # KURZE AUFRUFBESCHREIBUNG WIRD HIER AUSGEGEBEN |
---|
402 | if [[ "$1" = "?" ]] |
---|
403 | then |
---|
404 | (printf "\n *** mrun can be called as follows:\n" |
---|
405 | printf "\n $mrun_script_name -b -c.. -d.. -D.. -f.. -F -h.. -i.. -I -K.. -m.. -o.. -p.. -r.. -R -s.. -t.. -T.. -v -x -X.. <modus>\n" |
---|
406 | printf "\n Description of available options:\n" |
---|
407 | printf "\n Option Description Default-Value" |
---|
408 | printf "\n -a base name of input files equiv. -d" |
---|
409 | printf "\n -A no archiving when using file-attribute fl" |
---|
410 | printf "\n -b batch-job on local machine ---" |
---|
411 | printf "\n -B do not delete temporary directory at end ---" |
---|
412 | printf "\n -c configuration file .mrun.config" |
---|
413 | printf "\n -d base name of files attached to program test" |
---|
414 | printf "\n -D preprocessor(cpp)-directives \"\" " |
---|
415 | printf "\n -f filetransfer protocol (ftp or scp) depending on -h" |
---|
416 | printf "\n -F create remote job file only ---" |
---|
417 | printf "\n -h execution host $localhost_realname" |
---|
418 | printf "\n -i INPUT control list \"\" " |
---|
419 | printf "\n -I archiving errors of previous batch-jobs" |
---|
420 | printf "\n will be ignored" |
---|
421 | printf "\n -k keep data from previous run" |
---|
422 | printf "\n -K additional conditions for controling" |
---|
423 | printf "\n usage of conditional code and" |
---|
424 | printf "\n env-variables in configuration file \"\" " |
---|
425 | printf "\n -m memory demand in MB (batch-jobs) 0 MB" |
---|
426 | printf "\n -M Makefile name Makefile" |
---|
427 | printf "\n -n node usage (shared/not_shared) depending on -h" |
---|
428 | printf "\n -o OUTPUT control list \"\" " |
---|
429 | printf "\n -O use OpenMP ---" |
---|
430 | printf "\n -p software package list \"\" " |
---|
431 | printf "\n -q queue \"$queue\" " |
---|
432 | printf "\n -r run control list (combines -i -o) \"\" " |
---|
433 | printf "\n -s filenames of routines to be compiled \"\" " |
---|
434 | printf "\n must end with .f, .f90, .F, or .c !" |
---|
435 | printf "\n use \"..\" for more than one file and wildcards" |
---|
436 | printf "\n -s TEST compiles all files with w-permit" |
---|
437 | printf "\n -S config file interpreted by shellscript ---" |
---|
438 | printf "\n -t allowed cpu-time in seconds (batch) 0" |
---|
439 | printf "\n -T tasks per node depending on -h" |
---|
440 | printf "\n -u username on remote machine \"\" " |
---|
441 | printf "\n -v no prompt for confirmation ---" |
---|
442 | printf "\n -x tracing of mrun for debug purposes ---" |
---|
443 | printf "\n -X # of processors (on parallel machines) 1" |
---|
444 | printf "\n " |
---|
445 | printf "\n Possible values of positional parameter <modus>:" |
---|
446 | printf "\n \"?\" - this outline \n\n") | more |
---|
447 | exit |
---|
448 | elif [[ "$1" != "" ]] |
---|
449 | then |
---|
450 | printf "\n +++ positional parameter $1 unknown \n" |
---|
451 | locat=parameter; exit |
---|
452 | fi |
---|
453 | |
---|
454 | |
---|
455 | |
---|
456 | # KURZE STARTMELDUNG |
---|
457 | printf "\n*** $version " |
---|
458 | printf "\n will be executed. Please wait ..." |
---|
459 | |
---|
460 | |
---|
461 | # BASISNAME DER INPUT-DATEIEN GLEICH ALLGEMEINEM BASISNAMEN SETZEN, |
---|
462 | # WENN NICHT VOM BENUTZER ANDERS BESTIMMT |
---|
463 | [[ "$afname" = "" ]] && afname=$fname |
---|
464 | |
---|
465 | |
---|
466 | # EVTL. RUN-MODUS DEN I/O-LISTEN HINZUFUEGEN |
---|
467 | if [[ "$run_mode" != "" ]] |
---|
468 | then |
---|
469 | input_list="$input_list $run_mode" |
---|
470 | output_list="$output_list $run_mode" |
---|
471 | fi |
---|
472 | |
---|
473 | |
---|
474 | # RECHNERNAMEN ABSPEICHERN, VON DEM AUS JOB GESTARTET WIRD, |
---|
475 | # ALLERDINGS NUR DANN, WENN NICHT PER OPTION -H BEREITS EIN WERT |
---|
476 | # ZUGEWIESEN WURDE (MRUN MACHT DIES IMMER, WENN ES SELBST BATCH-JOBS |
---|
477 | # STARTET) |
---|
478 | if [[ "$fromhost" = "" ]] |
---|
479 | then |
---|
480 | fromhost=$localhost |
---|
481 | fi |
---|
482 | |
---|
483 | |
---|
484 | # PRUEFEN, OB MRUN NUR TESTWEISE AUF DER LOKALEN MASCHINE KOMPILIEREN SOLL |
---|
485 | if [[ "$source_list" = LOCAL_COMPILE_TEST ]] |
---|
486 | then |
---|
487 | source_list=TEST |
---|
488 | local_compile=true |
---|
489 | host=$localhost |
---|
490 | fi |
---|
491 | |
---|
492 | |
---|
493 | # PRUEFEN, OB AUF REMOTE-MASCHINE GERECHNET WERDEN SOLL |
---|
494 | # WERT VON do_remote WIRD FUER DATEIVERBINDUNGEN BENOETIGT. |
---|
495 | # WENN AUF REMOTE-MASCHINE GERECHNET WIRD, IST GLEICHZEITIG KLAR, |
---|
496 | # DASS EIN BATCH-JOB GESTARTET WERDEN MUSS |
---|
497 | if [[ -n $host && "$host" != $localhost ]] |
---|
498 | then |
---|
499 | do_batch=true |
---|
500 | do_remote=true |
---|
501 | case $host in |
---|
502 | (ibm|ibmb|ibmh|ibms|ibmy|nech|neck|lctit|unics) true;; |
---|
503 | (*) printf "\n" |
---|
504 | printf "\n +++ execution host \"$host\" not admitted for MRUN," |
---|
505 | printf "\n or NQS not available on execution host!" |
---|
506 | locat=nqs; (( iec = 0 )); exit;; |
---|
507 | esac |
---|
508 | else |
---|
509 | host=$localhost |
---|
510 | fi |
---|
511 | |
---|
512 | |
---|
513 | # ZUSATZBEDINGUNGEN (OPTION -K) AUSWERTEN |
---|
514 | if [[ -n $additional_conditions ]] |
---|
515 | then |
---|
516 | echo $additional_conditions | cut -d" " -f1-3 | read cond1 cond2 dummy |
---|
517 | # cond1=`echo $additional_conditions | cut -d" " -f1` |
---|
518 | # cond2=`echo $additional_conditions | cut -d" " -s -f2` |
---|
519 | # dummy=`echo $additional_conditions | cut -d" " -s -f3` |
---|
520 | if [[ -n $dummy ]] |
---|
521 | then |
---|
522 | printf "\n +++ more than 2 additional conditions given for Option \"-K\"" |
---|
523 | locat=options; exit |
---|
524 | fi |
---|
525 | fi |
---|
526 | |
---|
527 | |
---|
528 | # PRUEFEN, OB EVTL. BEI VORHERGEHENDEM LAUF (KETTENJOB) EINE |
---|
529 | # ARCHIVIERUNG FEHLGESCHLAGEN IST |
---|
530 | if [[ -f ~/job_queue/ARCHIVE_ERROR_$fname ]] |
---|
531 | then |
---|
532 | if [[ $ignore_archive_error = false ]] |
---|
533 | then |
---|
534 | printf "\n +++ data archiving of previous run failed" |
---|
535 | printf "\n see directory \~/job_queue on remote machine" |
---|
536 | locat=archive; exit |
---|
537 | else |
---|
538 | printf "\n +++ warning: data archiving in a previous run failed" |
---|
539 | printf "\n MRUN continues, trying to get backup copy" |
---|
540 | fi |
---|
541 | fi |
---|
542 | |
---|
543 | |
---|
544 | # PRUEFEN, OB KONFIGURATIONS-DATEI VORHANDEN |
---|
545 | if [[ ! -f $config_file ]] |
---|
546 | then |
---|
547 | printf "\n\n +++ configuration file: " |
---|
548 | printf "\n $config_file" |
---|
549 | printf "\n does not exist" |
---|
550 | locat=connect; exit |
---|
551 | fi |
---|
552 | |
---|
553 | |
---|
554 | |
---|
555 | # LESEN UND INTERPRETIEREN DER KONFIGURATIONS-DATEI VOM SHELLSCRIPT AUS |
---|
556 | # VORUEBERGEHEND ZWINGEND AUF LINUX-RECHNERN |
---|
557 | if [[ "$read_from_config" = false ]] |
---|
558 | then |
---|
559 | |
---|
560 | [[ $silent = false ]] && printf "\n Reading the configuration file... " |
---|
561 | while read zeile |
---|
562 | do |
---|
563 | [[ $silent = false ]] && printf "." |
---|
564 | |
---|
565 | |
---|
566 | # ZUERST EVENTUELL VORKOMMENDE ENVIRONMENT-VARIABLEN DURCH IHRE WERTE |
---|
567 | # ERSETZEN |
---|
568 | eval zeile=\"$zeile\" |
---|
569 | |
---|
570 | |
---|
571 | # INTERPRETATION DER ZEILE |
---|
572 | if [[ "$(echo $zeile | cut -c1)" = "#" ]] |
---|
573 | then |
---|
574 | |
---|
575 | # ZEILE IST KOMMENTARZEILE |
---|
576 | true |
---|
577 | |
---|
578 | elif [[ "$(echo $zeile | cut -c1)" = "%" ]] |
---|
579 | then |
---|
580 | |
---|
581 | # ZEILE DEFINIERT ENVIRONMENT-VARIABLE |
---|
582 | zeile=$(echo $zeile | cut -c2-) |
---|
583 | echo $zeile | cut -d" " -f1-5 | read var value for_host for_cond1 for_cond2 |
---|
584 | # var=`echo $zeile | cut -d" " -f1` |
---|
585 | # value=`echo $zeile | cut -d" " -s -f2` |
---|
586 | # for_host=`echo $zeile | cut -d" " -s -f3` |
---|
587 | # for_cond1=`echo $zeile | cut -d" " -s -f4` |
---|
588 | # for_cond2=`echo $zeile | cut -d" " -s -f5` |
---|
589 | |
---|
590 | if [[ "$for_host" = "" || ( "$for_host" = $host && "$for_cond1" = "$cond1" && "$for_cond2" = "$cond2" ) || $(echo "$input_list$output_list"|grep -c "$for_host") != 0 ]] |
---|
591 | then |
---|
592 | |
---|
593 | # BEI COMPILER- CPP- ODER LINKEROPTIONEN EVTL ":" DURCH " " |
---|
594 | # ERSETZEN. "::" WIRD DURCH ":" ERSETZT. |
---|
595 | value=`echo $value | sed 's/::/%DUM%/g' | sed 's/:/ /g' | sed 's/%DUM%/:/g'` |
---|
596 | |
---|
597 | |
---|
598 | # ENVIRONMENT-VARIABLE WIRD WERT AUS KONFIGURATIONSDATEI |
---|
599 | # ZUGEWIESEN, WENN SIE SELBST NOCH KEINEN WERT UEBER DIE |
---|
600 | # ENTSPRECHENDE SCRIPT-OPTION ERHALTEN HAT. SOLCHE |
---|
601 | # VARIABLEN HAETTEN DANN DEN WERT "" ODER IM INTEGER-FALL DEN |
---|
602 | # WERT 0. ALLGEMEINE REGEL ALSO: SCRIPT-OPTION GEHT UEBER |
---|
603 | # KONFIGURATIONSDATEI |
---|
604 | if [[ "$(eval echo \$$var)" = "" || "$(eval echo \$$var)" = "0" ]] |
---|
605 | then |
---|
606 | eval $var=\$value |
---|
607 | |
---|
608 | # EVTL. BILDSCHIRMAUSGABEN DER ENVIRONMENT-VARIABLEN |
---|
609 | if [[ $do_trace = true ]] |
---|
610 | then |
---|
611 | printf "\n*** ENVIRONMENT-VARIABLE $var = $value" |
---|
612 | fi |
---|
613 | fi |
---|
614 | |
---|
615 | # WENN ENVIRONMENT-VARIABLE HOST VEREINBART, DANN SOFORT AUSWERTEN |
---|
616 | # WERT VON do-remote WIRD BEI DATEIVERBINDUNGEN BENOETIGT |
---|
617 | # WENN AUF REMOTE-MASCHINE GERECHNET WIRD, IST GLEICHZEITIG KLAR, |
---|
618 | # DASS EIN BATCH-JOB GESTARTET WERDEN MUSS |
---|
619 | if [[ $var = host ]] |
---|
620 | then |
---|
621 | if [[ -n $host && "$host" != $localhost ]] |
---|
622 | then |
---|
623 | do_batch=true |
---|
624 | do_remote=true |
---|
625 | case $host in |
---|
626 | (ibm|ibms|ibmy|lctit|nech|neck|unics) true;; |
---|
627 | (*) printf "\n +++ no queueing system available on execution host \"$host\"" |
---|
628 | locat=nqs; exit;; |
---|
629 | esac |
---|
630 | else |
---|
631 | host=$localhost |
---|
632 | fi |
---|
633 | fi |
---|
634 | |
---|
635 | # VOM BENUTZER DEFINIERTE ENVIRONMENT VARIABLEN MUESSEN PRINZIPIELL |
---|
636 | # EXPORTIERT WERDEN, DA SIE VIELLEICHT IN WEITER UNTEN AUFZURUFEN- |
---|
637 | # DEN PROGRAMMEN BENOETIGT WERDEN |
---|
638 | export $var |
---|
639 | fi |
---|
640 | |
---|
641 | |
---|
642 | |
---|
643 | |
---|
644 | elif [[ "$(echo $zeile | cut -c1-3)" = "EC:" ]] |
---|
645 | then |
---|
646 | |
---|
647 | # ZEILE DEFINIERT ERROR-KOMMANDO |
---|
648 | (( iec = iec + 1 )) |
---|
649 | zeile=$(echo $zeile | cut -c4-) |
---|
650 | err_command[$iec]="$zeile" |
---|
651 | |
---|
652 | elif [[ "$(echo $zeile | cut -c1-3)" = "IC:" ]] |
---|
653 | then |
---|
654 | |
---|
655 | # ZEILE DEFINIERT INPUT-KOMMANDO |
---|
656 | (( iic = iic + 1 )) |
---|
657 | zeile=$(echo $zeile | cut -c4-) |
---|
658 | in_command[$iic]="$zeile" |
---|
659 | |
---|
660 | elif [[ "$(echo $zeile | cut -c1-3)" = "OC:" ]] |
---|
661 | then |
---|
662 | |
---|
663 | # ZEILE DEFINIERT OUTPUT-KOMMANDO |
---|
664 | (( ioc = ioc + 1 )) |
---|
665 | zeile=$(echo $zeile | cut -c4-) |
---|
666 | out_command[$ioc]="$zeile" |
---|
667 | |
---|
668 | else |
---|
669 | |
---|
670 | # ZEILE DEFINIERT DATEIVERBINDUNG. EINLESEN DER DATEIEIGENSCHAFTEN |
---|
671 | # s2a: in/out - Feld |
---|
672 | # s2b: loc - Feld (optional) |
---|
673 | # s2c: tr/ar - Feld (optional) |
---|
674 | echo $zeile | cut -d" " -f1-2 | read s1 s2 |
---|
675 | # s1=`echo $zeile | cut -d" " -f1` |
---|
676 | # s2=`echo $zeile | cut -d" " -s -f2` |
---|
677 | s2a=$(echo $s2 | cut -d":" -f1) |
---|
678 | if [[ $(echo $s2 | grep -c ":") = 0 ]] |
---|
679 | then |
---|
680 | s2b="" |
---|
681 | s2c="" |
---|
682 | else |
---|
683 | echo $s2 | cut -d":" -f2-3 | sed 's/:/ /g' | read s2b s2c |
---|
684 | # s2b=`echo $s2 | cut -d":" -f2 | sed 's/:/ /g'` |
---|
685 | # s2c=`echo $s2 | cut -d":" -s -f3 | sed 's/:/ /g'` |
---|
686 | fi |
---|
687 | echo $zeile | cut -d" " -f3-6 | read s3 s4 s5 s6 |
---|
688 | # s3=`echo $zeile | cut -d" " -f3` |
---|
689 | # s4=`echo $zeile | cut -d" " -s -f4` |
---|
690 | # s5=`echo $zeile | cut -d" " -s -f5` |
---|
691 | # s6=`echo $zeile | cut -d" " -s -f6` |
---|
692 | |
---|
693 | |
---|
694 | # ABSPEICHERN DER DATEIVERBINDUNG, FALLS IN INPUT- ODER OUTPUT-LIST |
---|
695 | # VERMERKT. VARIABLE S3 KANN AUCH LISTE ENTHALTEN (FELDTRENNER ":") |
---|
696 | # DATEIVERBINDUNG WIRD DANN NICHT ABGESPEICHERT UND GEPRUEFT, WENN |
---|
697 | # PROGRAMMLAUF AUF REMOTE-MASCHINE ERFOLGT UND DATEI NUR LOKAL VOR- |
---|
698 | # HANDEN SEIN MUSS (D.H. s2b = loc) |
---|
699 | IFSALT="$IFS"; IFS="$IFS:" |
---|
700 | if [[ "$s2a" = in && ! ( $do_remote = true && ( "$s2b" = loc || "$s2b" = locopt ) ) ]] |
---|
701 | then |
---|
702 | found=false |
---|
703 | for actual in $input_list |
---|
704 | do |
---|
705 | for formal in $s3 |
---|
706 | do |
---|
707 | [[ $actual = $formal || "$formal" = "-" ]] && found=true |
---|
708 | done |
---|
709 | done |
---|
710 | if [[ $found = true ]] |
---|
711 | then |
---|
712 | (( iin = iin + 1 )) |
---|
713 | localin[$iin]=$s1; transin[$iin]=$s2b; actionin[$iin]=$s2c; |
---|
714 | typein[$iin]=$s3; pathin[$iin]=$s4; endin[$iin]=$s5; |
---|
715 | extin[$iin]=$s6 |
---|
716 | fi |
---|
717 | elif [[ "$s2a" = out && ! ( $do_remote = true && "$s2b" = loc ) ]] |
---|
718 | then |
---|
719 | found=false |
---|
720 | for actual in $output_list |
---|
721 | do |
---|
722 | for formal in $s3 |
---|
723 | do |
---|
724 | [[ $actual = $formal || "$formal" = "-" ]] && found=true |
---|
725 | done |
---|
726 | done |
---|
727 | if [[ $found = true ]] |
---|
728 | then |
---|
729 | (( iout = iout + 1 )) |
---|
730 | localout[$iout]=$s1; actionout[$iout]=$s2c; typeout[$iout]=$s3; |
---|
731 | pathout[$iout]=$s4; endout[$iout]=$s5; extout[$iout]=$s6 |
---|
732 | fi |
---|
733 | elif [[ "$s2a" != in && "$s2a" != out ]] |
---|
734 | then |
---|
735 | printf "\n +++ I/O-attribute in configuration file $config_file has the invalid" |
---|
736 | printf "\n value \"$s2\". Only \"in\" and \"out\" are allowed!" |
---|
737 | locat=connect; exit |
---|
738 | fi |
---|
739 | IFS="$IFSALT" |
---|
740 | fi |
---|
741 | done < $config_file |
---|
742 | |
---|
743 | else |
---|
744 | |
---|
745 | |
---|
746 | # INTERPRETATION DER KONFIGURATIONSDATEI MITTELS FORTRAN 90 - PROGRAMM |
---|
747 | [[ $silent = false ]] && printf "..." |
---|
748 | export cond1 cond2 config_file do_remote do_trace input_list localhost output_list |
---|
749 | export interpreted_config_file=.icf.$RANDOM |
---|
750 | |
---|
751 | case $localhost_realname in |
---|
752 | (caurus|twister) interpret_config.hp;; |
---|
753 | (bora|breva|elephanta|gallego|gregale|hababai|maestro|orkan|ostria) export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/muksoft/packages/intel_ifc/8.1/lib/; interpret_config_9.x;; |
---|
754 | (levanto|vorias) export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/muksoft/packages/intel/ifort/9.1.037/lib/; interpret_config_9.x_levanto;; |
---|
755 | (quanero) export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/intel_fc_80/lib; interpret_config_9.x;; |
---|
756 | (*) interpret_config.x;; |
---|
757 | esac |
---|
758 | |
---|
759 | |
---|
760 | # AUSFUEHRUNG DER GENERIERTEN SHELL-KOMMANDOS IN DIESER SHELL |
---|
761 | chmod u+x $interpreted_config_file |
---|
762 | export PATH=$PATH:. |
---|
763 | . $interpreted_config_file |
---|
764 | rm $interpreted_config_file |
---|
765 | |
---|
766 | fi |
---|
767 | |
---|
768 | |
---|
769 | # QUELLTEXTVERZEICHNIS AUF LOKALER MASCHINE AUS KONFIGURATIONSDATEI |
---|
770 | # BESTIMMEN (WUERDE SONST EVTL. DAS VERZEICHNIS DES JEWEILS UNTER -h |
---|
771 | # ANGEGEBENEN REMOTE-RECHNERS SEIN) |
---|
772 | # BEI BATCH-JOBS SIND DIE ZU UEBERSETZENDEN PROGRAMMTEILE SCHON KOMPLETT |
---|
773 | if [[ "$SOURCES_COMPLETE" = "" ]] |
---|
774 | then |
---|
775 | |
---|
776 | # ZUERST PRUEFEN, OB EIN GLOBALER QUELLTEXTPFAD FUER ALLE RECHNER |
---|
777 | # VEREINBART WURDE |
---|
778 | source_path="" |
---|
779 | line="" |
---|
780 | grep "%source_path" $config_file > tmp_mrun |
---|
781 | while read line |
---|
782 | do |
---|
783 | if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] |
---|
784 | then |
---|
785 | if [[ "$(echo $line | cut -d" " -f3)" = "" ]] |
---|
786 | then |
---|
787 | global_source_path=`echo $line | cut -d" " -f2` |
---|
788 | fi |
---|
789 | fi |
---|
790 | done < tmp_mrun |
---|
791 | |
---|
792 | line="" |
---|
793 | found=false |
---|
794 | grep " $localhost" $config_file | grep "%source_path" > tmp_mrun |
---|
795 | while read line |
---|
796 | do |
---|
797 | if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] |
---|
798 | then |
---|
799 | if [[ $found = true ]] |
---|
800 | then |
---|
801 | printf "\n\n +++ more than one source path found in configuration file" |
---|
802 | printf "\n for local host \"$localhost\" " |
---|
803 | locat=source_path; exit |
---|
804 | fi |
---|
805 | source_path=`echo $line | cut -d" " -f2` |
---|
806 | found=true |
---|
807 | fi |
---|
808 | done < tmp_mrun |
---|
809 | rm tmp_mrun |
---|
810 | |
---|
811 | if [[ "$source_path" = "" ]] |
---|
812 | then |
---|
813 | if [[ "$global_source_path" != "" ]] |
---|
814 | then |
---|
815 | source_path=$global_source_path |
---|
816 | else |
---|
817 | printf "\n\n +++ no source path found in configuration file" |
---|
818 | printf "\n for local host \"$localhost\" " |
---|
819 | locat=source_path; exit |
---|
820 | fi |
---|
821 | fi |
---|
822 | eval source_path=$source_path |
---|
823 | |
---|
824 | if [[ ! -d $source_path ]] |
---|
825 | then |
---|
826 | printf "\n\n +++ source path \"$source_path\" on local host" |
---|
827 | printf "\n \"$localhost\" does not exist" |
---|
828 | locat=source_path; exit |
---|
829 | fi |
---|
830 | |
---|
831 | fi |
---|
832 | |
---|
833 | |
---|
834 | |
---|
835 | # NOCHMAL PRUEFEN, OB AUF REMOTE-MASCHINE GERECHNET WERDEN SOLL |
---|
836 | # (HOST KANN IN KONFIGURATIONSDATEI ANDERS FESTGELEGT WORDEN SEIN) |
---|
837 | # WERT VON do_remote WIRD FUER DATEIVERBINDUNGEN BENOETIGT. |
---|
838 | # WENN AUF REMOTE-MASCHINE GERECHNET WIRD, IST GLEICHZEITIG KLAR, |
---|
839 | # DASS EIN BATCH-JOB GESTARTET WERDEN MUSS |
---|
840 | if [[ -n $host && "$host" != $localhost ]] |
---|
841 | then |
---|
842 | do_batch=true |
---|
843 | do_remote=true |
---|
844 | case $host in |
---|
845 | (ibm|ibmb|ibmh|ibms|ibmy|lctit|nech|neck|unics) true;; |
---|
846 | (*) printf "\n" |
---|
847 | printf "\n +++ execution host \"$host\" not admitted for MRUN," |
---|
848 | printf "\n or no queueing system available on execution host!" |
---|
849 | locat=nqs; (( iec = 0 )); exit;; |
---|
850 | esac |
---|
851 | else |
---|
852 | host=$localhost |
---|
853 | fi |
---|
854 | |
---|
855 | |
---|
856 | # PRUEFUNG EINIGER PROZESSORZAHLANGABEN BEI RECHNUNGEN AUF PARALLELRECHNERN |
---|
857 | if [[ "$cond1" = parallel || "$cond2" = parallel ]] |
---|
858 | then |
---|
859 | |
---|
860 | # PRUEFEN, OB DIE ANZAHL DER ZU VERWENDENDEN PES ANGEGEBEN WURDE |
---|
861 | if [[ ! -n $numprocs ]] |
---|
862 | then |
---|
863 | printf "\n" |
---|
864 | printf "\n +++ option \"-K parallel\" requires additional specification" |
---|
865 | printf "\n of the number of processors to be used by" |
---|
866 | printf "\n mrun-option \"-X\" or by environment-variable" |
---|
867 | printf "\n \"numprocs\" in the configuration file" |
---|
868 | locat=numprocs; (( iec = 0 )); exit |
---|
869 | fi |
---|
870 | |
---|
871 | # PRUEFEN, OB DIE PROZESSORANZAHL PRO KNOTEN ANGEGEBEN WURDE (GGF. |
---|
872 | # DEFAULT-WERT SETZEN) UND OB SIE EIN GANZZAHLIGER TEILER DER |
---|
873 | # GESAMTPROZESSORANZAHL IST |
---|
874 | if [[ $host = nech || $host = neck || $host = ibmh || $host = ibmb || $host = ibms ]] |
---|
875 | then |
---|
876 | [[ "$tasks_per_node" = "" ]] && tasks_per_node=6 |
---|
877 | (( ival = $tasks_per_node )) |
---|
878 | (( pes = numprocs )) |
---|
879 | # if [[ $(echo $package_list | grep -c dvrp_graphics+1PE) = 1 ]] |
---|
880 | # then |
---|
881 | # (( pes = pes - 1 )) |
---|
882 | # fi |
---|
883 | (( ii = pes / ival )) |
---|
884 | if (( pes - ii * ival > 0 )) |
---|
885 | then |
---|
886 | printf "\n" |
---|
887 | printf "\n +++ tasks per node (option \"-T\") must be an integral" |
---|
888 | printf "\n divisor of the total number of processors (option \"-X\")" |
---|
889 | printf "\n values of this mrun-call: \"-T $tasks_per_node\" \"-X $numprocs\"" |
---|
890 | locat=tasks_per_node; (( iec = 0 )); exit |
---|
891 | fi |
---|
892 | fi |
---|
893 | |
---|
894 | # IBMY HAT NUR EINEN KNOTEN |
---|
895 | if [[ $host = ibmy ]] |
---|
896 | then |
---|
897 | if [[ "$tasks_per_node" != "" && "$tasks_per_node" != "$numprocs" ]] |
---|
898 | then |
---|
899 | printf "\n" |
---|
900 | printf "\n +++ on ibmy, tasks per node (option \"-T\") must be equal to the" |
---|
901 | printf "\n total number of processors (option \"-X\")" |
---|
902 | printf "\n values of this mrun-call: \"-T $tasks_per_node\" \"-X $numprocs\"" |
---|
903 | locat=tasks_per_node; (( iec = 0 )); exit |
---|
904 | fi |
---|
905 | fi |
---|
906 | |
---|
907 | # FALLS OPENMP PARALLELISIERUNG VERWENDET WERDEN SOLL, ANZAHL VON THREADS |
---|
908 | # SETZEN UND ZAHL DER TASKS PRO KNOTEN AUF 1 SETZEN |
---|
909 | if [[ $use_openmp = true ]] |
---|
910 | then |
---|
911 | threads_per_task=$tasks_per_node |
---|
912 | tasks_per_node=1 |
---|
913 | fi |
---|
914 | OOPT="-O $threads_per_task" |
---|
915 | TOPT="-T $tasks_per_node" |
---|
916 | |
---|
917 | # GESAMTZAHL DER KNOTEN BESTIMMEN |
---|
918 | if [[ "$tasks_per_node" != "" ]] |
---|
919 | then |
---|
920 | (( nodes = numprocs / ( tasks_per_node * threads_per_task ) )) |
---|
921 | fi |
---|
922 | |
---|
923 | # PRUEFEN, OB NODE USAGE EINEN ERLAUBTEN WERT HAT BZW. DEN DEFAULT |
---|
924 | # SETZEN |
---|
925 | if [[ $node_usage = default ]] |
---|
926 | then |
---|
927 | if [[ $host = ibms ]] |
---|
928 | then |
---|
929 | node_usage=shared |
---|
930 | else |
---|
931 | node_usage=not_shared |
---|
932 | fi |
---|
933 | fi |
---|
934 | if [[ $node_usage != shared && $node_usage != not_shared ]] |
---|
935 | then |
---|
936 | printf "\n" |
---|
937 | printf "\n +++ node usage (option \"-n\") is only allowed to be set" |
---|
938 | printf "\n \"shared\" or \"not_shared\"" |
---|
939 | locat=tasks_per_node; (( iec = 0 )); exit |
---|
940 | fi |
---|
941 | |
---|
942 | fi |
---|
943 | |
---|
944 | # PRUEFEN, OB HOSTFILE EXISTIERT |
---|
945 | if [[ -n $hostfile ]] |
---|
946 | then |
---|
947 | if [[ ! -f $hostfile ]] |
---|
948 | then |
---|
949 | printf "\n" |
---|
950 | printf "\n +++ hostfile \"$hostfile\" does not exist" |
---|
951 | locat=hostfile; exit |
---|
952 | fi |
---|
953 | fi |
---|
954 | |
---|
955 | # PRUEFEN, OB RHOSTS DATEI EXISTIERT. GEGEBENENFALLS ANLEGEN BZW. ERWEITERN |
---|
956 | if [[ $host = ibmy && $do_remote = false ]] |
---|
957 | then |
---|
958 | if [[ ! -f $HOME/.rhosts ]] |
---|
959 | then |
---|
960 | echo "gfdl5.yonsei.ac.kr" > $HOME/.rhosts |
---|
961 | printf "\n\n *** file:" |
---|
962 | printf "\n $HOME/.rhosts" |
---|
963 | printf "\n was created\n" |
---|
964 | fi |
---|
965 | if [[ $(grep -c gfdl5.yonsei.ac.kr $HOME/.rhosts) = 0 ]] |
---|
966 | then |
---|
967 | echo "gfdl5.yonsei.ac.kr" >> $HOME/.rhosts |
---|
968 | printf "\n\n *** file:" |
---|
969 | printf "\n $HOME/.rhosts" |
---|
970 | printf "\n was extended by the name of the current host\n" |
---|
971 | fi |
---|
972 | fi |
---|
973 | |
---|
974 | # DEFAULT-DATEITRANSFER-PROTOKOLL FESTLEGEN |
---|
975 | if [[ "$filetransfer_protocol" = "" ]] |
---|
976 | then |
---|
977 | case $host in |
---|
978 | (nech|neck|ibm|ibmb|ibmh|ibms|ibmy|lctit) filetransfer_protocol=scp;; |
---|
979 | (*) filetransfer_protocol=ftp;; |
---|
980 | esac |
---|
981 | fi |
---|
982 | |
---|
983 | # PRUEFEN, OB ZULAESSIGES DATEITRANSFER-PROTOKOLL GEWAEHLT WURDE |
---|
984 | if [[ "$filetransfer_protocol" != ftp && "$filetransfer_protocol" != scp ]] |
---|
985 | then |
---|
986 | printf "\n" |
---|
987 | printf "\n +++ illegal value \"$filetransfer_protocol\" for Option -f" |
---|
988 | printf "\n only \"ftp\" or \"scp\" are allowed" |
---|
989 | locat=options; exit |
---|
990 | fi |
---|
991 | |
---|
992 | |
---|
993 | # FALLS NICHT VORGEGEBEN, DEFAULT-QUEUE AUF DER ZIELMASCHINE FESTLEGEN |
---|
994 | if [[ $queue = none ]] |
---|
995 | then |
---|
996 | case $host in |
---|
997 | (ibmb) if [[ $node_usage = shared ]] |
---|
998 | then |
---|
999 | queue=cshare |
---|
1000 | else |
---|
1001 | queue=csolo |
---|
1002 | fi;; |
---|
1003 | (ibmh) if [[ $node_usage = shared ]] |
---|
1004 | then |
---|
1005 | queue=cshare |
---|
1006 | else |
---|
1007 | queue=csolo |
---|
1008 | fi;; |
---|
1009 | (ibmy) queue=parallel;; |
---|
1010 | (lctit) queue=default;; |
---|
1011 | (nech) queue=none;; |
---|
1012 | (neck) queue=P;; |
---|
1013 | (unics) queue=unics;; |
---|
1014 | esac |
---|
1015 | fi |
---|
1016 | |
---|
1017 | |
---|
1018 | # EVTL. NETCDF-UNTERSTUETZUNG SETZEN |
---|
1019 | case $host in |
---|
1020 | (decalpha) netcdf_support=true |
---|
1021 | netcdf_path=/usr/local/netcdf-3.5.1;; |
---|
1022 | (ibmb|ibmh) netcdf_support=true |
---|
1023 | netcdf_path=/aws/dataformats/netcdf-3.6.0-p1/64-32;; |
---|
1024 | (ibms) netcdf_support=true |
---|
1025 | netcdf_path=/applic/lib/NETCDF64;; |
---|
1026 | (ibmy) netcdf_support=true |
---|
1027 | netcdf_path=/usr1/users/raasch/pub/netcdf-3.6.0-p1;; |
---|
1028 | (lcmuk) netcdf_support=true |
---|
1029 | if [[ $scirocco = true ]] |
---|
1030 | then |
---|
1031 | netcdf_path=/opt/netcdf/3.6.2-beta4 |
---|
1032 | else |
---|
1033 | netcdf_path=/muksoft/packages/netcdf/linux |
---|
1034 | fi;; |
---|
1035 | (lctit) netcdf_support=true |
---|
1036 | netcdf_path=/home2/usr5/mkanda/netcdf-3.6.1;; |
---|
1037 | (nech) netcdf_support=true |
---|
1038 | netcdf_path=/pool/SX-6/netcdf/netcdf-3.6.0-p1;; |
---|
1039 | (neck) netcdf_support=true |
---|
1040 | netcdf_path=/home/DSRC/NC/tatuyama/pub/netcdf-3.6.0-p1;; |
---|
1041 | esac |
---|
1042 | |
---|
1043 | |
---|
1044 | # VOLLSTAENDIGE DATEINAMEN DER INPUT-FILES BILDEN, |
---|
1045 | # INPUT-DATEIEN AUF VORHANDENSEIN PRUEFEN UND EVTL. HOECHSTE ZYKLUSNUMMER |
---|
1046 | # ERMITTELN |
---|
1047 | (( i = 0 )) |
---|
1048 | while (( i < iin )) |
---|
1049 | do |
---|
1050 | (( i = i + 1 )) |
---|
1051 | (( maxcycle = 0 )) |
---|
1052 | |
---|
1053 | # NAMENSBILDUNG (EVTL. IST FESTER DATEINAME VORGEGEBEN) |
---|
1054 | if [[ "${actionin[$i]}" = di ]] |
---|
1055 | then |
---|
1056 | remotepathin[$i]=${pathin[$i]}/${endin[$i]} # REMOTE-PFAD ERST AUF |
---|
1057 | # REM-MASCHINE AUSWERTEN |
---|
1058 | eval filename=${pathin[$i]}/${endin[$i]} |
---|
1059 | else |
---|
1060 | remotepathin[$i]=${pathin[$i]}/${afname}${endin[$i]} # REMOTE-PFAD ERST AUF |
---|
1061 | # REM-MASCHINE AUSWERTEN |
---|
1062 | eval filename=${pathin[$i]}/${afname}${endin[$i]} |
---|
1063 | fi |
---|
1064 | |
---|
1065 | # PRUEFEN AUF VORHANDENSEIN |
---|
1066 | if [[ $(ls $filename* 2>&1 | grep -c "not found") = 1 || \ |
---|
1067 | $(ls $filename* 2>&1 | grep -c "No such file") = 1 || \ |
---|
1068 | $(ls $filename* 2>&1 | grep -c "does not exist") = 1 ]] |
---|
1069 | then |
---|
1070 | # DATEIEN MIT EXTENSION (Z.B. NC) MUESSEN NICHT ZWINGEND VORHANDEN |
---|
1071 | # SEIN, DESHALB IN SOLCHEN FAELLEN KEIN ABBRUCH. DIES IST NUR EINE |
---|
1072 | # VORUEBERGEHENDE LOESUNG (OKT 05). NICHT ZWINGEND BENOETIGTE |
---|
1073 | # EINGABEDATEIEN SOLLTEN EINE SPEZIELLE OPTION IN DER DATEI- |
---|
1074 | # VERBINDUNGSANWEISUNG BEKOMMEN (Z.B. inopt?) |
---|
1075 | if [[ "${transin[$i]}" != "locopt" ]] |
---|
1076 | then |
---|
1077 | printf "\n\n +++ INPUT-file: " |
---|
1078 | if [[ "${extin[$i]}" = "" ]] |
---|
1079 | then |
---|
1080 | printf "\n $filename" |
---|
1081 | else |
---|
1082 | printf "\n $filename.${extin[$i]}" |
---|
1083 | fi |
---|
1084 | printf "\n does not exist\n" |
---|
1085 | locat=input; exit |
---|
1086 | else |
---|
1087 | transin[$i]="unavailable" |
---|
1088 | fi |
---|
1089 | else |
---|
1090 | |
---|
1091 | # ZYKLUSNUMMER FESTSTELLEN |
---|
1092 | ls -1 -d $filename > filelist 2>/dev/null |
---|
1093 | ls -1 -d $filename.* >> filelist 2>/dev/null |
---|
1094 | while read zeile |
---|
1095 | do |
---|
1096 | cycle=$(print $zeile | cut -f2 -d".") |
---|
1097 | if [[ "$cycle" = "$zeile" ]] |
---|
1098 | then |
---|
1099 | (( icycle = 0 )) |
---|
1100 | elif [[ "$cycle" = "${extin[$i]}" ]] |
---|
1101 | then |
---|
1102 | (( icycle = 0 )) |
---|
1103 | else |
---|
1104 | (( icycle = $cycle )) |
---|
1105 | fi |
---|
1106 | if (( icycle > maxcycle )) |
---|
1107 | then |
---|
1108 | (( maxcycle = icycle )) |
---|
1109 | file_to_be_used=$zeile |
---|
1110 | fi |
---|
1111 | done <filelist |
---|
1112 | rm filelist |
---|
1113 | |
---|
1114 | # EVTL. ZYKLUSNUMMER AN DATEINAMEN ANFUEGEN |
---|
1115 | if (( maxcycle > 0 )) |
---|
1116 | then |
---|
1117 | if [[ "${extin[$i]}" != " " && "${extin[$i]}" != "" ]] |
---|
1118 | then |
---|
1119 | filename=${filename}.$maxcycle.${extin[$i]} |
---|
1120 | else |
---|
1121 | filename=${filename}.$maxcycle |
---|
1122 | fi |
---|
1123 | else |
---|
1124 | if [[ "${extin[$i]}" != " " && "${extin[$i]}" != "" ]] |
---|
1125 | then |
---|
1126 | filename=${filename}.${extin[$i]} |
---|
1127 | fi |
---|
1128 | fi |
---|
1129 | |
---|
1130 | # DATEINAMEN OHNE PFAD ABER MIT ZYKLUSNUMMER ABSPEICHERN, |
---|
1131 | # DA SPAETER BEI RUECKSPEICHERN VOM ARCHIVSYSTEM EVTL. BENOETIGT |
---|
1132 | absnamein[$i]=$filename |
---|
1133 | if (( maxcycle > 0 )) |
---|
1134 | then |
---|
1135 | if [[ "${actionin[$i]}" = di ]] |
---|
1136 | then |
---|
1137 | frelin[$i]=${endin[$i]}.$maxcycle |
---|
1138 | else |
---|
1139 | frelin[$i]=${afname}${endin[$i]}.$maxcycle |
---|
1140 | fi |
---|
1141 | else |
---|
1142 | if [[ "${actionin[$i]}" = di ]] |
---|
1143 | then |
---|
1144 | frelin[$i]=${endin[$i]} |
---|
1145 | else |
---|
1146 | frelin[$i]=${afname}${endin[$i]} |
---|
1147 | fi |
---|
1148 | fi |
---|
1149 | |
---|
1150 | fi |
---|
1151 | done |
---|
1152 | |
---|
1153 | |
---|
1154 | # VOLLSTAENDIGE DATEINAMEN (OHNE $ ODER ~) DER OUTPUT-FILES BILDEN, |
---|
1155 | # OUTPUT-DATEIEN AUF VORHANDENSEIN PRUEFEN UND EVTL. HOECHSTE ZYKLUSNUMMER |
---|
1156 | # ERMITTELN ODER, FALLS NICHT VORHANDEN, PRUEFEN, OB SIE SICH ANLEGEN LASSEN |
---|
1157 | # DIESE AKTIONEN FINDEN NICHT STATT, WENN PROGRAMM AUF REMOTE-MASCHINE |
---|
1158 | # RECHNET UND DATEI ANSCHLIESSEND TRANSFERIERT WERDEN SOLL! |
---|
1159 | (( i = 0 )) |
---|
1160 | while (( i < iout )) |
---|
1161 | do |
---|
1162 | (( i = i + 1 )) |
---|
1163 | if [[ ! ( $fromhost != $localhost && ( "${actionout[$i]}" = tr || "${actionout[$i]}" = tra || "${actionout[$i]}" = trpe ) ) ]] |
---|
1164 | then |
---|
1165 | if [[ "${actionout[$i]}" = tr || "${actionout[$i]}" = trpe ]] |
---|
1166 | then |
---|
1167 | actionout[$i]="" |
---|
1168 | elif [[ "${actionout[$i]}" = tra ]] |
---|
1169 | then |
---|
1170 | actionout[$i]=a |
---|
1171 | fi |
---|
1172 | (( maxcycle = 0 )) |
---|
1173 | eval filename=${pathout[$i]}/${fname}${endout[$i]} |
---|
1174 | eval catalogname=${pathout[$i]} |
---|
1175 | if [[ $(ls $filename* 2>&1 | grep -c "not found") = 1 || \ |
---|
1176 | $(ls $filename* 2>&1 | grep -c "No such file") = 1 || \ |
---|
1177 | $(ls $filename* 2>&1 | grep -c "does not exist") = 1 ]] |
---|
1178 | then |
---|
1179 | |
---|
1180 | # OUTPUT-DATEI NICHT VORHANDEN. PRUEFEN, OB ANLEGEN MOEGLICH. |
---|
1181 | if cat /dev/null > $filename |
---|
1182 | then |
---|
1183 | rm $filename |
---|
1184 | else |
---|
1185 | |
---|
1186 | # PRUEFEN, OB KATALOG VORHANDEN UND EVTL. DIESEN ANLEGEN |
---|
1187 | if [[ ! -d $catalogname ]] |
---|
1188 | then |
---|
1189 | if mkdir -p $catalogname |
---|
1190 | then |
---|
1191 | printf "\n\n *** directory:" |
---|
1192 | printf "\n $catalogname" |
---|
1193 | printf "\n was created\n" |
---|
1194 | else |
---|
1195 | printf "\n\n +++ OUTPUT-file:" |
---|
1196 | printf "\n $filename" |
---|
1197 | printf "\n cannot be created, because directory does not exist" |
---|
1198 | printf "\n and cannot be created either" |
---|
1199 | printf "\n" |
---|
1200 | locat=output ; exit |
---|
1201 | fi 2>/dev/null |
---|
1202 | else |
---|
1203 | printf "\n\n +++ OUTPUT-file:" |
---|
1204 | printf "\n $filename" |
---|
1205 | printf "\n cannot be created, although directory exists" |
---|
1206 | printf "\n" |
---|
1207 | locat=output ; exit |
---|
1208 | fi |
---|
1209 | fi 2>/dev/null |
---|
1210 | else |
---|
1211 | |
---|
1212 | # ZYKLUSNUMMER FESTSTELLEN |
---|
1213 | ls -1 -d $filename > filelist 2>/dev/null |
---|
1214 | ls -1 -d $filename.* >> filelist 2>/dev/null |
---|
1215 | while read zeile |
---|
1216 | do |
---|
1217 | cycle=$(print $zeile | cut -f2 -d".") |
---|
1218 | if [[ "$cycle" = "$zeile" || "$cycle" = ${extout[$i]} ]] |
---|
1219 | then |
---|
1220 | (( icycle = 1 )) |
---|
1221 | else |
---|
1222 | (( icycle = $cycle + 1 )) |
---|
1223 | fi |
---|
1224 | if (( icycle > maxcycle )) |
---|
1225 | then |
---|
1226 | (( maxcycle = icycle )) |
---|
1227 | fi |
---|
1228 | done <filelist |
---|
1229 | rm filelist |
---|
1230 | fi |
---|
1231 | |
---|
1232 | # EVTL. ZYKLUSNUMMER AN DATEINAMEN ANFUEGEN UND PRUEFEN, OB SICH |
---|
1233 | # DATEI AUCH WIRKLICH ANLEGEN LAESST. IM APPEND-FALL MUSS AN DEN |
---|
1234 | # HOECHSTEN VORHANDENEN ZYKLUS-ANGEHAENGT WERDEN. ANLAGEPRUEFUNG |
---|
1235 | # IST DANN NATUERLICH NICHT ZULAESSIG BZW. MOEGLICH |
---|
1236 | if [[ "${actionout[$i]}" != a ]] |
---|
1237 | then |
---|
1238 | if (( maxcycle > 0 )) |
---|
1239 | then |
---|
1240 | filename=${filename}.$maxcycle |
---|
1241 | if cat /dev/null > $filename |
---|
1242 | then |
---|
1243 | rm $filename |
---|
1244 | else |
---|
1245 | printf "\n +++ OUTPUT-file:" |
---|
1246 | printf "\n $filename" |
---|
1247 | printf "\n cannot be created" |
---|
1248 | locat=output ; exit |
---|
1249 | fi |
---|
1250 | fi |
---|
1251 | else |
---|
1252 | (( maxcycle = maxcycle - 1 )) |
---|
1253 | if (( maxcycle > 0 )) |
---|
1254 | then |
---|
1255 | filename=${filename}.$maxcycle |
---|
1256 | fi |
---|
1257 | fi |
---|
1258 | |
---|
1259 | # DATEINAMEN OHNE PFAD ABER MIT ZYKLUSNUMMER ABSPEICHERN, |
---|
1260 | # DA SPAETER BEI ABLAGE AUF ARCHIVSYSTEM BZW. FUER |
---|
1261 | # DATEI OUTPUT_FILE_CONNECTIONS EVTL. BENOETIGT |
---|
1262 | pathout[$i]=$filename |
---|
1263 | if (( maxcycle > 0 )) |
---|
1264 | then |
---|
1265 | frelout[$i]=${fname}${endout[$i]}.$maxcycle |
---|
1266 | else |
---|
1267 | frelout[$i]=${fname}${endout[$i]} |
---|
1268 | fi |
---|
1269 | |
---|
1270 | fi |
---|
1271 | done |
---|
1272 | |
---|
1273 | |
---|
1274 | # PRUEFEN, OB ENTWEDER HAUPTPROGRAMM ODER NUR EIN AUSFUEHRBARES |
---|
1275 | # PROGRAMM VEREINBART WURDE (IN DIESEM FALL BRAUCHT IM WEITEREN NICHT |
---|
1276 | # UEBERSETZT ZU WERDEN) |
---|
1277 | if [[ "$mainprog" = "" && "$executable" = "" ]] |
---|
1278 | then |
---|
1279 | printf "\n +++ neither main program nor executable defined" |
---|
1280 | locat=source; exit |
---|
1281 | elif [[ "$mainprog" != "" && "$executable" != "" ]] |
---|
1282 | then |
---|
1283 | printf "\n +++ main program as well as executable defined" |
---|
1284 | locat=source; exit |
---|
1285 | elif [[ "$mainprog" = "" && "$executable" != "" ]] |
---|
1286 | then |
---|
1287 | do_compile=false |
---|
1288 | fi |
---|
1289 | |
---|
1290 | |
---|
1291 | # ALLE ZU UEBERSETZENDEN PROGRAMMTEILE ZUSAMMENSAMMELN |
---|
1292 | # BEI BATCH-JOBS IST DIES NICHT NOETIG, WEIL DIE PROGRAMMTEILE BEREITS DURCH |
---|
1293 | # DEN MRUN-AUFRUF ERMITTELT SIND, DER DEN BATCH-JOB GENERIERT HAT, UND |
---|
1294 | # IM VERZEICHNIS SOURCES_FOR_RUN_... ABGELEGT SIND |
---|
1295 | if [[ $do_compile = true && "$SOURCES_COMPLETE" = "" ]] |
---|
1296 | then |
---|
1297 | |
---|
1298 | [[ "$source_list" = LM ]] && source_list=LOCALLY_MODIFIED |
---|
1299 | [[ "$source_list" = WP ]] && source_list=WRITE_PERMIT |
---|
1300 | |
---|
1301 | if [[ $restart_run != true ]] |
---|
1302 | then |
---|
1303 | rm -rf SOURCES_FOR_RUN_$fname |
---|
1304 | mkdir SOURCES_FOR_RUN_$fname |
---|
1305 | fi |
---|
1306 | |
---|
1307 | |
---|
1308 | # EVTL. ZU UEBERSETZENDE PROGRAMMTEILE DADURCH BESTIMMEN, DASS GEPRUEFT |
---|
1309 | # WIRD, WELCHE DATEIEN WRITE-PERMIT BESITZEN (DATEIEN SOLLTEN DESHALB |
---|
1310 | # UNTER RCS-KONTROLLE STEHEN). MIT DER VARIABLEN EXCLUDE KOENNEN |
---|
1311 | # BESTIMMTE DATEIEN GRUNDSAETZLICH VON DER UEBERSETZUNG AUSGESCHLOSSEN |
---|
1312 | # WERDEN. DIES IST NUR BEI MANUELLEM START VON MRUN DURCH DEN BENUTZER |
---|
1313 | # MOEGLICH, DA BEI AUTOMATISCHEN RESTARTS TEST DURCH DIE TATSAECHLICH |
---|
1314 | # ZU UBERSETZENDEN DATEIEN ERSETZT IST. |
---|
1315 | # ALLE ERMITTELTEN DATEIEN WERDEN IM VERZEICHNIS SOURCES_FOR_RUN_... |
---|
1316 | # GESAMMELT |
---|
1317 | if [[ "$source_list" = WRITE_PERMIT ]] |
---|
1318 | then |
---|
1319 | |
---|
1320 | source_list="" |
---|
1321 | cd $source_path |
---|
1322 | |
---|
1323 | |
---|
1324 | # ALLE MOEGLICHEN QUELLCODEDATEIEN AUFLISTEN |
---|
1325 | Names=$(ls -1 *.f90 2>&1) |
---|
1326 | [[ $(echo $Names | grep -c '*.f90') = 0 ]] && Filenames="$Names" |
---|
1327 | Names=$(ls -1 *.F90 2>&1) |
---|
1328 | [[ $(echo $Names | grep -c '*.F90') = 0 ]] && Filenames="$Filenames $Names" |
---|
1329 | Names=$(ls -1 *.F 2>&1) |
---|
1330 | [[ $(echo $Names | grep -c '*.F') = 0 ]] && Filenames="$Filenames $Names" |
---|
1331 | Names=$(ls -1 *.f 2>&1) |
---|
1332 | [[ $(echo $Names | grep -c '*.f') = 0 ]] && Filenames="$Filenames $Names" |
---|
1333 | Names=$(ls -1 *.c 2>&1) |
---|
1334 | [[ $(echo $Names | grep -c '*.c') = 0 ]] && Filenames="$Filenames $Names" |
---|
1335 | |
---|
1336 | |
---|
1337 | # DATEIEN MIT WRITE-PERMIT NACH SOURCES_FOR_RUN_... KOPIEREN |
---|
1338 | for dateiname in $Filenames |
---|
1339 | do |
---|
1340 | if [[ -w $dateiname ]] |
---|
1341 | then |
---|
1342 | if [[ "$exclude" = "" || $(echo $exclude | grep -c $dateiname) = 0 ]] |
---|
1343 | then |
---|
1344 | cp $dateiname $working_directory/SOURCES_FOR_RUN_$fname |
---|
1345 | source_list=$source_list"$dateiname " |
---|
1346 | fi |
---|
1347 | fi |
---|
1348 | done |
---|
1349 | |
---|
1350 | cd - > /dev/null |
---|
1351 | |
---|
1352 | |
---|
1353 | elif [[ "$source_list" = LOCALLY_MODIFIED ]] |
---|
1354 | then |
---|
1355 | |
---|
1356 | # MODIFIZIERTE DATEIEN DER SVN-ARBEITSKOPIE BESTIMMEN |
---|
1357 | source_list="" |
---|
1358 | cd $source_path |
---|
1359 | |
---|
1360 | |
---|
1361 | # PRUEFEN, OB VERZEICHNIS UEBERHAUPT UNTER SVN-KONTROLLE STEHT |
---|
1362 | if [[ ! -d .svn ]] |
---|
1363 | then |
---|
1364 | printf "\n\n +++ source directory" |
---|
1365 | printf "\n \"$source_path\" " |
---|
1366 | printf "\n is not under control of \"subversion\"." |
---|
1367 | printf "\n Please do not use mrun-option \"-s LOCALLY MODIFIED\"\n" |
---|
1368 | fi |
---|
1369 | |
---|
1370 | |
---|
1371 | # ALLE MODIFIZIERTEN QUELLCODEDATEIEN AUFLISTEN |
---|
1372 | Filenames="" |
---|
1373 | svn status | while read line |
---|
1374 | do |
---|
1375 | firstc=`echo $line | cut -c1` |
---|
1376 | if [[ $firstc = M || $firstc = "?" ]] |
---|
1377 | then |
---|
1378 | Name=`echo "$line" | cut -c8-` |
---|
1379 | extension=`echo $Name | cut -d. -f2` |
---|
1380 | if [[ "$extension" = f90 || "$extension" = F90 || "$extension" = f || "$extension" = F || "$extension" = c ]] |
---|
1381 | then |
---|
1382 | Filenames="$Filenames "$Name |
---|
1383 | fi |
---|
1384 | fi |
---|
1385 | done |
---|
1386 | |
---|
1387 | |
---|
1388 | # DATEIEN NACH SOURCES_FOR_RUN_... KOPIEREN |
---|
1389 | for dateiname in $Filenames |
---|
1390 | do |
---|
1391 | cp $dateiname $working_directory/SOURCES_FOR_RUN_$fname |
---|
1392 | source_list=$source_list"$dateiname " |
---|
1393 | done |
---|
1394 | |
---|
1395 | cd - > /dev/null |
---|
1396 | |
---|
1397 | |
---|
1398 | # MITTELS OPTION -s ANGEGEBENE DATEIEN NACH SOURCES_FOR_RUN_... KOPIEREN |
---|
1399 | # BEI AUTOMATISCHEN FORTSETZUNGSLAEUFEN SIND DORT SCHON ALLE DATEIEN |
---|
1400 | # VORHANDEN |
---|
1401 | elif [[ "$source_list" != "" && $restart_run != true ]] |
---|
1402 | then |
---|
1403 | |
---|
1404 | cd $source_path |
---|
1405 | |
---|
1406 | for filename in $source_list |
---|
1407 | do |
---|
1408 | |
---|
1409 | # QUELLTEXT-DATEI DARF KEINE PFADE BEINHALTEN |
---|
1410 | if [[ $(print $filename | grep -c "/") != 0 ]] |
---|
1411 | then |
---|
1412 | printf "\n +++ source code file: $filename" |
---|
1413 | printf "\n must not contain (\"/\") " |
---|
1414 | locat=source; exit |
---|
1415 | fi |
---|
1416 | |
---|
1417 | if [[ ! -f $filename ]] |
---|
1418 | then |
---|
1419 | printf "\n +++ source code file: $filename" |
---|
1420 | printf "\n does not exist" |
---|
1421 | locat=source; exit |
---|
1422 | else |
---|
1423 | cp $filename $working_directory/SOURCES_FOR_RUN_$fname |
---|
1424 | fi |
---|
1425 | |
---|
1426 | done |
---|
1427 | |
---|
1428 | cd - > /dev/null |
---|
1429 | |
---|
1430 | fi |
---|
1431 | |
---|
1432 | |
---|
1433 | # PRUEFEN, OB ENTWEDER HAUPTPROGRAMM VORHANDEN UND ES EVTL. IN DER |
---|
1434 | # LISTE DER ZU UEBERSETZENDEN PROGRAMMTEILE MIT ENTHALTEN IST (WENN |
---|
1435 | # NICHT, WIRD ES DIESER LISTE HINZUGEFUEGT) |
---|
1436 | if [[ $restart_run != true ]] |
---|
1437 | then |
---|
1438 | |
---|
1439 | if [[ ! -f "$source_path/$mainprog" ]] |
---|
1440 | then |
---|
1441 | printf "\n\n +++ main program: $mainprog" |
---|
1442 | printf "\n does not exist in source directory" |
---|
1443 | printf "\n \"$source_path\"\n" |
---|
1444 | locat=source; exit |
---|
1445 | else |
---|
1446 | if [[ $(echo $source_list | grep -c $mainprog) = 0 ]] |
---|
1447 | then |
---|
1448 | cp $source_path/$mainprog SOURCES_FOR_RUN_$fname |
---|
1449 | source_list=${mainprog}" $source_list" |
---|
1450 | fi |
---|
1451 | fi |
---|
1452 | fi |
---|
1453 | |
---|
1454 | |
---|
1455 | # DATEIEN AUS ZUSAETZLICHEM QUELLVERZEICHNIS HINZUFUEGEN |
---|
1456 | if [[ $restart_run != true && "$add_source_path" != "" ]] |
---|
1457 | then |
---|
1458 | |
---|
1459 | # GIBT ES DAS VERZEICHNIS UEBERHAUPT? |
---|
1460 | if [[ ! -d $add_source_path ]] |
---|
1461 | then |
---|
1462 | printf "\n\n +++ WARNING: additional source code directory" |
---|
1463 | printf "\n \"$add_source_path\" " |
---|
1464 | printf "\n does not exist or is not a directory." |
---|
1465 | printf "\n No source code will be used from this directory!\n" |
---|
1466 | add_source_path="" |
---|
1467 | sleep 3 |
---|
1468 | else |
---|
1469 | |
---|
1470 | cd $add_source_path |
---|
1471 | |
---|
1472 | Names=$(ls -1 *.f90 2>&1) |
---|
1473 | [[ $(echo $Names | grep -c '*.f90') = 0 ]] && AddFilenames="$Names" |
---|
1474 | Names=$(ls -1 *.F90 2>&1) |
---|
1475 | [[ $(echo $Names | grep -c '*.F90') = 0 ]] && AddFilenames="$AddFilenames $Names" |
---|
1476 | Names=$(ls -1 *.F 2>&1) |
---|
1477 | [[ $(echo $Names | grep -c '*.F') = 0 ]] && AddFilenames="$AddFilenames $Names" |
---|
1478 | Names=$(ls -1 *.f 2>&1) |
---|
1479 | [[ $(echo $Names | grep -c '*.f') = 0 ]] && AddFilenames="$AddFilenames $Names" |
---|
1480 | Names=$(ls -1 *.c 2>&1) |
---|
1481 | [[ $(echo $Names | grep -c '*.c') = 0 ]] && AddFilenames="$AddFilenames $Names" |
---|
1482 | |
---|
1483 | cd - > /dev/null |
---|
1484 | cd SOURCES_FOR_RUN_$fname |
---|
1485 | |
---|
1486 | for dateiname in $AddFilenames |
---|
1487 | do |
---|
1488 | if [[ -f $dateiname ]] |
---|
1489 | then |
---|
1490 | printf "\n +++ source code file \"$dateiname\" found in additional" |
---|
1491 | printf "\n source code directory \"$add_source_path\" " |
---|
1492 | printf "\n as well as in directory \"$source_path\"." |
---|
1493 | locat=source; exit |
---|
1494 | fi |
---|
1495 | |
---|
1496 | cp $add_source_path/$dateiname . |
---|
1497 | source_list="$source_list $dateiname" |
---|
1498 | |
---|
1499 | # Default User-Interface von der Liste entfernen, falls Datei |
---|
1500 | # ein User-Interface enthaelt |
---|
1501 | if [[ $( cat $dateiname | grep -c "END SUBROUTINE user_parin" ) != 0 ]] |
---|
1502 | then |
---|
1503 | if [[ -f user_interface.f90 ]] |
---|
1504 | then |
---|
1505 | rm -rf user_interface.f90 |
---|
1506 | source_list=`echo $source_list | sed -e 's/user_interface.f90//'` |
---|
1507 | printf "\n\n *** \"user_interface.f90\" removed from the files to be translated" |
---|
1508 | printf "\n since a user-interface is found in file" |
---|
1509 | printf "\n \"$add_source_path/$dateiname\" \n" |
---|
1510 | sleep 3 |
---|
1511 | else |
---|
1512 | printf "\n\n *** user-interface file \"$dateiname\" " |
---|
1513 | printf "\n added to the files to be translated \n" |
---|
1514 | sleep 3 |
---|
1515 | fi |
---|
1516 | fi |
---|
1517 | done |
---|
1518 | |
---|
1519 | cd - > /dev/null |
---|
1520 | fi |
---|
1521 | fi |
---|
1522 | |
---|
1523 | |
---|
1524 | # ALLE UNTERPROGRAMME, DIE ZU VEREINBARTEN SOFTWAREPAKETEN GEHOEREN, |
---|
1525 | # DER LISTE DER ZU UEBERSETZENDEN DATEIEN HINZUFUEGEN |
---|
1526 | if [[ $restart_run != true && -n $package_list ]] |
---|
1527 | then |
---|
1528 | |
---|
1529 | cd $source_path |
---|
1530 | |
---|
1531 | for package in $package_list |
---|
1532 | do |
---|
1533 | |
---|
1534 | [[ $package = "dvrp_graphics+1PE" ]] && package=dvrp_graphics |
---|
1535 | |
---|
1536 | # ERMITTELE ALLE DATEIEN, DIE ZUM PAKET GEHOEREN |
---|
1537 | # FEHLERMELDUNGEN WERDEN ABGEFANGEN, DA * AUCH VERZEICHNISSNAMEN |
---|
1538 | # LIEFERT |
---|
1539 | package_source_list=`grep "defined( __$package " * 2>/dev/null | cut -f1 -d:` |
---|
1540 | |
---|
1541 | |
---|
1542 | # FUEGE DIESE DATEIEN DER LISTE DER ZU UEBERSETZENDEN DATEIEN |
---|
1543 | # HINZU, FALLS SIE NOCH NICHT DAZUGEHOEREN |
---|
1544 | for source_list_name in $package_source_list |
---|
1545 | do |
---|
1546 | if [[ $(echo $source_list | grep -c $source_list_name) = 0 ]] |
---|
1547 | then |
---|
1548 | |
---|
1549 | # NUR DATEIEN MIT GUELTIGEN ENDUNGEN VERWENDEN |
---|
1550 | ending=`echo $source_list_name | cut -f2 -d.` |
---|
1551 | if [[ "$ending" = f90 || "$ending" = F90 || "$ending" = f || "$ending" = F || "$ending" = c ]] |
---|
1552 | then |
---|
1553 | cp $source_list_name $working_directory/SOURCES_FOR_RUN_$fname |
---|
1554 | source_list="$source_list $source_list_name" |
---|
1555 | fi |
---|
1556 | fi |
---|
1557 | done |
---|
1558 | done |
---|
1559 | |
---|
1560 | cd - > /dev/null |
---|
1561 | fi |
---|
1562 | |
---|
1563 | |
---|
1564 | # MAKEFILE AUF VORHANDENSEIN PRUEFEN UND KOPIEREN |
---|
1565 | # BEI RESTART-LAEUFEN LIEGT ES SCHON IM VERZEICHNIS SOURCES_FOR_RUN... |
---|
1566 | if [[ "$use_makefile" = true && "$restart_run" != true ]] |
---|
1567 | then |
---|
1568 | [[ "$makefile" = "" ]] && makefile=$source_path/Makefile |
---|
1569 | if [[ ! -f $makefile ]] |
---|
1570 | then |
---|
1571 | printf "\n +++ file \"$makefile\" does not exist" |
---|
1572 | printf "\n provide this file or set \"use_makefile=false\" in configuration file\n" |
---|
1573 | locat=make; exit |
---|
1574 | else |
---|
1575 | cp $makefile SOURCES_FOR_RUN_$fname/Makefile |
---|
1576 | fi |
---|
1577 | fi |
---|
1578 | |
---|
1579 | fi # do_compile=true |
---|
1580 | |
---|
1581 | |
---|
1582 | # FALLS PROGRAMMTEILE UEBERSETZT WERDEN SOLLEN, FOLGEN JETZT EINIGE |
---|
1583 | # UEBERPRUEFUNGEN UND DAS SETZEN DER PRAEPROZESSOR-DIREKTIVEN |
---|
1584 | if [[ $do_compile = true ]] |
---|
1585 | then |
---|
1586 | |
---|
1587 | # PRAEPROZESSOR-DIREKTIVEN ZUM SELEKTIVEN AUSWAEHLEN VON CODETEILEN |
---|
1588 | # ZUSAMMENSETZEN |
---|
1589 | if [[ $(echo $localhost | cut -c1-3) = ibm ]] |
---|
1590 | then |
---|
1591 | PPOPTS=-Dibm=ibm |
---|
1592 | elif [[ $(echo $localhost | cut -c1-3) = nec ]] |
---|
1593 | then |
---|
1594 | PPOPTS=-Dnec |
---|
1595 | else |
---|
1596 | PPOPTS=-D$localhost |
---|
1597 | fi |
---|
1598 | if [[ $(echo $localhost | cut -c1-3) = ibm ]] |
---|
1599 | then |
---|
1600 | [[ -n $cond1 ]] && PPOPTS="$PPOPTS -D$cond1=$cond1" |
---|
1601 | [[ -n $cond2 ]] && PPOPTS="$PPOPTS -D$cond2=$cond2" |
---|
1602 | if [[ $netcdf_support = true ]] |
---|
1603 | then |
---|
1604 | PPOPTS="$PPOPTS -Dnetcdf=netcdf" |
---|
1605 | [[ $localhost != ibms ]] && PPOPTS="$PPOPTS -Dnetcdf_64bit=netcdf_64bit" |
---|
1606 | fi |
---|
1607 | if [[ $localhost = ibmy ]] |
---|
1608 | then |
---|
1609 | PPOPTS="$PPOPTS -Dibmy_special=ibmy_special" |
---|
1610 | fi |
---|
1611 | else |
---|
1612 | [[ -n $cond1 ]] && PPOPTS="$PPOPTS -D$cond1" |
---|
1613 | [[ -n $cond2 ]] && PPOPTS="$PPOPTS -D$cond2" |
---|
1614 | if [[ $netcdf_support = true ]] |
---|
1615 | then |
---|
1616 | PPOPTS="$PPOPTS -Dnetcdf" |
---|
1617 | [[ $localhost != decalpha && $localhost != lctit ]] && PPOPTS="$PPOPTS -Dnetcdf_64bit" |
---|
1618 | fi |
---|
1619 | fi |
---|
1620 | if [[ -n $package_list ]] |
---|
1621 | then |
---|
1622 | for package in $package_list |
---|
1623 | do |
---|
1624 | if [[ $(echo $localhost | cut -c1-3) = ibm ]] |
---|
1625 | then |
---|
1626 | if [[ $package != "dvrp_graphics+1PE" ]] |
---|
1627 | then |
---|
1628 | PPOPTS="$PPOPTS -D$package=$package" |
---|
1629 | else |
---|
1630 | PPOPTS="$PPOPTS -Ddvrp_graphics" |
---|
1631 | export use_seperate_pe_for_dvrp_output=true |
---|
1632 | fi |
---|
1633 | else |
---|
1634 | if [[ $package != "dvrp_graphics+1PE" ]] |
---|
1635 | then |
---|
1636 | PPOPTS="$PPOPTS -D$package" |
---|
1637 | else |
---|
1638 | PPOPTS="$PPOPTS -Ddvrp_graphics" |
---|
1639 | export use_seperate_pe_for_dvrp_output=true |
---|
1640 | fi |
---|
1641 | fi |
---|
1642 | done |
---|
1643 | fi |
---|
1644 | if [[ -n $cpp_opts ]] |
---|
1645 | then |
---|
1646 | for popts in $cpp_opts |
---|
1647 | do |
---|
1648 | PPOPTS="$PPOPTS -D$popts" |
---|
1649 | done |
---|
1650 | fi |
---|
1651 | |
---|
1652 | # -D ARGUMENTEN EINEN DOPPELTEN UNTERSTRICH VORANSTELLEN |
---|
1653 | PPOPTS=`echo " $PPOPTS" | sed 's/ -D/ -D__/g'` |
---|
1654 | |
---|
1655 | # OPTION ZUM EINSCHALTEN DES PRAEPROZESSORS HINZUFUEGEN |
---|
1656 | if [[ $host = decalpha ]] |
---|
1657 | then |
---|
1658 | C_PPOPTS="-cpp -DMPI_REAL=MPI_DOUBLE_PRECISION -DMPI_2REAL=MPI_2DOUBLE_PRECISION $PPOPTS" |
---|
1659 | elif [[ $(echo $host | cut -c1-3) = ibm ]] |
---|
1660 | then |
---|
1661 | # blanks in PPOPTS muessen durch "," ersetzt werden |
---|
1662 | PPOPTS=`echo $PPOPTS | sed 's/ -/,-/g'` |
---|
1663 | C_PPOPTS="-qsuffix=cpp=f90 -WF,-DMPI_REAL=MPI_DOUBLE_PRECISION,$PPOPTS" |
---|
1664 | elif [[ $host = lcmuk ]] |
---|
1665 | then |
---|
1666 | C_PPOPTS="$PPOPTS -DMPI_REAL=MPI_DOUBLE_PRECISION -DMPI_2REAL=MPI_2DOUBLE_PRECISION" |
---|
1667 | elif [[ $host = lctit ]] |
---|
1668 | then |
---|
1669 | C_PPOPTS="$PPOPTS -Mpreprocess -DMPI_REAL=MPI_DOUBLE_PRECISION -DMPI_2REAL=MPI_2DOUBLE_PRECISION" |
---|
1670 | elif [[ $(echo $host | cut -c1-3) = nec ]] |
---|
1671 | then |
---|
1672 | C_PPOPTS="-Ep -DMPI_REAL=MPI_REAL8 -DMPI_2REAL=MPI_2REAL8 -DSCFFT=dzfft -DCSFFT=zdfft $PPOPTS" |
---|
1673 | else |
---|
1674 | C_PPOPTS="$PPOPTS" |
---|
1675 | fi |
---|
1676 | |
---|
1677 | else |
---|
1678 | |
---|
1679 | |
---|
1680 | # BEI LOKALEN RECHNUNGEN PRUEFEN, OB EXECUTABLE VORHANDEN |
---|
1681 | if [[ $do_remote = false ]] |
---|
1682 | then |
---|
1683 | if [[ ! -f $executable ]] |
---|
1684 | then |
---|
1685 | printf "\n +++ executable file: $executable" |
---|
1686 | printf "\n does not exist" |
---|
1687 | locat=executable; exit |
---|
1688 | fi |
---|
1689 | fi |
---|
1690 | fi |
---|
1691 | |
---|
1692 | |
---|
1693 | # JOBMODUS FESTSTELLEN |
---|
1694 | if [[ "$ENVIRONMENT" = BATCH && $localhost != lctit || "$QUEUE" != interactive && $localhost = lctit ]] |
---|
1695 | then |
---|
1696 | jobmo=BATCH |
---|
1697 | else |
---|
1698 | jobmo=INTERACTIVE |
---|
1699 | fi |
---|
1700 | |
---|
1701 | |
---|
1702 | # HOSTSPEZIFISCHE DEFAULT-COMPILER SETZEN, FALLS NICHT BEREITS |
---|
1703 | # DURCH BENUTZER ANDERWEITIG VEREINBART |
---|
1704 | if [[ "$compiler_name" = "" ]] |
---|
1705 | then |
---|
1706 | case $localhost in |
---|
1707 | (unics) compiler_name=f77;; |
---|
1708 | (lcmuk) if [[ "$cond1" = parallel || "$cond2" = parallel ]] |
---|
1709 | then |
---|
1710 | compiler_name=mpif90 |
---|
1711 | else |
---|
1712 | compiler_name=ifc |
---|
1713 | fi;; |
---|
1714 | (lctit) if [[ "$cond1" = parallel || "$cond2" = parallel ]] |
---|
1715 | then |
---|
1716 | compiler_name=mpif90 |
---|
1717 | echo ">>> compiler=mpif90" |
---|
1718 | else |
---|
1719 | compiler_name=pgf95 |
---|
1720 | echo ">>> compiler=pgf95" |
---|
1721 | fi;; |
---|
1722 | (nech) compiler_name=sxmpif90;; |
---|
1723 | (decalpha) compiler_name=f95;; |
---|
1724 | (ibm|ibmb|ibmh|ibms|ibmy) compiler_name=mpxlf95_r;; |
---|
1725 | (*) printf "\n +++ unknown host name: $localhost \n"; |
---|
1726 | locat=localhost; exit;; |
---|
1727 | esac |
---|
1728 | fi |
---|
1729 | |
---|
1730 | |
---|
1731 | # COMPILER AUF NECK UEBERSCHREIBEN |
---|
1732 | [[ $localhost = neck ]] && compiler_name=mpif90 |
---|
1733 | |
---|
1734 | |
---|
1735 | |
---|
1736 | # PRAEPROZESSOR-PFAD BESTIMMEN |
---|
1737 | case $localhost in |
---|
1738 | (decalpha|ibm|ibmb|ibmh|ibms|ibmy|unics) praeproc=cpp;; |
---|
1739 | esac |
---|
1740 | |
---|
1741 | |
---|
1742 | # TEMPORAEREN KATALOGNAMEN BESTIMMEN |
---|
1743 | kennung=$RANDOM |
---|
1744 | if [[ "$tmp_user_catalog" = "" ]] |
---|
1745 | then |
---|
1746 | if [[ $localhost = ibmb || $localhost = ibmh ]] |
---|
1747 | then |
---|
1748 | tmp_user_catalog=$TMPDIR |
---|
1749 | elif [[ $localhost = nech ]] |
---|
1750 | then |
---|
1751 | tmp_user_catalog=$WRKSHR |
---|
1752 | else |
---|
1753 | tmp_user_catalog=/tmp |
---|
1754 | fi |
---|
1755 | fi |
---|
1756 | TEMPDIR=$tmp_user_catalog/${usern}.$kennung |
---|
1757 | |
---|
1758 | |
---|
1759 | # KATALOGNAMEN FUER ZWISCHENSPEICHERUNG VON FORTSETZUNGSLAUFDATEIEN |
---|
1760 | # BESTIMMEN |
---|
1761 | if [[ "$tmp_data_catalog" = "" ]] |
---|
1762 | then |
---|
1763 | if [[ $localhost = ibmb || $localhost = ibmh ]] |
---|
1764 | then |
---|
1765 | tmp_data_catalog=$WORK/mrun_restart_data |
---|
1766 | elif [[ $localhost = nech ]] |
---|
1767 | then |
---|
1768 | tmp_data_catalog=$WRKSHR/mrun_restart_data |
---|
1769 | else |
---|
1770 | tmp_data_catalog=/tmp/mrun_restart_data |
---|
1771 | fi |
---|
1772 | fi |
---|
1773 | |
---|
1774 | |
---|
1775 | # EVENTUELL BEI LOKALEN RECHNUNGEN $-ZEICHEN IN ENVIRONMENT-VARIABLEN |
---|
1776 | # ERSETZEN |
---|
1777 | if [[ $do_remote = false && $do_compile = true ]] |
---|
1778 | then |
---|
1779 | eval fopts=\"$fopts\" |
---|
1780 | eval lopts=\"$lopts\" |
---|
1781 | fi |
---|
1782 | |
---|
1783 | |
---|
1784 | |
---|
1785 | # COMPILE- UND LINK-OPTIONEN BESTIMMEN |
---|
1786 | FOPTS="$fopts" |
---|
1787 | LOPTS="$lopts" |
---|
1788 | ROPTS="$ropts" |
---|
1789 | if [[ ( $(echo $host | cut -c1-3) = nec || $(echo $host | cut -c1-3) = ibm || $host = lctit ) && -n $numprocs ]] |
---|
1790 | then |
---|
1791 | XOPT="-X $numprocs" |
---|
1792 | fi |
---|
1793 | |
---|
1794 | |
---|
1795 | # BEI VERWENDUNG VON DVRP-SOFTWARE MUSS ENTSPECHENDE GRAFIK-BIBLIOTHEK |
---|
1796 | # MIT EINGEBUNDEN WERDEN |
---|
1797 | if [[ -n $package_list ]] |
---|
1798 | then |
---|
1799 | if [[ $(echo $package_list | grep -c dvrp_graphics) != 0 ]] |
---|
1800 | then |
---|
1801 | |
---|
1802 | # DVRP-GRAFIK GIBT ES NUR AUF DER IBM AM HLRN, AUF NECH UND |
---|
1803 | # DEM NOTEBOOK SCIROCCO |
---|
1804 | if [[ $host != ibmh && $host != nech && $host != lcmuk && "$local_compile" != true ]] |
---|
1805 | then |
---|
1806 | printf "\n" |
---|
1807 | printf "\n +++ option -p with package \"dvrp_graphics\" only allowed on nech and ibmh" |
---|
1808 | locat=parameter; exit |
---|
1809 | fi |
---|
1810 | if [[ $host = ibmh ]] |
---|
1811 | then |
---|
1812 | if [[ $cond1 = debug || $cond2 = debug ]] |
---|
1813 | then |
---|
1814 | FOPTS="-I/home/h/hzazchmi/lib/debug $FOPTS" |
---|
1815 | LOPTS="$LOPTS -L/home/h/hzazchmi/lib/debug -lDVRP2 -lftp" |
---|
1816 | else |
---|
1817 | FOPTS="-I/home/h/nikevita/lib_stable/optimize $FOPTS" |
---|
1818 | LOPTS="$LOPTS -L/home/h/nikevita/lib_stable/optimize -lDVRP2 -lftp" |
---|
1819 | fi |
---|
1820 | elif [[ $host = nech ]] |
---|
1821 | then |
---|
1822 | FOPTS="-I/import/ds9b/ipf2/b/b323013/lib/optimize $FOPTS" |
---|
1823 | LOPTS="$LOPTS -L/import/ds9b/ipf2/b/b323013/lib/optimize -lDVRP2 -lftp" |
---|
1824 | elif [[ $host = lcmuk ]] |
---|
1825 | then |
---|
1826 | FOPTS="-I/usr/local/lib/dvrp/optimize $FOPTS" |
---|
1827 | LOPTS="$LOPTS -L/usr/local/lib/dvrp/optimize -lDVRP2 -lftp" |
---|
1828 | fi |
---|
1829 | fi |
---|
1830 | fi |
---|
1831 | |
---|
1832 | |
---|
1833 | # EVTL. EINBINDEN DER NETCDF-BIBLIOTHEK |
---|
1834 | if [[ $netcdf_support = true ]] |
---|
1835 | then |
---|
1836 | case $host in |
---|
1837 | (decalpha) FOPTS="-I${netcdf_path}/include $FOPTS" |
---|
1838 | LOPTS="$LOPTS -L${netcdf_path}/lib -lnetcdf";; |
---|
1839 | (ibmb|ibmh) FOPTS="-I ${netcdf_path}/include-64 $FOPTS" |
---|
1840 | LOPTS="$LOPTS -L${netcdf_path}/lib -lnetcdf";; |
---|
1841 | (ibms) FOPTS="-I /applic/netcdf64/src/f90 $FOPTS" |
---|
1842 | LOPTS="$LOPTS -L${netcdf_path} -lnetcdf";; |
---|
1843 | (ibmy) FOPTS="-I ${netcdf_path}/include $FOPTS" |
---|
1844 | LOPTS="$LOPTS -L${netcdf_path}/lib -lnetcdf";; |
---|
1845 | (lcmuk|nech|neck) FOPTS="-I ${netcdf_path}/include $FOPTS" |
---|
1846 | LOPTS="$LOPTS -L${netcdf_path}/lib -lnetcdf";; |
---|
1847 | (lctit) FOPTS="-I ${netcdf_path}/src/f90 $FOPTS" |
---|
1848 | LOPTS="$LOPTS -L${netcdf_path}/src/libsrc -lnetcdf";; |
---|
1849 | |
---|
1850 | esac |
---|
1851 | fi |
---|
1852 | |
---|
1853 | # PRUEFEN DER CPU-ZEIT. (CPUMAX WIRD ALS ENV-VARIABLE VOM HAUTPRO- |
---|
1854 | # GRAMM BENOETIGT |
---|
1855 | done=false |
---|
1856 | while [[ $done = false ]] |
---|
1857 | do |
---|
1858 | cputime=$cpumax |
---|
1859 | if (( $cputime == 0 )) |
---|
1860 | then |
---|
1861 | printf "\n +++ cpu-time is undefined" |
---|
1862 | printf "\n >>> Please type CPU-time in seconds as INTEGER:" |
---|
1863 | printf "\n >>> " |
---|
1864 | read cputime 1>/dev/null 2>&1 |
---|
1865 | else |
---|
1866 | done=true |
---|
1867 | fi |
---|
1868 | cpumax=$cputime |
---|
1869 | done |
---|
1870 | |
---|
1871 | (( minuten = cputime / 60 )) |
---|
1872 | (( sekunden = cputime - minuten * 60 )) |
---|
1873 | |
---|
1874 | |
---|
1875 | # PRUEFEN DER KERNSPEICHERANFORDERUNG |
---|
1876 | if [[ $do_batch = true ]] |
---|
1877 | then |
---|
1878 | done=false |
---|
1879 | while [[ $done = false ]] |
---|
1880 | do |
---|
1881 | if (( memory == 0 )) |
---|
1882 | then |
---|
1883 | printf "\n +++ memory demand is undefined" |
---|
1884 | printf "\n >>> Please type memory in MByte per process as INTEGER:" |
---|
1885 | printf "\n >>> " |
---|
1886 | read memory 1>/dev/null 2>&1 |
---|
1887 | else |
---|
1888 | done=true |
---|
1889 | fi |
---|
1890 | done |
---|
1891 | fi |
---|
1892 | |
---|
1893 | |
---|
1894 | # PRUEFEN, OB FUER REMOTE-RECHNUNGEN EIN BENUTZERNAME ANGEGEBEN WURDE |
---|
1895 | if [[ $do_remote = true && -z $remote_username ]] |
---|
1896 | then |
---|
1897 | while [[ -z $remote_username ]] |
---|
1898 | do |
---|
1899 | printf "\n +++ username on remote host \"$host\" is undefined" |
---|
1900 | printf "\n >>> Please type username:" |
---|
1901 | printf "\n >>> " |
---|
1902 | read remote_username |
---|
1903 | done |
---|
1904 | mc="$mc -u$remote_username" |
---|
1905 | fi |
---|
1906 | |
---|
1907 | ########################################################################### |
---|
1908 | # HEADER-AUSGABE |
---|
1909 | ########################################################################### |
---|
1910 | |
---|
1911 | |
---|
1912 | calltime=$(date) |
---|
1913 | printf "\n" |
---|
1914 | # [[ $silent = false ]] && clear |
---|
1915 | printf "#--------------------------------------------------------------# \n" |
---|
1916 | printf "| $version$calltime | \n" |
---|
1917 | printf "| | \n" |
---|
1918 | spalte1="called on:"; spalte2=$localhost_realname |
---|
1919 | printf "| $spalte1$spalte2 | \n" |
---|
1920 | if [[ $local_compile = false ]] |
---|
1921 | then |
---|
1922 | if [[ $do_remote = true ]] |
---|
1923 | then |
---|
1924 | spalte1="execution on:"; spalte2="$host (username: $remote_username)" |
---|
1925 | else |
---|
1926 | spalte1="execution on:"; spalte2="$host ($localhost_realname)" |
---|
1927 | fi |
---|
1928 | else |
---|
1929 | spalte1="compiling test only!"; spalte2="" |
---|
1930 | fi |
---|
1931 | printf "| $spalte1$spalte2 | \n" |
---|
1932 | if [[ -n $numprocs ]] |
---|
1933 | then |
---|
1934 | spalte1="number of PEs:"; spalte2=$numprocs |
---|
1935 | printf "| $spalte1$spalte2 | \n" |
---|
1936 | fi |
---|
1937 | if [[ -n $tasks_per_node ]] |
---|
1938 | then |
---|
1939 | spalte1="tasks per node:"; spalte2="$tasks_per_node (number of nodes: $nodes)" |
---|
1940 | printf "| $spalte1$spalte2 | \n" |
---|
1941 | fi |
---|
1942 | if [[ $threads_per_task != 1 ]] |
---|
1943 | then |
---|
1944 | spalte1="threads per task:"; spalte2="$threads_per_task" |
---|
1945 | printf "| $spalte1$spalte2 | \n" |
---|
1946 | fi |
---|
1947 | printf "| | \n" |
---|
1948 | if [[ $do_compile = true ]] |
---|
1949 | then |
---|
1950 | spalte1=cpp-directives:; spalte2=$C_PPOPTS |
---|
1951 | printf "| $spalte1$spalte2 | \n" |
---|
1952 | zeile=$(echo "$C_PPOPTS" | cut -c41-) |
---|
1953 | while [[ "$zeile" != "" ]] |
---|
1954 | do |
---|
1955 | spalte1="" |
---|
1956 | spalte2=$zeile |
---|
1957 | printf "| $spalte1$spalte2 | \n" |
---|
1958 | zeile=$(echo "$zeile" | cut -c41-) |
---|
1959 | done |
---|
1960 | |
---|
1961 | spalte1=compiler-options:; spalte2="$FOPTS $MODULE_OPTIONS" |
---|
1962 | printf "| $spalte1$spalte2 | \n" |
---|
1963 | zeile=$(echo "$FOPTS $MODULE_OPTIONS" | cut -c41-) |
---|
1964 | while [[ "$zeile" != "" ]] |
---|
1965 | do |
---|
1966 | spalte1="" |
---|
1967 | spalte2=$zeile |
---|
1968 | printf "| $spalte1$spalte2 | \n" |
---|
1969 | zeile=$(echo "$zeile" | cut -c41-) |
---|
1970 | done |
---|
1971 | |
---|
1972 | spalte1=linker-options:; spalte2=$LOPTS |
---|
1973 | printf "| $spalte1$spalte2 | \n" |
---|
1974 | zeile=$(echo "$LOPTS" | cut -c41-) |
---|
1975 | while [[ "$zeile" != "" ]] |
---|
1976 | do |
---|
1977 | spalte1="" |
---|
1978 | spalte2=$zeile |
---|
1979 | printf "| $spalte1$spalte2 | \n" |
---|
1980 | zeile=$(echo "$zeile" | cut -c41-) |
---|
1981 | done |
---|
1982 | |
---|
1983 | spalte1="main program":; spalte2=$mainprog |
---|
1984 | printf "| $spalte1$spalte2 | \n" |
---|
1985 | if [[ "$use_makefile" = true ]] |
---|
1986 | then |
---|
1987 | spalte1="using \"make\" for com"; spalte2="piling and linking" |
---|
1988 | printf "| $spalte1$spalte2 | \n" |
---|
1989 | fi |
---|
1990 | # if [[ $vtk_graphics = true ]] |
---|
1991 | # then |
---|
1992 | # spalte1=""; spalte2="wird in C++ - Programm eingebunden (vtk)" |
---|
1993 | # printf "| $spalte1$spalte2 | \n" |
---|
1994 | # fi |
---|
1995 | else |
---|
1996 | spalte1=executable:; spalte2=$executable |
---|
1997 | printf "| $spalte1$spalte2 | \n" |
---|
1998 | fi |
---|
1999 | printf "| | \n" |
---|
2000 | spalte1="base name of files":; spalte2=$fname |
---|
2001 | printf "| $spalte1$spalte2 | \n" |
---|
2002 | if [[ $fname != $afname ]] |
---|
2003 | then |
---|
2004 | spalte1="base name of input files":; spalte2=$afname |
---|
2005 | printf "| $spalte1$spalte2 | \n" |
---|
2006 | fi |
---|
2007 | spalte1="INPUT control list":; spalte2=$input_list |
---|
2008 | printf "| $spalte1$spalte2 | \n" |
---|
2009 | spalte1="OUTPUT control list":; spalte2=$output_list |
---|
2010 | printf "| $spalte1$spalte2 | \n" |
---|
2011 | |
---|
2012 | if [[ $do_batch = true || "$LOADLBATCH" = yes ]] |
---|
2013 | then |
---|
2014 | spalte1="memory demand / PE":; spalte2="$memory MB" |
---|
2015 | printf "| $spalte1$spalte2 | \n" |
---|
2016 | spalte1=CPU-time:; spalte2="$minuten:$sekunden" |
---|
2017 | printf "| $spalte1$spalte2 | \n" |
---|
2018 | fi |
---|
2019 | |
---|
2020 | if [[ $do_compile = true ]] |
---|
2021 | then |
---|
2022 | printf "| | \n" |
---|
2023 | printf "| Files to be compiled: | \n" |
---|
2024 | zeile=$source_list |
---|
2025 | while [[ "$zeile" != "" ]] |
---|
2026 | do |
---|
2027 | spalte3=$zeile |
---|
2028 | printf "| $spalte3 | \n" |
---|
2029 | zeile=$(echo "$zeile" | cut -c61-) |
---|
2030 | done |
---|
2031 | fi |
---|
2032 | printf "#--------------------------------------------------------------#" |
---|
2033 | |
---|
2034 | |
---|
2035 | |
---|
2036 | # BEDINGTE AUSGABE DER DATEIVERBINDUNGEN |
---|
2037 | if [[ $do_trace = true ]] |
---|
2038 | then |
---|
2039 | (( i = 0 )) |
---|
2040 | while (( i < iin )) |
---|
2041 | do |
---|
2042 | (( i = i + 1 )) |
---|
2043 | if (( i == 1 )) |
---|
2044 | then |
---|
2045 | printf "\n\n >>> INPUT-file assignments:\n" |
---|
2046 | fi |
---|
2047 | printf "\n ${localin[$i]} : ${absnamein[$i]}" |
---|
2048 | done |
---|
2049 | (( i = 0 )) |
---|
2050 | while (( i < iout )) |
---|
2051 | do |
---|
2052 | (( i = i + 1 )) |
---|
2053 | if (( i == 1 )) |
---|
2054 | then |
---|
2055 | printf "\n\n >>> OUTPUT-file assignments:\n" |
---|
2056 | fi |
---|
2057 | printf "\n ${localout[$i]} : ${pathout[$i]}" |
---|
2058 | done |
---|
2059 | (( i = 0 )) |
---|
2060 | while (( i < iic )) |
---|
2061 | do |
---|
2062 | (( i = i + 1 )) |
---|
2063 | if (( i == 1 )) |
---|
2064 | then |
---|
2065 | printf "\n\n >>> INPUT-commands:\n" |
---|
2066 | fi |
---|
2067 | printf "\n ${in_command[$i]}" |
---|
2068 | done |
---|
2069 | (( i = 0 )) |
---|
2070 | while (( i < ioc )) |
---|
2071 | do |
---|
2072 | (( i = i + 1 )) |
---|
2073 | if (( i == 1 )) |
---|
2074 | then |
---|
2075 | printf "\n\n >>> OUTPUT-commands:\n" |
---|
2076 | fi |
---|
2077 | printf "\n ${out_command[$i]}" |
---|
2078 | done |
---|
2079 | fi |
---|
2080 | |
---|
2081 | |
---|
2082 | # ABFRAGEN BEI AUFRUF AUF LOKALER MASCHINE |
---|
2083 | if [[ $remotecall = false && $silent = false && $jobmo != BATCH ]] |
---|
2084 | then |
---|
2085 | antwort=dummy |
---|
2086 | printf "\n\n" |
---|
2087 | while [[ "$antwort" != y && "$antwort" != Y && "$antwort" != n && "$antwort" != N ]] |
---|
2088 | do |
---|
2089 | printf " >>> everything o.k. (y/n) ? " |
---|
2090 | read antwort |
---|
2091 | done |
---|
2092 | if [[ $antwort = n || $antwort = N ]] |
---|
2093 | then |
---|
2094 | locat=user_abort; (( iec = 0 )); exit |
---|
2095 | fi |
---|
2096 | if [[ $do_batch = true ]] |
---|
2097 | then |
---|
2098 | printf " >>> batch-job will be created and submitted" |
---|
2099 | else |
---|
2100 | if [[ $local_compile = false ]] |
---|
2101 | then |
---|
2102 | printf " >>> MRUN will now continue to execute on this machine" |
---|
2103 | else |
---|
2104 | printf " >>> a test compilation will now be carried out on this machine" |
---|
2105 | fi |
---|
2106 | fi |
---|
2107 | fi |
---|
2108 | |
---|
2109 | |
---|
2110 | |
---|
2111 | |
---|
2112 | # FALLS AUF DIESER MASCHINE GERECHNET WERDEN SOLL, WERDEN JETZT ENTSPRE- |
---|
2113 | # CHENDE AKTIONEN DURCHGEFUEHRT |
---|
2114 | if [[ $do_batch = false ]] |
---|
2115 | then |
---|
2116 | |
---|
2117 | |
---|
2118 | # TEMPORAEREN KATALOG ERZEUGEN |
---|
2119 | mkdir -p $TEMPDIR |
---|
2120 | chmod go+rx $TEMPDIR |
---|
2121 | tmpcreate=true |
---|
2122 | |
---|
2123 | |
---|
2124 | # SAEMTLICHE QUELLTEXT-DATEIEN BZW. AUSFUEHRBARES PROGRAMM IN |
---|
2125 | # TEMPORAERES VERZEICHNIS KOPIEREN |
---|
2126 | if [[ $do_compile = true ]] |
---|
2127 | then |
---|
2128 | |
---|
2129 | # ON NEC, COMPILATION IS DONE ON HOST CROSS VIA CROSS COMPILING |
---|
2130 | # CREATE A TEMPORARY DIRECTORY ON THAT MACHINE (HOME MOUNTED VIA NFS) |
---|
2131 | if [[ $localhost = nech ]] |
---|
2132 | then |
---|
2133 | TEMPDIR_COMPILE=$HOME/work/${usern}.$kennung |
---|
2134 | if mkdir -p $TEMPDIR_COMPILE |
---|
2135 | then |
---|
2136 | printf "\n *** \"$TEMPDIR_COMPILE\" " |
---|
2137 | printf "\n is generated as temporary directory for cross compiling\n" |
---|
2138 | else |
---|
2139 | printf "\n +++ creating directory \"$TEMPDIR_COMPILE\" " |
---|
2140 | printf "\n needed for cross compilation failed" |
---|
2141 | locat=compile |
---|
2142 | exit |
---|
2143 | fi |
---|
2144 | else |
---|
2145 | TEMPDIR_COMPILE=$TEMPDIR |
---|
2146 | fi |
---|
2147 | |
---|
2148 | if [[ "$use_makefile" = true ]] |
---|
2149 | then |
---|
2150 | |
---|
2151 | # PFADNAMEN FUER DAS MAKE-DEPOSITORY ERMITTELN |
---|
2152 | line="" |
---|
2153 | grep "%depository_path" $config_file | while read line |
---|
2154 | do |
---|
2155 | if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] |
---|
2156 | then |
---|
2157 | if [[ "$(echo $line | cut -d" " -s -f3)" = "" ]] |
---|
2158 | then |
---|
2159 | global_depository_path=`echo $line | cut -d" " -s -f2` |
---|
2160 | fi |
---|
2161 | fi |
---|
2162 | done |
---|
2163 | |
---|
2164 | line="" |
---|
2165 | grep " $localhost" $config_file | grep "%depository_path" | while read line |
---|
2166 | do |
---|
2167 | if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] |
---|
2168 | then |
---|
2169 | local_depository_path=`echo $line | cut -d" " -s -f2` |
---|
2170 | fi |
---|
2171 | done |
---|
2172 | |
---|
2173 | if [[ "$local_depository_path" = "" ]] |
---|
2174 | then |
---|
2175 | if [[ "$global_depository_path" != "" ]] |
---|
2176 | then |
---|
2177 | local_depository_path=$global_depository_path |
---|
2178 | else |
---|
2179 | printf "\n\n +++ no depository path found in configuration file" |
---|
2180 | printf "\n for local host \"$localhost\" " |
---|
2181 | printf "\n please set \"\%depository_path\" in configuration file\n" |
---|
2182 | locat=config_file; exit |
---|
2183 | fi |
---|
2184 | fi |
---|
2185 | eval local_depository_path=$local_depository_path |
---|
2186 | |
---|
2187 | basename=`print $mainprog | cut -f1 -d"."` |
---|
2188 | eval make_depository=${local_depository_path}/${basename}_current_version.tar |
---|
2189 | if [[ ! -f $make_depository ]] |
---|
2190 | then |
---|
2191 | printf "\n" |
---|
2192 | printf "\n *** WARNING: make depository \"$make_depository\" not found" |
---|
2193 | printf "\n \"make\" will fail, if the Makefile or other source files are missing\n" |
---|
2194 | else |
---|
2195 | cp $make_depository $TEMPDIR_COMPILE |
---|
2196 | cd $TEMPDIR_COMPILE |
---|
2197 | tar -xf $make_depository > /dev/null 2>&1 |
---|
2198 | cd - > /dev/null |
---|
2199 | fi |
---|
2200 | |
---|
2201 | cp SOURCES_FOR_RUN_$fname/* $TEMPDIR_COMPILE |
---|
2202 | |
---|
2203 | # FALLS USER-INTERFACE VORHANDEN UND AUF DATEI MIT ANDEREM NAMEN |
---|
2204 | # ALS user_interface.f90 LIEGT, DIESEN GEAENDERTEN NAMEN INS |
---|
2205 | # MAKEFILE EINTRAGEN |
---|
2206 | cd $TEMPDIR_COMPILE |
---|
2207 | interface_file=`grep -l "END SUBROUTINE user_parin" $source_list` |
---|
2208 | if [[ "$interface_file" != "" ]] |
---|
2209 | then |
---|
2210 | interface_file=`echo $interface_file | cut -d"." -f1` |
---|
2211 | mv Makefile Makefile_old |
---|
2212 | sed "s/user_interface/$interface_file/g" Makefile_old > Makefile |
---|
2213 | fi |
---|
2214 | cd - > /dev/null |
---|
2215 | fi |
---|
2216 | else |
---|
2217 | cp $executable ${TEMPDIR}/a.out |
---|
2218 | fi |
---|
2219 | |
---|
2220 | |
---|
2221 | # WECHSEL IN TEMPORAEREN KATALOG |
---|
2222 | cd $TEMPDIR |
---|
2223 | printf "\n *** changed to temporary directory: $TEMPDIR" |
---|
2224 | |
---|
2225 | |
---|
2226 | # OUTPUT-DATEI-VERBINDUNGEN AUF TEMPORAERER DATEI ABLEGEN |
---|
2227 | # DIESE DATEI KANN VON SPAETER AUFZURUFENDEN BENUTZERPROZEDUREN GELESEN |
---|
2228 | # WERDEN, UM ZU LOKALEN DATEINAMEN GEHOERENDE PERMANENTE NAMEN ZU |
---|
2229 | # ERMITTELN |
---|
2230 | (( i = 0 )) |
---|
2231 | while (( i < iout )) |
---|
2232 | do |
---|
2233 | (( i = i + 1 )) |
---|
2234 | if [[ "${actionout[$i]}" = tr || "${actionout[$i]}" = tra || "${actionout[$i]}" = trpe ]] |
---|
2235 | then |
---|
2236 | printf "${localout[$i]} ${actionout[$i]}\n${pathout[$i]}\n${localhost}_${fname}${endout[$i]}\n" >> OUTPUT_FILE_CONNECTIONS |
---|
2237 | else |
---|
2238 | printf "${localout[$i]} ${actionout[$i]}\n${pathout[$i]}\n${frelout[$i]}\n" >> OUTPUT_FILE_CONNECTIONS |
---|
2239 | fi |
---|
2240 | done |
---|
2241 | |
---|
2242 | |
---|
2243 | # EVTL. UEBERSETZUNGSAKTIONEN STARTEN |
---|
2244 | if [[ $do_compile = true ]] |
---|
2245 | then |
---|
2246 | |
---|
2247 | |
---|
2248 | # COMPILING WITH MAKE (ON NEC COMPILER IS CALLED ON HOST CROSS) |
---|
2249 | if [[ "$use_makefile" = true ]] |
---|
2250 | then |
---|
2251 | printf "\n\n\n *** compilation starts \n$striche\n" |
---|
2252 | printf " *** compilation with make using following options:\n" |
---|
2253 | printf " compilername: $compiler_name\n" |
---|
2254 | printf " options: $FOPTS\n" |
---|
2255 | printf " preprocessor-directives: $C_PPOPTS \n" |
---|
2256 | printf " linker-options: $LOPTS \n" |
---|
2257 | printf " source code files: $source_list \n" |
---|
2258 | |
---|
2259 | if [[ $localhost = nech ]] |
---|
2260 | then |
---|
2261 | ssh 136.172.44.192 -l $usern ". /SX/opt/etc/initsx.sh; cd \$HOME/work/${usern}.$kennung; sxmake -f Makefile PROG=a.out F90=$compiler_name COPT=\"$C_PPOPTS\" F90FLAGS=\"$FOPTS\" LDFLAGS=\"$LOPTS\" " |
---|
2262 | cp $TEMPDIR_COMPILE/a.out . |
---|
2263 | [[ $? != 0 ]] && compile_error=true |
---|
2264 | rm -rf $TEMPDIR_COMPILE |
---|
2265 | else |
---|
2266 | make -f Makefile PROG=a.out F90=$compiler_name COPT="$C_PPOPTS" F90FLAGS="$FOPTS" LDFLAGS="$LOPTS" |
---|
2267 | fi |
---|
2268 | |
---|
2269 | # UEBERSETZUNG "VON HAND" (OHNE MAKE) |
---|
2270 | else |
---|
2271 | |
---|
2272 | |
---|
2273 | # UEBERSETZUNG DER QUELLTEXT-DATEIEN UND DES HAUPTPROGRAMMS |
---|
2274 | # $CPPOPTS FUER CPP-PRAEPROZESSOR WURDEN OBEN BESTIMMT |
---|
2275 | printf "\n\n\n *** compilation starts \n$striche\n" |
---|
2276 | |
---|
2277 | |
---|
2278 | # VORWEG EVTL. UEBERSETZUNG VON PROGRAMMTEILEN MIT SPEZIELLEN |
---|
2279 | # COMPILERN UND/ODER COMPILEROPTIONEN. DIESE WERDEN BEI DER SPAETEREN |
---|
2280 | # EIGENTLICHEN UEBERSETZUNG ALS OBJECT-FILES EINGEBUNDEN |
---|
2281 | new_source_list="" |
---|
2282 | for filename in $source_list |
---|
2283 | do |
---|
2284 | |
---|
2285 | basename=`print $filename | cut -f1 -d"."` |
---|
2286 | |
---|
2287 | # EVTL. SPEZIELLEN COMPILER FUER UP BESTIMMEN |
---|
2288 | comp_var=$(eval echo \$comp_$basename) # \$ liefert evtl. fuer source alternativ vereinbarten Compiler |
---|
2289 | comp_opt_var=$(eval echo \$$basename) # \$$ liefert evtl. fuer source vereinbarte Compiler-Environment-Variable |
---|
2290 | |
---|
2291 | if [[ "$comp_var" = "" && "$comp_opt_var" = "" ]] |
---|
2292 | then |
---|
2293 | new_source_list="$new_source_list "$filename |
---|
2294 | else |
---|
2295 | |
---|
2296 | if [[ "$comp_var" = "" ]] |
---|
2297 | then |
---|
2298 | SPECIAL_COMPILER=$compiler_name |
---|
2299 | else |
---|
2300 | SPECIAL_COMPILER=$comp_var |
---|
2301 | fi |
---|
2302 | |
---|
2303 | if [[ "$comp_opt_var" = "" ]] |
---|
2304 | then |
---|
2305 | SPECIAL_FOPTS=$FOPTS |
---|
2306 | else |
---|
2307 | SPECIAL_FOPTS="$parallel_options $(eval echo \$$comp_opt_var)" |
---|
2308 | fi |
---|
2309 | |
---|
2310 | printf " *** compiling of $filename with special compiler call: $SPECIAL_COMPILER $CPPOPTS -c $SPECIAL_FOPTS \n" |
---|
2311 | $SPECIAL_COMPILER $C_PPOPTS -c $SPECIAL_FOPTS $MODULE_OPTIONS $filename |
---|
2312 | if [[ $? != 0 ]] |
---|
2313 | then |
---|
2314 | printf "\n +++ compiling error occured" |
---|
2315 | locat=compile |
---|
2316 | exit |
---|
2317 | fi |
---|
2318 | new_source_list="$new_source_list "${basename}.o |
---|
2319 | fi |
---|
2320 | done |
---|
2321 | source_list="$new_source_list" |
---|
2322 | |
---|
2323 | |
---|
2324 | # EIGENTLICHE UEBERSETZUNG MIT DEN NORMALEN OPTIONEN |
---|
2325 | printf " *** compilation with standard options: $compiler_name $FOPTS $MODULE_OPTIONS \n" |
---|
2326 | printf " preprocessor-directives: $C_PPOPTS \n" |
---|
2327 | printf " linker-options: $LOPTS \n" |
---|
2328 | printf " source code files: $source_list \n" |
---|
2329 | |
---|
2330 | $compiler_name $C_PPOPTS $FOPTS $MODULE_OPTIONS $LOPTS $source_list |
---|
2331 | |
---|
2332 | fi |
---|
2333 | if [[ $? != 0 || "$compile_error" = true || "$module_compile_error" = true ]] |
---|
2334 | then |
---|
2335 | printf "\n +++ error occured while compiling or linking" |
---|
2336 | locat=compile |
---|
2337 | exit |
---|
2338 | else |
---|
2339 | printf "$striche\n *** compilation finished \n" |
---|
2340 | fi |
---|
2341 | fi |
---|
2342 | |
---|
2343 | |
---|
2344 | # FALLS NUR TESTWEISE KOMPILIERT WERDEN SOLLTE, IST MRUN JETZT FERTIG |
---|
2345 | if [[ $local_compile = true ]] |
---|
2346 | then |
---|
2347 | cd $HOME |
---|
2348 | rm -rf $TEMPDIR |
---|
2349 | locat=local_compile; exit |
---|
2350 | fi |
---|
2351 | |
---|
2352 | |
---|
2353 | # BEREITSTELLEN DER INPUT-DATEIEN |
---|
2354 | # SCHLEIFE UEBER ALLE VOM BENUTZER ANGEGEBENEN DATEIEN |
---|
2355 | (( i = 0 )) |
---|
2356 | while (( i < iin )) |
---|
2357 | do |
---|
2358 | (( i = i + 1 )) |
---|
2359 | if (( i == 1 )) |
---|
2360 | then |
---|
2361 | printf "\n\n *** providing INPUT-files:\n$striche" |
---|
2362 | fi |
---|
2363 | |
---|
2364 | |
---|
2365 | # OPTIONALE DATEIEN BEI NICHTVORHANDENSEIN UEBERGEHEN |
---|
2366 | if [[ "${transin[$i]}" = unavailable ]] |
---|
2367 | then |
---|
2368 | if [[ "${extin[$i]}" = "" || "${extin[$i]}" = " " ]] |
---|
2369 | then |
---|
2370 | printf "\n +++ WARNING: input file \"${pathin[$i]}/${afname}${endin[$i]}\" " |
---|
2371 | printf "\n is not available!" |
---|
2372 | else |
---|
2373 | printf "\n +++ WARNING: input file \"${pathin[$i]}/${afname}${endin[$i]}.${extin[$i]}\" " |
---|
2374 | printf "\n is not available!" |
---|
2375 | fi |
---|
2376 | continue |
---|
2377 | fi |
---|
2378 | |
---|
2379 | # PRUEFEN, OB EINZELDATEI ODER DATEI PRO PROZESSOR |
---|
2380 | files_for_pes=false; datentyp=file |
---|
2381 | if [[ "${actionin[$i]}" = pe && -n $numprocs ]] |
---|
2382 | then |
---|
2383 | files_for_pes=true; datentyp=directory |
---|
2384 | actionin[$i]="" |
---|
2385 | elif [[ "${actionin[$i]}" = pe && ! -n $numprocs ]] |
---|
2386 | then |
---|
2387 | actionin[$i]="" |
---|
2388 | elif [[ "${actionin[$i]}" = arpe && -n $numprocs ]] |
---|
2389 | then |
---|
2390 | files_for_pes=true; datentyp=directory |
---|
2391 | actionin[$i]="ar" |
---|
2392 | elif [[ "${actionin[$i]}" = arpe && ! -n $numprocs ]] |
---|
2393 | then |
---|
2394 | actionin[$i]="ar" |
---|
2395 | elif [[ "${actionin[$i]}" = flpe && -n $numprocs ]] |
---|
2396 | then |
---|
2397 | files_for_pes=true; datentyp=directory |
---|
2398 | actionin[$i]="fl" |
---|
2399 | elif [[ "${actionin[$i]}" = flpe && ! -n $numprocs ]] |
---|
2400 | then |
---|
2401 | actionin[$i]="fl" |
---|
2402 | fi |
---|
2403 | |
---|
2404 | if [[ $files_for_pes = true ]] |
---|
2405 | then |
---|
2406 | printf "\n >>> INPUT: ${absnamein[$i]}/.... to ${localin[$i]}" |
---|
2407 | else |
---|
2408 | printf "\n >>> INPUT: ${absnamein[$i]} to ${localin[$i]}" |
---|
2409 | fi |
---|
2410 | |
---|
2411 | # INPUT-DATEI FUER EINEN FORTSETZUNGSLAUF. ES WIRD GEPRUEFT, |
---|
2412 | # OB DIESE DATEI NOCH AUF DEM TEMPORAEREN DATENKATALOG VORHANDEN |
---|
2413 | # IST. FALLS NICHT, WIRD VERSUCHT, SIE ANSCHLIESSEND VOM ARCHIV- |
---|
2414 | # SERVER ZU HOLEN |
---|
2415 | if [[ "${actionin[$i]}" = fl ]] |
---|
2416 | then |
---|
2417 | printf "\n $datentyp will be fetched from temporary directory \"${tmp_data_catalog}\" !" |
---|
2418 | if [[ $files_for_pes = false ]] |
---|
2419 | then |
---|
2420 | if [[ -f "$tmp_data_catalog/${frelin[$i]}" ]] |
---|
2421 | then |
---|
2422 | ln $tmp_data_catalog/${frelin[$i]} ${localin[$i]} |
---|
2423 | got_tmp[$i]=true |
---|
2424 | elif [[ -f "$WORK/${frelin[$i]}" && $ignore_archive_error = true ]] |
---|
2425 | then |
---|
2426 | printf "\n +++ $datentyp not found in \"$tmp_data_catalog\" !" |
---|
2427 | printf "\n *** trying to use backup copy in \"$WORK\" " |
---|
2428 | cp $WORK/${frelin[$i]} ${localin[$i]} |
---|
2429 | else |
---|
2430 | printf "\n +++ $datentyp not found in \"$tmp_data_catalog\" " |
---|
2431 | printf "\n or \"$tmp_data_catalog\" does not exist!" |
---|
2432 | printf "\n *** trying to get copy from archive" |
---|
2433 | actionin[$i]=ar |
---|
2434 | fi |
---|
2435 | else |
---|
2436 | if [[ -d "$tmp_data_catalog/${frelin[$i]}" ]] |
---|
2437 | then |
---|
2438 | mkdir ${localin[$i]} |
---|
2439 | ln $tmp_data_catalog/${frelin[$i]}/* ${localin[$i]} |
---|
2440 | got_tmp[$i]=true |
---|
2441 | elif [[ -d "$WORK/${frelin[$i]}" && $ignore_archive_error = true ]] |
---|
2442 | then |
---|
2443 | printf "\n +++ $datentyp not found in \"$tmp_data_catalog\" !" |
---|
2444 | printf "\n *** trying to use backup copy in \"$WORK\" " |
---|
2445 | cp -r $WORK/${frelin[$i]} ${localin[$i]} |
---|
2446 | else |
---|
2447 | printf "\n +++ $datentyp not found in \"$tmp_data_catalog\" " |
---|
2448 | printf "\n or \"$tmp_data_catalog\" does not exist!" |
---|
2449 | printf "\n *** trying to get copy from archive" |
---|
2450 | actionin[$i]=ar |
---|
2451 | fi |
---|
2452 | fi |
---|
2453 | fi |
---|
2454 | |
---|
2455 | |
---|
2456 | # DATEI LIEGT AUF ARCHIV-SERVER |
---|
2457 | if [[ "${actionin[$i]}" = ar ]] |
---|
2458 | then |
---|
2459 | |
---|
2460 | if [[ $files_for_pes = false ]] |
---|
2461 | then |
---|
2462 | printf "\n file will be restored from archive-system ($archive_system)!" |
---|
2463 | else |
---|
2464 | printf "\n directory will be restored from archive-system ($archive_system)!" |
---|
2465 | fi |
---|
2466 | |
---|
2467 | file_restored=false |
---|
2468 | |
---|
2469 | if [[ $archive_system = asterix ]] |
---|
2470 | then |
---|
2471 | do_stagein=true |
---|
2472 | (( stagein_anz = 0 )) |
---|
2473 | while [[ $do_stagein = true ]] |
---|
2474 | do |
---|
2475 | if [[ $files_for_pes = false ]] |
---|
2476 | then |
---|
2477 | stagein -O ${frelin[$i]} > STAGEIN_OUTPUT |
---|
2478 | else |
---|
2479 | stagein -t -O ${frelin[$i]} > STAGEIN_OUTPUT |
---|
2480 | fi |
---|
2481 | cat STAGEIN_OUTPUT |
---|
2482 | if [[ $(grep -c "st.msg:i24" STAGEIN_OUTPUT) != 0 ]] |
---|
2483 | then |
---|
2484 | file_restored=true |
---|
2485 | do_stagein=false |
---|
2486 | else |
---|
2487 | (( stagein_anz = stagein_anz + 1 )) |
---|
2488 | if (( stagein_anz == 10 )) |
---|
2489 | then |
---|
2490 | printf "\n +++ stagein stoped after 10 tries" |
---|
2491 | locat=stage |
---|
2492 | exit |
---|
2493 | fi |
---|
2494 | printf "\n +++ restoring from archive failed, trying again:" |
---|
2495 | sleep 900 |
---|
2496 | fi |
---|
2497 | done |
---|
2498 | elif [[ $archive_system = DMF ]] |
---|
2499 | then |
---|
2500 | if [[ $files_for_pes = false ]] |
---|
2501 | then |
---|
2502 | printf "\n +++ restoring of single files impossible with $archive_system !\n" |
---|
2503 | locat=DMF |
---|
2504 | exit |
---|
2505 | else |
---|
2506 | find $ARCHIVE/${frelin[$i]} -type m -print | dmget |
---|
2507 | cp -r $ARCHIVE/${frelin[$i]} $PWD |
---|
2508 | file_restored=true |
---|
2509 | fi |
---|
2510 | elif [[ $archive_system = tivoli ]] |
---|
2511 | then |
---|
2512 | if [[ $files_for_pes = false ]] |
---|
2513 | then |
---|
2514 | if [[ $localhost = ibmh ]] |
---|
2515 | then |
---|
2516 | ssh $usern@hdata.hlrn.de "cp $PERM/${frelin[$i]} $PWD" |
---|
2517 | else |
---|
2518 | ssh $usern@bdata.hlrn.de "cp $PERM/${frelin[$i]} $PWD" |
---|
2519 | fi |
---|
2520 | else |
---|
2521 | (( inode = 0 )) |
---|
2522 | while (( inode < nodes )) |
---|
2523 | do |
---|
2524 | if [[ $localhost = ibmh ]] |
---|
2525 | then |
---|
2526 | ssh $usern@hdata.hlrn.de "cd $PWD; tar xf $PERM/${frelin[$i]}/${frelin[$i]}.node_$inode.tar" |
---|
2527 | else |
---|
2528 | ssh $usern@bdata.hlrn.de "cd $PWD; tar xf $PERM/${frelin[$i]}/${frelin[$i]}.node_$inode.tar" |
---|
2529 | fi |
---|
2530 | (( inode = inode + 1 )) |
---|
2531 | done |
---|
2532 | fi |
---|
2533 | file_restored=true |
---|
2534 | elif [[ $archive_system = ut ]] |
---|
2535 | then |
---|
2536 | if [[ $files_for_pes = false ]] |
---|
2537 | then |
---|
2538 | cp $UT/${frelin[$i]} . |
---|
2539 | else |
---|
2540 | (( inode = 0 )) |
---|
2541 | while (( inode < nodes )) |
---|
2542 | do |
---|
2543 | tar xf $UT/${frelin[$i]}/${frelin[$i]}.node_$inode.tar |
---|
2544 | (( inode = inode + 1 )) |
---|
2545 | done |
---|
2546 | fi |
---|
2547 | file_restored=true |
---|
2548 | else |
---|
2549 | printf "\n +++ archive_system=\"$archive_system\" restore impossible!" |
---|
2550 | locat=rearchive |
---|
2551 | exit |
---|
2552 | fi |
---|
2553 | |
---|
2554 | if [[ $file_restored = true ]] |
---|
2555 | then |
---|
2556 | |
---|
2557 | # DATEI AUCH AUF TEMPORAERES DATENVERZEICHNIS LEGEN, DAMIT |
---|
2558 | # SIE BEI WEITEREN ZUGRIFFEN NOCH VORHANDEN IST |
---|
2559 | [[ ! -d $tmp_data_catalog ]] && mkdir -p $tmp_data_catalog; chmod g+rx $tmp_data_catalog |
---|
2560 | if [[ $files_for_pes = false ]] |
---|
2561 | then |
---|
2562 | ln -f ${frelin[$i]} $tmp_data_catalog/${frelin[$i]} |
---|
2563 | else |
---|
2564 | mkdir $tmp_data_catalog/${frelin[$i]} |
---|
2565 | ln -f ${frelin[$i]}/* $tmp_data_catalog/${frelin[$i]} |
---|
2566 | fi |
---|
2567 | got_tmp[$i]=true |
---|
2568 | |
---|
2569 | # DATEI UNTER LOKALEM NAMEN ZUR VERFUEGUNG STELLEN |
---|
2570 | mv ${frelin[$i]} ${localin[$i]} |
---|
2571 | |
---|
2572 | fi |
---|
2573 | fi |
---|
2574 | |
---|
2575 | |
---|
2576 | # DATEI LIEGT IM VOM BENUTZER ANGEGEBENEN VERZEICHNIS |
---|
2577 | if [[ "${actionin[$i]}" = "" || "${actionin[$i]}" = "di" || "${actionin[$i]}" = "npe" ]] |
---|
2578 | then |
---|
2579 | |
---|
2580 | if [[ "${actionin[$i]}" = "npe" && -n $numprocs ]] |
---|
2581 | then |
---|
2582 | |
---|
2583 | # DATEI WIRD FUER DIE PROZESSOREN EINES PARALLERECHNERS BEREITGESTELLT |
---|
2584 | printf "\n file will be provided for $numprocs processors" |
---|
2585 | mkdir ${localin[$i]} |
---|
2586 | ival=$numprocs |
---|
2587 | (( ii = 0 )) |
---|
2588 | while (( ii <= ival-1 )) |
---|
2589 | do |
---|
2590 | if (( ii < 10 )) |
---|
2591 | then |
---|
2592 | cp ${absnamein[$i]} ${localin[$i]}/_000$ii |
---|
2593 | elif (( ii < 100 )) |
---|
2594 | then |
---|
2595 | cp ${absnamein[$i]} ${localin[$i]}/_00$ii |
---|
2596 | elif (( ii < 1000 )) |
---|
2597 | then |
---|
2598 | cp ${absnamein[$i]} ${localin[$i]}/_0$ii |
---|
2599 | else |
---|
2600 | cp ${absnamein[$i]} ${localin[$i]}/_$ii |
---|
2601 | fi |
---|
2602 | (( ii = ii + 1 )) |
---|
2603 | done |
---|
2604 | |
---|
2605 | else |
---|
2606 | |
---|
2607 | if [[ $files_for_pes = true ]] |
---|
2608 | then |
---|
2609 | |
---|
2610 | # DIE DEN PROZESSOREN EINES PARALLELRECHNERS ZUGEHOERIGEN |
---|
2611 | # DATEIEN WERDEN BEREITGESTELLT, INDEM ZUERST DER GESAMTE |
---|
2612 | # KATALOGINHALT KOPIERT UND DANN DIE EINZELNEN DATEIEN |
---|
2613 | # PER MOVE UMBENANNT WERDEN |
---|
2614 | printf "\n providing $numprocs files for the respective processors" |
---|
2615 | mkdir ${localin[$i]} |
---|
2616 | cp -r ${absnamein[$i]}/* ${localin[$i]} |
---|
2617 | |
---|
2618 | else |
---|
2619 | # BEREITSTELLUNG AUF EINPROZESSORRECHNERN |
---|
2620 | cp ${absnamein[$i]} ${localin[$i]} |
---|
2621 | fi |
---|
2622 | fi |
---|
2623 | fi |
---|
2624 | |
---|
2625 | done |
---|
2626 | if (( i != 0 )) |
---|
2627 | then |
---|
2628 | printf "\n$striche\n *** all INPUT-files provided \n" |
---|
2629 | fi |
---|
2630 | |
---|
2631 | |
---|
2632 | # NAMELIST-DATEI MIT WERTEN VON ENVIRONMENT-VARIABLEN ERZEUGEN (ZU |
---|
2633 | # LESEN VON PALM) |
---|
2634 | cat > ENVPAR << %%END%% |
---|
2635 | &envpar run_identifier = '$fname', host = '$localhost', |
---|
2636 | write_binary = '$write_binary', tasks_per_node = $tasks_per_node, |
---|
2637 | maximum_cpu_time_allowed = ${cpumax}. / |
---|
2638 | |
---|
2639 | %%END%% |
---|
2640 | |
---|
2641 | |
---|
2642 | # EVENTUELLE INPUT-KOMMANDOS ABARBEITEN |
---|
2643 | (( i = 0 )) |
---|
2644 | while (( i < iic )) |
---|
2645 | do |
---|
2646 | (( i = i + 1 )) |
---|
2647 | if (( i == 1 )) |
---|
2648 | then |
---|
2649 | printf "\n\n *** execution of INPUT-commands:\n$striche" |
---|
2650 | fi |
---|
2651 | printf "\n >>> ${in_command[$i]}" |
---|
2652 | eval ${in_command[$i]} |
---|
2653 | if (( i == iic )) |
---|
2654 | then |
---|
2655 | printf "\n$striche\n" |
---|
2656 | fi |
---|
2657 | done |
---|
2658 | |
---|
2659 | |
---|
2660 | # VERBLEIBENDE CPU-ZEIT BERECHNEN |
---|
2661 | cpurest=${cpumax}. |
---|
2662 | |
---|
2663 | |
---|
2664 | # PROGRAMMSTART |
---|
2665 | printf "\n\n *** execution starts in directory\n \"`pwd`\"\n$striche\n" |
---|
2666 | PATH=$PATH:$TEMPDIR |
---|
2667 | |
---|
2668 | if [[ "$cond1" = debug || "$cond2" = debug ]] |
---|
2669 | then |
---|
2670 | if [[ "$ENVIRONMENT" = BATCH ]] |
---|
2671 | then |
---|
2672 | printf "\n +++ debug is allowed in interactive mode only" |
---|
2673 | locat=debug |
---|
2674 | exit |
---|
2675 | fi |
---|
2676 | if [[ $localhost = decalpha ]] |
---|
2677 | then |
---|
2678 | dxladebug a.out |
---|
2679 | elif [[ $localhost = ibmb || $localhost = ibmh ]] |
---|
2680 | then |
---|
2681 | |
---|
2682 | # SETUP THE IBM MPI ENVIRONMENT |
---|
2683 | export MP_SHARED_MEMORY=yes |
---|
2684 | export AIXTHREADS_SCOPE=S |
---|
2685 | export OMP_NUM_THREADS=$threads_per_task |
---|
2686 | export AUTHSTATE=files |
---|
2687 | export XLFRTEOPTS="nlwidth=132:err_recovery=no" # RECORD-LENGTH OF NAMELIST-OUTPUT |
---|
2688 | |
---|
2689 | # FOLLOWING OPTIONS ARE MANDATORY FOR TOTALVIEW |
---|
2690 | export MP_ADAPTER_USE=shared |
---|
2691 | export MP_CPU_USE=multiple |
---|
2692 | export MP_TIMEOUT=1200 |
---|
2693 | |
---|
2694 | unset MP_TASK_AFFINITY |
---|
2695 | |
---|
2696 | # SO FAR, TOTALVIEW NEEDS HOSTFILE MECHANISM FOR EXECUTION |
---|
2697 | #(( ii = 1 )) |
---|
2698 | #while (( ii <= $numprocs )) |
---|
2699 | #do |
---|
2700 | # echo $localhost_realname >> hostfile |
---|
2701 | # (( ii = ii + 1 )) |
---|
2702 | #done |
---|
2703 | #export MP_HOSTFILE=hostfile |
---|
2704 | |
---|
2705 | if [[ "$LOADLBATCH" = yes ]] |
---|
2706 | then |
---|
2707 | totalview poe a.out $ROPTS |
---|
2708 | else |
---|
2709 | echo totalview poe -a a.out -procs $numprocs -rmpool 0 -nodes 1 $ROPTS |
---|
2710 | export TVDSVRLAUNCHCMD=ssh |
---|
2711 | totalview poe -a a.out -procs $numprocs -rmpool 0 -nodes 1 $ROPTS |
---|
2712 | fi |
---|
2713 | else |
---|
2714 | printf "\n +++ no debug available on \"$localhost\" " |
---|
2715 | printf "\n or not implemented in mrun so far" |
---|
2716 | locat=debug |
---|
2717 | exit |
---|
2718 | fi |
---|
2719 | else |
---|
2720 | if [[ -n $numprocs ]] |
---|
2721 | then |
---|
2722 | |
---|
2723 | # RUNNING THE PROGRAM ON PARALLEL MACHINES |
---|
2724 | if [[ $(echo $host | cut -c1-3) = ibm ]] |
---|
2725 | then |
---|
2726 | # SETUP THE IBM MPI ENVIRONMENT |
---|
2727 | export MP_SHARED_MEMORY=yes |
---|
2728 | export AIXTHREAD_SCOPE=S |
---|
2729 | export OMP_NUM_THREADS=$threads_per_task |
---|
2730 | export XLSMPOPTS="spins=0:yields=0:stack=20000000" |
---|
2731 | export AUTHSTATE=files |
---|
2732 | export XLFRTEOPTS="nlwidth=132:err_recovery=no" # RECORD-LENGTH OF NAMELIST-OUTPUT |
---|
2733 | # export MP_PRINTENV=yes |
---|
2734 | |
---|
2735 | # TUNING-VARIABLEN ZUR VERBESSERUNG DER KOMMUNIKATION |
---|
2736 | # ZEIGEN ABER DERZEIT (SEP 04, FEDERATION) KAUM WIRKUNG |
---|
2737 | export MP_WAIT_MODE=poll |
---|
2738 | [[ $node_usage = not_shared ]] && export MP_SINGLE_THREAD=yes |
---|
2739 | # export MP_EAGER_LIMIT=65535 |
---|
2740 | |
---|
2741 | # # TESTWEISE FUER TURBOMPI (JAN 05) |
---|
2742 | # export MPJ_MTAB=128 |
---|
2743 | # export MPJ_ALLTOALL=1 |
---|
2744 | # export MPJ_ALLTOALLV=1 |
---|
2745 | |
---|
2746 | if [[ "$LOADLBATCH" = yes ]] |
---|
2747 | then |
---|
2748 | printf "\n--- Control: OMP_NUM_THREADS = \"$OMP_NUM_THREADS\" \n" |
---|
2749 | if [[ "$cond1" = hpmcount || "$cond2" = hpmcount ]] |
---|
2750 | then |
---|
2751 | /opt/optibm/HPM_2_4_1/bin/hpmcount a.out $ROPTS > aout_output 2>&1 |
---|
2752 | else |
---|
2753 | poe ./a.out $ROPTS > aout_output 2>&1 |
---|
2754 | fi |
---|
2755 | else |
---|
2756 | if [[ $localhost = ibmb || $localhost = ibmh || $localhost = ibms ]] |
---|
2757 | then |
---|
2758 | poe a.out -procs $numprocs -nodes 1 -rmpool 0 $ROPTS > aout_output 2>&1 |
---|
2759 | elif [[ $localhost = ibmy ]] |
---|
2760 | then |
---|
2761 | if [[ -f $hostfile ]] |
---|
2762 | then |
---|
2763 | cp $hostfile hostfile |
---|
2764 | else |
---|
2765 | (( ii = 1 )) |
---|
2766 | while (( ii <= $numprocs )) |
---|
2767 | do |
---|
2768 | echo $localhost_realname >> hostfile |
---|
2769 | (( ii = ii + 1 )) |
---|
2770 | done |
---|
2771 | fi |
---|
2772 | export MP_HOSTFILE=hostfile |
---|
2773 | ./a.out -procs $tasks_per_node $ROPTS > aout_output 2>&1 |
---|
2774 | else |
---|
2775 | if [[ "$host_file" = "" ]] |
---|
2776 | then |
---|
2777 | printf "\n +++ no hostfile given in configuration file" |
---|
2778 | locat=config_file |
---|
2779 | exit |
---|
2780 | else |
---|
2781 | eval host_file=$host_file |
---|
2782 | fi |
---|
2783 | export MP_HOSTFILE=$host_file |
---|
2784 | poe a.out -procs $numprocs -tasks_per_node $numprocs $ROPTS > aout_output 2>&1 |
---|
2785 | fi |
---|
2786 | fi |
---|
2787 | elif [[ $host = nech || $host = neck ]] |
---|
2788 | then |
---|
2789 | (( ii = nodes )) |
---|
2790 | if [[ $ii = 1 ]] |
---|
2791 | then |
---|
2792 | export F_ERRCNT=0 # acceptable number of errors before program is stopped |
---|
2793 | export MPIPROGINF=YES |
---|
2794 | echo "*** execution on single node with mpirun" |
---|
2795 | mpirun -np $numprocs ./a.out $ROPTS > aout_output 2>&1 |
---|
2796 | else |
---|
2797 | (( i = 0 )) |
---|
2798 | while (( i < ii )) |
---|
2799 | do |
---|
2800 | echo "-h $i -p $tasks_per_node -e ./mpi_exec_shell" >> multinode_config |
---|
2801 | (( i = i + 1 )) |
---|
2802 | done |
---|
2803 | |
---|
2804 | echo "#!/bin/sh" > mpi_exec_shell |
---|
2805 | echo " " >> mpi_exec_shell |
---|
2806 | echo "set -u" >> mpi_exec_shell |
---|
2807 | echo "F_ERRCNT=0" >> mpi_exec_shell |
---|
2808 | echo "MPIPROGINV=YES" >> mpi_exec_shell |
---|
2809 | echo "OMP_NUM_THREADS=$threads_per_task" >> mpi_exec_shell |
---|
2810 | echo "cpurest=$cpurest" >> mpi_exec_shell |
---|
2811 | echo "fname=$fname" >> mpi_exec_shell |
---|
2812 | echo "localhost=$localhost" >> mpi_exec_shell |
---|
2813 | echo "return_addres=$return_addres" >> mpi_exec_shell |
---|
2814 | echo "return_username=$return_username" >> mpi_exec_shell |
---|
2815 | echo "tasks_per_node=$tasks_per_node" >> mpi_exec_shell |
---|
2816 | echo "write_binary=$write_binary" >> mpi_exec_shell |
---|
2817 | echo "use_seperate_pe_for_dvrp_output=$use_seperate_pe_for_dvrp_output" >> mpi_exec_shell |
---|
2818 | echo " " >> mpi_exec_shell |
---|
2819 | echo "export F_ERRCNT" >> mpi_exec_shell |
---|
2820 | echo "export MPIPROGINV" >> mpi_exec_shell |
---|
2821 | echo "export OMP_NUM_THREADS" >> mpi_exec_shell |
---|
2822 | echo "export cpurest" >> mpi_exec_shell |
---|
2823 | echo "export fname" >> mpi_exec_shell |
---|
2824 | echo "export localhost" >> mpi_exec_shell |
---|
2825 | echo "export return_addres" >> mpi_exec_shell |
---|
2826 | echo "export return_username" >> mpi_exec_shell |
---|
2827 | echo "export tasks_per_node" >> mpi_exec_shell |
---|
2828 | echo "export write_binary" >> mpi_exec_shell |
---|
2829 | echo "export use_seperate_pe_for_dvrp_output" >> mpi_exec_shell |
---|
2830 | echo " " >> mpi_exec_shell |
---|
2831 | echo "exec ./a.out > aout_output 2>&1" >> mpi_exec_shell |
---|
2832 | |
---|
2833 | chmod u+x mpi_exec_shell |
---|
2834 | export MPIPROGINF=YES |
---|
2835 | mpirun -f multinode_config & |
---|
2836 | wait |
---|
2837 | |
---|
2838 | fi |
---|
2839 | elif [[ $host = lcmuk ]] |
---|
2840 | then |
---|
2841 | |
---|
2842 | # COPY HOSTFILE FROM SOURCE DIRECTORY OR CREATE IT, IF IT |
---|
2843 | # DOES NOT EXIST |
---|
2844 | if [[ -f $hostfile ]] |
---|
2845 | then |
---|
2846 | cp $hostfile hostfile |
---|
2847 | else |
---|
2848 | (( ii = 1 )) |
---|
2849 | while (( ii <= $numprocs / $threads_per_task )) |
---|
2850 | do |
---|
2851 | echo $localhost_realname >> hostfile |
---|
2852 | (( ii = ii + 1 )) |
---|
2853 | done |
---|
2854 | fi |
---|
2855 | (( ii = $numprocs / $threads_per_task )) |
---|
2856 | eval zeile=\"`head -n $ii hostfile`\" |
---|
2857 | printf "\n *** running on: $zeile" |
---|
2858 | export OMP_NUM_THREADS=$threads_per_task |
---|
2859 | if [[ $threads_per_task != 1 ]] |
---|
2860 | then |
---|
2861 | printf "\n threads per task: $threads_per_task" |
---|
2862 | fi |
---|
2863 | printf "\n\n" |
---|
2864 | if [[ $scirocco = true ]] |
---|
2865 | then |
---|
2866 | mpiexec -machinefile hostfile -n $ii a.out $ROPTS > aout_output 2>&1 |
---|
2867 | else |
---|
2868 | mpirun -machinefile hostfile -np $ii a.out $ROPTS > aout_output 2>&1 |
---|
2869 | fi |
---|
2870 | elif [[ $host = decalpha ]] |
---|
2871 | then |
---|
2872 | dmpirun -np $numprocs a.out $ROPTS > aout_output 2>&1 |
---|
2873 | elif [[ $host = lctit ]] |
---|
2874 | then |
---|
2875 | export runfile=runfile.$kennung |
---|
2876 | |
---|
2877 | echo "cd $PWD" > $runfile |
---|
2878 | echo "export OMP_NUM_THREADS=$OMP_NUM_THREADS" >> $runfile |
---|
2879 | echo "export cpurest=$cpurest" >> $runfile |
---|
2880 | echo "export fname=$fname" >> $runfile |
---|
2881 | echo "export localhost=$localhost" >> $runfile |
---|
2882 | echo "export return_addres=$return_addres" >> $runfile |
---|
2883 | echo "export return_username=$return_username" >> $runfile |
---|
2884 | echo "export tasks_per_node=$tasks_per_node" >> $runfile |
---|
2885 | echo "export write_binary=$write_binary" >> $runfile |
---|
2886 | echo "export use_seperate_pe_for_dvrp_output=$use_seperate_pe_for_dvrp_output" >> $runfile |
---|
2887 | echo "./a.out" >> $runfile |
---|
2888 | chmod u+x $runfile |
---|
2889 | |
---|
2890 | if [[ "$QUEUE" = interactive ]] |
---|
2891 | then |
---|
2892 | mpirun -np $numprocs $runfile $ROPTS > aout_output 2>&1 |
---|
2893 | else |
---|
2894 | n1ge -fore -mpi $numprocs -q $queue $runfile $ROPTS > aout_output 2>&1 |
---|
2895 | fi |
---|
2896 | |
---|
2897 | rm $runfile |
---|
2898 | else |
---|
2899 | mpprun -n $numprocs a.out $ROPTS > aout_output 2>&1 |
---|
2900 | fi |
---|
2901 | [[ $? != 0 ]] && execution_error=true |
---|
2902 | |
---|
2903 | |
---|
2904 | # PERFORMANCE-AUSWERTUNG MIT APPRENTICE |
---|
2905 | if [[ "$cond1" = apprentice || "$cond2" = apprentice ]] |
---|
2906 | then |
---|
2907 | apprentice |
---|
2908 | fi |
---|
2909 | else |
---|
2910 | a.out $ROPTS > aout_output 2>&1 |
---|
2911 | fi |
---|
2912 | fi |
---|
2913 | if [[ $? != 0 || $execution_error = true ]] |
---|
2914 | then |
---|
2915 | |
---|
2916 | # ABBRUCH BEI LAUFZEITFEHLER |
---|
2917 | [[ ! ( "$cond1" = debug || "$cond2" = debug ) ]] && cat aout_output |
---|
2918 | printf "\n +++ runtime error occured" |
---|
2919 | locat=execution |
---|
2920 | exit |
---|
2921 | else |
---|
2922 | [[ ! ( "$cond1" = debug || "$cond2" = debug ) ]] && cat aout_output |
---|
2923 | printf "\n$striche\n *** execution finished \n" |
---|
2924 | fi |
---|
2925 | |
---|
2926 | |
---|
2927 | |
---|
2928 | # EVENTUELLE OUTPUT-KOMMANDOS ABARBEITEN |
---|
2929 | (( i = 0 )) |
---|
2930 | while (( i < ioc )) |
---|
2931 | do |
---|
2932 | (( i = i + 1 )) |
---|
2933 | if (( i == 1 )) |
---|
2934 | then |
---|
2935 | printf "\n\n *** execution of OUTPUT-commands:\n$striche" |
---|
2936 | fi |
---|
2937 | printf "\n >>> ${out_command[$i]}" |
---|
2938 | eval ${out_command[$i]} |
---|
2939 | if (( i == ioc )) |
---|
2940 | then |
---|
2941 | printf "\n$striche\n" |
---|
2942 | fi |
---|
2943 | done |
---|
2944 | |
---|
2945 | |
---|
2946 | # EVTL. INHALT DES AKTUELLEN VERZEICHNISSES AUSGEBEN |
---|
2947 | if [[ $do_trace = true ]] |
---|
2948 | then |
---|
2949 | printf "\n\n" |
---|
2950 | ls -al |
---|
2951 | fi |
---|
2952 | |
---|
2953 | |
---|
2954 | |
---|
2955 | # OUTPUT-DATEIEN AN IHRE ZIELORTE KOPIEREN |
---|
2956 | (( i = 0 )) |
---|
2957 | while (( i < iout )) |
---|
2958 | do |
---|
2959 | (( i = i + 1 )) |
---|
2960 | if (( i == 1 )) |
---|
2961 | then |
---|
2962 | printf "\n\n *** saving OUTPUT-files:\n$striche" |
---|
2963 | fi |
---|
2964 | |
---|
2965 | # PRUEFEN, OB EINZELDATEI ODER DATEI PRO PROZESSOR |
---|
2966 | files_for_pes=false; filetyp=file |
---|
2967 | if [[ "${actionout[$i]}" = pe && -n $numprocs ]] |
---|
2968 | then |
---|
2969 | files_for_pes=true; filetyp=directory |
---|
2970 | actionout[$i]="" |
---|
2971 | elif [[ "${actionout[$i]}" = pe && ! -n $numprocs ]] |
---|
2972 | then |
---|
2973 | actionout[$i]="" |
---|
2974 | elif [[ "${actionout[$i]}" = arpe && -n $numprocs ]] |
---|
2975 | then |
---|
2976 | files_for_pes=true; filetyp=directory |
---|
2977 | actionout[$i]="ar" |
---|
2978 | elif [[ "${actionout[$i]}" = arpe && ! -n $numprocs ]] |
---|
2979 | then |
---|
2980 | actionout[$i]="ar" |
---|
2981 | elif [[ "${actionout[$i]}" = flpe && -n $numprocs ]] |
---|
2982 | then |
---|
2983 | files_for_pes=true; filetyp=directory |
---|
2984 | actionout[$i]="fl" |
---|
2985 | elif [[ "${actionout[$i]}" = flpe && ! -n $numprocs ]] |
---|
2986 | then |
---|
2987 | actionout[$i]="fl" |
---|
2988 | elif [[ "${actionout[$i]}" = trpe && -n $numprocs ]] |
---|
2989 | then |
---|
2990 | files_for_pes=true; filetyp=directory |
---|
2991 | actionout[$i]="tr" |
---|
2992 | elif [[ "${actionout[$i]}" = trpe && ! -n $numprocs ]] |
---|
2993 | then |
---|
2994 | actionout[$i]="tr" |
---|
2995 | fi |
---|
2996 | |
---|
2997 | if [[ ! -f ${localout[$i]} && $files_for_pes = false ]] |
---|
2998 | then |
---|
2999 | printf "\n +++ temporary OUTPUT-file ${localout[$i]} does not exist\n" |
---|
3000 | elif [[ ! -f ${localout[$i]}/_0000 && $files_for_pes = true ]] |
---|
3001 | then |
---|
3002 | printf "\n +++ temporary OUTPUT-file ${localout[$i]}/.... does not exist\n" |
---|
3003 | else |
---|
3004 | |
---|
3005 | |
---|
3006 | # KOPIEREN PER FTP/SCP (IMMER IM BINAERMODUS, -M: FALLS ZIELKATALOG |
---|
3007 | # NICHT VORHANDEN, WIRD VERSUCHT, IHN ANZULEGEN), ABER NUR BEI |
---|
3008 | # REMOTE-RECHNUNGEN |
---|
3009 | if [[ "${actionout[$i]}" = tr ]] |
---|
3010 | then |
---|
3011 | if [[ $localhost != $fromhost ]] |
---|
3012 | then |
---|
3013 | if [[ $files_for_pes = false ]] |
---|
3014 | then |
---|
3015 | cps="" |
---|
3016 | cst="" |
---|
3017 | else |
---|
3018 | cps=-c |
---|
3019 | cst="/" |
---|
3020 | fi |
---|
3021 | if [[ $localhost = ibmh || $localhost = ibmb || $localhost = nech ]] |
---|
3022 | then |
---|
3023 | |
---|
3024 | # TRANSFER IN EIGENSTAENDIGEM JOB |
---|
3025 | # ZUERST KOPIE DER DATEI INS TEMPORAERE DATENVERZEICHNIS |
---|
3026 | [[ ! -d $tmp_data_catalog/TRANSFER ]] && mkdir -p $tmp_data_catalog/TRANSFER |
---|
3027 | file_to_transfer=${fname}_${localout[$i]}_to_transfer_$kennung |
---|
3028 | if [[ $files_for_pes = false ]] |
---|
3029 | then |
---|
3030 | ln -f ${localout[$i]} $tmp_data_catalog/TRANSFER/$file_to_transfer |
---|
3031 | else |
---|
3032 | mkdir $tmp_data_catalog/TRANSFER/$file_to_transfer |
---|
3033 | ln ${localout[$i]}/* $tmp_data_catalog/TRANSFER/$file_to_transfer |
---|
3034 | fi |
---|
3035 | |
---|
3036 | echo "set -x" > transfer_${localout[$i]} |
---|
3037 | echo "cd $tmp_data_catalog/TRANSFER" >> transfer_${localout[$i]} |
---|
3038 | if [[ $filetransfer_protocol = ftp ]] |
---|
3039 | then |
---|
3040 | if [[ $files_for_pes = true ]] |
---|
3041 | then |
---|
3042 | printf "\n +++ WARNING: no transfer of catalogs via ftpcopy\n" |
---|
3043 | fi |
---|
3044 | printf "\n >>> OUTPUT: ${localout[$i]} by FTP in seperate job to" |
---|
3045 | printf "\n ${pathout[$i]}/${localhost}_${fname}${endout[$i]}" |
---|
3046 | printf "\n or higher cycle\n" |
---|
3047 | echo "ftpcopy -b -m $return_addres $file_to_transfer \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" >> transfer_${localout[$i]} |
---|
3048 | else |
---|
3049 | printf "\n >>> OUTPUT: ${localout[$i]}$cst by SCP in seperate job to" |
---|
3050 | printf "\n ${pathout[$i]}/${localhost}_${fname}${endout[$i]}$cst" |
---|
3051 | printf "\n or higher cycle\n" |
---|
3052 | echo "batch_scp $cps -b -m -u $return_username $return_addres $file_to_transfer \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" >> transfer_${localout[$i]} |
---|
3053 | fi |
---|
3054 | echo "[[ \$? = 0 ]] && rm $file_to_transfer" >> transfer_${localout[$i]} |
---|
3055 | |
---|
3056 | if [[ $localhost = nech ]] |
---|
3057 | then |
---|
3058 | subjob -d -c /pf/b/$usern/job_queue -v -q pp -X 0 -m 1000 -t 900 -f $filetransfer_protocol transfer_${localout[$i]} |
---|
3059 | else |
---|
3060 | if [[ "$LOGNAME" = b323013 ]] |
---|
3061 | then |
---|
3062 | subjob -v -q c1 -X 0 -m 1000 -t 900 -f $filetransfer_protocol transfer_${localout[$i]} |
---|
3063 | else |
---|
3064 | subjob -d -v -q c1 -X 0 -m 1000 -t 900 -f $filetransfer_protocol transfer_${localout[$i]} |
---|
3065 | fi |
---|
3066 | fi |
---|
3067 | |
---|
3068 | else |
---|
3069 | |
---|
3070 | # TRANSFER INNERHALB DIESES JOBS |
---|
3071 | transfer_failed=false |
---|
3072 | if [[ $filetransfer_protocol = ftp ]] |
---|
3073 | then |
---|
3074 | if [[ $files_for_pes = true ]] |
---|
3075 | then |
---|
3076 | printf "\n +++ WARNING: no transfer of catalogs via ftpcopy\n" |
---|
3077 | fi |
---|
3078 | printf "\n >>> OUTPUT: ${localout[$i]} by FTP to" |
---|
3079 | printf "\n ${pathout[$i]}/${localhost}_${fname}${endout[$i]}\n" |
---|
3080 | ftpcopy -b -m $return_addres ${localout[$i]} "${pathout[$i]}" ${localhost}_${fname}${endout[$i]} ${extout[$i]} |
---|
3081 | [[ $? != 0 ]] && transfer_failed=true |
---|
3082 | else |
---|
3083 | printf "\n >>> OUTPUT: ${localout[$i]}$cst by SCP to" |
---|
3084 | printf "\n ${pathout[$i]}/${localhost}_${fname}${endout[$i]}$cst\n" |
---|
3085 | batch_scp $cps -b -m -u $return_username $return_addres ${localout[$i]} "${pathout[$i]}" ${localhost}_${fname}${endout[$i]} ${extout[$i]} |
---|
3086 | [[ $? != 0 ]] && transfer_failed=true |
---|
3087 | fi |
---|
3088 | |
---|
3089 | # BEI FEHLGESCHLAGENEM TRANSFER SICHERUNGSKOPIE AUF |
---|
3090 | # LOKALER MASCHINE ANLEGEN |
---|
3091 | if [[ $transfer_failed = true ]] |
---|
3092 | then |
---|
3093 | printf " +++ transfer failed. Trying to save a copy on the local host under:\n" |
---|
3094 | printf " ${pathout[$i]}/${localhost}_${fname}${endout[$i]}_$kennung\n" |
---|
3095 | |
---|
3096 | # ERSTMAL PRUEFEN, OB VERZEICHNIS EXISTIERT. GEGEBENENFALLS |
---|
3097 | # ANLEGEN. |
---|
3098 | eval local_catalog=${pathout[$i]} |
---|
3099 | if [[ ! -d $local_catalog ]] |
---|
3100 | then |
---|
3101 | printf " *** local directory does not exist. Trying to create:\n" |
---|
3102 | printf " $local_catalog \n" |
---|
3103 | mkdir -p $local_catalog |
---|
3104 | fi |
---|
3105 | eval cp ${localout[$i]} ${pathout[$i]}/${localhost}_${fname}${endout[$i]}_$kennung |
---|
3106 | transfer_problems=true |
---|
3107 | fi |
---|
3108 | fi |
---|
3109 | else |
---|
3110 | |
---|
3111 | # WERTZUWEISUNG, SO DASS WEITER UNTEN NUR KOPIERT WIRD |
---|
3112 | actionout[$i]="" |
---|
3113 | fi |
---|
3114 | fi |
---|
3115 | |
---|
3116 | |
---|
3117 | # APPEND PER FTP/SCP (IMMER IM BINAERMODUS, -M: FALLS ZIELKATALOG |
---|
3118 | # NICHT VORHANDEN, WIRD VERSUCHT, IHN ANZULEGEN), ABER NUR BEI |
---|
3119 | # REMOTE-RECHNUNGEN |
---|
3120 | if [[ "${actionout[$i]}" = tra ]] |
---|
3121 | then |
---|
3122 | if [[ $localhost != $fromhost ]] |
---|
3123 | then |
---|
3124 | if [[ $localhost = ibmh || $localhost = ibmb || $localhost = nech ]] |
---|
3125 | then |
---|
3126 | |
---|
3127 | # TRANSFER IN EIGENSTAENDIGEM JOB |
---|
3128 | # ZUERST KOPIE DER DATEI INS TEMPORAERE DATENVERZEICHNIS |
---|
3129 | [[ ! -d $tmp_data_catalog/TRANSFER ]] && mkdir -p $tmp_data_catalog/TRANSFER |
---|
3130 | file_to_transfer=${fname}_${localout[$i]}_to_transfer_$kennung |
---|
3131 | ln -f ${localout[$i]} $tmp_data_catalog/TRANSFER/$file_to_transfer |
---|
3132 | |
---|
3133 | echo "set -x" > transfer_${localout[$i]} |
---|
3134 | echo "cd $tmp_data_catalog/TRANSFER" >> transfer_${localout[$i]} |
---|
3135 | if [[ $filetransfer_protocol = ftp ]] |
---|
3136 | then |
---|
3137 | printf "\n >>> OUTPUT: ${localout[$i]} append by FTP in seperate job to" |
---|
3138 | printf "\n ${pathout[$i]}/${localhost}_${fname}${endout[$i]}" |
---|
3139 | printf "\n or higher cycle\n" |
---|
3140 | echo "ftpcopy -A -b -m $return_addres $file_to_transfer \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" >> transfer_${localout[$i]} |
---|
3141 | else |
---|
3142 | printf "\n >>> OUTPUT: ${localout[$i]} append by SCP in seperate job to" |
---|
3143 | printf "\n ${pathout[$i]}/${localhost}_${fname}${endout[$i]}" |
---|
3144 | printf "\n or higher cycle\n" |
---|
3145 | echo "batch_scp -A -b -m -u $return_username $return_addres $file_to_transfer \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" >> transfer_${localout[$i]} |
---|
3146 | fi |
---|
3147 | echo "[[ \$? = 0 ]] && rm $file_to_transfer" >> transfer_${localout[$i]} |
---|
3148 | |
---|
3149 | if [[ $localhost = nech ]] |
---|
3150 | then |
---|
3151 | subjob -d -c /pf/b/$usern/job_queue -v -q pp -X 0 -m 1000 -t 900 -f $filetransfer_protocol transfer_${localout[$i]} |
---|
3152 | else |
---|
3153 | if [[ $LOGNAME = b323013 ]] |
---|
3154 | then |
---|
3155 | subjob -v -q c1 -X 0 -m 1000 -t 900 -f $filetransfer_protocol transfer_${localout[$i]} |
---|
3156 | else |
---|
3157 | subjob -d -v -q c1 -X 0 -m 1000 -t 900 -f $filetransfer_protocol transfer_${localout[$i]} |
---|
3158 | fi |
---|
3159 | fi |
---|
3160 | |
---|
3161 | else |
---|
3162 | |
---|
3163 | # TRANSFER INNERHALB DIESES JOBS |
---|
3164 | transfer_failed=false |
---|
3165 | if [[ $filetransfer_protocol = ftp ]] |
---|
3166 | then |
---|
3167 | printf "\n >>> OUTPUT: ${localout[$i]} append by FTP to" |
---|
3168 | printf "\n ${pathout[$i]}/${localhost}_${fname}${endout[$i]}\n" |
---|
3169 | ftpcopy -A -b -m $return_addres ${localout[$i]} "${pathout[$i]}" ${localhost}_${fname}${endout[$i]} ${extout[$i]} |
---|
3170 | [[ $? != 0 ]] && transfer_failed=true |
---|
3171 | else |
---|
3172 | printf "\n >>> OUTPUT: ${localout[$i]} append by SCP to" |
---|
3173 | printf "\n ${pathout[$i]}/${localhost}_${fname}${endout[$i]}\n" |
---|
3174 | batch_scp -A -b -m -u $return_username $return_addres ${localout[$i]} "${pathout[$i]}" ${localhost}_${fname}${endout[$i]} ${extout[$i]} |
---|
3175 | [[ $? != 0 ]] && transfer_failed=true |
---|
3176 | fi |
---|
3177 | |
---|
3178 | # BEI FEHLGESCHLAGENEM TRANSFER SICHERUNGSKOPIE AUF |
---|
3179 | # LOKALER MASCHINE ANLEGEN |
---|
3180 | if [[ $transfer_failed = true ]] |
---|
3181 | then |
---|
3182 | printf " +++ transfer failed. Trying to save a copy on the local host under:\n" |
---|
3183 | printf " ${pathout[$i]}/${localhost}_${fname}${endout[$i]}_$kennung\n" |
---|
3184 | |
---|
3185 | # ERSTMAL PRUEFEN, OB VERZEICHNIS EXISTIERT. GEGEBENENFALLS |
---|
3186 | # ANLEGEN |
---|
3187 | eval local_catalog=${pathout[$i]} |
---|
3188 | if [[ ! -d $local_catalog ]] |
---|
3189 | then |
---|
3190 | printf " *** local directory does not exist. Trying to create:\n" |
---|
3191 | printf " $local_catalog \n" |
---|
3192 | mkdir -p $local_catalog |
---|
3193 | fi |
---|
3194 | |
---|
3195 | eval cp ${localout[$i]} ${pathout[$i]}/${localhost}_${fname}${endout[$i]}_$kennung |
---|
3196 | transfer_problems=true |
---|
3197 | fi |
---|
3198 | fi |
---|
3199 | else |
---|
3200 | |
---|
3201 | # WERTZUWEISUNG, SO DASS WEITER UNTEN NUR APPEND AUF |
---|
3202 | # LOKALER MASCHINE DURCHGEFUEHRT WIRD |
---|
3203 | actionout[$i]=a |
---|
3204 | fi |
---|
3205 | fi |
---|
3206 | |
---|
3207 | |
---|
3208 | # OUTPUT-DATEI FUER EINEN FORTSETZUNGSLAUF. DATEI WIRD PER |
---|
3209 | # LINK AUF DEN TEMPORAEREN DATENKATALOG GELEGT. OPTION -f WIRD |
---|
3210 | # VERWENDET, FALLS DORT NOCH EINE DATEI GLEICHEN NAMENS VORHANDEN |
---|
3211 | # SEIN SOLLTE. ANSCHLIESSEND WIRD SEINE ARCHIVIERUNG ANGESTOSSEN |
---|
3212 | if [[ "${actionout[$i]}" = fl ]] |
---|
3213 | then |
---|
3214 | [[ ! -d $tmp_data_catalog ]] && mkdir -p $tmp_data_catalog |
---|
3215 | chmod g+rx $tmp_data_catalog |
---|
3216 | if [[ $files_for_pes = false ]] |
---|
3217 | then |
---|
3218 | printf "\n >>> OUTPUT: ${localout[$i]} to" |
---|
3219 | printf "\n $tmp_data_catalog/${frelout[$i]} (temporary data catalog)\n" |
---|
3220 | ln -f ${localout[$i]} $tmp_data_catalog/${frelout[$i]} |
---|
3221 | else |
---|
3222 | printf "\n >>> OUTPUT: ${localout[$i]}/.... to" |
---|
3223 | printf "\n $tmp_data_catalog/${frelout[$i]} (temporary data catalog)\n" |
---|
3224 | mkdir $tmp_data_catalog/${frelout[$i]} |
---|
3225 | ln -f ${localout[$i]}/* $tmp_data_catalog/${frelout[$i]} |
---|
3226 | fi |
---|
3227 | |
---|
3228 | |
---|
3229 | # ARCHIVIERUNGSJOB WIRD ERZEUGT UND ABGESCHICKT |
---|
3230 | if [[ $store_on_archive_system = true ]] |
---|
3231 | then |
---|
3232 | |
---|
3233 | if [[ $archive_system = asterix ]] |
---|
3234 | then |
---|
3235 | echo "cd $tmp_data_catalog" >> archive_${frelout[$i]} |
---|
3236 | if [[ $files_for_pes = false ]] |
---|
3237 | then |
---|
3238 | echo "stageout ${frelout[$i]} > STAGE_OUTPUT${i}_$kennung" >> archive_${frelout[$i]} |
---|
3239 | else |
---|
3240 | echo "stageout -t ${frelout[$i]} > STAGE_OUTPUT${i}_$kennung" >> archive_${frelout[$i]} |
---|
3241 | fi |
---|
3242 | echo "cat STAGE_OUTPUT${i}_$kennung" >> archive_${frelout[$i]} |
---|
3243 | echo "if [[ \$(grep -c \"st.msg:150\" STAGE_OUTPUT${i}_$kennung) != 0 ]]" >> archive_${frelout[$i]} |
---|
3244 | echo "then" >> archive_${frelout[$i]} |
---|
3245 | echo " do_stageout=false" >> archive_${frelout[$i]} |
---|
3246 | echo "else" >> archive_${frelout[$i]} |
---|
3247 | echo " echo \" +++ $filetyp ${frelout[$i]} could not be stored on archive-system\" " >> archive_${frelout[$i]} |
---|
3248 | echo " cat /dev/null > ~/job_queue/ARCHIVE_ERROR_$fname" >> archive_${frelout[$i]} |
---|
3249 | echo " cat STAGE_OUTPUT${i}_$kennung > ~/job_queue/archive_${frelout[$i]}_error" >> archive_${frelout[$i]} |
---|
3250 | echo " echo \" *** $filetyp ${frelout[$i]} will be copied to \$WORK as backup\" " >> archive_${frelout[$i]} |
---|
3251 | if [[ $files_for_pes = false ]] |
---|
3252 | then |
---|
3253 | echo " cp ${frelout[$i]} \$WORK" >> archive_${frelout[$i]} |
---|
3254 | else |
---|
3255 | echo " cp -r ${frelout[$i]} \$WORK/${frelout[$i]}" >> archive_${frelout[$i]} |
---|
3256 | fi |
---|
3257 | echo " echo \" *** $filetyp ${frelout[$i]} saved\" " >> archive_${frelout[$i]} |
---|
3258 | echo "fi" >> archive_${frelout[$i]} |
---|
3259 | echo "rm STAGE_OUTPUT${i}_$kennung" >> archive_${frelout[$i]} |
---|
3260 | elif [[ $archive_system = DMF ]] |
---|
3261 | then |
---|
3262 | echo "cd $tmp_data_catalog" >> archive_${frelout[$i]} |
---|
3263 | if [[ $files_for_pes = false ]] |
---|
3264 | then |
---|
3265 | printf "\n +++ archiving of single files impossible with $archive_system !\n" |
---|
3266 | locat=DMF |
---|
3267 | exit |
---|
3268 | else |
---|
3269 | # FUER RECHNER IN JUELICH. DORT KOENNTEN AUCH |
---|
3270 | # EINZELNE DATEIEN GESICHERT WERDEN (SPAETER KORR.) |
---|
3271 | echo "rm -rf \$ARCHIVE/${frelout[$i]}" >> archive_${frelout[$i]} |
---|
3272 | echo "cp -r ${frelout[$i]} \$ARCHIVE" >> archive_${frelout[$i]} |
---|
3273 | fi |
---|
3274 | elif [[ $archive_system = tivoli ]] |
---|
3275 | then |
---|
3276 | echo "cd $tmp_data_catalog" >> archive_${frelout[$i]} |
---|
3277 | if [[ $files_for_pes = false ]] |
---|
3278 | then |
---|
3279 | # EVENTUELL NOCH VORHANDENE DATEI IM ARCHIV LOSCHEN |
---|
3280 | echo "set -x" >> archive_${frelout[$i]} |
---|
3281 | echo "rm -rf \$PERM/${frelout[$i]}" >> archive_${frelout[$i]} |
---|
3282 | echo "cp ${frelout[$i]} \$PERM/${frelout[$i]}" >> archive_${frelout[$i]} |
---|
3283 | else |
---|
3284 | |
---|
3285 | echo "set -x" >> archive_${frelout[$i]} |
---|
3286 | echo "rm -rf \$PERM/${frelout[$i]}/*" >> archive_${frelout[$i]} |
---|
3287 | echo "[[ ! -d \$PERM/${frelout[$i]} ]] && mkdir $PERM/${frelout[$i]}" >> archive_${frelout[$i]} |
---|
3288 | cd $tmp_data_catalog |
---|
3289 | all_files=`ls -1 ${frelout[$i]}/*` |
---|
3290 | cd - > /dev/null |
---|
3291 | (( inode = 0 )) |
---|
3292 | (( tp1 = tasks_per_node + 1 )) |
---|
3293 | while (( inode < nodes )) |
---|
3294 | do |
---|
3295 | # echo "*** all_files = \"$all_files\" " |
---|
3296 | files=`echo $all_files | cut -d" " -f1-$tasks_per_node` |
---|
3297 | all_files=`echo $all_files | cut -d" " -f$tp1-` |
---|
3298 | # echo "*** tasks_per_node = \"$tasks_per_node\" " |
---|
3299 | # echo "*** files = \"$files\" " |
---|
3300 | # echo "*** all_files = \"$all_files\" " |
---|
3301 | echo "tar cvf \$PERM/${frelout[$i]}/${frelout[$i]}.node_$inode.tar $files" >> archive_${frelout[$i]} |
---|
3302 | echo "dsmc incremental \$PERM/${frelout[$i]}/${frelout[$i]}.node_$inode.tar" >> archive_${frelout[$i]} |
---|
3303 | echo "dsmmigrate \$PERM/${frelout[$i]}/${frelout[$i]}.node_$inode.tar" >> archive_${frelout[$i]} |
---|
3304 | (( inode = inode + 1 )) |
---|
3305 | done |
---|
3306 | # echo "rm -rf \$PERM/${frelout[$i]}.tar" >> archive_${frelout[$i]} |
---|
3307 | # echo "tar cvf \$PERM/${frelout[$i]}.tar ${frelout[$i]}" >> archive_${frelout[$i]} |
---|
3308 | fi |
---|
3309 | elif [[ $archive_system = ut ]] |
---|
3310 | then |
---|
3311 | echo "cd $tmp_data_catalog" >> archive_${frelout[$i]} |
---|
3312 | if [[ $files_for_pes = false ]] |
---|
3313 | then |
---|
3314 | # EVENTUELL NOCH VORHANDENE DATEI IM ARCHIV LOSCHEN |
---|
3315 | echo "set -x" >> archive_${frelout[$i]} |
---|
3316 | echo "rm -rf \$UT/${frelout[$i]}" >> archive_${frelout[$i]} |
---|
3317 | echo "cp ${frelout[$i]} \$UT/${frelout[$i]}" >> archive_${frelout[$i]} |
---|
3318 | else |
---|
3319 | |
---|
3320 | echo "set -x" >> archive_${frelout[$i]} |
---|
3321 | echo "rm -rf \$UT/${frelout[$i]}/*" >> archive_${frelout[$i]} |
---|
3322 | echo "[[ ! -d \$UT/${frelout[$i]} ]] && mkdir $UT/${frelout[$i]}" >> archive_${frelout[$i]} |
---|
3323 | cd $tmp_data_catalog |
---|
3324 | all_files=`ls -1 ${frelout[$i]}/*` |
---|
3325 | cd - > /dev/null |
---|
3326 | (( inode = 0 )) |
---|
3327 | (( tp1 = tasks_per_node + 1 )) |
---|
3328 | while (( inode < nodes )) |
---|
3329 | do |
---|
3330 | files=`echo $all_files | cut -d" " -f1-$tasks_per_node` |
---|
3331 | all_files=`echo $all_files | cut -d" " -f$tp1-` |
---|
3332 | echo "tar cvf \$UT/${frelout[$i]}/${frelout[$i]}.node_$inode.tar $files" >> archive_${frelout[$i]} |
---|
3333 | (( inode = inode + 1 )) |
---|
3334 | done |
---|
3335 | fi |
---|
3336 | elif [[ $archive_system = none ]] |
---|
3337 | then |
---|
3338 | printf " +++ archiving on $localhost not available!\n" |
---|
3339 | fi |
---|
3340 | |
---|
3341 | if [[ $archive_system != none ]] |
---|
3342 | then |
---|
3343 | if [[ $localhost = ibmh || $localhost = ibmb ]] |
---|
3344 | then |
---|
3345 | subjob -d -v -q cdata -X 0 -m 1000 -t 7200 -f $filetransfer_protocol archive_${frelout[$i]} |
---|
3346 | elif [[ $localhost = nech ]] |
---|
3347 | then |
---|
3348 | subjob -d -c /pf/b/$usern/job_queue -v -q pp -X 0 -m 1000 -t 7200 -f $filetransfer_protocol archive_${frelout[$i]} |
---|
3349 | fi |
---|
3350 | printf " Archiving of $tmp_data_catalog/${frelout[$i]} initiated (batch job submitted)\n" |
---|
3351 | fi |
---|
3352 | else |
---|
3353 | printf " +++ caution: option -A is switched on. No archiving on $archive_system!\n" |
---|
3354 | fi |
---|
3355 | |
---|
3356 | |
---|
3357 | # LEERDATEI IM BENUTZERVERZEICHNIS ANLEGEN, DAMIT BEKANNT IST, |
---|
3358 | # WIE DIE HOECHSTE ZYKLUSNUMMER AUF DEM ARCHIV-SYSTEM LAUTET |
---|
3359 | if [[ $files_for_pes = false ]] |
---|
3360 | then |
---|
3361 | cat /dev/null > ${pathout[$i]} |
---|
3362 | else |
---|
3363 | mkdir -p ${pathout[$i]} |
---|
3364 | fi |
---|
3365 | |
---|
3366 | fi |
---|
3367 | |
---|
3368 | |
---|
3369 | # KOPIEREN AUF LOKALER MASCHINE ZUM ARCHIV-SYSTEM |
---|
3370 | # AUSSERDEM MUSS LEERDATEI ANGELEGT WERDEN, DAMIT BEKANNT IST, |
---|
3371 | # WIE DIE HOECHSTE ZYKLUSNUMMER AUF DEM ARCHIV-SYSTEM LAUTET |
---|
3372 | # FALLS IRGENDEINE (VON MEHREREN) ARCHIVIERUNGEN SCHIEF GEHT, |
---|
3373 | # WIRD FLAG GESETZT UND BLEIBT AUCH BEI WEITEREN ORDNUNGS- |
---|
3374 | # GEMAESSEN ARCHIVIERUNGEN GESETZT |
---|
3375 | if [[ "${actionout[$i]}" = ar ]] |
---|
3376 | then |
---|
3377 | if [[ $files_for_pes = false ]] |
---|
3378 | then |
---|
3379 | printf "\n >>> OUTPUT: ${localout[$i]} to" |
---|
3380 | printf "\n ${pathout[$i]}" |
---|
3381 | printf "\n File will be copied to archive-system ($archive_system) !\n" |
---|
3382 | else |
---|
3383 | printf "\n >>> OUTPUT: ${localout[$i]}/_.... to" |
---|
3384 | printf "\n ${pathout[$i]}" |
---|
3385 | printf "\n Directory will be copied to archive-system ($archive_system) !\n" |
---|
3386 | fi |
---|
3387 | mv ${localout[$i]} ${frelout[$i]} |
---|
3388 | |
---|
3389 | file_saved=false |
---|
3390 | |
---|
3391 | if [[ $archive_system = asterix ]] |
---|
3392 | then |
---|
3393 | do_stageout=true |
---|
3394 | (( stageout_anz = 0 )) |
---|
3395 | while [[ $do_stageout = true ]] |
---|
3396 | do |
---|
3397 | if [[ $files_for_pes = false ]] |
---|
3398 | then |
---|
3399 | stageout ${frelout[$i]} > STAGE_OUTPUT |
---|
3400 | else |
---|
3401 | stageout -t ${frelout[$i]} > STAGE_OUTPUT |
---|
3402 | fi |
---|
3403 | cat STAGE_OUTPUT |
---|
3404 | if [[ $(grep -c "st.msg:150" STAGE_OUTPUT) != 0 ]] |
---|
3405 | then |
---|
3406 | file_saved=true |
---|
3407 | do_stageout=false |
---|
3408 | else |
---|
3409 | if [[ $files_for_pes = false ]] |
---|
3410 | then |
---|
3411 | printf "\n +++ file ${frelout[$i]} could not be saved on archive-system" |
---|
3412 | else |
---|
3413 | printf "\n +++ directory ${frelout[$i]} could not be saved on archive-system" |
---|
3414 | fi |
---|
3415 | (( stageout_anz = stageout_anz + 1 )) |
---|
3416 | if (( stageout_anz == 10 )) |
---|
3417 | then |
---|
3418 | printf "\n +++ stoped after 10 unsuccessful tries!" |
---|
3419 | archive_save=false |
---|
3420 | do_stageout=false |
---|
3421 | else |
---|
3422 | printf "\n *** new try to store on archive after 15 min:" |
---|
3423 | sleep 900 |
---|
3424 | fi |
---|
3425 | fi |
---|
3426 | done |
---|
3427 | elif [[ $archive_system = DMF ]] |
---|
3428 | then |
---|
3429 | if [[ $files_for_pes = false ]] |
---|
3430 | then |
---|
3431 | printf "\n +++ archiving of single files impossible on $archive_system!\n" |
---|
3432 | locat=DMF |
---|
3433 | exit |
---|
3434 | else |
---|
3435 | rm -rf $ARCHIVE/${frelout[$i]} |
---|
3436 | cp -r ${frelout[$i]} $ARCHIVE |
---|
3437 | fi |
---|
3438 | file_saved=true |
---|
3439 | elif [[ $archive_system = tivoli ]] |
---|
3440 | then |
---|
3441 | # ARCHIVIERUNG NUR PER BATCH-JOB MOEGLICH |
---|
3442 | # DATEI MUSS ZWISCHENZEITLICH INS TEMPORAERE DATENVERZEICHNIS |
---|
3443 | # GELEGT WERDEN |
---|
3444 | [[ ! -d $tmp_data_catalog ]] && mkdir -p $tmp_data_catalog |
---|
3445 | chmod g+rx $tmp_data_catalog |
---|
3446 | if [[ $files_for_pes = false ]] |
---|
3447 | then |
---|
3448 | ln -f ${frelout[$i]} $tmp_data_catalog/${frelout[$i]} |
---|
3449 | else |
---|
3450 | mkdir $tmp_data_catalog/${frelout[$i]} |
---|
3451 | ln -f ${frelout[$i]}/* $tmp_data_catalog/${frelout[$i]} |
---|
3452 | fi |
---|
3453 | |
---|
3454 | # BATCH JOB GENERIEREN UND ABSCHICKEN; DATEI MUSS WIEDER |
---|
3455 | # AUS TEMPORAEREM DATENVERZEICHNIS ENTFERNT WERDEN |
---|
3456 | echo "cd $tmp_data_catalog" > archive_${frelout[$i]} |
---|
3457 | if [[ $files_for_pes = false ]] |
---|
3458 | then |
---|
3459 | # EVENTUELL NOCH VORHANDENE DATEI IM ARCHIV LOSCHEN |
---|
3460 | echo "rm -rf \$PERM/${frelout[$i]}" >> archive_${frelout[$i]} |
---|
3461 | echo "cp ${frelout[$i]} \$PERM/${frelout[$i]}" >> archive_${frelout[$i]} |
---|
3462 | echo "rm -rf ${frelout[$i]}" >> archive_${frelout[$i]} |
---|
3463 | else |
---|
3464 | echo "rm -rf \$PERM/${frelout[$i]}.tar" >> archive_${frelout[$i]} |
---|
3465 | echo "tar cvf \$PERM/${frelout[$i]}.tar ${frelout[$i]}" >> archive_${frelout[$i]} |
---|
3466 | echo "rm -rf ${frelout[$i]}" >> archive_${frelout[$i]} |
---|
3467 | fi |
---|
3468 | |
---|
3469 | subjob -v -d -q cdata -X 0 -m 1000 -t 7200 -f $filetransfer_protocol archive_${frelout[$i]} |
---|
3470 | printf " Archiving of $tmp_data_catalog/${frelout[$i]} initiated (batch job submitted)\n" |
---|
3471 | file_saved=true |
---|
3472 | |
---|
3473 | elif [[ $archive_system = ut ]] |
---|
3474 | then |
---|
3475 | # ARCHIVIERUNG NUR PER BATCH-JOB MOEGLICH |
---|
3476 | # DATEI MUSS ZWISCHENZEITLICH INS TEMPORAERE DATENVERZEICHNIS |
---|
3477 | # GELEGT WERDEN |
---|
3478 | [[ ! -d $tmp_data_catalog ]] && mkdir -p $tmp_data_catalog |
---|
3479 | chmod g+rx $tmp_data_catalog |
---|
3480 | if [[ $files_for_pes = false ]] |
---|
3481 | then |
---|
3482 | ln -f ${frelout[$i]} $tmp_data_catalog/${frelout[$i]} |
---|
3483 | else |
---|
3484 | mkdir $tmp_data_catalog/${frelout[$i]} |
---|
3485 | ln -f ${frelout[$i]}/* $tmp_data_catalog/${frelout[$i]} |
---|
3486 | fi |
---|
3487 | |
---|
3488 | # BATCH JOB GENERIEREN UND ABSCHICKEN; DATEI MUSS WIEDER |
---|
3489 | # AUS TEMPORAEREM DATENVERZEICHNIS ENTFERNT WERDEN |
---|
3490 | echo "cd $tmp_data_catalog" > archive_${frelout[$i]} |
---|
3491 | if [[ $files_for_pes = false ]] |
---|
3492 | then |
---|
3493 | # EVENTUELL NOCH VORHANDENE DATEI IM ARCHIV LOSCHEN |
---|
3494 | echo "rm -rf \$UT/${frelout[$i]}" >> archive_${frelout[$i]} |
---|
3495 | echo "cp ${frelout[$i]} \$UT/${frelout[$i]}" >> archive_${frelout[$i]} |
---|
3496 | echo "rm -rf ${frelout[$i]}" >> archive_${frelout[$i]} |
---|
3497 | else |
---|
3498 | echo "rm -rf \$UT/${frelout[$i]}.tar" >> archive_${frelout[$i]} |
---|
3499 | echo "tar cvf \$UT/${frelout[$i]}.tar ${frelout[$i]}" >> archive_${frelout[$i]} |
---|
3500 | echo "rm -rf ${frelout[$i]}" >> archive_${frelout[$i]} |
---|
3501 | fi |
---|
3502 | |
---|
3503 | subjob -v -c /pf/b/$usern/job_queue -d -q pp -X 0 -m 1000 -t 7200 -f $filetransfer_protocol archive_${frelout[$i]} |
---|
3504 | printf " Archiving of $tmp_data_catalog/${frelout[$i]} initiated (batch job submitted)\n" |
---|
3505 | file_saved=true |
---|
3506 | |
---|
3507 | else |
---|
3508 | printf "\n +++ archive_system=\"$archive_system\" archiving impossible!" |
---|
3509 | archive_save=false |
---|
3510 | fi |
---|
3511 | if [[ $file_saved = true ]] |
---|
3512 | then |
---|
3513 | if [[ $files_for_pes = false ]] |
---|
3514 | then |
---|
3515 | cat /dev/null > ${pathout[$i]} |
---|
3516 | else |
---|
3517 | mkdir -p ${pathout[$i]} |
---|
3518 | fi |
---|
3519 | fi |
---|
3520 | fi |
---|
3521 | |
---|
3522 | # APPEND AUF LOKALER MASCHINE |
---|
3523 | if [[ "${actionout[$i]}" = "a" ]] |
---|
3524 | then |
---|
3525 | printf "\n >>> OUTPUT: ${localout[$i]} append to ${pathout[$i]}\n" |
---|
3526 | cat ${localout[$i]} >> ${pathout[$i]} |
---|
3527 | fi |
---|
3528 | |
---|
3529 | # KOPIEREN AUF LOKALER MASCHINE |
---|
3530 | # ES MUSS KOPIERT WERDEN, DA MOVE NICHT UEBER FILESYSTEM HINAUS MOEGLICH |
---|
3531 | if [[ "${actionout[$i]}" = "" && $files_for_pes = false ]] |
---|
3532 | then |
---|
3533 | |
---|
3534 | # KOPIEREN AUF EINPROZESSORMASCHINE |
---|
3535 | if [[ "${extout[$i]}" != " " && "${extout[$i]}" != "" ]] |
---|
3536 | then |
---|
3537 | printf "\n >>> OUTPUT: ${localout[$i]} to ${pathout[$i]}.${extout[$i]}\n" |
---|
3538 | cp ${localout[$i]} ${pathout[$i]}.${extout[$i]} |
---|
3539 | else |
---|
3540 | printf "\n >>> OUTPUT: ${localout[$i]} to ${pathout[$i]}\n" |
---|
3541 | cp ${localout[$i]} ${pathout[$i]} |
---|
3542 | fi |
---|
3543 | |
---|
3544 | elif [[ "${actionout[$i]}" = "" && $files_for_pes = true ]] |
---|
3545 | then |
---|
3546 | |
---|
3547 | # DIE DEN PROZESSOREN EINES PARALLELRECHNERS ZUGEHOERIGEN |
---|
3548 | # DATEIEN WERDEN ERST IN EINEM KATALOG GESAMMELT UND DIESER |
---|
3549 | # WIRD DANN KOPIERT |
---|
3550 | # PER MOVE UMBENANNT WERDEN |
---|
3551 | printf "\n >>> OUTPUT: ${localout[$i]}/_.... to ${pathout[$i]}\n" |
---|
3552 | cp -r ${localout[$i]} ${pathout[$i]} |
---|
3553 | |
---|
3554 | fi |
---|
3555 | fi |
---|
3556 | done |
---|
3557 | if (( i != 0 )) |
---|
3558 | then |
---|
3559 | if [[ $transfer_problems = true ]] |
---|
3560 | then |
---|
3561 | printf "\n$striche\n *** OUTPUT-files saved" |
---|
3562 | printf "\n +++ WARNING: some data transfers failed! \n" |
---|
3563 | else |
---|
3564 | printf "\n$striche\n *** all OUTPUT-files saved \n" |
---|
3565 | fi |
---|
3566 | fi |
---|
3567 | |
---|
3568 | |
---|
3569 | # EVENTUELL FOLGEJOB STARTEN |
---|
3570 | # DATEI CONTINUE_RUN MUSS VOM BENUTZERPROGRAMM AUS ERZEUGT WERDEN |
---|
3571 | if [[ -f CONTINUE_RUN ]] |
---|
3572 | then |
---|
3573 | |
---|
3574 | if [[ $archive_save = true ]] |
---|
3575 | then |
---|
3576 | |
---|
3577 | # ZUERST IN MRUN-AUFRUF OPTIONEN FUER FORTSETZUNGSLAUF, FUER |
---|
3578 | # STILLES ABARBEITEN (OHNE INTERAKTIVE RUECKFAGEN) UND FUER |
---|
3579 | # BATCH-BETRIEB (NUR WICHTIG, FALLS BATCH AUF LOKALER MASCHINE |
---|
3580 | # DURCHGEFUEHRT WERDEN SOLL) EINFUEGEN, FALLS NICHT BEREITS VOR- |
---|
3581 | # HANDEN |
---|
3582 | [[ $(echo $mc | grep -c "\-C") = 0 ]] && mc="$mc -C" |
---|
3583 | [[ $(echo $mc | grep -c "\-v") = 0 ]] && mc="$mc -v" |
---|
3584 | [[ $(echo $mc | grep -c "\-b") = 0 ]] && mc="$mc -b" |
---|
3585 | if [[ $(echo $mc | grep -c "#") != 0 ]] |
---|
3586 | then |
---|
3587 | mc=`echo $mc | sed 's/#/f/g'` |
---|
3588 | fi |
---|
3589 | |
---|
3590 | |
---|
3591 | # JOB STARTEN |
---|
3592 | printf "\n\n *** initiating restart-run on \"$return_addres\" using command:\n" |
---|
3593 | echo " $mc" |
---|
3594 | printf "\n$striche\n" |
---|
3595 | if [[ $localhost != $fromhost ]] |
---|
3596 | then |
---|
3597 | |
---|
3598 | if [[ $localhost = nech || $localhost = ibmb || $localhost = ibmh || $localhost = ibms || $localhost = lctit ]] |
---|
3599 | then |
---|
3600 | echo "*** ssh will be used to initiate restart-runs!" |
---|
3601 | echo " return_addres=\"$return_addres\" " |
---|
3602 | echo " return_username=\"$return_username\" " |
---|
3603 | if [[ $return_addres = 172.20.25.41 ]] |
---|
3604 | then |
---|
3605 | # WORKAROUND AUF SCIROCCO AM TIT |
---|
3606 | print "PATH=\$PATH:$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc " | ssh $return_addres -l $return_username |
---|
3607 | else |
---|
3608 | ssh $return_addres -l $return_username "PATH=\$PATH:$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc " |
---|
3609 | fi |
---|
3610 | else |
---|
3611 | printf "\n +++ no restart mechanism available for host \"$localhost\" " |
---|
3612 | locat=restart; exit |
---|
3613 | fi |
---|
3614 | |
---|
3615 | # WARTEN, DAMIT SICH RESTART JOB IN QUEUE EINREIHEN KANN, BEVOR |
---|
3616 | # DER AKTUELLE JOB ENDET |
---|
3617 | sleep 30 |
---|
3618 | |
---|
3619 | else |
---|
3620 | |
---|
3621 | # BEI RECHNUNGEN AUF LOKALER MASCHINE KANN MRUN DIREKT AUFGE- |
---|
3622 | # RUFEN WERDEN |
---|
3623 | cd $LOCAL_PWD |
---|
3624 | eval $mc # ' MUESSEN AUSGEWERTET WERDEN |
---|
3625 | cd - > /dev/null |
---|
3626 | fi |
---|
3627 | printf "\n$striche\n *** restart-run initiated \n" |
---|
3628 | |
---|
3629 | |
---|
3630 | # EVENTUELL INPUT-DATEIEN, DIE VON TEMPORAEREM DATENVERZEICHNIS |
---|
3631 | # GEHOLT WORDEN SIND, LOESCHEN |
---|
3632 | (( i = 0 )) |
---|
3633 | while (( i < iin )) |
---|
3634 | do |
---|
3635 | (( i = i + 1 )) |
---|
3636 | if [[ "${got_tmp[$i]}" = true && $keep_data_from_previous_run = false ]] |
---|
3637 | then |
---|
3638 | rm -r $tmp_data_catalog/${frelin[$i]} |
---|
3639 | fi |
---|
3640 | done |
---|
3641 | |
---|
3642 | else |
---|
3643 | |
---|
3644 | printf "\n +++ no restart-run possible, since errors occured" |
---|
3645 | printf "\n during the archive process" |
---|
3646 | fi |
---|
3647 | |
---|
3648 | fi |
---|
3649 | |
---|
3650 | |
---|
3651 | |
---|
3652 | # EVTL. EMAIL-BENACHRICHTIGUNG UEBER ABGESCHLOSSENEN LAUF |
---|
3653 | if [[ "$email_notification" != "" ]] |
---|
3654 | then |
---|
3655 | |
---|
3656 | if [[ $localhost != $fromhost ]] |
---|
3657 | then |
---|
3658 | if [[ -f CONTINUE_RUN ]] |
---|
3659 | then |
---|
3660 | echo "PALM restart run necessary" > email_text |
---|
3661 | echo "description header of actual run:" >> email_text |
---|
3662 | cat CONTINUE_RUN >> email_text |
---|
3663 | echo "mrun-command to restart:" >> email_text |
---|
3664 | echo "$mc" >> email_text |
---|
3665 | else |
---|
3666 | echo "PALM run with base filename \"$fname\" on host \"$localhost\" finished" > email_text |
---|
3667 | fi |
---|
3668 | mail $email_notification < email_text |
---|
3669 | printf "\n *** email notification sent to \"$email_notification\" " |
---|
3670 | fi |
---|
3671 | fi |
---|
3672 | |
---|
3673 | |
---|
3674 | |
---|
3675 | # ALLE ARBEITEN BEENDET. TEMPORAERER KATALOG KANN GELOESCHT WERDEN |
---|
3676 | cd $HOME |
---|
3677 | [[ $delete_temporary_catalog = true ]] && rm -rf $TEMPDIR |
---|
3678 | |
---|
3679 | else |
---|
3680 | |
---|
3681 | |
---|
3682 | # FALLS AUF REMOTE-MASCHINE GERECHNET WERDEN SOLL, WERDEN JETZT ENTSPRE- |
---|
3683 | # CHENDE AKTIONEN DURCHGEFUEHRT |
---|
3684 | |
---|
3685 | # MRUN-BEFEHL FUER REMOTE-MASCHINE ZUSAMMENSTELLEN |
---|
3686 | mrun_com="$mrun_script_name -a $afname -c $config_file -d $fname -f $filetransfer_protocol -h $host -H $fromhost -m $memory -t $cpumax -q $queue -R $return_addres -U $return_username -u $remote_username" |
---|
3687 | [[ "$cpp_opts" != "" ]] && mrun_com=${mrun_com}" -D \"$cpp_opts\"" |
---|
3688 | [[ $do_compile = true ]] && mrun_com=${mrun_com}" -s \"$source_list\"" |
---|
3689 | [[ "$input_list" != "" ]] && mrun_com=${mrun_com}" -i \"$input_list\"" |
---|
3690 | [[ $ignore_archive_error = true ]] && mrun_com=${mrun_com}" -I" |
---|
3691 | [[ $keep_data_from_previous_run = true ]] && mrun_com=${mrun_com}" -k" |
---|
3692 | [[ "$additional_conditions" != "" ]] && mrun_com=${mrun_com}" -K \"$additional_conditions\"" |
---|
3693 | # [[ "$makefile" != "$source_path/Makefile" ]] && mrun_com=${mrun_com}" -M \"$makefile\"" |
---|
3694 | [[ "$output_list" != "" ]] && mrun_com=${mrun_com}" -o \"$output_list\"" |
---|
3695 | [[ "$read_from_config" = false ]] && mrun_com=${mrun_com}" -S" |
---|
3696 | [[ $do_trace = true ]] && mrun_com=${mrun_com}" -x" |
---|
3697 | [[ "$numprocs" != "" ]] && mrun_com=${mrun_com}" -X $numprocs" |
---|
3698 | if [[ $use_openmp = true ]] |
---|
3699 | then |
---|
3700 | mrun_com=${mrun_com}" -O" |
---|
3701 | [[ "$tasks_per_node" != "" ]] && mrun_com=${mrun_com}" -T $threads_per_task" |
---|
3702 | else |
---|
3703 | [[ "$tasks_per_node" != "" ]] && mrun_com=${mrun_com}" -T $tasks_per_node" |
---|
3704 | fi |
---|
3705 | [[ $store_on_archive_system = false ]] && mrun_com=${mrun_com}" -A" |
---|
3706 | [[ $package_list != "" ]] && mrun_com=${mrun_com}" -p \"$package_list\"" |
---|
3707 | [[ $return_password != "" ]] && mrun_com=${mrun_com}" -P $return_password" |
---|
3708 | [[ $delete_temporary_catalog = false ]] && mrun_com=${mrun_com}" -B" |
---|
3709 | [[ $node_usage != default ]] && mrun_com=${mrun_com}" -n $node_usage" |
---|
3710 | if [[ $do_remote = true ]] |
---|
3711 | then |
---|
3712 | printf "\n>>>> MRUN-command on execution host:\n>>>> $mrun_com \n" |
---|
3713 | fi |
---|
3714 | |
---|
3715 | |
---|
3716 | # ZUSAMMENSTELLUNG DES JOBSCRIPTS AUF DATEI jobfile |
---|
3717 | jobfile=jobfile.$RANDOM |
---|
3718 | |
---|
3719 | |
---|
3720 | # TEMPORAERES VERZEICHNIS GENERIEREN UND NACH DORT WECHSELN |
---|
3721 | echo "mkdir $TEMPDIR" >> $jobfile |
---|
3722 | echo "cd $TEMPDIR" >> $jobfile |
---|
3723 | |
---|
3724 | |
---|
3725 | # EVENTUELL FEHLERVERFOLGUNG AKTIVIEREN |
---|
3726 | if [[ $do_trace = true ]] |
---|
3727 | then |
---|
3728 | echo "set -x" >> $jobfile |
---|
3729 | else |
---|
3730 | echo "set +vx" >> $jobfile |
---|
3731 | fi |
---|
3732 | |
---|
3733 | |
---|
3734 | # ABSPEICHERN DER QUELLTEXTE (NUR FALLS UEBERSETZT WERDEN SOLL) |
---|
3735 | # SOWIE GEGEBENENFALLS DES MAKEFILES |
---|
3736 | if [[ $do_compile = true ]] |
---|
3737 | then |
---|
3738 | |
---|
3739 | source_catalog=SOURCES_FOR_RUN_$fname |
---|
3740 | |
---|
3741 | # UNTERVERZEICHNIS FUER QUELLTEXTE UND MAKEFILE ANLEGEN |
---|
3742 | # MRUN WIRD DIESES VRZEICHNIS UEBER ENVIRONMENT VARIABLE |
---|
3743 | # MITGETEILT (UEBERSTEUERT ANGABE IN KONFIGURATIONSDATEI) |
---|
3744 | echo "mkdir SOURCES_FOR_RUN_$fname" >> $jobfile |
---|
3745 | echo "export SOURCES_COMPLETE=true" >> $jobfile |
---|
3746 | echo "cd SOURCES_FOR_RUN_$fname" >> $jobfile |
---|
3747 | |
---|
3748 | for filename in $source_list |
---|
3749 | do |
---|
3750 | # ABDECKZEICHEN VERHINDERN, DASS ERSETZUNGEN ERFOLGEN |
---|
3751 | echo "cat > $filename << \"%END%\"" >> $jobfile |
---|
3752 | cat $source_catalog/$filename >> $jobfile |
---|
3753 | echo " " >> $jobfile |
---|
3754 | echo "%END%" >> $jobfile |
---|
3755 | echo " " >> $jobfile |
---|
3756 | done |
---|
3757 | |
---|
3758 | if [[ "$use_makefile" = true ]] |
---|
3759 | then |
---|
3760 | # ABDECKZEICHEN VERHINDERN, DASS ERSETZUNGEN ERFOLGEN |
---|
3761 | echo "cat > Makefile << \"%END%\"" >> $jobfile |
---|
3762 | cat $source_catalog/Makefile >> $jobfile |
---|
3763 | echo " " >> $jobfile |
---|
3764 | echo "%END%" >> $jobfile |
---|
3765 | echo " " >> $jobfile |
---|
3766 | fi |
---|
3767 | |
---|
3768 | echo "cd - > /dev/null" >> $jobfile |
---|
3769 | |
---|
3770 | fi |
---|
3771 | |
---|
3772 | |
---|
3773 | # ABSPEICHERN DER KONFIGURATIONSDATEI |
---|
3774 | # ABDECKZEICHEN VERHINDERN, DASS ERSETZUNGEN ERFOLGEN |
---|
3775 | echo "cat > $config_file << \"%END%\"" >> $jobfile |
---|
3776 | cat $config_file >> $jobfile |
---|
3777 | echo "%END%" >> $jobfile |
---|
3778 | echo " " >> $jobfile |
---|
3779 | |
---|
3780 | |
---|
3781 | # ABSPEICHERN DER AKTUELLEN MRUN-VERSION |
---|
3782 | # ABDECKZEICHEN VERHINDERN, DASS ERSETZUNGEN ERFOLGEN |
---|
3783 | echo "cat > $mrun_script_name <<\"%END%\"" >> $jobfile |
---|
3784 | cat ${mrun_path}/$mrun_script_name >> $jobfile |
---|
3785 | echo "%END%" >> $jobfile |
---|
3786 | if [[ $host = lctit ]] |
---|
3787 | then |
---|
3788 | echo "sed 's/bin\/ksh/home2\/usr5\/mkanda\/pub\/ksh/' < $mrun_script_name > mrun_new" >> $jobfile |
---|
3789 | echo "mv mrun_new $mrun_script_name" >> $jobfile |
---|
3790 | fi |
---|
3791 | echo "chmod u+x $mrun_script_name" >> $jobfile |
---|
3792 | echo "execute_mrun=true" >> $jobfile |
---|
3793 | echo " " >> $jobfile |
---|
3794 | |
---|
3795 | # EVTL. BENOETIGTE INPUT-DATEIEN PER FTP HOLEN ODER DEM JOB DIREKT |
---|
3796 | # MITGEBEN UND AUF DEM REMOTE-RECHNER IM BENUTZERVERZEICHNIS ABLEGEN |
---|
3797 | # FALLS DIESES NICHT EXISTIERT, WIRD VERSUCHT, DAS JEWEILS LETZTE |
---|
3798 | # UNTERVERZEICHNIS DES PFADNAMENS ANZULEGEN |
---|
3799 | if [[ $do_remote = true ]] |
---|
3800 | then |
---|
3801 | (( i = 0 )) |
---|
3802 | while (( i < iin )) |
---|
3803 | do |
---|
3804 | (( i = i + 1 )) |
---|
3805 | echo "[[ ! -d ${pathin[$i]} ]] && mkdir -p ${pathin[$i]}" >> $jobfile |
---|
3806 | if [[ "${transin[$i]}" = job ]] |
---|
3807 | then |
---|
3808 | echo "cat > ${remotepathin[$i]} <<\"%END%\"" >> $jobfile |
---|
3809 | eval cat ${pathin[$i]}/${frelin[$i]} >> $jobfile |
---|
3810 | echo " " >> $jobfile |
---|
3811 | echo "%END%" >> $jobfile |
---|
3812 | else |
---|
3813 | if [[ $filetransfer_protocol = ftp ]] |
---|
3814 | then |
---|
3815 | echo "ftpcopy -b -o -g -s $return_addres ${remotepathin[$i]} \"${pathin[$i]}\" ${frelin[$i]}" >> $jobfile |
---|
3816 | else |
---|
3817 | echo "batch_scp -b -o -g -s -u $return_username $return_addres ${remotepathin[$i]} \"${pathin[$i]}\" ${frelin[$i]}" >> $jobfile |
---|
3818 | fi |
---|
3819 | fi |
---|
3820 | |
---|
3821 | # UEBERPRUEFEN, OB DATEI ANGELEGT WERDEN KONNTE |
---|
3822 | echo "if [[ \$? = 1 ]]" >> $jobfile |
---|
3823 | echo "then" >> $jobfile |
---|
3824 | echo " echo \" \" " >> $jobfile |
---|
3825 | echo " echo \"+++ file ${remotepathin[$i]} could not be created\" " >> $jobfile |
---|
3826 | echo " echo \" please check, if directory exists on $host!\" " >> $jobfile |
---|
3827 | echo " echo \"+++ MRUN will not be continued\" " >> $jobfile |
---|
3828 | echo " execute_mrun=false" >> $jobfile |
---|
3829 | echo "fi" >> $jobfile |
---|
3830 | done |
---|
3831 | fi |
---|
3832 | |
---|
3833 | # ARBEITSKATALOG AUF DER LOKALEN MASCHINE FUER EVENTUELLE |
---|
3834 | # FORTSETZUNGSLAUEFE PER ENV-VARIABLE UEBERGEBEN |
---|
3835 | echo "LOCAL_PWD=$working_directory" >> $jobfile |
---|
3836 | echo "export LOCAL_PWD" >> $jobfile |
---|
3837 | |
---|
3838 | # EBENSO LOKALEN MRUN-KATALOG UEBERGEBEN |
---|
3839 | echo "LOCAL_MRUN_PATH=$mrun_path" >> $jobfile |
---|
3840 | echo "export LOCAL_MRUN_PATH" >> $jobfile |
---|
3841 | |
---|
3842 | # echo "for_subjob_to_do=\"rm -rf $TEMPDIR\" " >> $jobfile |
---|
3843 | |
---|
3844 | # MRUN AUF ZIELRECHNER AUFRUFEN |
---|
3845 | echo "set -x" >> $jobfile |
---|
3846 | echo "[[ \$execute_mrun = true ]] && ./$mrun_com" >> $jobfile |
---|
3847 | |
---|
3848 | echo 'ls -al; echo `pwd`' >> $jobfile |
---|
3849 | echo "cd \$HOME" >> $jobfile |
---|
3850 | echo "rm -rf $TEMPDIR" >> $jobfile |
---|
3851 | |
---|
3852 | |
---|
3853 | |
---|
3854 | |
---|
3855 | # JOB PER SUBJOB STARTEN |
---|
3856 | if [[ $silent = false ]] |
---|
3857 | then |
---|
3858 | printf "\n " |
---|
3859 | else |
---|
3860 | printf "\n\n" |
---|
3861 | fi |
---|
3862 | |
---|
3863 | subjob $job_on_file -h $host -u $remote_username -q $queue -m $memory -N $node_usage -t $cpumax $XOPT $TOPT $OOPT -n $fname -f $filetransfer_protocol -v $jobfile |
---|
3864 | rm -rf $jobfile |
---|
3865 | |
---|
3866 | |
---|
3867 | fi # ENDE REMOTE-TEIL |
---|
3868 | |
---|
3869 | |
---|
3870 | |
---|
3871 | # ENDE DER PROZEDUR |
---|