1 | #!/bin/ksh |
---|
2 | |
---|
3 | # mrun - script for running PALM jobs |
---|
4 | |
---|
5 | #--------------------------------------------------------------------------------# |
---|
6 | # This file is part of PALM. |
---|
7 | # |
---|
8 | # PALM is free software: you can redistribute it and/or modify it under the terms |
---|
9 | # of the GNU General Public License as published by the Free Software Foundation, |
---|
10 | # either version 3 of the License, or (at your option) any later version. |
---|
11 | # |
---|
12 | # PALM is distributed in the hope that it will be useful, but WITHOUT ANY |
---|
13 | # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
---|
14 | # A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
---|
15 | # |
---|
16 | # You should have received a copy of the GNU General Public License along with |
---|
17 | # PALM. If not, see <http://www.gnu.org/licenses/>. |
---|
18 | # |
---|
19 | # Copyright 1997-2014 Leibniz Universitaet Hannover |
---|
20 | #--------------------------------------------------------------------------------# |
---|
21 | # |
---|
22 | # Current revisions: |
---|
23 | # ------------------ |
---|
24 | # -j1 option added to aprung command for lccrayf (CSC) |
---|
25 | # |
---|
26 | # Former revisions: |
---|
27 | # ----------------- |
---|
28 | # $Id: mrun 1420 2014-06-10 06:24:14Z raasch $ |
---|
29 | # |
---|
30 | # 1402 2014-05-09 14:25:13Z raasch |
---|
31 | # batch_job added to envpar-NAMELIST |
---|
32 | # |
---|
33 | # 1357 2014-04-11 15:02:03Z witha |
---|
34 | # adjustments for lccrayh (automatic restarts on lccrayh outside of IMUK are now |
---|
35 | # possible) |
---|
36 | # |
---|
37 | # 1320 2014-03-20 08:40:49Z raasch |
---|
38 | # check namelist file set false by default |
---|
39 | # |
---|
40 | # 1304 2014-03-12 10:29:42Z raasch |
---|
41 | # ulimit option changed from -Ss to -s |
---|
42 | # |
---|
43 | # bugfix: missing "fi" in r1289 |
---|
44 | # |
---|
45 | # 1289 2014-03-04 07:12:34Z raasch |
---|
46 | # comments translated to English |
---|
47 | # necriam-, fimm-, ibmy-, and sgi-specific code removed |
---|
48 | # export of variables for palm and interpret_config removed |
---|
49 | # |
---|
50 | # 1281 2014-02-01 07:55:49Z raasch |
---|
51 | # rsync-copy restricted to Cray machines, since command is unavailable on some |
---|
52 | # other systems |
---|
53 | # |
---|
54 | # 1279 2014-01-28 12:10:14Z raasch |
---|
55 | # tasks_per_node must not be an integral divisor of numprocs any more. This was done |
---|
56 | # in order to remove annoying restrictions concerning the number of processors which |
---|
57 | # appear on machines with larger nodes (e.g. containing 24 cores). Now without this |
---|
58 | # restriction, one of the nodes will be filled with less than the given number of |
---|
59 | # tasks per node. A respective warning is given. |
---|
60 | # |
---|
61 | # 1274 2014-01-09 13:14:54Z heinze |
---|
62 | # adjustments for lccrayh |
---|
63 | # |
---|
64 | # 1272 2014-01-08 10:19:32Z witha |
---|
65 | # small adjustment for lcflow |
---|
66 | # |
---|
67 | # 1270 2013-12-16 11:05:01Z fricke |
---|
68 | # call of combine_plot_fields adjusted for lccrayb/lccrayh |
---|
69 | # |
---|
70 | # 1255 2013-11-07 14:43:35Z raasch |
---|
71 | # further adjustments for lccrayb remote access |
---|
72 | # |
---|
73 | # 1241 2013-10-30 11:36:58Z heinze |
---|
74 | # Enable use of nudging input and input of large scale forcing from |
---|
75 | # external files |
---|
76 | # |
---|
77 | # 1229 2013-09-20 06:55:19Z raasch |
---|
78 | # further adjustments for lccrayb |
---|
79 | # |
---|
80 | # 1224 2013-09-16 07:27:23Z raasch |
---|
81 | # first adjustments for lccrayb |
---|
82 | # |
---|
83 | # 1210 2013-08-14 10:58:20Z raasch |
---|
84 | # fftw support added |
---|
85 | # |
---|
86 | # 1201 2013-07-10 16:17:59Z witha |
---|
87 | # adjustments for Forwind cluster (lcflow) |
---|
88 | # |
---|
89 | # 1199 2013-07-05 14:52:22Z raasch |
---|
90 | # adjustments for CSC Helsinki (lccrayf), |
---|
91 | # executables for batch jobs can be created in advance, in order to avoid calling |
---|
92 | # the compiler within the batch job (only works if batch jobs are submitted on |
---|
93 | # local host) |
---|
94 | # |
---|
95 | # 1190 2013-06-25 09:39:21Z heinze |
---|
96 | # enable use of automatic restarts for ibmh |
---|
97 | # use of cluster/express queue enabled (ibmh) |
---|
98 | # |
---|
99 | # 1124 2013-04-09 15:46:52Z raasch |
---|
100 | # variable "memory" is exported via typeset option -x, because otherwise an unknown |
---|
101 | # side effect may lead to data loss while getopts is reading the script-option arguments |
---|
102 | # |
---|
103 | # 1122 2013-04-09 08:37:16Z heinze |
---|
104 | # Bugfix: change type of variable last_char |
---|
105 | # |
---|
106 | # 1119 2013-04-05 15:11:19Z raasch |
---|
107 | # Bugfix for setting -T option for subjob |
---|
108 | # |
---|
109 | # 1108 2013-03-05 07:03:32Z raasch |
---|
110 | # bugfix for coupled runs on lckyut/lckyuh |
---|
111 | # |
---|
112 | # 1106 2013-03-04 05:31:38Z raasch |
---|
113 | # --stdin argument for mpiexec on lckyuh |
---|
114 | # -y and -Y settings output to header |
---|
115 | # |
---|
116 | # 1103 2013-02-20 02:15:53Z raasch |
---|
117 | # default script runs again under ksh, because of unsolved problems with read |
---|
118 | # from stdin: when bash script is called from a ksh, message "read error: 0: |
---|
119 | # Resource temporarily unavailable" appears and script does not stop, |
---|
120 | # further bash compatibility adjustments, |
---|
121 | # shebang line replaced by /bin/bash when running jobs on lckyuh; no restarts |
---|
122 | # on lckyuh, but mrun does not terminate and issues a warning instead |
---|
123 | # |
---|
124 | # 1101 2013-02-17 10:20:21Z raasch |
---|
125 | # script now running under bash instead of ksh, which required small adjustments |
---|
126 | # (output formatting with printf instead "typeset -L/-R", print replaced by echo, |
---|
127 | # read from stdin), |
---|
128 | # cross compilername on lckyuh compute nodes replaced by real compiler name |
---|
129 | # |
---|
130 | # 1099 2013-02-10 01:47:43Z raasch |
---|
131 | # adjustments for Kyushu-University computing center (lckyuh - hayaka) |
---|
132 | # and for Forwind cluster (lcflow) |
---|
133 | # small further adjustments for lckyut |
---|
134 | # |
---|
135 | # 1094 2013-02-03 01:52:12Z raasch |
---|
136 | # explicit ssh/scp port can be set in config file with environment variable |
---|
137 | # scp_port. This port is handled to all ssh/scp/batch_scp calls. |
---|
138 | # decalpha parts (yonsei) removed |
---|
139 | # |
---|
140 | # 2013-02-02 07:06:13Z raasch |
---|
141 | # adjustments for Kyushu-University computing center (lckyut - tatara) |
---|
142 | # |
---|
143 | # 1083 2013-01-04 10:22:09Z maronga |
---|
144 | # bugfix in parameter file check (read %cpp_options was missing) |
---|
145 | # |
---|
146 | # 1069 2012-11-28 16:18:43Z maronga |
---|
147 | # bugfix: coupling mode was always set to mpi2, typos removed |
---|
148 | # |
---|
149 | # 1058 2012-11-21 07:00:35Z raasch |
---|
150 | # Intel inspector (inspxe) is given the number of PEs instead of the number of |
---|
151 | # nodes |
---|
152 | # |
---|
153 | # 1046 2012-11-09 14:38:45Z maronga |
---|
154 | # code put under GPL (PALM 3.9) |
---|
155 | # |
---|
156 | # 21/03/94 - Siggi - first version finished |
---|
157 | # 03/03/94 - Siggi - script development started |
---|
158 | # |
---|
159 | #--------------------------------------------------------------------------------# |
---|
160 | # mrun - script for running PALM jobs |
---|
161 | #--------------------------------------------------------------------------------# |
---|
162 | |
---|
163 | |
---|
164 | |
---|
165 | # DECLARATION OF VARIABLES AND THEIR DEFUALT VALUES |
---|
166 | |
---|
167 | set +o allexport # SUPPRESS EXPORT OF ALL VARIABLES, SINCE IN THE PAST THIS |
---|
168 | # LES TO PROBLEMS IN ROUTINES CALLED BY MRUN |
---|
169 | # (TOO MANY ARGUMENTS - PROBLEM) |
---|
170 | set +o noclobber # EXISTING FILES ARE ALLOWED TO BE OVERWRITTEN |
---|
171 | |
---|
172 | AddFilenames="" |
---|
173 | additional_conditions="" |
---|
174 | add_source_path="" |
---|
175 | afname="" |
---|
176 | archive_save=true |
---|
177 | archive_system=none |
---|
178 | check_namelist_files=false |
---|
179 | combine_plot_fields=true |
---|
180 | compiler_name="" |
---|
181 | cond1="" |
---|
182 | cond2="" |
---|
183 | config_file=.mrun.config |
---|
184 | coupled_dist="" |
---|
185 | coupled_mode="mpi1" |
---|
186 | cpp_opts="" |
---|
187 | cpp_options="" |
---|
188 | cpumax=0 |
---|
189 | cpurest=0 |
---|
190 | create_executable_for_batch=false |
---|
191 | delete_temporary_catalog=true |
---|
192 | do_batch=false |
---|
193 | do_compile=true |
---|
194 | do_remote=false |
---|
195 | do_stagein=true |
---|
196 | do_stageout=true |
---|
197 | do_trace=false |
---|
198 | email_notification="none" |
---|
199 | exclude="" |
---|
200 | executable="" |
---|
201 | execution_error=false |
---|
202 | fftw_inc="" |
---|
203 | fftw_lib="" |
---|
204 | fftw_support=false |
---|
205 | fname=test |
---|
206 | fromhost="" |
---|
207 | global_revision="" |
---|
208 | group_number=none |
---|
209 | host="" |
---|
210 | host_file="" |
---|
211 | hp="" |
---|
212 | ignore_archive_error=false |
---|
213 | input_list="" |
---|
214 | interpreted_config_file="" |
---|
215 | job_catalog="~/job_queue" |
---|
216 | job_on_file="" |
---|
217 | keep_data_from_previous_run=false |
---|
218 | link_local_input=false |
---|
219 | link_local_output=false |
---|
220 | localhost_realname=$(hostname) |
---|
221 | local_dvrserver_running=.FALSE. |
---|
222 | locat=normal |
---|
223 | mainprog="" |
---|
224 | makefile="" |
---|
225 | max_par_io_str="" |
---|
226 | mc=$0 |
---|
227 | while [[ $(echo $mc | grep -c "/") != 0 ]] |
---|
228 | do |
---|
229 | mc=`echo $mc | cut -f2- -d"/"` |
---|
230 | done |
---|
231 | module_calls="" |
---|
232 | mrun_script_name=$mc |
---|
233 | netcdf_inc="" |
---|
234 | netcdf_lib="" |
---|
235 | netcdf_support=false |
---|
236 | node_usage=default |
---|
237 | numprocs="" |
---|
238 | numprocs_atmos=0 |
---|
239 | numprocs_ocean=0 |
---|
240 | OOPT="" |
---|
241 | openmp=false |
---|
242 | output_list="" |
---|
243 | package_list="" |
---|
244 | queue=none |
---|
245 | read_from_config="" |
---|
246 | restart_run=false |
---|
247 | if [[ `hostname` = rte10 ]] |
---|
248 | then |
---|
249 | return_addres=133.5.185.60 |
---|
250 | echo "+++ WARNING: fixed return_addres = $return_addres is used !!!!!" |
---|
251 | elif [[ `hostname` = climate0 ]] |
---|
252 | then |
---|
253 | return_addres=165.132.26.68 |
---|
254 | echo "+++ WARNING: fixed return_addres = $return_addres is used !!!!!" |
---|
255 | elif [[ `hostname` = urban00 ]] |
---|
256 | then |
---|
257 | return_addres=147.46.30.151 |
---|
258 | echo "+++ WARNING: fixed return_addres = $return_addres is used !!!!!" |
---|
259 | else |
---|
260 | return_addres=$(nslookup `hostname` 2>&1 | grep "Address:" | tail -1 | awk '{print $2}') |
---|
261 | fi |
---|
262 | return_password="" |
---|
263 | return_username=$LOGNAME |
---|
264 | remotecall=false |
---|
265 | remote_username="" |
---|
266 | run_coupled_model=false |
---|
267 | run_mode="" |
---|
268 | store_on_archive_system=false |
---|
269 | dashes=" ----------------------------------------------------------------------------" |
---|
270 | silent=false |
---|
271 | source_list="" |
---|
272 | source_path=SOURCE |
---|
273 | tasks_per_node="" |
---|
274 | threads_per_task=1 |
---|
275 | tmpcreate=false |
---|
276 | tmp_data_catalog="" |
---|
277 | transfer_problems=false |
---|
278 | usern=$LOGNAME |
---|
279 | use_openmp=false |
---|
280 | version="MRUN 2.1 Rev$Rev: 1420 $" |
---|
281 | working_directory=`pwd` |
---|
282 | TOPT="" |
---|
283 | XOPT="" |
---|
284 | zeit=$( date | cut -c 12-19 ) |
---|
285 | |
---|
286 | typeset -i iec=0 iic=0 iin=0 ioc=0 iout=0 stagein_anz=0 stageout_anz=0 |
---|
287 | typeset -x -i memory=0 # HAS TO BE EXPORTED HERE, OTHERWISE AN UNKNOWN SIDE |
---|
288 | # SIDE EFFECT MAY CAUSE DATA LOSS WHEN GETOPTS IS READING THE |
---|
289 | # SCRIPT-OPTION ARGUMENTS |
---|
290 | typeset -i cputime i ii iia iii iio icycle inode ival jobges jobsek last_char_int maxcycle minuten nodes pes remaining_pes sekunden tp1 |
---|
291 | |
---|
292 | |
---|
293 | |
---|
294 | # ERROR HANDLING IN CASE OF EXIT |
---|
295 | trap 'rm -rf $working_directory/tmp_mrun |
---|
296 | if [[ $locat != normal && $locat != control_c ]] |
---|
297 | then |
---|
298 | |
---|
299 | # CARRY OUT ERROR-COMMANDS GIVEN IN THE CONFIGURATION FILE (EC:) |
---|
300 | (( i = 0 )) |
---|
301 | while (( i < iec )) |
---|
302 | do |
---|
303 | (( i = i + 1 )) |
---|
304 | printf "\n *** Execution of ERROR-command:\n" |
---|
305 | printf " >>> ${err_command[$i]}\n" |
---|
306 | eval ${err_command[$i]} |
---|
307 | done |
---|
308 | if [[ -n $interpreted_config_file ]] |
---|
309 | then |
---|
310 | rm -rf $interpreted_config_file |
---|
311 | fi |
---|
312 | if [[ -n .mrun_environment ]] |
---|
313 | then |
---|
314 | rm -rf .mrun_environment |
---|
315 | fi |
---|
316 | if [[ $tmpcreate = true ]] |
---|
317 | then |
---|
318 | printf "\n *** Contents of \"$TEMPDIR\":\n" |
---|
319 | ls -al; cd |
---|
320 | [[ $delete_temporary_catalog = true ]] && rm -rf $TEMPDIR |
---|
321 | fi |
---|
322 | if [[ "$dvrserver_id" != "" ]] |
---|
323 | then |
---|
324 | echo "+++ killing dvrserver_id=$dvrserver_id" |
---|
325 | kill $dvrserver_id |
---|
326 | fi |
---|
327 | if [[ -f ~/job_queue/JOBINFO.$QSUB_REQID ]] |
---|
328 | then |
---|
329 | rm -rf ~/job_queue/JOBINFO.$QSUB_REQID |
---|
330 | fi |
---|
331 | printf "\n\n+++ MRUN killed \n\n" |
---|
332 | elif [[ $locat != control_c ]] |
---|
333 | then |
---|
334 | printf "\n\n --> all actions finished\n\n" |
---|
335 | printf " Bye, bye $usern !!\n\n" |
---|
336 | fi' exit |
---|
337 | |
---|
338 | |
---|
339 | # ACTIONS IN CASE OF TERMINAL-BREAK (CONTROL-C): |
---|
340 | trap 'rm -rf $working_directory/tmp_mrun |
---|
341 | rm -rf $working_directory/tmp_check_namelist_files |
---|
342 | [[ $tmpcreate = true ]] && (cd; rm -rf $TEMPDIR) |
---|
343 | if [[ -f ~/job_queue/JOBINFO.$QSUB_REQID ]] |
---|
344 | then |
---|
345 | rm -rf ~/job_queue/JOBINFO.$QSUB_REQID |
---|
346 | fi |
---|
347 | if [[ "$dvrserver_id" != "" ]] |
---|
348 | then |
---|
349 | echo "+++ killing dvrserver_id=$dvrserver_id" |
---|
350 | kill $dvrserver_id |
---|
351 | fi |
---|
352 | printf "\n+++ MRUN killed by \"^C\" \n\n" |
---|
353 | locat=control_c |
---|
354 | exit |
---|
355 | ' 2 |
---|
356 | |
---|
357 | |
---|
358 | # CHECK IF THE PATH FOR THE PALM BINARIES (SCRIPTS+UTILITY-PROGRAMS) HAS |
---|
359 | # BEEN SET |
---|
360 | if [[ "$PALM_BIN" = "" ]] |
---|
361 | then |
---|
362 | printf "\n +++ environment variable PALM_BIN has not been set" |
---|
363 | printf "\n please set it to the directory where the PALM scripts are located" |
---|
364 | locat=palm_bin; exit |
---|
365 | fi |
---|
366 | export PATH=$PALM_BIN:$PATH |
---|
367 | |
---|
368 | |
---|
369 | |
---|
370 | # READ SHELLSCRIPT-OPTIONS AND REBUILD THE MRUN-COMMAND STRING (MC), |
---|
371 | # WHICH WILL BE USED TO START RESTART-JOBS |
---|
372 | while getopts :a:AbBc:Cd:D:Fg:G:h:H:i:IkK:m:M:n:o:O:p:P:q:r:R:s:St:T:u:U:vw:xX:yY:zZ option |
---|
373 | do |
---|
374 | case $option in |
---|
375 | (a) afname=$OPTARG;; |
---|
376 | (A) store_on_archive_system=true; mc="$mc -A";; |
---|
377 | (b) do_batch=true; mc="$mc -b";; |
---|
378 | (B) delete_temporary_catalog=false; mc="$mc -B";; |
---|
379 | (c) config_file=$OPTARG; mc="$mc -c$OPTARG";; |
---|
380 | (C) restart_run=true; mc="$mc -C";; |
---|
381 | (d) fname=$OPTARG; mc="$mc -d$OPTARG";; |
---|
382 | (D) cpp_opts="$cpp_opts $OPTARG"; mc="$mc -D'$OPTARG'";; |
---|
383 | (F) job_on_file="-D"; mc="$mc -F";; |
---|
384 | (g) group_number=$OPTARG; mc="$mc -g$OPTARG";; |
---|
385 | (G) global_revision=$OPTARG; mc="$mc -G'$OPTARG'";; |
---|
386 | (h) host=$OPTARG; mc="$mc -h$OPTARG";; |
---|
387 | (H) fromhost=$OPTARG; mc="$mc -H$OPTARG";; |
---|
388 | (i) input_list=$OPTARG; mc="$mc -i'$OPTARG'";; |
---|
389 | (I) ignore_archive_error=true; mc="$mc -I";; |
---|
390 | (k) keep_data_from_previous_run=true; mc="$mc -k";; |
---|
391 | (K) additional_conditions="$OPTARG"; mc="$mc -K'$OPTARG'";; |
---|
392 | (m) memory=$OPTARG; mc="$mc -m$OPTARG";; |
---|
393 | (M) makefile=$OPTARG; mc="$mc -M$OPTARG";; |
---|
394 | (n) node_usage=$OPTARG; mc="$mc -n$OPTARG";; |
---|
395 | (o) output_list=$OPTARG; mc="$mc -o'$OPTARG'";; |
---|
396 | (O) use_openmp=true; threads_per_task=$OPTARG; mc="$mc -O$OPTARG";; |
---|
397 | (p) package_list=$OPTARG; mc="$mc -p'$OPTARG'";; |
---|
398 | (P) return_password=$OPTARG; mc="$mc -P$OPTARG";; |
---|
399 | (q) queue=$OPTARG; mc="$mc -q$OPTARG";; |
---|
400 | (r) run_mode=$OPTARG; mc="$mc -r'$OPTARG'";; |
---|
401 | (R) remotecall=true;return_addres=$OPTARG; mc="$mc -R$OPTARG";; |
---|
402 | (s) source_list=$OPTARG; mc="$mc -s'$OPTARG'";; |
---|
403 | (S) read_from_config=false; mc="$mc -S";; |
---|
404 | (t) cpumax=$OPTARG; mc="$mc -t$OPTARG";; |
---|
405 | (T) mrun_tasks_per_node=$OPTARG; mc="$mc -T$OPTARG";; |
---|
406 | (u) remote_username=$OPTARG; mc="$mc -u$OPTARG";; |
---|
407 | (U) return_username=$OPTARG; mc="$mc -U$OPTARG";; |
---|
408 | (v) silent=true; mc="$mc -v";; |
---|
409 | (w) max_par_io_str=$OPTARG; mc="$mc -w$OPTARG";; |
---|
410 | (x) do_trace=true;set -x; mc="$mc -x";; |
---|
411 | (X) numprocs=$OPTARG; mc="$mc -X$OPTARG";; |
---|
412 | (y) ocean_file_appendix=true; mc="$mc -y";; |
---|
413 | (Y) run_coupled_model=true; coupled_dist=$OPTARG; mc="$mc -Y'$OPTARG'";; |
---|
414 | (z) check_namelist_files=false; mc="$mc -z";; |
---|
415 | (Z) combine_plot_fields=false; mc="$mc -Z";; |
---|
416 | (\?) printf "\n +++ unknown option $OPTARG \n" |
---|
417 | printf "\n --> type \"$0 ?\" for available options \n" |
---|
418 | locat=parameter;exit;; |
---|
419 | esac |
---|
420 | done |
---|
421 | |
---|
422 | |
---|
423 | # SKIP GIVEN OPTIONS TO READ POSITIONAL PARAMETER, IF GIVEN |
---|
424 | # CURRENTLY ONLY PARAMETER ? (TO OUTPUT A SHORT COMMAND INFO) IS ALLOWED |
---|
425 | (( to_shift = $OPTIND - 1 )) |
---|
426 | shift $to_shift |
---|
427 | |
---|
428 | # PRINT SHORT DESCRIPTION OF MRUN OPTIONS |
---|
429 | if [[ "$1" = "?" ]] |
---|
430 | then |
---|
431 | (printf "\n *** mrun can be called as follows:\n" |
---|
432 | 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.. -y -Y.. -z -Z <modus> \n" |
---|
433 | printf "\n Description of available options:\n" |
---|
434 | printf "\n Option Description Default-Value" |
---|
435 | printf "\n -a base name of input files equiv. -d" |
---|
436 | printf "\n -A archiving when using file-attribute fl" |
---|
437 | printf "\n -b batch-job on local machine ---" |
---|
438 | printf "\n -B do not delete temporary directory at end ---" |
---|
439 | printf "\n -c configuration file .mrun.config" |
---|
440 | printf "\n -d base name of files attached to program test" |
---|
441 | printf "\n -D preprocessor(cpp)-directives \"\" " |
---|
442 | printf "\n -F create remote job file only ---" |
---|
443 | printf "\n -h execution host $localhost_realname" |
---|
444 | printf "\n -i INPUT control list \"\" " |
---|
445 | printf "\n -I archiving errors of previous batch-jobs" |
---|
446 | printf "\n will be ignored" |
---|
447 | printf "\n -k keep data from previous run" |
---|
448 | printf "\n -K additional conditions for controling" |
---|
449 | printf "\n usage of conditional code and" |
---|
450 | printf "\n env-variables in configuration file \"\" " |
---|
451 | printf "\n -m memory demand in MB (batch-jobs) 0 MB" |
---|
452 | printf "\n -M Makefile name Makefile" |
---|
453 | printf "\n -n node usage (shared/not_shared) depending on -h" |
---|
454 | printf "\n -o OUTPUT control list \"\" " |
---|
455 | printf "\n -O threads per openMP task ---" |
---|
456 | printf "\n -p software package list \"\" " |
---|
457 | printf "\n -q queue \"$queue\" " |
---|
458 | printf "\n -r run control list (combines -i -o) \"\" " |
---|
459 | printf "\n -s filenames of routines to be compiled \"\" " |
---|
460 | printf "\n must end with .f, .f90, .F, or .c !" |
---|
461 | printf "\n use \"..\" for more than one file and wildcards" |
---|
462 | printf "\n -s LM compiles all locally modified files" |
---|
463 | printf "\n -S config file interpreted by shellscript ---" |
---|
464 | printf "\n -t allowed cpu-time in seconds (batch) 0" |
---|
465 | printf "\n -T tasks per node depending on -h" |
---|
466 | printf "\n -u username on remote machine \"\" " |
---|
467 | printf "\n -v no prompt for confirmation ---" |
---|
468 | printf "\n -w maximum parallel io streams as given by -X" |
---|
469 | printf "\n -x tracing of mrun for debug purposes ---" |
---|
470 | printf "\n -X # of processors (on parallel machines) 1" |
---|
471 | printf "\n -y add appendix \"_O\" to all local output" |
---|
472 | printf "\n files (ocean precursor runs followed by" |
---|
473 | printf "\n coupled atmosphere-ocean runs) ---" |
---|
474 | printf "\n -Y run coupled model, \"#1 #2\" with" |
---|
475 | printf "\n #1 atmosphere and #2 ocean processors \"#/2 #/2\" depending on -X" |
---|
476 | printf "\n -z disable a priori parameter file check ---" |
---|
477 | printf "\n -Z skip combine_plot_fields at the end of " |
---|
478 | printf "\n the simulation ---" |
---|
479 | printf "\n " |
---|
480 | printf "\n Possible values of positional parameter <modus>:" |
---|
481 | printf "\n \"?\" - this outline \n\n") | more |
---|
482 | exit |
---|
483 | elif [[ "$1" != "" ]] |
---|
484 | then |
---|
485 | printf "\n +++ positional parameter $1 unknown \n" |
---|
486 | locat=parameter; exit |
---|
487 | fi |
---|
488 | |
---|
489 | |
---|
490 | |
---|
491 | # SHORT STARTING MESSAGE |
---|
492 | printf "\n*** $version " |
---|
493 | printf "\n will be executed. Please wait ..." |
---|
494 | |
---|
495 | |
---|
496 | |
---|
497 | # CHECK, IF CONFIGURATION FILE EXISTS |
---|
498 | if [[ ! -f $config_file ]] |
---|
499 | then |
---|
500 | printf "\n\n +++ configuration file: " |
---|
501 | printf "\n $config_file" |
---|
502 | printf "\n does not exist" |
---|
503 | locat=connect; exit |
---|
504 | fi |
---|
505 | |
---|
506 | |
---|
507 | # DETERMINE THE HOST-IDENTIFIER (localhost) FROM THE CONFIGURATION FILE |
---|
508 | line="" |
---|
509 | grep "%host_identifier" $config_file > tmp_mrun |
---|
510 | while read line |
---|
511 | do |
---|
512 | if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] |
---|
513 | then |
---|
514 | HOSTNAME=`echo $line | cut -d" " -s -f2` |
---|
515 | host_identifier=`echo $line | cut -d" " -s -f3` |
---|
516 | if [[ $localhost_realname = $HOSTNAME ]] |
---|
517 | then |
---|
518 | localhost=$host_identifier |
---|
519 | break |
---|
520 | fi |
---|
521 | fi |
---|
522 | done < tmp_mrun |
---|
523 | |
---|
524 | if [[ "$localhost" = "" ]] |
---|
525 | then |
---|
526 | printf "\n\n +++ no host identifier found in configuration file \"$config_file\"" |
---|
527 | printf "\n for local host \"$localhost_realname\"." |
---|
528 | printf "\n Please add line" |
---|
529 | printf "\n \"\%host_identifier $localhost_realname <identifier>\"" |
---|
530 | printf "\n to the configuration file." |
---|
531 | locat=localhost; exit |
---|
532 | fi |
---|
533 | |
---|
534 | |
---|
535 | # SET HOST-SPECIFIC VARIABLES |
---|
536 | case $localhost_realname in |
---|
537 | (r1*|r2*|h01*|b01*) archive_system=tivoli;; |
---|
538 | (cs*) archive_system=ut;; |
---|
539 | esac |
---|
540 | |
---|
541 | |
---|
542 | # ??? THIS SHOULD BE DECRIBED IN THE MRUN DOCUMENTATION ??? |
---|
543 | # SET BASENAME OF THE INPUT-FILES TO THE GENERAL BASENAME (GIVEN BY OPTION -d), |
---|
544 | # IF IT HAS NOT BEEN SET BY THE USER DIFFERENTLY (USING OPTION -a) |
---|
545 | [[ "$afname" = "" ]] && afname=$fname |
---|
546 | |
---|
547 | |
---|
548 | # ADD RUN-FILE ACTIVATION STRINGS (GIVEN BY OPTION -r) TO THE |
---|
549 | # RESPECTIVE LISTS FOR ACTIVATING THE INPUT/OUTPUT FILE CONNECTION |
---|
550 | # STATEMENTS IN THE CONFIGURATION FILE |
---|
551 | if [[ "$run_mode" != "" ]] |
---|
552 | then |
---|
553 | input_list="$input_list $run_mode" |
---|
554 | output_list="$output_list $run_mode" |
---|
555 | fi |
---|
556 | |
---|
557 | |
---|
558 | # ??? is this (and the respective option -H) really required ??? |
---|
559 | # STORE HOSTNAME, FROM WHICH THE JOB IS STARTED, |
---|
560 | # BUT ONLY IF IT HASN'T BEEN ALREADY SET BY OPTION -H |
---|
561 | # (MRUN IS AUTOMATICALLY SETTING THIS OPTION IN THE MRUN-CALLS WITHIN |
---|
562 | # THOSE BATCH-JOBS, WHICH ARE CREATED BY MRUN ITSELF) |
---|
563 | if [[ "$fromhost" = "" ]] |
---|
564 | then |
---|
565 | fromhost=$localhost |
---|
566 | fi |
---|
567 | |
---|
568 | |
---|
569 | # CHECK, IF EXECUTION SHALL TO BE DONE ON THE REMOTE-MACHINE. |
---|
570 | # VALUE OF do_remote IS IMPORTANT FOR THE FILE CONNECTIONS. |
---|
571 | # IN CASE OF EXECUTION ON A REMOTE-MACHINE, A BATCH-JOB HAS |
---|
572 | # TO BE SUBMITTED (I.E. do_bacth=true) |
---|
573 | if [[ -n $host && "$host" != $localhost ]] |
---|
574 | then |
---|
575 | do_batch=true |
---|
576 | do_remote=true |
---|
577 | case $host in |
---|
578 | (ibm|ibmh|ibmkisti|ibmku|ibms|nech|lccrayb|lccrayh|lccrayf|lcflow|lckyoto|unics|lcxe6|lcxt5m|lck|lckiaps|lckordi|lckyuh|lckyut|lcsb) true;; |
---|
579 | (*) printf "\n" |
---|
580 | printf "\n +++ sorry: execution of batch jobs on remote host \"$host\"" |
---|
581 | printf "\n is not available" |
---|
582 | locat=nqs; (( iec = 0 )); exit;; |
---|
583 | esac |
---|
584 | else |
---|
585 | host=$localhost |
---|
586 | fi |
---|
587 | |
---|
588 | |
---|
589 | # EVALUATE ADDITIONAL CONDITIONS GIVEN BY OPTION -K |
---|
590 | if [[ -n $additional_conditions ]] |
---|
591 | then |
---|
592 | cond1=`echo $additional_conditions | cut -d" " -f1` |
---|
593 | cond2=`echo $additional_conditions | cut -d" " -s -f2` |
---|
594 | dummy=`echo $additional_conditions | cut -d" " -s -f3` |
---|
595 | if [[ -n $dummy ]] |
---|
596 | then |
---|
597 | printf "\n +++ more than 2 additional conditions given for Option \"-K\"" |
---|
598 | locat=options; exit |
---|
599 | fi |
---|
600 | block=_$cond1 |
---|
601 | [[ -n $cond2 ]] && block=${block}_$cond2 |
---|
602 | fi |
---|
603 | |
---|
604 | |
---|
605 | # EVALUATE MODEL COUPLING FEATURES (OPTION -Y) AND DETERMINE coupled_mode |
---|
606 | if [[ $run_coupled_model = true ]] |
---|
607 | then |
---|
608 | |
---|
609 | numprocs_atmos=`echo $coupled_dist | cut -d" " -s -f1` |
---|
610 | numprocs_ocean=`echo $coupled_dist | cut -d" " -s -f2` |
---|
611 | |
---|
612 | if (( $numprocs_ocean + $numprocs_atmos != $numprocs )) |
---|
613 | then |
---|
614 | |
---|
615 | printf "\n +++ number of processors does not fit to specification by \"-Y\"." |
---|
616 | printf "\n PEs (total) : $numprocs" |
---|
617 | printf "\n PEs (atmosphere): $numprocs_atmos" |
---|
618 | printf "\n PEs (ocean) : $numprocs_ocean" |
---|
619 | locat=coupling; exit |
---|
620 | |
---|
621 | fi |
---|
622 | |
---|
623 | |
---|
624 | # GET coupled_mode FROM THE CONFIG FILE |
---|
625 | line="" |
---|
626 | grep "%cpp_options.*-D__mpi2.*$host" $config_file > tmp_mrun |
---|
627 | while read line |
---|
628 | do |
---|
629 | if [[ "$line" != "" && $(echo $line | cut -c1) != "#" && $(echo $line | cut -d" " -s -f4) = $cond1 && $(echo $line | cut -d" " -s -f4) = $cond2 ]] |
---|
630 | then |
---|
631 | coupled_mode="mpi2" |
---|
632 | fi |
---|
633 | done < tmp_mrun |
---|
634 | |
---|
635 | fi |
---|
636 | |
---|
637 | |
---|
638 | # CHECK, IF FILE-ARCHIVING HAS FAILED IN PREVIOUS JOB (OF A JOB-CHAIN) |
---|
639 | if [[ -f ~/job_queue/ARCHIVE_ERROR_$fname ]] |
---|
640 | then |
---|
641 | if [[ $ignore_archive_error = false ]] |
---|
642 | then |
---|
643 | printf "\n +++ data archiving of previous run failed" |
---|
644 | printf "\n see directory \~/job_queue on remote machine" |
---|
645 | locat=archive; exit |
---|
646 | else |
---|
647 | printf "\n +++ warning: data archiving in a previous run failed" |
---|
648 | printf "\n MRUN continues, trying to get backup copy" |
---|
649 | fi |
---|
650 | fi |
---|
651 | |
---|
652 | |
---|
653 | # SAVE VALUES OF MRUN-OPTIONS SICHERN IN ORDER TO OVERWRITE |
---|
654 | # THOSE VALUES GIVEN IN THE CONFIGURATION-FILE |
---|
655 | mrun_memory=$memory |
---|
656 | mrun_group_number=$group_number |
---|
657 | mrun_cpumax=$cpumax |
---|
658 | mrun_numprocs=$numprocs |
---|
659 | |
---|
660 | |
---|
661 | # READ AND EVALUATE THE CONFIGURATION-FILE FROM WITHIN THIS SHELLSCRIPT |
---|
662 | # (OPTION -S). THE DEFAULT IS USING THE ROUTINE interpret_config |
---|
663 | if [[ "$read_from_config" = false ]] |
---|
664 | then |
---|
665 | |
---|
666 | [[ $silent = false ]] && printf "\n Reading the configuration file... " |
---|
667 | |
---|
668 | # READ THE CONFIGURATION FILE LINE BY LINE |
---|
669 | while read zeile |
---|
670 | do |
---|
671 | [[ $silent = false ]] && printf "." |
---|
672 | |
---|
673 | |
---|
674 | # FIRST REPLACE ENVIRONMENT-VARIABLES BY THEIR RESPECTIVE VALUES |
---|
675 | eval zeile=\"$zeile\" |
---|
676 | |
---|
677 | |
---|
678 | # INTERPRET THE LINE |
---|
679 | if [[ "$(echo $zeile)" = "" ]] |
---|
680 | then |
---|
681 | # EMPTY LINE, NO ACTION |
---|
682 | continue |
---|
683 | |
---|
684 | elif [[ "$(echo $zeile | cut -c1)" = "#" ]] |
---|
685 | then |
---|
686 | |
---|
687 | # LINE IS A COMMENT LINE |
---|
688 | true |
---|
689 | |
---|
690 | elif [[ "$(echo $zeile | cut -c1)" = "%" ]] |
---|
691 | then |
---|
692 | |
---|
693 | # LINE DEFINES AN ENVIRONMENT-VARIABLE |
---|
694 | zeile=$(echo $zeile | cut -c2-) |
---|
695 | var=`echo $zeile | cut -d" " -f1` |
---|
696 | value=`echo $zeile | cut -d" " -s -f2` |
---|
697 | for_host=`echo $zeile | cut -d" " -s -f3` |
---|
698 | for_cond1=`echo $zeile | cut -d" " -s -f4` |
---|
699 | for_cond2=`echo $zeile | cut -d" " -s -f5` |
---|
700 | |
---|
701 | if [[ "$for_host" = "" || ( "$for_host" = $host && "$for_cond1" = "$cond1" && "$for_cond2" = "$cond2" ) || $(echo "$input_list$output_list"|grep -c "$for_host") != 0 ]] |
---|
702 | then |
---|
703 | |
---|
704 | # REPLACE ":" BY " " IN COMPILER- CPP- OR LINKER-OPTIONS, |
---|
705 | # "::" IS REPLACED BY ":". |
---|
706 | value=`echo $value | sed 's/::/%DUM%/g' | sed 's/:/ /g' | sed 's/%DUM%/:/g'` |
---|
707 | |
---|
708 | |
---|
709 | # VALUE FROM THE CONFIGURATION-FILE IS ASSIGNED TO THE |
---|
710 | # ENVIRONMENT-VARIABLE, BUT ONLY IF NO VALUE HAS BEEN ALREADY |
---|
711 | # ASSIGNED WITHIN THIS SCRIPT (E.G. BY SCRIPT-OPTIONS). |
---|
712 | # NON-ASSIGNED VARIABLES HAVE VALUE "" OR 0 (IN CASE OF INTEGER). |
---|
713 | # HENCE THE GENERAL RULE IS: SCRIPT-OPTION OVERWRITES THE |
---|
714 | # CONFIGURATION-FILE. |
---|
715 | if [[ "$(eval echo \$$var)" = "" || "$(eval echo \$$var)" = "0" ]] |
---|
716 | then |
---|
717 | eval $var=\$value |
---|
718 | |
---|
719 | # TERMINAL OUTPUT OF ENVIRONMENT-VARIABLES, IF TRACEBACK IS SWITCHED on |
---|
720 | if [[ $do_trace = true ]] |
---|
721 | then |
---|
722 | printf "\n*** ENVIRONMENT-VARIABLE $var = $value" |
---|
723 | fi |
---|
724 | fi |
---|
725 | |
---|
726 | # IF AN ENVIRONMENT-VARIABLE DETERMINES THE HOST, THEN EVALUATE IT IMMEDIATELY: |
---|
727 | # VALUE OF do-remote IS REQUIRED FOR THE FILE CONNECTIONS (COPY OF I/O FILES). |
---|
728 | # IF EXECUTION IS SCHEDULED FOR A REMOTE-MASCHINE, A BATCH-JOB |
---|
729 | # MUST HAVE TO BE STARTED |
---|
730 | if [[ $var = host ]] |
---|
731 | then |
---|
732 | if [[ -n $host && "$host" != $localhost ]] |
---|
733 | then |
---|
734 | do_batch=true |
---|
735 | do_remote=true |
---|
736 | case $host in |
---|
737 | (ibm|ibmh|ibmkisti|ibmku|ibms|lccrayb|lccrayh|lccrayf|lcflow|lckyoto|nech|unics|lcxe6|lcxt5m|lck|lckiaps|lckordi|lckyuh|lckyut|lcsb) true;; |
---|
738 | (*) printf "\n +++ sorry: execution of batch jobs on remote host \"$host\"" |
---|
739 | printf "\n is not available" |
---|
740 | locat=nqs; exit;; |
---|
741 | esac |
---|
742 | else |
---|
743 | host=$localhost |
---|
744 | fi |
---|
745 | fi |
---|
746 | |
---|
747 | # USER-DEFINED ENVIRONMENT VARIABLES MUST BE EXPORTED, |
---|
748 | # BECAUSE THEY MAY BE REQUIRED IN OTHER SCRIPTS CALLED |
---|
749 | # BY MRUN (E.G. subjob) |
---|
750 | export $var |
---|
751 | fi |
---|
752 | |
---|
753 | |
---|
754 | |
---|
755 | |
---|
756 | elif [[ "$(echo $zeile | cut -c1-3)" = "EC:" ]] |
---|
757 | then |
---|
758 | |
---|
759 | # LINE DEFINES ERROR-COMMAND |
---|
760 | (( iec = iec + 1 )) |
---|
761 | zeile=$(echo $zeile | cut -c4-) |
---|
762 | err_command[$iec]="$zeile" |
---|
763 | |
---|
764 | elif [[ "$(echo $zeile | cut -c1-3)" = "IC:" ]] |
---|
765 | then |
---|
766 | |
---|
767 | # LINE DEFINES INPUT-COMMAND |
---|
768 | (( iic = iic + 1 )) |
---|
769 | zeile=$(echo $zeile | cut -c4-) |
---|
770 | in_command[$iic]="$zeile" |
---|
771 | |
---|
772 | elif [[ "$(echo $zeile | cut -c1-3)" = "OC:" ]] |
---|
773 | then |
---|
774 | |
---|
775 | # LINE DEFINES OUTPUT-COMMAND |
---|
776 | (( ioc = ioc + 1 )) |
---|
777 | zeile=$(echo $zeile | cut -c4-) |
---|
778 | out_command[$ioc]="$zeile" |
---|
779 | |
---|
780 | else |
---|
781 | |
---|
782 | # LINE DEFINES FILE CONNECTION. READ THE FILE ATTRIBUTES. |
---|
783 | # s2a: in/out - field |
---|
784 | # s2b: loc - field (optional) |
---|
785 | # s2c: tr/ar - field (optional) |
---|
786 | s1=`echo $zeile | cut -d" " -f1` |
---|
787 | s2=`echo $zeile | cut -d" " -s -f2` |
---|
788 | s2a=$(echo $s2 | cut -d":" -f1) |
---|
789 | if [[ $(echo $s2 | grep -c ":") = 0 ]] |
---|
790 | then |
---|
791 | s2b="" |
---|
792 | s2c="" |
---|
793 | else |
---|
794 | s2b=`echo $s2 | cut -d":" -f2 | sed 's/:/ /g'` |
---|
795 | s2c=`echo $s2 | cut -d":" -s -f3 | sed 's/:/ /g'` |
---|
796 | fi |
---|
797 | s3=`echo $zeile | cut -d" " -f3` |
---|
798 | s4=`echo $zeile | cut -d" " -s -f4` |
---|
799 | s5=`echo $zeile | cut -d" " -s -f5` |
---|
800 | s6=`echo $zeile | cut -d" " -s -f6` |
---|
801 | |
---|
802 | |
---|
803 | # STORE FILE CONNECTION, IF ACTIVATED BY ACTIVATION-STRING FROM |
---|
804 | # INPUT- OR OUTPUT-LIST. |
---|
805 | # VARIABLE S3 MAY CONTAIN A LIST OF ACTIVATION STRINGS (FIELD-SEPERATOR ":"). |
---|
806 | # IF EXECUTION IS SCHEDULED FOR A REMOTE-MACHINE AND THE FILE IS ONLY |
---|
807 | # LOCALLY REQUIRED ON THAT MACHINE (I.E. s2b = loc), THE FILE CONNECTION |
---|
808 | # IS NOT CHECKED AND STORED. |
---|
809 | IFSALT="$IFS"; IFS="$IFS:" |
---|
810 | if [[ "$s2a" = in && ! ( $do_remote = true && ( "$s2b" = loc || "$s2b" = locopt ) ) ]] |
---|
811 | then |
---|
812 | found=false |
---|
813 | for actual in $input_list |
---|
814 | do |
---|
815 | for formal in $s3 |
---|
816 | do |
---|
817 | [[ $actual = $formal || "$formal" = "-" ]] && found=true |
---|
818 | done |
---|
819 | done |
---|
820 | if [[ $found = true ]] |
---|
821 | then |
---|
822 | (( iin = iin + 1 )) |
---|
823 | localin[$iin]=$s1; transin[$iin]=$s2b; actionin[$iin]=$s2c; |
---|
824 | typein[$iin]=$s3; pathin[$iin]=$s4; endin[$iin]=$s5; |
---|
825 | extin[$iin]=$s6 |
---|
826 | fi |
---|
827 | elif [[ "$s2a" = out && ! ( $do_remote = true && "$s2b" = loc ) ]] |
---|
828 | then |
---|
829 | found=false |
---|
830 | for actual in $output_list |
---|
831 | do |
---|
832 | for formal in $s3 |
---|
833 | do |
---|
834 | [[ $actual = $formal || "$formal" = "-" ]] && found=true |
---|
835 | done |
---|
836 | done |
---|
837 | if [[ $found = true ]] |
---|
838 | then |
---|
839 | (( iout = iout + 1 )) |
---|
840 | localout[$iout]=$s1; actionout[$iout]=$s2c; typeout[$iout]=$s3; |
---|
841 | pathout[$iout]=$s4; endout[$iout]=$s5; extout[$iout]=$s6 |
---|
842 | fi |
---|
843 | elif [[ "$s2a" != in && "$s2a" != out ]] |
---|
844 | then |
---|
845 | printf "\n +++ I/O-attribute in configuration file $config_file has the invalid" |
---|
846 | printf "\n value \"$s2\". Only \"in\" and \"out\" are allowed!" |
---|
847 | locat=connect; exit |
---|
848 | fi |
---|
849 | IFS="$IFSALT" |
---|
850 | fi |
---|
851 | done < $config_file |
---|
852 | |
---|
853 | else |
---|
854 | |
---|
855 | |
---|
856 | # EVALUATE THE CONFIGURATION-FILE BY FORTRAN-PROGRAM |
---|
857 | [[ $silent = false ]] && printf "..." |
---|
858 | interpreted_config_file=.icf.$RANDOM |
---|
859 | |
---|
860 | |
---|
861 | |
---|
862 | # PROVIDE VALUES OF ENVIRONMENT-VARIABLE FOR interpret_config VIA NAMELIST-FILE |
---|
863 | cat > .mrun_environment << %%END%% |
---|
864 | &mrun_environment cond1 = '$cond1', cond2 = '$cond2', |
---|
865 | config_file = '$config_file', do_remote = '$do_remote', |
---|
866 | do_trace = '$do_trace', host = '$host', |
---|
867 | input_list = '$input_list', icf = '$interpreted_config_file', |
---|
868 | localhost = '$localhost', output_list = '$output_list' / |
---|
869 | |
---|
870 | %%END%% |
---|
871 | |
---|
872 | if [[ "$host" != $localhost ]] |
---|
873 | then |
---|
874 | |
---|
875 | # REMOTE JOB FROM LOCAL HOST: JUST TAKE THE FIRST EXECUTABLE FOUND |
---|
876 | interpret_config_executable=`ls -1 ${PALM_BIN}/interpret_config*.x 2>/dev/null` |
---|
877 | if [[ $? != 0 ]] |
---|
878 | then |
---|
879 | printf "\n\n +++ no interpret_config found" |
---|
880 | printf "\n run \"mbuild -u -h ...\" to generate utilities for this host" |
---|
881 | locat=interpret_config; exit |
---|
882 | fi |
---|
883 | interpret_config_executable=`echo $interpret_config_executable | cut -d" " -f1` |
---|
884 | $interpret_config_executable |
---|
885 | |
---|
886 | else |
---|
887 | |
---|
888 | # CHECK, IF THERE IS AN EXECUTABLE FOR THE BLOCK |
---|
889 | if [[ ! -f ${PALM_BIN}/interpret_config${block}.x ]] |
---|
890 | then |
---|
891 | printf "\n\n +++ no interpret_config found for given block \"$cond1 $cond2\"" |
---|
892 | printf "\n run \"mbuild -u -h ...\" to generate utilities for this block" |
---|
893 | locat=interpret_config; exit |
---|
894 | else |
---|
895 | interpret_config${block}.x |
---|
896 | fi |
---|
897 | |
---|
898 | fi |
---|
899 | rm .mrun_environment |
---|
900 | |
---|
901 | |
---|
902 | # EXECUTE SHELL-COMMANDS GENERATED BY interpret_config WITHIN THIS SHELL |
---|
903 | chmod u+x $interpreted_config_file |
---|
904 | export PATH=$PATH:. |
---|
905 | . $interpreted_config_file |
---|
906 | rm $interpreted_config_file |
---|
907 | |
---|
908 | fi |
---|
909 | |
---|
910 | |
---|
911 | # VALUES OF MRUN-OPTIONS OVERWRITE THOSE FROM THE CONFIGURATION-FILE |
---|
912 | [[ $mrun_memory != 0 ]] && memory=$mrun_memory |
---|
913 | [[ "$mrun_group_number" != "none" ]] && group_number=$mrun_group_number |
---|
914 | [[ $mrun_cpumax != 0 ]] && cpumax=$mrun_cpumax |
---|
915 | [[ "$mrun_numprocs" != "" ]] && numprocs=$mrun_numprocs |
---|
916 | [[ "$max_par_io_str" != "" ]] && maximum_parallel_io_streams=$max_par_io_str |
---|
917 | [[ "$mrun_tasks_per_node" != "" ]] && tasks_per_node=$mrun_tasks_per_node |
---|
918 | |
---|
919 | |
---|
920 | # ON THE LOCAL MACHINE, DETERMINE (FROM THE CONFIGURATION-FILE) THE PATH |
---|
921 | # FOR SOURCE-FILES TO BE COMPILED. |
---|
922 | # IN A BATCH-JOB, SOURCES (ROUTINES TO BE COMPILED) ARE COMPLETE ALREADY. |
---|
923 | # BEFORE MRUN IS CALLED IN THE JOB, SOURCES_COMPLETE = true IS ASSIGNED (SEE FURTHER BELOW). |
---|
924 | if [[ "$SOURCES_COMPLETE" = "" ]] |
---|
925 | then |
---|
926 | |
---|
927 | # FIRST CHECK, IF A GLOBAL SOURCE PATH (TO BE USED FOR ALL HOSTS) |
---|
928 | # HAS BEEN DEFINED |
---|
929 | source_path="" |
---|
930 | line="" |
---|
931 | grep "%source_path" $config_file > tmp_mrun |
---|
932 | while read line |
---|
933 | do |
---|
934 | if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] |
---|
935 | then |
---|
936 | if [[ "$(echo $line | cut -d" " -f3)" = "" ]] |
---|
937 | then |
---|
938 | global_source_path=`echo $line | cut -d" " -f2` |
---|
939 | fi |
---|
940 | fi |
---|
941 | done < tmp_mrun |
---|
942 | |
---|
943 | line="" |
---|
944 | found=false |
---|
945 | grep " $localhost" $config_file | grep "%source_path" > tmp_mrun |
---|
946 | while read line |
---|
947 | do |
---|
948 | if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] |
---|
949 | then |
---|
950 | if [[ $found = true ]] |
---|
951 | then |
---|
952 | printf "\n\n +++ more than one source path found in configuration file" |
---|
953 | printf "\n for local host \"$localhost\" " |
---|
954 | locat=source_path; exit |
---|
955 | fi |
---|
956 | source_path=`echo $line | cut -d" " -f2` |
---|
957 | found=true |
---|
958 | fi |
---|
959 | done < tmp_mrun |
---|
960 | rm tmp_mrun |
---|
961 | |
---|
962 | if [[ "$source_path" = "" ]] |
---|
963 | then |
---|
964 | if [[ "$global_source_path" != "" ]] |
---|
965 | then |
---|
966 | source_path=$global_source_path |
---|
967 | else |
---|
968 | printf "\n\n +++ no source path found in configuration file" |
---|
969 | printf "\n for local host \"$localhost\" " |
---|
970 | locat=source_path; exit |
---|
971 | fi |
---|
972 | fi |
---|
973 | eval source_path=$source_path |
---|
974 | |
---|
975 | if [[ ! -d $source_path ]] |
---|
976 | then |
---|
977 | printf "\n\n +++ source path \"$source_path\" on local host" |
---|
978 | printf "\n \"$localhost\" does not exist" |
---|
979 | locat=source_path; exit |
---|
980 | fi |
---|
981 | |
---|
982 | fi |
---|
983 | |
---|
984 | |
---|
985 | # GET THE GLOBAL REVISION-NUMBER OF THE SVN-REPOSITORY |
---|
986 | # (HANDED OVER TO RESTART-RUNS USING OPTION -G) |
---|
987 | if [[ "$global_revision" = "" && $host != "ibmkisti" ]] |
---|
988 | then |
---|
989 | global_revision=`svnversion $source_path 2>/dev/null` |
---|
990 | global_revision="Rev: $global_revision" |
---|
991 | fi |
---|
992 | |
---|
993 | |
---|
994 | # ??? das darf doch eigentlich garnicht passieren, weil optionen config-datei uebersteuern ??? |
---|
995 | # CHECK AGAIN, IF EXECUTION SHALL BE DONE ON A REMOTE-HOST (BATCH-JOB). |
---|
996 | # (HOST MAY HAVE CHANGED DUE TO SETTINGS IN THE CONFIGURATION-FILE) |
---|
997 | if [[ -n $host && "$host" != $localhost ]] |
---|
998 | then |
---|
999 | do_batch=true |
---|
1000 | do_remote=true |
---|
1001 | case $host in |
---|
1002 | (ibm|ibmh|ibmkisti|ibmku|ibms|lccrayb|lccrayh|lccrayf|lcflow|lckyoto|nech|unics|lcxe6|lcxt5m|lck|lckiaps|lckordi|lckyuh|lckyut|lcsb) true;; |
---|
1003 | (*) printf "\n" |
---|
1004 | printf "\n +++ sorry: execution of batch jobs on remote host \"$host\"" |
---|
1005 | printf "\n is not available" |
---|
1006 | locat=nqs; (( iec = 0 )); exit;; |
---|
1007 | esac |
---|
1008 | else |
---|
1009 | host=$localhost |
---|
1010 | fi |
---|
1011 | |
---|
1012 | |
---|
1013 | # IN CASE OF PARALLEL EXECUTION, CHECK SOME SPECIFICATIONS CONCERNING PROCESSOR NUMBERS |
---|
1014 | if [[ "$cond1" = parallel || "$cond2" = parallel ]] |
---|
1015 | then |
---|
1016 | |
---|
1017 | # CHECK, IF NUMBER OF CORES TO BE USED HAS BEEN GIVEN |
---|
1018 | if [[ ! -n $numprocs ]] |
---|
1019 | then |
---|
1020 | printf "\n" |
---|
1021 | printf "\n +++ option \"-K parallel\" requires additional specification" |
---|
1022 | printf "\n of the number of processors to be used by" |
---|
1023 | printf "\n mrun-option \"-X\" or by environment-variable" |
---|
1024 | printf "\n \"numprocs\" in the configuration file" |
---|
1025 | locat=numprocs; (( iec = 0 )); exit |
---|
1026 | fi |
---|
1027 | |
---|
1028 | # CHECK, IF THE NUMBER OF CORES PER NODE HAS BEEN GIVEN UND IF IT IS AN |
---|
1029 | # INTEGRAL DIVISOR OF THE TOTAL NUMBER OF CORES GIVEN BY OPTION -X |
---|
1030 | if [[ "$tasks_per_node" = "" && $host != lcflow && $host != lcxt5m ]] |
---|
1031 | then |
---|
1032 | printf "\n" |
---|
1033 | printf "\n +++ option \"-T\" (tasks per node) is missing" |
---|
1034 | printf "\n set -T option or define tasks_per_node in the config file" |
---|
1035 | locat=tasks_per_node; (( iec = 0 )); exit |
---|
1036 | fi |
---|
1037 | |
---|
1038 | if (( numprocs < tasks_per_node )) |
---|
1039 | then |
---|
1040 | printf "\n" |
---|
1041 | printf "\n +++ tasks per node (-T) cannot exceed total number of processors (-X)" |
---|
1042 | printf "\n given values: -T $tasks_per_node -X $numprocs" |
---|
1043 | locat=tasks_per_node; (( iec = 0 )); exit |
---|
1044 | fi |
---|
1045 | |
---|
1046 | if [[ $host != lcflow && $host != lcxt5m ]] |
---|
1047 | then |
---|
1048 | (( nodes = numprocs / ( tasks_per_node * threads_per_task ) )) |
---|
1049 | (( ival = $tasks_per_node )) |
---|
1050 | (( pes = numprocs )) |
---|
1051 | (( ii = pes / ival )) |
---|
1052 | (( remaining_pes = pes - ii * ival )) |
---|
1053 | if (( remaining_pes > 0 )) |
---|
1054 | then |
---|
1055 | printf "\n" |
---|
1056 | printf "\n +++ WARNING: tasks per node (option \"-T\") is not an integral" |
---|
1057 | printf "\n divisor of the total number of processors (option \"-X\")" |
---|
1058 | printf "\n values of this mrun-call: \"-T $tasks_per_node\" \"-X $numprocs\"" |
---|
1059 | printf "\n One of the nodes is filled with $remaining_pes instead of $tasks_per_node tasks" |
---|
1060 | (( nodes = nodes + 1 )) |
---|
1061 | fi |
---|
1062 | fi |
---|
1063 | |
---|
1064 | |
---|
1065 | # SETTINGS FOR SUBJOB-COMMAND |
---|
1066 | OOPT="-O $threads_per_task" |
---|
1067 | |
---|
1068 | # SET THE TOTAL NUMBER OF NODES, REQUIRED FOR THE SUBJOB-COMMAND (SEE FURTHER BELOW) |
---|
1069 | if [[ "$tasks_per_node" != "" ]] |
---|
1070 | then |
---|
1071 | TOPT="-T $tasks_per_node" |
---|
1072 | fi |
---|
1073 | |
---|
1074 | # CHECK node_usage FOR ALLOWED VALUES AND SET DEFAULT VALUE, IF NECESSARY |
---|
1075 | if [[ $node_usage = default ]] |
---|
1076 | then |
---|
1077 | if [[ $host = ibms ]] |
---|
1078 | then |
---|
1079 | node_usage=shared |
---|
1080 | else |
---|
1081 | node_usage=not_shared |
---|
1082 | fi |
---|
1083 | fi |
---|
1084 | |
---|
1085 | if [[ $node_usage != shared && $node_usage != not_shared && $node_usage != singlejob && "$(echo $node_usage | cut -c1-3)" != "sla" ]] |
---|
1086 | then |
---|
1087 | printf "\n" |
---|
1088 | printf "\n +++ node usage (option \"-n\") is only allowed to be set" |
---|
1089 | printf "\n \"shared\" or \"not_shared\"" |
---|
1090 | locat=tasks_per_node; (( iec = 0 )); exit |
---|
1091 | fi |
---|
1092 | |
---|
1093 | fi |
---|
1094 | |
---|
1095 | # CHECK IF HOSTFILE EXISTS |
---|
1096 | if [[ -n $hostfile ]] |
---|
1097 | then |
---|
1098 | if [[ ! -f $hostfile ]] |
---|
1099 | then |
---|
1100 | printf "\n" |
---|
1101 | printf "\n +++ hostfile \"$hostfile\" does not exist" |
---|
1102 | locat=hostfile; exit |
---|
1103 | fi |
---|
1104 | fi |
---|
1105 | |
---|
1106 | |
---|
1107 | # SET DEFAULT VALUE FOR THE MAXIMUM NUMBER OF PARALLEL IO STREAMS |
---|
1108 | if [[ "$maximum_parallel_io_streams" = "" ]] |
---|
1109 | then |
---|
1110 | maximum_parallel_io_streams=$numprocs |
---|
1111 | fi |
---|
1112 | |
---|
1113 | |
---|
1114 | # SET PORT NUMBER OPTION FOR CALLS OF SSH/SCP, subjob AND batch_scp SCRIPTS |
---|
1115 | if [[ "$scp_port" != "" ]] |
---|
1116 | then |
---|
1117 | PORTOPT="-P $scp_port" |
---|
1118 | SSH_PORTOPT="-p $scp_port" |
---|
1119 | fi |
---|
1120 | |
---|
1121 | |
---|
1122 | # SET DEFAULT-QUEUE, IF NOT GIVEN |
---|
1123 | if [[ $queue = none ]] |
---|
1124 | then |
---|
1125 | case $host in |
---|
1126 | (ibmh) queue=cluster;; |
---|
1127 | (ibmkisti) queue=class.32plus;; |
---|
1128 | (lckiaps) queue=normal;; |
---|
1129 | (lckyoto) queue=ph;; |
---|
1130 | (lckyuh) queue=fx-single;; |
---|
1131 | (lckyut) queue=cx-single;; |
---|
1132 | (lctit) queue=S;; |
---|
1133 | (nech) queue=none;; |
---|
1134 | (unics) queue=unics;; |
---|
1135 | esac |
---|
1136 | fi |
---|
1137 | |
---|
1138 | |
---|
1139 | # GENERATE FULL FILENAMES OF INPUT-FILES, INCLUDING THEIR PATH |
---|
1140 | # CHECK, IF INPUT-FILES EXIST, AND DETERMINE HIGHEST CYCLE NUMBER (IF CYCLES EXIST) |
---|
1141 | (( i = 0 )) |
---|
1142 | while (( i < iin )) |
---|
1143 | do |
---|
1144 | (( i = i + 1 )) |
---|
1145 | (( maxcycle = 0 )) |
---|
1146 | |
---|
1147 | # GENERATE PATH AND FULL FILE NAME (then-BRANCH: FIXED FULL NAME IS GIVEN, I.E. THE |
---|
1148 | # FILE IDENTIFIER IS NOT PART OF THE FILENAME)) |
---|
1149 | if [[ "${actionin[$i]}" = di ]] |
---|
1150 | then |
---|
1151 | remotepathin[$i]=${pathin[$i]}/${endin[$i]} # EVALUATE REMOTE-PATH ON THE REMOTE |
---|
1152 | # HOST ONLY |
---|
1153 | eval filename=${pathin[$i]}/${endin[$i]} |
---|
1154 | else |
---|
1155 | remotepathin[$i]=${pathin[$i]}/${afname}${endin[$i]} # EVALUATE REMOTE-PATH ON THE REMOTE |
---|
1156 | # HOST ONLY |
---|
1157 | eval filename=${pathin[$i]}/${afname}${endin[$i]} |
---|
1158 | fi |
---|
1159 | eval pathname=${pathin[$i]} |
---|
1160 | |
---|
1161 | # SAVE INPUT FILE NAME FOR PARAMETER FILE CHECK |
---|
1162 | if [[ ("${transin[$i]}" = job) && (-f $filename) ]] |
---|
1163 | then |
---|
1164 | filename_input=$filename |
---|
1165 | fi |
---|
1166 | |
---|
1167 | # CHECK IF FILE EXISTS |
---|
1168 | if [[ $(ls $filename* 2>&1 | grep -c "not found") = 1 || \ |
---|
1169 | $(ls $filename* 2>&1 | grep -c "nicht gefunden") = 1 || \ |
---|
1170 | $(ls $filename* 2>&1 | grep -c "No such file") = 1 || \ |
---|
1171 | $(ls $filename* 2>&1 | grep -c "does not exist") = 1 ]] |
---|
1172 | then |
---|
1173 | |
---|
1174 | # FILES WITH ATTRIBUTE locopt ARE OPTIONAL. NO ABORT, IF THEY DO NOT EXIST. |
---|
1175 | if [[ "${transin[$i]}" != "locopt" ]] |
---|
1176 | then |
---|
1177 | printf "\n\n +++ INPUT-file: " |
---|
1178 | if [[ "${extin[$i]}" = "" ]] |
---|
1179 | then |
---|
1180 | printf "\n $filename" |
---|
1181 | else |
---|
1182 | printf "\n $filename.${extin[$i]}" |
---|
1183 | fi |
---|
1184 | printf "\n does not exist\n" |
---|
1185 | locat=input; exit |
---|
1186 | else |
---|
1187 | transin[$i]="unavailable" |
---|
1188 | fi |
---|
1189 | else |
---|
1190 | |
---|
1191 | # DETERMINE THE FILE'S CYCLE NUMBER |
---|
1192 | ls -1 -d $filename > filelist 2>/dev/null |
---|
1193 | ls -1 -d $filename.* >> filelist 2>/dev/null |
---|
1194 | while read zeile |
---|
1195 | do |
---|
1196 | cycle=$(echo $zeile | cut -f2 -d".") |
---|
1197 | if [[ "$cycle" = "$zeile" ]] |
---|
1198 | then |
---|
1199 | (( icycle = 0 )) |
---|
1200 | elif [[ "$cycle" = "${extin[$i]}" ]] |
---|
1201 | then |
---|
1202 | (( icycle = 0 )) |
---|
1203 | else |
---|
1204 | (( icycle = $cycle )) |
---|
1205 | fi |
---|
1206 | if (( icycle > maxcycle )) |
---|
1207 | then |
---|
1208 | (( maxcycle = icycle )) |
---|
1209 | file_to_be_used=$zeile |
---|
1210 | fi |
---|
1211 | done <filelist |
---|
1212 | rm filelist |
---|
1213 | |
---|
1214 | # APPEND CYCLE NUMBER TO FILENAME |
---|
1215 | if (( maxcycle > 0 )) |
---|
1216 | then |
---|
1217 | if [[ "${extin[$i]}" != " " && "${extin[$i]}" != "" ]] |
---|
1218 | then |
---|
1219 | filename=${filename}.$maxcycle.${extin[$i]} |
---|
1220 | else |
---|
1221 | filename=${filename}.$maxcycle |
---|
1222 | fi |
---|
1223 | else |
---|
1224 | if [[ "${extin[$i]}" != " " && "${extin[$i]}" != "" ]] |
---|
1225 | then |
---|
1226 | filename=${filename}.${extin[$i]} |
---|
1227 | fi |
---|
1228 | fi |
---|
1229 | |
---|
1230 | # STORE FILENAME WITHOUT PATH BUT WITH CYCLE NUMBER, |
---|
1231 | # BECAUSE IT MIGHT BE REQUIRED LATER TO RESTORE THE FILE FROM AN ARCHIVE-SYSTEM |
---|
1232 | absnamein[$i]=$filename |
---|
1233 | if (( maxcycle > 0 )) |
---|
1234 | then |
---|
1235 | if [[ "${actionin[$i]}" = di ]] |
---|
1236 | then |
---|
1237 | frelin[$i]=${endin[$i]}.$maxcycle |
---|
1238 | else |
---|
1239 | frelin[$i]=${afname}${endin[$i]}.$maxcycle |
---|
1240 | fi |
---|
1241 | else |
---|
1242 | if [[ "${actionin[$i]}" = di ]] |
---|
1243 | then |
---|
1244 | frelin[$i]=${endin[$i]} |
---|
1245 | else |
---|
1246 | frelin[$i]=${afname}${endin[$i]} |
---|
1247 | fi |
---|
1248 | fi |
---|
1249 | |
---|
1250 | fi |
---|
1251 | done |
---|
1252 | |
---|
1253 | # GENERATE FULL FILENAMES OF OUTPUT-FILES (WITHOUT $ OR ~), |
---|
1254 | # CHECK, IF OUTPUT-FILES EXIST, AND DETERMINE HIGHEST CYCLE NUMBER (IF CYCLES EXIST), |
---|
1255 | # OR, IN CASE THAT FILE DOES NOT EXIST, CHECK, IF IT CAN BE CREATED |
---|
1256 | # THESE ACTIONS ARE NOT CARRIED OUT, IF FILES SHALL BE TRASFERRED FROM THE REMOTE TO |
---|
1257 | # THE LOCAL HOST (BECAUSE THEIR IS NO DIRECT ACCESS TO THE LOCAL DIRECTORIES FROM THE |
---|
1258 | # REMOTE HOST) |
---|
1259 | (( i = 0 )) |
---|
1260 | while (( i < iout )) |
---|
1261 | do |
---|
1262 | (( i = i + 1 )) |
---|
1263 | if [[ ! ( $fromhost != $localhost && ( "${actionout[$i]}" = tr || "${actionout[$i]}" = tra || "${actionout[$i]}" = trpe ) ) ]] |
---|
1264 | then |
---|
1265 | if [[ "${actionout[$i]}" = tr ]] |
---|
1266 | then |
---|
1267 | actionout[$i]="" |
---|
1268 | elif [[ "${actionout[$i]}" = trpe ]] |
---|
1269 | then |
---|
1270 | actionout[$i]=pe |
---|
1271 | elif [[ "${actionout[$i]}" = tra ]] |
---|
1272 | then |
---|
1273 | actionout[$i]=a |
---|
1274 | fi |
---|
1275 | (( maxcycle = 0 )) |
---|
1276 | eval filename=${pathout[$i]}/${fname}${endout[$i]} |
---|
1277 | eval catalogname=${pathout[$i]} |
---|
1278 | if [[ $(ls $filename* 2>&1 | grep -c "not found") = 1 || \ |
---|
1279 | $(ls $filename* 2>&1 | grep -c "nicht gefunden") = 1 || \ |
---|
1280 | $(ls $filename* 2>&1 | grep -c "No such file") = 1 || \ |
---|
1281 | $(ls $filename* 2>&1 | grep -c "does not exist") = 1 ]] |
---|
1282 | then |
---|
1283 | |
---|
1284 | # IF OUTPUT-FILE DOES NOT EXIST CHECK, IF IT CAN BE CREATED |
---|
1285 | if cat /dev/null > $filename |
---|
1286 | then |
---|
1287 | rm $filename |
---|
1288 | else |
---|
1289 | |
---|
1290 | # CHECK, IF THE DIRECTORY WHERE FILE SHALL BE COPIED TO EXISTS |
---|
1291 | # IF IT DOES NOT EXIST, TRY TO CREATE IT |
---|
1292 | if [[ ! -d $catalogname ]] |
---|
1293 | then |
---|
1294 | if mkdir -p $catalogname |
---|
1295 | then |
---|
1296 | printf "\n\n *** directory:" |
---|
1297 | printf "\n $catalogname" |
---|
1298 | printf "\n was created\n" |
---|
1299 | else |
---|
1300 | printf "\n\n +++ OUTPUT-file:" |
---|
1301 | printf "\n $filename" |
---|
1302 | printf "\n cannot be created, because directory does not exist" |
---|
1303 | printf "\n and cannot be created either" |
---|
1304 | printf "\n" |
---|
1305 | locat=output ; exit |
---|
1306 | fi 2>/dev/null |
---|
1307 | else |
---|
1308 | printf "\n\n +++ OUTPUT-file:" |
---|
1309 | printf "\n $filename" |
---|
1310 | printf "\n cannot be created, although directory exists" |
---|
1311 | printf "\n" |
---|
1312 | locat=output ; exit |
---|
1313 | fi |
---|
1314 | fi 2>/dev/null |
---|
1315 | else |
---|
1316 | |
---|
1317 | # DETERMINE THE CYCLE NUMBER |
---|
1318 | ls -1 -d $filename > filelist 2>/dev/null |
---|
1319 | ls -1 -d $filename.* >> filelist 2>/dev/null |
---|
1320 | while read zeile |
---|
1321 | do |
---|
1322 | cycle=$(echo $zeile | cut -f2 -d".") |
---|
1323 | if [[ "$cycle" = "$zeile" || "$cycle" = ${extout[$i]} ]] |
---|
1324 | then |
---|
1325 | (( icycle = 1 )) |
---|
1326 | else |
---|
1327 | (( icycle = $cycle + 1 )) |
---|
1328 | fi |
---|
1329 | if (( icycle > maxcycle )) |
---|
1330 | then |
---|
1331 | (( maxcycle = icycle )) |
---|
1332 | fi |
---|
1333 | done <filelist |
---|
1334 | rm filelist |
---|
1335 | fi |
---|
1336 | |
---|
1337 | # APPEND CYCLE NUMBER TO FILENAME AND CHECK, IF FILE CAN BE CREATED |
---|
1338 | # IN CASE OF FILE-APPEND, FILE MUST BE APPENDED TO THE ONE WITH HIGHEST CYCLE NUMBER |
---|
1339 | if [[ "${actionout[$i]}" != a ]] |
---|
1340 | then |
---|
1341 | if (( maxcycle > 0 )) |
---|
1342 | then |
---|
1343 | filename=${filename}.$maxcycle |
---|
1344 | if cat /dev/null > $filename |
---|
1345 | then |
---|
1346 | rm $filename |
---|
1347 | else |
---|
1348 | printf "\n +++ OUTPUT-file:" |
---|
1349 | printf "\n $filename" |
---|
1350 | printf "\n cannot be created" |
---|
1351 | locat=output ; exit |
---|
1352 | fi |
---|
1353 | fi |
---|
1354 | else |
---|
1355 | (( maxcycle = maxcycle - 1 )) |
---|
1356 | if (( maxcycle > 0 )) |
---|
1357 | then |
---|
1358 | filename=${filename}.$maxcycle |
---|
1359 | fi |
---|
1360 | fi |
---|
1361 | |
---|
1362 | # STORE FILENAME WITHOUT PATH BUT WITH CYCLE NUMBER, |
---|
1363 | # BECAUSE IT MIGHT BE REQUIRED LATER TO STORE THE FILE ON AN ARCHIVE-SYSTEM |
---|
1364 | # OR TO PUT THIS FILENAME ON FILE OUTPUT_FILE_CONNECTIONS |
---|
1365 | pathout[$i]=$filename |
---|
1366 | if (( maxcycle > 0 )) |
---|
1367 | then |
---|
1368 | frelout[$i]=${fname}${endout[$i]}.$maxcycle |
---|
1369 | else |
---|
1370 | frelout[$i]=${fname}${endout[$i]} |
---|
1371 | fi |
---|
1372 | |
---|
1373 | fi |
---|
1374 | done |
---|
1375 | |
---|
1376 | |
---|
1377 | # THE DVR-PACKAGE REQUIRES ITS OWN LIBRARY |
---|
1378 | if [[ $(echo $package_list | grep -c dvrp_graphics) != 0 ]] |
---|
1379 | then |
---|
1380 | if [[ "$dvr_inc" = "" ]] |
---|
1381 | then |
---|
1382 | printf "\n\n +++ no value for \"dvr_inc\" given in configuration file" |
---|
1383 | printf "\n This is required for the dvrp_graphics package.\n" |
---|
1384 | locat=dvr; exit |
---|
1385 | fi |
---|
1386 | if [[ "$dvr_lib" = "" ]] |
---|
1387 | then |
---|
1388 | printf "\n\n +++ no value for \"dvr_lib\" given in configuration file" |
---|
1389 | printf "\n This is required for the dvrp_graphics package.\n" |
---|
1390 | locat=dvr; exit |
---|
1391 | fi |
---|
1392 | fi |
---|
1393 | |
---|
1394 | |
---|
1395 | # CHECK, WETHER A MAIN PROGRAM OR AN EXECUTABLE HAVE BEEN DECLARED. |
---|
1396 | # EXECUTABLES DO NOT NEED TO BE COMPILED. |
---|
1397 | if [[ "$mainprog" = "" && "$executable" = "" ]] |
---|
1398 | then |
---|
1399 | printf "\n +++ neither main program nor executable defined" |
---|
1400 | locat=source; exit |
---|
1401 | elif [[ "$mainprog" != "" && "$executable" != "" ]] |
---|
1402 | then |
---|
1403 | printf "\n +++ main program as well as executable defined" |
---|
1404 | locat=source; exit |
---|
1405 | elif [[ "$mainprog" = "" && "$executable" != "" ]] |
---|
1406 | then |
---|
1407 | do_compile=false |
---|
1408 | fi |
---|
1409 | |
---|
1410 | |
---|
1411 | # CREATE SOURCE-DIRECTORY TO COLLECT ROUTINES TO BE COMPILED. |
---|
1412 | # LATER THE MRUN-SCRIPT AND CONFIGURATION-FILE WILL ALSO BE COPIED TO THIS DIRECTORY. |
---|
1413 | if [[ $restart_run != true && "$SOURCES_COMPLETE" = "" ]] |
---|
1414 | then |
---|
1415 | rm -rf SOURCES_FOR_RUN_$fname |
---|
1416 | mkdir SOURCES_FOR_RUN_$fname |
---|
1417 | fi |
---|
1418 | |
---|
1419 | |
---|
1420 | # COLLECT ALL ROUTINES TO BE COMPILED |
---|
1421 | # THIS IS NOT REQUIRED WITHIN BATCH-JOBS, BECAUSE ROUTINES HAVE ALREADY BEEN COLLECTED |
---|
1422 | # BY THE MRUN-CALL WHICH CREATED THE BATCH-JOB. |
---|
1423 | if [[ $do_compile = true && "$SOURCES_COMPLETE" = "" ]] |
---|
1424 | then |
---|
1425 | |
---|
1426 | [[ "$source_list" = LM ]] && source_list=LOCALLY_MODIFIED |
---|
1427 | |
---|
1428 | if [[ "$source_list" = LOCALLY_MODIFIED ]] |
---|
1429 | then |
---|
1430 | |
---|
1431 | # DETERMINE MODIFIED FILES OF THE SVN WORKING COPY |
---|
1432 | source_list="" |
---|
1433 | cd $source_path |
---|
1434 | |
---|
1435 | |
---|
1436 | # CHECK, IF DIRECTORY IS UNDER SVN CONTROL |
---|
1437 | if [[ ! -d .svn ]] |
---|
1438 | then |
---|
1439 | printf "\n\n +++ source directory" |
---|
1440 | printf "\n \"$source_path\" " |
---|
1441 | printf "\n is not under control of \"subversion\"." |
---|
1442 | printf "\n Please do not use mrun-option \"-s LOCALLY_MODIFIED\"\n" |
---|
1443 | fi |
---|
1444 | |
---|
1445 | |
---|
1446 | # LIST ALL MODIFIED SOURCE CODE FILES |
---|
1447 | Filenames="" |
---|
1448 | svn status > tmp_mrun |
---|
1449 | while read line |
---|
1450 | do |
---|
1451 | firstc=`echo $line | cut -c1` |
---|
1452 | if [[ $firstc = M || $firstc = "?" ]] |
---|
1453 | then |
---|
1454 | Name=`echo "$line" | cut -c8-` |
---|
1455 | extension=`echo $Name | cut -d. -f2` |
---|
1456 | if [[ "$extension" = f90 || "$extension" = F90 || "$extension" = f || "$extension" = F || "$extension" = c ]] |
---|
1457 | then |
---|
1458 | Filenames="$Filenames "$Name |
---|
1459 | fi |
---|
1460 | fi |
---|
1461 | done < tmp_mrun |
---|
1462 | |
---|
1463 | |
---|
1464 | # COPY FILES TO SOURCES_FOR_RUN_... |
---|
1465 | for dateiname in $Filenames |
---|
1466 | do |
---|
1467 | cp $dateiname $working_directory/SOURCES_FOR_RUN_$fname |
---|
1468 | source_list=$source_list"$dateiname " |
---|
1469 | done |
---|
1470 | |
---|
1471 | cd - > /dev/null |
---|
1472 | |
---|
1473 | |
---|
1474 | # COPY FILES GIVEN BY OPTION -s TO DIRECTORY SOURCES_FOR_RUN_... |
---|
1475 | # AUTOMATIC RESTART RUNS JUST ACCESS THE DIRECTORY CREATED BY THE INITIAL RUN |
---|
1476 | elif [[ "$source_list" != "" && $restart_run != true ]] |
---|
1477 | then |
---|
1478 | |
---|
1479 | cd $source_path |
---|
1480 | |
---|
1481 | for filename in $source_list |
---|
1482 | do |
---|
1483 | |
---|
1484 | # SOURCE CODE FILE IS NOT ALLOWED TO INCLUDE PATH |
---|
1485 | if [[ $(echo $filename | grep -c "/") != 0 ]] |
---|
1486 | then |
---|
1487 | printf "\n +++ source code file: $filename" |
---|
1488 | printf "\n must not contain (\"/\") " |
---|
1489 | locat=source; exit |
---|
1490 | fi |
---|
1491 | |
---|
1492 | if [[ ! -f $filename ]] |
---|
1493 | then |
---|
1494 | printf "\n +++ source code file: $filename" |
---|
1495 | printf "\n does not exist" |
---|
1496 | locat=source; exit |
---|
1497 | else |
---|
1498 | cp $filename $working_directory/SOURCES_FOR_RUN_$fname |
---|
1499 | fi |
---|
1500 | |
---|
1501 | done |
---|
1502 | |
---|
1503 | cd - > /dev/null |
---|
1504 | |
---|
1505 | fi |
---|
1506 | |
---|
1507 | |
---|
1508 | # CHECK, IF A MAIN PROGRAM EXISTS AND IF IT IS PART OF THE LIST OF FILES |
---|
1509 | # TO BE COMPILED. IF NOT, ADD IT TO THE LIST. |
---|
1510 | if [[ $restart_run != true ]] |
---|
1511 | then |
---|
1512 | |
---|
1513 | if [[ ! -f "$source_path/$mainprog" ]] |
---|
1514 | then |
---|
1515 | printf "\n\n +++ main program: $mainprog" |
---|
1516 | printf "\n does not exist in source directory" |
---|
1517 | printf "\n \"$source_path\"\n" |
---|
1518 | locat=source; exit |
---|
1519 | else |
---|
1520 | if [[ $(echo $source_list | grep -c $mainprog) = 0 ]] |
---|
1521 | then |
---|
1522 | cp $source_path/$mainprog SOURCES_FOR_RUN_$fname |
---|
1523 | source_list=${mainprog}" $source_list" |
---|
1524 | fi |
---|
1525 | fi |
---|
1526 | fi |
---|
1527 | |
---|
1528 | |
---|
1529 | # CHECK, IF MAKEFILE EXISTS AND COPY IT TO THE SOURCES_FOR_RUN... DIRECTORY |
---|
1530 | # NOT REQUIRED FOR RESTART RUNS, SOURCES_FOR_RUN... HAS BEEN CREATED BY THE INITIAL RUN |
---|
1531 | if [[ "$restart_run" != true ]] |
---|
1532 | then |
---|
1533 | [[ "$makefile" = "" ]] && makefile=$source_path/Makefile |
---|
1534 | if [[ ! -f $makefile ]] |
---|
1535 | then |
---|
1536 | printf "\n +++ file \"$makefile\" does not exist" |
---|
1537 | locat=make; exit |
---|
1538 | else |
---|
1539 | cp $makefile SOURCES_FOR_RUN_$fname/Makefile |
---|
1540 | fi |
---|
1541 | fi |
---|
1542 | |
---|
1543 | |
---|
1544 | # COPY FILES FROM OPTIONAL SOURCE PATH GIVEN IN THE CONFIGURATION FILE |
---|
1545 | if [[ $restart_run != true && "$add_source_path" != "" ]] |
---|
1546 | then |
---|
1547 | |
---|
1548 | # DOES THE DIRECTORY EXIST? |
---|
1549 | if [[ ! -d $add_source_path ]] |
---|
1550 | then |
---|
1551 | printf "\n\n +++ WARNING: additional source code directory" |
---|
1552 | printf "\n \"$add_source_path\" " |
---|
1553 | printf "\n does not exist or is not a directory." |
---|
1554 | printf "\n No source code will be used from this directory!\n" |
---|
1555 | add_source_path="" |
---|
1556 | if [[ $silent == false ]] |
---|
1557 | then |
---|
1558 | sleep 3 |
---|
1559 | fi |
---|
1560 | else |
---|
1561 | |
---|
1562 | cd $add_source_path |
---|
1563 | found=false |
---|
1564 | |
---|
1565 | Names=$(ls -1 *.f90 2>&1) |
---|
1566 | [[ $(echo $Names | grep -c '*.f90') = 0 ]] && AddFilenames="$Names" |
---|
1567 | Names=$(ls -1 *.F90 2>&1) |
---|
1568 | [[ $(echo $Names | grep -c '*.F90') = 0 ]] && AddFilenames="$AddFilenames $Names" |
---|
1569 | Names=$(ls -1 *.F 2>&1) |
---|
1570 | [[ $(echo $Names | grep -c '*.F') = 0 ]] && AddFilenames="$AddFilenames $Names" |
---|
1571 | Names=$(ls -1 *.f 2>&1) |
---|
1572 | [[ $(echo $Names | grep -c '*.f') = 0 ]] && AddFilenames="$AddFilenames $Names" |
---|
1573 | Names=$(ls -1 *.c 2>&1) |
---|
1574 | [[ $(echo $Names | grep -c '*.c') = 0 ]] && AddFilenames="$AddFilenames $Names" |
---|
1575 | |
---|
1576 | cd - > /dev/null |
---|
1577 | cd SOURCES_FOR_RUN_$fname |
---|
1578 | |
---|
1579 | # COPY MAKEFILE IF EXISTING |
---|
1580 | if [[ -f $add_source_path/Makefile ]] |
---|
1581 | then |
---|
1582 | printf "\n\n *** user Makefile from directory" |
---|
1583 | printf "\n \"$add_source_path\" is used \n" |
---|
1584 | if [[ $silent == false ]] |
---|
1585 | then |
---|
1586 | sleep 1 |
---|
1587 | fi |
---|
1588 | cp $add_source_path/Makefile . |
---|
1589 | fi |
---|
1590 | |
---|
1591 | for dateiname in $AddFilenames |
---|
1592 | do |
---|
1593 | if [[ -f $dateiname ]] |
---|
1594 | then |
---|
1595 | printf "\n +++ source code file \"$dateiname\" found in additional" |
---|
1596 | printf "\n source code directory \"$add_source_path\" " |
---|
1597 | printf "\n but was also given with option \"-s\" which means that it should be taken" |
---|
1598 | printf "\n from directory \"$source_path\"." |
---|
1599 | locat=source; exit |
---|
1600 | fi |
---|
1601 | |
---|
1602 | cp $add_source_path/$dateiname . |
---|
1603 | source_list="$source_list $dateiname" |
---|
1604 | |
---|
1605 | # CHECK IF FILE IS CONTAINED IN MAKEFILE |
---|
1606 | if [[ $(grep -c $dateiname Makefile) = 0 ]] |
---|
1607 | then |
---|
1608 | printf "\n\n +++ user file \"$dateiname\" " |
---|
1609 | printf "\n is not listed in Makefile \n" |
---|
1610 | locat=source; exit |
---|
1611 | else |
---|
1612 | |
---|
1613 | if [[ $found = false ]] |
---|
1614 | then |
---|
1615 | found=true |
---|
1616 | printf "\n\n *** following user file(s) added to the" |
---|
1617 | printf " files to be translated:\n " |
---|
1618 | fi |
---|
1619 | printf "$dateiname " |
---|
1620 | if [[ $silent == false ]] |
---|
1621 | then |
---|
1622 | sleep 0.5 |
---|
1623 | fi |
---|
1624 | |
---|
1625 | fi |
---|
1626 | done |
---|
1627 | [[ $found = true ]] && printf "\n" |
---|
1628 | cd - > /dev/null |
---|
1629 | fi |
---|
1630 | fi |
---|
1631 | |
---|
1632 | |
---|
1633 | # ADD ALL ROUTINES BELONGING TO SOFTWARE PACKAGES (GIVEN BY OPTION -p) |
---|
1634 | # TO THE LIST OF FILES TO BE COMPILED |
---|
1635 | if [[ $restart_run != true && -n $package_list ]] |
---|
1636 | then |
---|
1637 | |
---|
1638 | cd $source_path |
---|
1639 | |
---|
1640 | for package in $package_list |
---|
1641 | do |
---|
1642 | |
---|
1643 | [[ $package = "dvrp_graphics+1PE" ]] && package=dvrp_graphics |
---|
1644 | |
---|
1645 | # DETERMINE FILES BELONGING TO THE PACKAGE |
---|
1646 | # ERROR MESSAGE ARE REDIRECTED TO /dev/null, BECAUSE WILDCARD (*) ALSO GIVES |
---|
1647 | # THE NAME OF THE DIRECTORY |
---|
1648 | package_source_list=`grep "defined( __$package " * 2>/dev/null | cut -f1 -d:` |
---|
1649 | |
---|
1650 | |
---|
1651 | # ADD THESE FILES TO THE LIST OF FILES TO BE COMPILED, |
---|
1652 | # IF THEY ARE NOT ALREADY PART OF THE LIST |
---|
1653 | for source_list_name in $package_source_list |
---|
1654 | do |
---|
1655 | if [[ $(echo $source_list | grep -c $source_list_name) = 0 ]] |
---|
1656 | then |
---|
1657 | |
---|
1658 | # ONLY TAKE FILES WITH VALID SUFFIX |
---|
1659 | ending=`echo $source_list_name | cut -f2 -d.` |
---|
1660 | if [[ "$ending" = f90 || "$ending" = F90 || "$ending" = f || "$ending" = F || "$ending" = c ]] |
---|
1661 | then |
---|
1662 | cp $source_list_name $working_directory/SOURCES_FOR_RUN_$fname |
---|
1663 | source_list="$source_list $source_list_name" |
---|
1664 | fi |
---|
1665 | fi |
---|
1666 | done |
---|
1667 | done |
---|
1668 | |
---|
1669 | cd - > /dev/null |
---|
1670 | fi |
---|
1671 | |
---|
1672 | fi # do_compile=true |
---|
1673 | |
---|
1674 | |
---|
1675 | # IF SOURCE CODE IS TO BE COMPILED, DO SOME MORE CHECKS |
---|
1676 | # AND SET PRE-PROCESSOR DIRECTIVES |
---|
1677 | if [[ $do_compile = true || $create_executable_for_batch = true ]] |
---|
1678 | then |
---|
1679 | |
---|
1680 | # SET PREPROCESSOR-DIRECTIVES TO SELECT OPERATING SYSTEM SPECIFIC CODE |
---|
1681 | if [[ $(echo $localhost | cut -c1-3) = ibm ]] |
---|
1682 | then |
---|
1683 | cpp_options="${cpp_options},-D__ibm=__ibm" |
---|
1684 | elif [[ $(echo $localhost | cut -c1-3) = nec ]] |
---|
1685 | then |
---|
1686 | cpp_options="$cpp_options -D__nec" |
---|
1687 | elif [[ $(echo $localhost | cut -c1-2) = lc ]] |
---|
1688 | then |
---|
1689 | cpp_options="$cpp_options -D__lc" |
---|
1690 | else |
---|
1691 | cpp_options="$cpp_options -D__$localhost" |
---|
1692 | fi |
---|
1693 | |
---|
1694 | # SET DIRECTIVES GIVEN BY OPTION -K (E.G. parallel) |
---|
1695 | if [[ $(echo $localhost | cut -c1-3) = ibm ]] |
---|
1696 | then |
---|
1697 | [[ -n $cond1 ]] && cpp_options="${cpp_options},-D__$cond1=__$cond1" |
---|
1698 | [[ -n $cond2 ]] && cpp_options="${cpp_options},-D__$cond2=__$cond2" |
---|
1699 | else |
---|
1700 | [[ -n $cond1 ]] && cpp_options="$cpp_options -D__$cond1" |
---|
1701 | [[ -n $cond2 ]] && cpp_options="$cpp_options -D__$cond2" |
---|
1702 | fi |
---|
1703 | |
---|
1704 | # SET DIRECTIVES FOR ACTIVATING SOFTWARE-PACKAGES (OPTION -p) |
---|
1705 | if [[ -n $package_list ]] |
---|
1706 | then |
---|
1707 | for package in $package_list |
---|
1708 | do |
---|
1709 | if [[ $(echo $localhost | cut -c1-3) = ibm ]] |
---|
1710 | then |
---|
1711 | if [[ $package != "dvrp_graphics+1PE" ]] |
---|
1712 | then |
---|
1713 | cpp_options="${cpp_options},-D__$package=__$package" |
---|
1714 | else |
---|
1715 | cpp_options="${cpp_options},-D__dvrp_graphics=__dvrp_graphics" |
---|
1716 | export use_seperate_pe_for_dvrp_output=true |
---|
1717 | fi |
---|
1718 | else |
---|
1719 | if [[ $package != "dvrp_graphics+1PE" ]] |
---|
1720 | then |
---|
1721 | cpp_options="$cpp_options -D__$package" |
---|
1722 | else |
---|
1723 | cpp_options="$cpp_options -D__dvrp_graphics" |
---|
1724 | export use_seperate_pe_for_dvrp_output=true |
---|
1725 | fi |
---|
1726 | fi |
---|
1727 | done |
---|
1728 | fi |
---|
1729 | |
---|
1730 | # SET DIRECTIVES GIVEN BY OPTION -D |
---|
1731 | if [[ -n $cpp_opts ]] |
---|
1732 | then |
---|
1733 | for popts in $cpp_opts |
---|
1734 | do |
---|
1735 | if [[ $(echo $localhost | cut -c1-3) = ibm ]] |
---|
1736 | then |
---|
1737 | cpp_options="${cpp_options},-D__$popts=__$popts" |
---|
1738 | else |
---|
1739 | cpp_options="$cpp_options -D__$popts" |
---|
1740 | fi |
---|
1741 | done |
---|
1742 | fi |
---|
1743 | |
---|
1744 | else |
---|
1745 | |
---|
1746 | |
---|
1747 | # FOR LOCAL RUNS CHECK AGAIN, IF EXECUTABLE EXISTS |
---|
1748 | if [[ $do_remote = false ]] |
---|
1749 | then |
---|
1750 | if [[ ! -f $executable ]] |
---|
1751 | then |
---|
1752 | printf "\n +++ executable file: $executable" |
---|
1753 | printf "\n does not exist" |
---|
1754 | locat=executable; exit |
---|
1755 | fi |
---|
1756 | fi |
---|
1757 | fi |
---|
1758 | |
---|
1759 | |
---|
1760 | # DETERMINE THE JOB MODE |
---|
1761 | if [[ "$ENVIRONMENT" = BATCH ]] |
---|
1762 | then |
---|
1763 | batch_job=.TRUE. |
---|
1764 | jobmo=BATCH |
---|
1765 | else |
---|
1766 | batch_job=.FALSE. |
---|
1767 | jobmo=INTERACTIVE |
---|
1768 | fi |
---|
1769 | |
---|
1770 | |
---|
1771 | # NO INTERACTIVE RUNS ALLOWED ON LCTIT |
---|
1772 | if [[ $host = lctit && $jobmo = INTERACTIVE && $do_batch = false ]] |
---|
1773 | then |
---|
1774 | printf "\n +++ no interactive runs allowed on host \"$host\" " |
---|
1775 | printf "\n please submit batch job using mrun option \"-b\" \n" |
---|
1776 | locat=normal; exit |
---|
1777 | fi |
---|
1778 | |
---|
1779 | |
---|
1780 | # CHECK, IF USER DEFINED A COMPILER |
---|
1781 | if [[ "$compiler_name" = "" ]] |
---|
1782 | then |
---|
1783 | |
---|
1784 | printf "\n +++ no compiler specified for \"$host $cond1 $cond2\"" |
---|
1785 | locat=compiler_name; exit |
---|
1786 | |
---|
1787 | fi |
---|
1788 | |
---|
1789 | |
---|
1790 | # DETERMINE THE NAME OF MRUN'S TEMPORARY WORKING DIRECTORY |
---|
1791 | kennung=$RANDOM |
---|
1792 | if [[ "$tmp_user_catalog" = "" ]] |
---|
1793 | then |
---|
1794 | if [[ $localhost = ibmh ]] |
---|
1795 | then |
---|
1796 | tmp_user_catalog=$SCRATCH |
---|
1797 | elif [[ $localhost = nech ]] |
---|
1798 | then |
---|
1799 | tmp_user_catalog=$WRKSHR |
---|
1800 | else |
---|
1801 | tmp_user_catalog=/tmp |
---|
1802 | fi |
---|
1803 | fi |
---|
1804 | TEMPDIR=$tmp_user_catalog/${usern}.$kennung |
---|
1805 | |
---|
1806 | |
---|
1807 | # DETERMINE THE NAME OF THE DIRECTORY WHICH IS USED TO TEMPORARILY STORE DATA FOR RESTART RUNS |
---|
1808 | if [[ "$tmp_data_catalog" = "" ]] |
---|
1809 | then |
---|
1810 | if [[ $localhost = nech ]] |
---|
1811 | then |
---|
1812 | tmp_data_catalog=$WRKSHR/mrun_restart_data |
---|
1813 | else |
---|
1814 | tmp_data_catalog=/tmp/mrun_restart_data |
---|
1815 | fi |
---|
1816 | fi |
---|
1817 | |
---|
1818 | |
---|
1819 | # IN CASE OF LOCAL RUNS REPLACE ENVIRONMENT VARIABLES BY THEIR VALUES |
---|
1820 | if [[ $do_remote = false && $do_compile = true || $create_executable_for_batch = true ]] |
---|
1821 | then |
---|
1822 | eval fopts=\"$fopts\" |
---|
1823 | eval lopts=\"$lopts\" |
---|
1824 | fi |
---|
1825 | |
---|
1826 | |
---|
1827 | |
---|
1828 | # DETERMINE COMPILE- AND LINK-OPTIONS |
---|
1829 | fopts="$fopts $netcdf_inc $fftw_inc $dvr_inc" |
---|
1830 | lopts="$lopts $netcdf_lib $fftw_lib $dvr_lib" |
---|
1831 | ROPTS="$ropts" |
---|
1832 | # if [[ ( $(echo $host | cut -c1-3) = nec || $(echo $host | cut -c1-3) = ibm || $host = lckyoto || $host = lctit || $host = lcflow || $host = lcxe6 || $host = lcxt5m || $host = lck || $host = lckiaps || $host = lckordi || $host = lcsb || $host ) && -n $numprocs ]] |
---|
1833 | # then |
---|
1834 | XOPT="-X $numprocs" |
---|
1835 | # fi |
---|
1836 | |
---|
1837 | |
---|
1838 | |
---|
1839 | # CHECK THE CPU-LIMIT. IT MUST BE GIVEN FOR BATCH-JOBS AND IS COMMUNICATED TO THE |
---|
1840 | # EXECUTABLE VIA NAMELIST-PARAMETER cputime |
---|
1841 | done=false |
---|
1842 | while [[ $done = false ]] |
---|
1843 | do |
---|
1844 | cputime=$cpumax |
---|
1845 | if (( $cputime == 0 )) |
---|
1846 | then |
---|
1847 | if [[ $do_batch = true ]] |
---|
1848 | then |
---|
1849 | printf "\n +++ cpu-time is undefined" |
---|
1850 | printf "\n >>> Please type CPU-time in seconds as INTEGER:" |
---|
1851 | printf "\n >>> " |
---|
1852 | read cputime 1>/dev/null 2>&1 |
---|
1853 | else |
---|
1854 | cputime=10000000 # NO CPU LIMIT FOR INTERACTIVE RUNS |
---|
1855 | fi |
---|
1856 | else |
---|
1857 | done=true |
---|
1858 | fi |
---|
1859 | cpumax=$cputime |
---|
1860 | done |
---|
1861 | |
---|
1862 | (( minuten = cputime / 60 )) |
---|
1863 | (( sekunden = cputime - minuten * 60 )) |
---|
1864 | |
---|
1865 | |
---|
1866 | # CHECK THE MEMORY DEMAND |
---|
1867 | if [[ $do_batch = true ]] |
---|
1868 | then |
---|
1869 | done=false |
---|
1870 | while [[ $done = false ]] |
---|
1871 | do |
---|
1872 | if (( memory == 0 )) |
---|
1873 | then |
---|
1874 | printf "\n +++ memory demand is undefined" |
---|
1875 | printf "\n >>> Please type memory in MByte per process as INTEGER:" |
---|
1876 | printf "\n >>> " |
---|
1877 | read memory 1>/dev/null 2>&1 |
---|
1878 | else |
---|
1879 | done=true |
---|
1880 | fi |
---|
1881 | done |
---|
1882 | fi |
---|
1883 | |
---|
1884 | |
---|
1885 | # IN CASE OF REMOTE-JOBS CHECK, IF A USERNAME FOR THE REMOTE HOST IS GIVEN |
---|
1886 | if [[ $do_remote = true && -z $remote_username ]] |
---|
1887 | then |
---|
1888 | while [[ -z $remote_username ]] |
---|
1889 | do |
---|
1890 | printf "\n +++ username on remote host \"$host\" is undefined" |
---|
1891 | printf "\n >>> Please type username:" |
---|
1892 | printf "\n >>> " |
---|
1893 | read remote_username |
---|
1894 | done |
---|
1895 | mc="$mc -u$remote_username" |
---|
1896 | fi |
---|
1897 | |
---|
1898 | # CHECK FOR INITIAL COMMANDS AFTER LOGIN |
---|
1899 | if [[ "$login_init_cmd" != "" ]] |
---|
1900 | then |
---|
1901 | export init_cmds="${login_init_cmd};" |
---|
1902 | fi |
---|
1903 | |
---|
1904 | |
---|
1905 | # SET THE MODULE-LOAD COMMAD AND EXPORT IT FOR subjob |
---|
1906 | if [[ "$modules" != "" ]] |
---|
1907 | then |
---|
1908 | if [[ $host = lctit ]] |
---|
1909 | then |
---|
1910 | export module_calls=". $modules" |
---|
1911 | else |
---|
1912 | export module_calls="module load ${modules};" |
---|
1913 | fi |
---|
1914 | fi |
---|
1915 | |
---|
1916 | |
---|
1917 | |
---|
1918 | # OUTPUT OF THE MRUN-HEADER |
---|
1919 | calltime=$(date) |
---|
1920 | printf "\n" |
---|
1921 | printf "#------------------------------------------------------------------------# \n" |
---|
1922 | printf "| %-35s%35s | \n" "$version" "$calltime" |
---|
1923 | printf "| | \n" |
---|
1924 | spalte1="called on:"; spalte2=$localhost_realname |
---|
1925 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
1926 | if [[ $do_remote = true ]] |
---|
1927 | then |
---|
1928 | spalte1="execution on:"; spalte2="$host (username: $remote_username)" |
---|
1929 | else |
---|
1930 | spalte1="execution on:"; spalte2="$host ($localhost_realname)" |
---|
1931 | fi |
---|
1932 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
1933 | if [[ -n $numprocs ]] |
---|
1934 | then |
---|
1935 | if [[ $run_coupled_model = false ]] |
---|
1936 | then |
---|
1937 | spalte1="number of PEs:"; spalte2=$numprocs |
---|
1938 | else |
---|
1939 | spalte1="number of PEs:"; spalte2="$numprocs (atmosphere: $numprocs_atmos, ocean: $numprocs_ocean)" |
---|
1940 | fi |
---|
1941 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
1942 | fi |
---|
1943 | if [[ -n $tasks_per_node ]] |
---|
1944 | then |
---|
1945 | spalte1="tasks per node:"; spalte2="$tasks_per_node (number of nodes: $nodes)" |
---|
1946 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
1947 | if (( remaining_pes > 0 )) |
---|
1948 | then |
---|
1949 | spalte1=" "; spalte2="one of the nodes only filled with $remaining_pes tasks" |
---|
1950 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
1951 | fi |
---|
1952 | fi |
---|
1953 | if [[ $maximum_parallel_io_streams != $numprocs ]] |
---|
1954 | then |
---|
1955 | spalte1="max par io streams:"; spalte2="$maximum_parallel_io_streams" |
---|
1956 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
1957 | fi |
---|
1958 | if [[ $use_openmp = true ]] |
---|
1959 | then |
---|
1960 | spalte1="threads per task:"; spalte2="$threads_per_task" |
---|
1961 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
1962 | fi |
---|
1963 | printf "| | \n" |
---|
1964 | if [[ $do_compile = true ]] |
---|
1965 | then |
---|
1966 | if [[ "$mopts" != "" ]] |
---|
1967 | then |
---|
1968 | spalte1="make options:"; spalte2=$(echo "$mopts" | cut -c-45) |
---|
1969 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
1970 | zeile=$(echo "$mopts" | cut -c46-) |
---|
1971 | while [[ "$zeile" != "" ]] |
---|
1972 | do |
---|
1973 | spalte1="" |
---|
1974 | spalte2=$(echo "$zeile" | cut -c-45) |
---|
1975 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
1976 | zeile=$(echo "$zeile" | cut -c46-) |
---|
1977 | done |
---|
1978 | fi |
---|
1979 | |
---|
1980 | spalte1="cpp directives:"; spalte2=$(echo "$cpp_options" | cut -c-45) |
---|
1981 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
1982 | zeile=$(echo "$cpp_options" | cut -c46-) |
---|
1983 | while [[ "$zeile" != "" ]] |
---|
1984 | do |
---|
1985 | spalte1="" |
---|
1986 | spalte2=$(echo "$zeile" | cut -c-45) |
---|
1987 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
1988 | zeile=$(echo "$zeile" | cut -c46-) |
---|
1989 | done |
---|
1990 | |
---|
1991 | spalte1="compiler options:"; spalte2=$(echo "$fopts" | cut -c-45) |
---|
1992 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
1993 | zeile=$(echo "$fopts" | cut -c46-) |
---|
1994 | while [[ "$zeile" != "" ]] |
---|
1995 | do |
---|
1996 | spalte1="" |
---|
1997 | spalte2=$(echo "$zeile" | cut -c-45) |
---|
1998 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
1999 | zeile=$(echo "$zeile" | cut -c46-) |
---|
2000 | done |
---|
2001 | |
---|
2002 | spalte1="linker options:"; spalte2=$(echo "$lopts" | cut -c-45) |
---|
2003 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
2004 | zeile=$(echo "$lopts" | cut -c46-) |
---|
2005 | while [[ "$zeile" != "" ]] |
---|
2006 | do |
---|
2007 | spalte1="" |
---|
2008 | spalte2=$(echo "$zeile" | cut -c-45) |
---|
2009 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
2010 | zeile=$(echo "$zeile" | cut -c46-) |
---|
2011 | done |
---|
2012 | |
---|
2013 | spalte1="modules to be load:"; spalte2=$(echo "$modules" | cut -c-45) |
---|
2014 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
2015 | zeile=$(echo "$modules" | cut -c46-) |
---|
2016 | while [[ "$zeile" != "" ]] |
---|
2017 | do |
---|
2018 | spalte1="" |
---|
2019 | spalte2=$(echo "$zeile" | cut -c-45) |
---|
2020 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
2021 | zeile=$(echo "$zeile" | cut -c46-) |
---|
2022 | done |
---|
2023 | |
---|
2024 | spalte1="main program:"; spalte2=$mainprog |
---|
2025 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
2026 | else |
---|
2027 | spalte1=executable:; spalte2=$executable |
---|
2028 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
2029 | fi |
---|
2030 | printf "| | \n" |
---|
2031 | spalte1="base name of files:"; spalte2=$fname |
---|
2032 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
2033 | if [[ $fname != $afname ]] |
---|
2034 | then |
---|
2035 | spalte1="base name of input files:"; spalte2=$afname |
---|
2036 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
2037 | fi |
---|
2038 | spalte1="INPUT control list:"; spalte2=$(echo $input_list) |
---|
2039 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
2040 | spalte1="OUTPUT control list:"; spalte2=$(echo $output_list) |
---|
2041 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
2042 | |
---|
2043 | if [[ "$ocean_file_appendix" = true ]] |
---|
2044 | then |
---|
2045 | printf "| %-35s%-35s | \n" "suffix \"_O\" is added to local files" " " |
---|
2046 | fi |
---|
2047 | |
---|
2048 | if [[ $do_batch = true || "$LOADLBATCH" = yes ]] |
---|
2049 | then |
---|
2050 | spalte1="memory demand / PE":; spalte2="$memory MB" |
---|
2051 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
2052 | spalte1=CPU-time:; spalte2="$minuten:$sekunden" |
---|
2053 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
2054 | fi |
---|
2055 | |
---|
2056 | if [[ $do_compile = true ]] |
---|
2057 | then |
---|
2058 | printf "| | \n" |
---|
2059 | printf "| Files to be compiled: | \n" |
---|
2060 | zeile=$source_list |
---|
2061 | while [[ "$zeile" != "" ]] |
---|
2062 | do |
---|
2063 | linestart=$(echo $zeile | cut -c-70) |
---|
2064 | printf "| %-70s | \n" "$linestart" |
---|
2065 | zeile=$(echo "$zeile" | cut -c71-) |
---|
2066 | done |
---|
2067 | fi |
---|
2068 | printf "#------------------------------------------------------------------------#" |
---|
2069 | |
---|
2070 | |
---|
2071 | |
---|
2072 | # OUTPUT OF FILE CONNECTIONS IN CASE OF TRACEBACK |
---|
2073 | if [[ $do_trace = true ]] |
---|
2074 | then |
---|
2075 | (( i = 0 )) |
---|
2076 | while (( i < iin )) |
---|
2077 | do |
---|
2078 | (( i = i + 1 )) |
---|
2079 | if (( i == 1 )) |
---|
2080 | then |
---|
2081 | printf "\n\n >>> INPUT-file assignments:\n" |
---|
2082 | fi |
---|
2083 | printf "\n ${localin[$i]} : ${absnamein[$i]}" |
---|
2084 | done |
---|
2085 | (( i = 0 )) |
---|
2086 | while (( i < iout )) |
---|
2087 | do |
---|
2088 | (( i = i + 1 )) |
---|
2089 | if (( i == 1 )) |
---|
2090 | then |
---|
2091 | printf "\n\n >>> OUTPUT-file assignments:\n" |
---|
2092 | fi |
---|
2093 | printf "\n ${localout[$i]} : ${pathout[$i]}" |
---|
2094 | done |
---|
2095 | (( i = 0 )) |
---|
2096 | while (( i < iic )) |
---|
2097 | do |
---|
2098 | (( i = i + 1 )) |
---|
2099 | if (( i == 1 )) |
---|
2100 | then |
---|
2101 | printf "\n\n >>> INPUT-commands:\n" |
---|
2102 | fi |
---|
2103 | printf "\n ${in_command[$i]}" |
---|
2104 | done |
---|
2105 | (( i = 0 )) |
---|
2106 | while (( i < ioc )) |
---|
2107 | do |
---|
2108 | (( i = i + 1 )) |
---|
2109 | if (( i == 1 )) |
---|
2110 | then |
---|
2111 | printf "\n\n >>> OUTPUT-commands:\n" |
---|
2112 | fi |
---|
2113 | printf "\n ${out_command[$i]}" |
---|
2114 | done |
---|
2115 | fi |
---|
2116 | |
---|
2117 | |
---|
2118 | # QUERY FOR CONTINUE (ON LOCAL MACHINES ONLY) |
---|
2119 | if [[ $remotecall = false && $silent = false && $jobmo != BATCH ]] |
---|
2120 | then |
---|
2121 | antwort=dummy |
---|
2122 | printf "\n\n" |
---|
2123 | printf " >>> everything o.k. (y/n) ? " |
---|
2124 | while read antwort |
---|
2125 | do |
---|
2126 | if [[ "$antwort" != y && "$antwort" != Y && "$antwort" != n && "$antwort" != N ]] |
---|
2127 | then |
---|
2128 | printf " >>> everything o.k. (y/n) ? " |
---|
2129 | else |
---|
2130 | break |
---|
2131 | fi |
---|
2132 | done |
---|
2133 | if [[ $antwort = n || $antwort = N ]] |
---|
2134 | then |
---|
2135 | locat=user_abort; (( iec = 0 )); exit |
---|
2136 | fi |
---|
2137 | if [[ $do_batch = true ]] |
---|
2138 | then |
---|
2139 | printf " >>> batch-job will be created and submitted" |
---|
2140 | else |
---|
2141 | printf " >>> MRUN will now continue to execute on this machine" |
---|
2142 | fi |
---|
2143 | fi |
---|
2144 | |
---|
2145 | |
---|
2146 | # PERFORM PARAMETER FILE CHECK (COUPLED RUNS ARE NOT SUPPORTED YET) |
---|
2147 | # DEFINE VARIABLES FOR FREQUENTLY USED DIRECTORIES |
---|
2148 | check_depository="${working_directory}/trunk/UTIL" |
---|
2149 | check_sources="${working_directory}/tmp_check_namelist_files" |
---|
2150 | skip_check=false |
---|
2151 | |
---|
2152 | # CHECK IF NAMELIST_FILE_CHECK HAS BEEN COMPILED SUCCESSFULLY |
---|
2153 | if [[ ! -f $check_depository/check_namelist_files.tar ]] |
---|
2154 | then |
---|
2155 | skip_check=true |
---|
2156 | reason="run on remote host or parameter file check has not been compiled." |
---|
2157 | fi |
---|
2158 | if [[ ! -f $PALM_BIN/check_namelist_files.x ]] |
---|
2159 | then |
---|
2160 | skip_check=true |
---|
2161 | reason="parameter file check has not been compiled." |
---|
2162 | fi |
---|
2163 | |
---|
2164 | # CHECK FOR PARALLEL RUN; OTHERWISE SKIP CHECK |
---|
2165 | if [[ "$cond1" != "parallel" && "$cond2" != "parallel" ]] |
---|
2166 | then |
---|
2167 | skip_check=true |
---|
2168 | reason="serial run." |
---|
2169 | fi |
---|
2170 | |
---|
2171 | # ONLY PERFORM CHECK IF -z OPTION IS NOT SET, NO RESTART RUN IS CARRIED OUT |
---|
2172 | # AND IF THE EXECUTION HOST IS THE LOCAL HOST |
---|
2173 | # ATTENTION: THIS ROUTINE DOES NOT WORK IF THE COMPILER ON THE LOCAL HOST |
---|
2174 | # DIFFERS FROM THE COMPILER ON THE REMOTE HOST |
---|
2175 | if [[ $check_namelist_files == false ]] |
---|
2176 | then |
---|
2177 | skip_check=true |
---|
2178 | reason="-z option set." |
---|
2179 | fi |
---|
2180 | |
---|
2181 | if [[ $fromhost != $localhost ]] |
---|
2182 | then |
---|
2183 | skip_check=true |
---|
2184 | reason="submitting host is local host." |
---|
2185 | fi |
---|
2186 | |
---|
2187 | if [[ $run_coupled_model == true ]] |
---|
2188 | then |
---|
2189 | skip_check=true |
---|
2190 | reason="coupled run." |
---|
2191 | fi |
---|
2192 | |
---|
2193 | if [[ $restart_run == true ]] |
---|
2194 | then |
---|
2195 | skip_check=true |
---|
2196 | reason="restart run." |
---|
2197 | fi |
---|
2198 | |
---|
2199 | # SKIP CHECK IN CASE OF RESTART RUN: CHECK WHETHER THE LAST CHAR IS "f" IN PARIN |
---|
2200 | (( last_char_int = `echo $filename_input | wc -c` - 1 )) |
---|
2201 | last_char=`echo $filename_input | cut -c $last_char_int` |
---|
2202 | if [[ "$last_char" == "f" ]] |
---|
2203 | then |
---|
2204 | skip_check=true |
---|
2205 | reason="restart run." |
---|
2206 | fi |
---|
2207 | |
---|
2208 | if [[ $skip_check == false ]] |
---|
2209 | then |
---|
2210 | tmp_check=${working_directory}/tmp_check |
---|
2211 | |
---|
2212 | # GET TOPOGRAPHY PARAMETER FILE SUFFIX (USUALLY "_TOPO"). THIS FILE IS |
---|
2213 | # NOT NECESSARILY REQUIRED |
---|
2214 | line="" |
---|
2215 | found=false |
---|
2216 | grep "TOPOGRAPHY_DATA" $config_file > $tmp_check |
---|
2217 | while read line1 |
---|
2218 | do |
---|
2219 | line="$line1" |
---|
2220 | if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] |
---|
2221 | then |
---|
2222 | topo_suffix=`echo $line | tr -s " " | cut -d" " -s -f5` |
---|
2223 | found=true |
---|
2224 | fi |
---|
2225 | done < $tmp_check |
---|
2226 | |
---|
2227 | if [[ $found = false ]] |
---|
2228 | then |
---|
2229 | printf "\n +++ no TOPOGRAPHY list entry found in the configuration file." |
---|
2230 | fi |
---|
2231 | |
---|
2232 | # GET NUDGING PARAMETER FILE SUFFIX (USUALLY "_NUDGE"). THIS FILE IS |
---|
2233 | # NOT NECESSARILY REQUIRED |
---|
2234 | line="" |
---|
2235 | found=false |
---|
2236 | grep "NUDGING_DATA" $config_file > $tmp_check |
---|
2237 | while read line1 |
---|
2238 | do |
---|
2239 | line="$line1" |
---|
2240 | if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] |
---|
2241 | then |
---|
2242 | nudge_suffix=`echo $line | tr -s " " | cut -d" " -s -f5` |
---|
2243 | found=true |
---|
2244 | fi |
---|
2245 | done < $tmp_check |
---|
2246 | |
---|
2247 | if [[ $found = false ]] |
---|
2248 | then |
---|
2249 | printf "\n +++ no NUDGING list entry found in the configuration file." |
---|
2250 | fi |
---|
2251 | |
---|
2252 | # GET LARGE SCALE FORCING PARAMETER FILE SUFFIX (USUALLY "_LSF"). THIS FILE IS |
---|
2253 | # NOT NECESSARILY REQUIRED |
---|
2254 | line="" |
---|
2255 | found=false |
---|
2256 | grep "LSF_DATA" $config_file > $tmp_check |
---|
2257 | while read line1 |
---|
2258 | do |
---|
2259 | line="$line1" |
---|
2260 | if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] |
---|
2261 | then |
---|
2262 | lsf_suffix=`echo $line | tr -s " " | cut -d" " -s -f5` |
---|
2263 | found=true |
---|
2264 | fi |
---|
2265 | done < $tmp_check |
---|
2266 | |
---|
2267 | if [[ $found = false ]] |
---|
2268 | then |
---|
2269 | printf "\n +++ no LSF list entry found in the configuration file." |
---|
2270 | fi |
---|
2271 | |
---|
2272 | rm -rf ${working_directory}/tmp_check |
---|
2273 | |
---|
2274 | # CHECK IF THE P3DF FILE MUST BE CHECKED |
---|
2275 | for item in $input_list |
---|
2276 | do |
---|
2277 | if [[ "$item" == "restart" ]] |
---|
2278 | then |
---|
2279 | check_restart=1 |
---|
2280 | else |
---|
2281 | check_restart=0 |
---|
2282 | fi |
---|
2283 | done |
---|
2284 | |
---|
2285 | # ERROR IF NO PARAMETER FILE WAS FOUND, OTHERWISE PROCEED |
---|
2286 | if [[ (! -f $filename_input) && ( "$filename_input" != "" ) ]] |
---|
2287 | then |
---|
2288 | printf "\n\n +++ ERROR: parameter file ($filename_input) not found." |
---|
2289 | locat=check_namelist; exit |
---|
2290 | fi |
---|
2291 | |
---|
2292 | # CHECK IF THE RESTART PARAMETER FILE EXISTS (IF NECESSARY) |
---|
2293 | if [[ $check_restart == 1 ]] |
---|
2294 | then |
---|
2295 | |
---|
2296 | filenamef="${filename_input}f" |
---|
2297 | if [[ ! -f $filenamef ]] |
---|
2298 | then |
---|
2299 | printf "\n\n +++ WARNING: restart parameter file ($filenamef) is missing." |
---|
2300 | check_restart=0 |
---|
2301 | answer=dummy |
---|
2302 | printf "\n\n" |
---|
2303 | |
---|
2304 | if [[ $silent == false ]] |
---|
2305 | then |
---|
2306 | while [[ "$answer" != c && "$answer" != C && "$answer" != a && "$answer" != A ]] |
---|
2307 | do |
---|
2308 | printf " >>> continue anyway (c(ontinue)/a(bort)) ? " |
---|
2309 | read answer |
---|
2310 | done |
---|
2311 | if [[ $answer = a || $answer = A ]] |
---|
2312 | then |
---|
2313 | printf "\n +++ Aborting...." |
---|
2314 | locat=normal; exit |
---|
2315 | fi |
---|
2316 | fi |
---|
2317 | else |
---|
2318 | check_restart=1 |
---|
2319 | fi |
---|
2320 | fi |
---|
2321 | |
---|
2322 | # CREATE TEMPORARY SOURCES_FOR_CHECK PATH |
---|
2323 | mkdir $check_sources |
---|
2324 | cd $check_sources |
---|
2325 | |
---|
2326 | |
---|
2327 | # CHECK FOR USER CODE, OTHERWISE USE THE PRECOMPILED CHECK_NAMELIST_FILES.X |
---|
2328 | if [[ -d $add_source_path ]] |
---|
2329 | then |
---|
2330 | printf "\n\n *** copying files from $check_depository" |
---|
2331 | cp $check_depository/check_namelist_files.tar ./ |
---|
2332 | |
---|
2333 | printf "\n\n *** untar of makefile and source files in $check_sources" |
---|
2334 | tar -xf check_namelist_files.tar > /dev/null 2>&1 |
---|
2335 | |
---|
2336 | printf "\n\n *** adding user code." |
---|
2337 | cp $add_source_path/* ./ |
---|
2338 | touch check_namelist_files.f90 |
---|
2339 | |
---|
2340 | # GET COMPILER OPTIONS AND PERFORM MAKE |
---|
2341 | printf "\n\n *** compiling code if necessary...\n" |
---|
2342 | |
---|
2343 | # workaround for batch jobs on local machine (lcxe6) |
---|
2344 | if [[ $do_batch == true && $do_remote == false ]] |
---|
2345 | then |
---|
2346 | eval $init_cmds |
---|
2347 | fi |
---|
2348 | |
---|
2349 | # GET CHECK OPTIONS |
---|
2350 | line="" |
---|
2351 | found=false |
---|
2352 | |
---|
2353 | grep "$localhost" ${base_directory}/${config_file} | grep "%cpp_options" > $tmp_check |
---|
2354 | |
---|
2355 | while read line1 |
---|
2356 | do |
---|
2357 | |
---|
2358 | if [[ $(echo $line1 | cut -d" " -s -f3-) = "$localhost" ]] |
---|
2359 | then |
---|
2360 | line="$line1" |
---|
2361 | fi |
---|
2362 | |
---|
2363 | if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] |
---|
2364 | then |
---|
2365 | # REMOVE COLONS FROM OPTION-STRING, REMOVE ALL -D OPTIONS |
---|
2366 | line="$line " |
---|
2367 | copts_check=`echo $line | cut -d" " -s -f2 | sed 's/::/%DUM%/g' | sed 's/:/ /g' | sed 's/%DUM%/:/g' | sed 's/-D[^ ]* //g' | sed 's/ -D.*//g'` |
---|
2368 | found=true |
---|
2369 | fi |
---|
2370 | |
---|
2371 | done < $tmp_check |
---|
2372 | copts_check="$copts_check -D__check -D__parallel" |
---|
2373 | |
---|
2374 | make -f Makefile_check F90=$compiler_name_ser COPT="$copts_check" |
---|
2375 | |
---|
2376 | # GET MAKE OUTPUT |
---|
2377 | if [[ $? != 0 ]] |
---|
2378 | then |
---|
2379 | printf "\n +++ error during make." |
---|
2380 | answer=dummy |
---|
2381 | printf "\n\n" |
---|
2382 | if [[ $silent == false ]] |
---|
2383 | then |
---|
2384 | while [[ "$answer" != c && "$answer" != C && "$answer" != a && "$answer" != A ]] |
---|
2385 | do |
---|
2386 | printf " >>> continue anyway (c(ontinue)/a(bort)) ? " |
---|
2387 | read answer |
---|
2388 | done |
---|
2389 | if [[ $answer = a || $answer = A ]] |
---|
2390 | then |
---|
2391 | printf "\n +++ Aborting..." |
---|
2392 | rm -rf $check_sources |
---|
2393 | locat=normal; exit |
---|
2394 | else |
---|
2395 | skip_check=true |
---|
2396 | fi |
---|
2397 | else |
---|
2398 | skip_check=true |
---|
2399 | fi |
---|
2400 | fi |
---|
2401 | else |
---|
2402 | cp $PALM_BIN/check_namelist_files.x ./ |
---|
2403 | fi |
---|
2404 | |
---|
2405 | cp $filename_input ./PARIN |
---|
2406 | if [[ $check_restart == 1 ]] |
---|
2407 | then |
---|
2408 | cp $filenamef ./PARINF |
---|
2409 | fi |
---|
2410 | |
---|
2411 | if [[ -f ${pathname}/${fname}${topo_suffix} && $skip_check == false ]] |
---|
2412 | then |
---|
2413 | printf "\n *** adding topography data" |
---|
2414 | cp ${pathname}/${fname}${topo_suffix} ./TOPOGRAPHY_DATA |
---|
2415 | |
---|
2416 | # IN CASE OF TOPOGRAPHY AND HIGH GRID POINT NUMBERS, THE STACK SIZE |
---|
2417 | # MUST BE INCREASED. THIS IS DUE TO THE ARRAY nzb_local AND topo_height, |
---|
2418 | # WHICH REQUIRE SUFFICIENT MEMORY |
---|
2419 | ulimit -s unlimited |
---|
2420 | fi |
---|
2421 | |
---|
2422 | if [[ -f ${pathname}/${fname}${nudge_suffix} && $skip_check == false ]] |
---|
2423 | then |
---|
2424 | printf "\n *** adding nudging data" |
---|
2425 | cp ${pathname}/${fname}${nudge_suffix} ./NUDGING_DATA |
---|
2426 | fi |
---|
2427 | |
---|
2428 | if [[ -f ${pathname}/${fname}${lsf_suffix} && $skip_check == false ]] |
---|
2429 | then |
---|
2430 | printf "\n *** adding large scale forcing data" |
---|
2431 | cp ${pathname}/${fname}${lsf_suffix} ./LSF_DATA |
---|
2432 | fi |
---|
2433 | |
---|
2434 | # CREATE ENVPAR FILE, WHICH IS NEEDED BY CHECK_NAMELIST_FILES.X |
---|
2435 | cat > ENVPAR << %%END%% |
---|
2436 | &envpar run_identifier = '$fname', host = '$host', |
---|
2437 | write_binary = '$write_binary', tasks_per_node = $tasks_per_node, |
---|
2438 | maximum_parallel_io_streams = $maximum_parallel_io_streams, |
---|
2439 | maximum_cpu_time_allowed = ${cpumax}., |
---|
2440 | revision = '$global_revision', |
---|
2441 | local_dvrserver_running = $local_dvrserver_running / |
---|
2442 | |
---|
2443 | %%END%% |
---|
2444 | |
---|
2445 | # SAFETY CHECK: ONLY PROCEED IF THE PARAMETER CHECK PROGRAM WAS PROPERLY COMPILED |
---|
2446 | if [[ ! -f check_namelist_files.x && $skip_check == false ]] |
---|
2447 | then |
---|
2448 | printf "\n +++ WARNING: check_namelist_files.x not found." |
---|
2449 | answer=dummy |
---|
2450 | printf "\n\n" |
---|
2451 | |
---|
2452 | if [[ $silent == false ]] |
---|
2453 | then |
---|
2454 | while [[ "$answer" != c && "$answer" != C && "$answer" != a && "$answer" != A ]] |
---|
2455 | do |
---|
2456 | printf " >>> continue anyway (c(ontinue)/a(bort)) ? " |
---|
2457 | read answer |
---|
2458 | done |
---|
2459 | if [[ $answer = a || $answer = A ]] |
---|
2460 | then |
---|
2461 | printf "\n +++ Aborting..." |
---|
2462 | rm -rf $check_sources |
---|
2463 | locat=normal; exit |
---|
2464 | else |
---|
2465 | printf "\n *** skipping parameter file check." |
---|
2466 | fi |
---|
2467 | fi |
---|
2468 | |
---|
2469 | elif [[ $skip_check == false ]] |
---|
2470 | then |
---|
2471 | # STARTING THE PARAMETER FILE CHECK |
---|
2472 | printf "\n\n *** starting parameter file check..." |
---|
2473 | |
---|
2474 | # CHECKING THE P3D FILE |
---|
2475 | printf "\n\n (1) checking $filename_input" |
---|
2476 | echo "$numprocs 0 0" > VARIN |
---|
2477 | errors=`./check_namelist_files.x < VARIN 2>&1` |
---|
2478 | |
---|
2479 | check_error=false |
---|
2480 | if [[ "$errors" == "" ]] |
---|
2481 | then |
---|
2482 | printf " --> o.k." |
---|
2483 | else |
---|
2484 | printf " --> failed." |
---|
2485 | check_error=true |
---|
2486 | printf "\n\n $errors" |
---|
2487 | fi |
---|
2488 | |
---|
2489 | # CHECKING THE PD3F FILE IF NECESSARY |
---|
2490 | if [[ $check_restart == 1 && $check_error == false ]] |
---|
2491 | then |
---|
2492 | printf "\n\n (2) checking $filenamef" |
---|
2493 | |
---|
2494 | # FIRST CHECK IF INITIALIZING_ACTIONS="READ_RESTART_DATA" IS SET |
---|
2495 | # IN &INIPAR LIST |
---|
2496 | found=false |
---|
2497 | cat PARINF | while read line |
---|
2498 | do |
---|
2499 | line=$(echo $line|sed 's/ //g') |
---|
2500 | if [[ $line == *"&inipar"* ]] |
---|
2501 | then |
---|
2502 | start_search=true |
---|
2503 | fi |
---|
2504 | |
---|
2505 | if [[ $start_search == true ]] |
---|
2506 | then |
---|
2507 | if [[ $line == *"initializing_actions='read_restart_data'"* ]] |
---|
2508 | then |
---|
2509 | found=true |
---|
2510 | break |
---|
2511 | fi |
---|
2512 | fi |
---|
2513 | |
---|
2514 | if [[ $line == *"/"* ]] |
---|
2515 | then |
---|
2516 | start_search=false |
---|
2517 | fi |
---|
2518 | |
---|
2519 | done |
---|
2520 | |
---|
2521 | if [[ $found = false ]] |
---|
2522 | then |
---|
2523 | printf "\n\n +++ ERROR: initializing_actions = 'read_restart_data' not found" |
---|
2524 | printf "\n in &inipar list in $fname$p3df_suffix." |
---|
2525 | rm -rf $check_sources |
---|
2526 | locat=check_namelist; exit |
---|
2527 | fi |
---|
2528 | |
---|
2529 | # READ max_user_pr FROM FILES |
---|
2530 | if [[ -f parin_for_check ]] |
---|
2531 | then |
---|
2532 | read max_pr_user < parin_for_check |
---|
2533 | else |
---|
2534 | max_user_pr=0 |
---|
2535 | fi |
---|
2536 | |
---|
2537 | echo "$numprocs 1 $max_pr_user" > VARIN |
---|
2538 | errors=`./check_namelist_files.x < VARIN 2>&1` |
---|
2539 | |
---|
2540 | if [[ "$errors" == "" ]] |
---|
2541 | then |
---|
2542 | printf " --> o.k." |
---|
2543 | else |
---|
2544 | printf " --> failed." |
---|
2545 | check_error=true |
---|
2546 | printf "\n\n $errors" |
---|
2547 | fi |
---|
2548 | fi |
---|
2549 | |
---|
2550 | # REPORT ERRORS AND CONTINUE/EXIT |
---|
2551 | if [[ $check_error == true ]] |
---|
2552 | then |
---|
2553 | printf "\n +++ errors found in the parameter file!\n" |
---|
2554 | answer=dummy |
---|
2555 | printf "\n\n" |
---|
2556 | |
---|
2557 | while [[ "$answer" != c && "$answer" != C && "$answer" != a && "$answer" != A ]] |
---|
2558 | do |
---|
2559 | printf " >>> continue anyway (c(ontinue)/a(bort)) ? " |
---|
2560 | read answer |
---|
2561 | done |
---|
2562 | |
---|
2563 | if [[ $answer = a || $answer = A ]] |
---|
2564 | then |
---|
2565 | printf "\n +++ Aborting..." |
---|
2566 | rm -rf $check_sources |
---|
2567 | locat=normal; exit |
---|
2568 | fi |
---|
2569 | else |
---|
2570 | printf "\n\n *** parameter file(s) seem(s) to be o.k.\n" |
---|
2571 | fi |
---|
2572 | rm -rf $check_sources |
---|
2573 | fi |
---|
2574 | else |
---|
2575 | printf "\n\n +++ skipping parameter file check due to following reason: $reason \n" |
---|
2576 | fi |
---|
2577 | |
---|
2578 | # DELETE TEMPORARY DIRECTORY AND FINISH NAMELIST FILE CHECK |
---|
2579 | rm -rf $check_sources |
---|
2580 | cd $working_directory |
---|
2581 | |
---|
2582 | |
---|
2583 | # DETERMINE PATH FOR MAKE DEPOSITORY |
---|
2584 | if [[ $do_batch = false || $create_executable_for_batch = true ]] |
---|
2585 | then |
---|
2586 | |
---|
2587 | line="" |
---|
2588 | grep "%depository_path" $config_file > tmp_mrun |
---|
2589 | while read line |
---|
2590 | do |
---|
2591 | if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] |
---|
2592 | then |
---|
2593 | if [[ "$(echo $line | cut -d" " -s -f3)" = "" ]] |
---|
2594 | then |
---|
2595 | global_depository_path=`echo $line | cut -d" " -s -f2` |
---|
2596 | fi |
---|
2597 | fi |
---|
2598 | done < tmp_mrun |
---|
2599 | |
---|
2600 | line="" |
---|
2601 | grep " $localhost" $config_file | grep "%depository_path" > tmp_mrun |
---|
2602 | while read line |
---|
2603 | do |
---|
2604 | if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] |
---|
2605 | then |
---|
2606 | if [[ "$(echo $line | cut -d" " -s -f4)" = "$cond1" && "$(echo $line | cut -d" " -s -f5)" = "$cond2" ]] |
---|
2607 | then |
---|
2608 | local_depository_path=`echo $line | cut -d" " -s -f2` |
---|
2609 | fi |
---|
2610 | fi |
---|
2611 | done < tmp_mrun |
---|
2612 | |
---|
2613 | if [[ "$local_depository_path" = "" ]] |
---|
2614 | then |
---|
2615 | if [[ "$global_depository_path" != "" ]] |
---|
2616 | then |
---|
2617 | local_depository_path=$global_depository_path |
---|
2618 | else |
---|
2619 | printf "\n\n +++ no depository path found in configuration file" |
---|
2620 | printf "\n for local host \"$localhost\" " |
---|
2621 | printf "\n please set \"\%depository_path\" in configuration file\n" |
---|
2622 | locat=config_file; exit |
---|
2623 | fi |
---|
2624 | fi |
---|
2625 | eval local_depository_path=$local_depository_path |
---|
2626 | [[ "$cond1" != "" ]] && local_depository_path=${local_depository_path}_$cond1 |
---|
2627 | [[ "$cond2" != "" ]] && local_depository_path=${local_depository_path}_$cond2 |
---|
2628 | |
---|
2629 | |
---|
2630 | basename=`echo $mainprog | cut -f1 -d"."` |
---|
2631 | eval make_depository=${local_depository_path}/${basename}_current_version.tar |
---|
2632 | if [[ ! -f $make_depository ]] |
---|
2633 | then |
---|
2634 | printf "\n" |
---|
2635 | printf "\n *** WARNING: make depository \"$make_depository\" not found" |
---|
2636 | printf "\n \"make\" will fail, if the Makefile or other source files are missing\n" |
---|
2637 | fi |
---|
2638 | |
---|
2639 | fi |
---|
2640 | |
---|
2641 | |
---|
2642 | # NOW PERFORM THOSE ACTIONS REQUIRED TO EXECUTE THE PROGRAM (PALM) ON THIS MACHINE |
---|
2643 | # (COMPILING/LINKING, EXECUTING, COPYING I/O FILES) |
---|
2644 | if [[ $do_batch = false ]] |
---|
2645 | then |
---|
2646 | |
---|
2647 | |
---|
2648 | # CREATE THE TEMPORARY WORKING DIRECTORY |
---|
2649 | mkdir -p $TEMPDIR |
---|
2650 | chmod go+rx $TEMPDIR |
---|
2651 | tmpcreate=true |
---|
2652 | |
---|
2653 | |
---|
2654 | # COPY EITHER THE COMPLETE SOURCE CODE FILES TO BE COMPILED OR THE EXECUTABLE |
---|
2655 | # INTO THE TEMPORARY WORKING DIRECTORY |
---|
2656 | if [[ $do_compile = true ]] |
---|
2657 | then |
---|
2658 | |
---|
2659 | # ON NEC, COMPILATION IS DONE ON HOST CROSS VIA CROSS COMPILING |
---|
2660 | # CREATE A TEMPORARY DIRECTORY ON THAT MACHINE (HOME MOUNTED VIA NFS) |
---|
2661 | if [[ $localhost = nech ]] |
---|
2662 | then |
---|
2663 | TEMPDIR_COMPILE=$HOME/work/${usern}.$kennung |
---|
2664 | if mkdir -p $TEMPDIR_COMPILE |
---|
2665 | then |
---|
2666 | printf "\n *** \"$TEMPDIR_COMPILE\" " |
---|
2667 | printf "\n is generated as temporary directory for cross compiling\n" |
---|
2668 | else |
---|
2669 | printf "\n +++ creating directory \"$TEMPDIR_COMPILE\" " |
---|
2670 | printf "\n needed for cross compilation failed" |
---|
2671 | locat=compile |
---|
2672 | exit |
---|
2673 | fi |
---|
2674 | else |
---|
2675 | TEMPDIR_COMPILE=$TEMPDIR |
---|
2676 | fi |
---|
2677 | |
---|
2678 | cp $make_depository $TEMPDIR_COMPILE |
---|
2679 | cd $TEMPDIR_COMPILE |
---|
2680 | tar -xf $make_depository > /dev/null 2>&1 |
---|
2681 | cd - > /dev/null |
---|
2682 | |
---|
2683 | # DUE TO UNKNOWN REASONS, COPY WITH cp COMMAND CREATES CORRUPT |
---|
2684 | # FILES ON CRAY XC30 SYSTEMS (HLRN III), rsync IS USED INSTEAD |
---|
2685 | if [[ $(echo $host | cut -c1-6) = lccray ]] |
---|
2686 | then |
---|
2687 | rsync -av -t SOURCES_FOR_RUN_$fname/* $TEMPDIR_COMPILE > /dev/null |
---|
2688 | else |
---|
2689 | cp SOURCES_FOR_RUN_$fname/* $TEMPDIR_COMPILE > /dev/null |
---|
2690 | fi |
---|
2691 | |
---|
2692 | else |
---|
2693 | |
---|
2694 | cp $executable ${TEMPDIR}/a.out |
---|
2695 | |
---|
2696 | fi |
---|
2697 | |
---|
2698 | |
---|
2699 | # CHANGE TO THE TEMPORARY WORKING DIRECTORY |
---|
2700 | cd $TEMPDIR |
---|
2701 | printf "\n *** changed to temporary directory: $TEMPDIR" |
---|
2702 | |
---|
2703 | |
---|
2704 | # THE FOLLOWING IS REQUIRED FPR AVS-OUTPUT WITH PALM ??? REMOVE ??? |
---|
2705 | # WRITE INFORMATIONS ABOUT THE OUTPUT-FILE CONNECTIONS TO A TEMPORARY FILE |
---|
2706 | # THIS FILE CAN LATER BE READ FROM USER-DEFINED CODE TO DETERMINE THE |
---|
2707 | # RELATION BETWEEN THE LOCAL TEMPORARY AND PERMANENT FILE NAMES |
---|
2708 | (( i = 0 )) |
---|
2709 | while (( i < iout )) |
---|
2710 | do |
---|
2711 | (( i = i + 1 )) |
---|
2712 | if [[ "${actionout[$i]}" = tr || "${actionout[$i]}" = tra || "${actionout[$i]}" = trpe ]] |
---|
2713 | then |
---|
2714 | printf "${localout[$i]} ${actionout[$i]}\n${pathout[$i]}\n${localhost}_${fname}${endout[$i]}\n" >> OUTPUT_FILE_CONNECTIONS |
---|
2715 | else |
---|
2716 | printf "${localout[$i]} ${actionout[$i]}\n${pathout[$i]}\n${frelout[$i]}\n" >> OUTPUT_FILE_CONNECTIONS |
---|
2717 | fi |
---|
2718 | done |
---|
2719 | |
---|
2720 | |
---|
2721 | # IF REQUIRED, START WITH COMPILING |
---|
2722 | if [[ $do_compile = true ]] |
---|
2723 | then |
---|
2724 | |
---|
2725 | |
---|
2726 | if [[ -f a.out ]] |
---|
2727 | then |
---|
2728 | |
---|
2729 | # EXECUTABLE WAS CREATED DURING INTERACTIVE CALL OF MRUN |
---|
2730 | printf "\n\n\n *** executable a.out found" |
---|
2731 | printf "\n no compilation required \n" |
---|
2732 | |
---|
2733 | else |
---|
2734 | |
---|
2735 | # COMPILING WITH MAKE (ON NEC COMPILER IS CALLED ON HOST CROSS) |
---|
2736 | printf "\n\n\n *** compilation starts \n$dashes\n" |
---|
2737 | printf " *** compilation with make using following options:\n" |
---|
2738 | printf " make depository: $make_depository" |
---|
2739 | if [[ "$mopts" != "" ]] |
---|
2740 | then |
---|
2741 | printf " make options: $mopts\n" |
---|
2742 | fi |
---|
2743 | printf " compilername: $compiler_name\n" |
---|
2744 | printf " compiler options: $fopts\n" |
---|
2745 | printf " preprocessor directives: $cpp_options \n" |
---|
2746 | printf " linker options: $lopts \n" |
---|
2747 | if [[ "$modules" != "" ]] |
---|
2748 | then |
---|
2749 | printf " modules to be load: $modules \n" |
---|
2750 | fi |
---|
2751 | printf " source code files: $source_list \n" |
---|
2752 | |
---|
2753 | if [[ $localhost = nech ]] |
---|
2754 | then |
---|
2755 | ssh $SSH_PORTOPT 136.172.44.192 -l $usern "$init_cmds $module_calls cd \$HOME/work/${usern}.$kennung; sxmake $mopts -f Makefile PROG=a.out F90=$compiler_name COPT=\"$cpp_options\" F90FLAGS=\"$fopts\" LDFLAGS=\"$lopts\" " |
---|
2756 | cp $TEMPDIR_COMPILE/a.out . |
---|
2757 | [[ $? != 0 ]] && compile_error=true |
---|
2758 | rm -rf $TEMPDIR_COMPILE |
---|
2759 | elif [[ $localhost = ibmh ]] |
---|
2760 | then |
---|
2761 | printf " compiler is called via ssh on \"plogin1\" \n" |
---|
2762 | ssh $SSH_PORTOPT plogin1 -l $usern "$init_cmds export PATH=/sw/ibm/xlf/13.1.0.8/usr/bin:$PATH; $module_calls cd $TEMPDIR; make $mopts -f Makefile PROG=a.out F90=$compiler_name COPT=\"$cpp_options\" F90FLAGS=\"$fopts\" LDFLAGS=\"$lopts\" " |
---|
2763 | [[ ! -f a.out ]] && compile_error=true |
---|
2764 | continue # STATUS=1, IF a.out EXISTS |
---|
2765 | elif [[ $localhost = lcflow ]] |
---|
2766 | then |
---|
2767 | printf " compiler is called via ssh on \"flow\" \n" |
---|
2768 | /usr/bin/ssh $SSH_PORTOPT flow02.hpc.uni-oldenburg.de -l $usern "$init_cmds $module_calls cd $TEMPDIR; make $mopts -f Makefile PROG=a.out F90=$compiler_name COPT=\"$cpp_options\" F90FLAGS=\"$fopts\" LDFLAGS=\"$lopts\" " |
---|
2769 | check_for_file=`/usr/bin/ssh $SSH_PORTOPT flow02.hpc.uni-oldenburg.de -l $usern "ls $TEMPDIR/a.out 2> /dev/null"` |
---|
2770 | [[ "$check_for_file" = "" ]] && compile_error=true |
---|
2771 | continue # STATUS=1, IF a.out EXISTS |
---|
2772 | elif [[ $localhost = lccrayb || $localhost = lccrayf || $localhost = lccrayh ]] |
---|
2773 | then |
---|
2774 | make $mopts -f Makefile PROG=a.out F90=$compiler_name COPT="$cpp_options" F90FLAGS="$fopts" LDFLAGS="$lopts" |
---|
2775 | else |
---|
2776 | [[ "$init_cmds" != "" ]] && eval $init_cmds |
---|
2777 | [[ "$module_calls" != "" ]] && eval $module_calls |
---|
2778 | make $mopts -f Makefile PROG=a.out F90=$compiler_name COPT="$cpp_options" F90FLAGS="$fopts" LDFLAGS="$lopts" |
---|
2779 | fi |
---|
2780 | |
---|
2781 | if [[ $? != 0 || "$compile_error" = true || "$module_compile_error" = true ]] |
---|
2782 | then |
---|
2783 | printf "\n +++ error occured while compiling or linking" |
---|
2784 | locat=compile |
---|
2785 | |
---|
2786 | exit |
---|
2787 | else |
---|
2788 | printf "$dashes\n *** compilation finished \n" |
---|
2789 | fi |
---|
2790 | |
---|
2791 | fi |
---|
2792 | |
---|
2793 | fi |
---|
2794 | |
---|
2795 | |
---|
2796 | # PROVIDE THE INPUT FILES |
---|
2797 | # LOOP OVER ALL ACTIVATED FILES (LISTED IN THE CONFIGURATION FILE) |
---|
2798 | (( i = 0 )) |
---|
2799 | while (( i < iin )) |
---|
2800 | do |
---|
2801 | (( i = i + 1 )) |
---|
2802 | if (( i == 1 )) |
---|
2803 | then |
---|
2804 | printf "\n\n *** providing INPUT-files:\n$dashes" |
---|
2805 | fi |
---|
2806 | |
---|
2807 | |
---|
2808 | # SKIP OPTIONAL FILES, IF THEY DO NOT EXIST |
---|
2809 | if [[ "${transin[$i]}" = unavailable ]] |
---|
2810 | then |
---|
2811 | if [[ "${extin[$i]}" = "" || "${extin[$i]}" = " " ]] |
---|
2812 | then |
---|
2813 | printf "\n +++ WARNING: input file \"${pathin[$i]}/${afname}${endin[$i]}\" " |
---|
2814 | printf "\n is not available!" |
---|
2815 | else |
---|
2816 | printf "\n +++ WARNING: input file \"${pathin[$i]}/${afname}${endin[$i]}.${extin[$i]}\" " |
---|
2817 | printf "\n is not available!" |
---|
2818 | fi |
---|
2819 | continue |
---|
2820 | fi |
---|
2821 | |
---|
2822 | # CHECK FOR SINGLE FILE (SERIAL RUN) OR DIRECTORY (ONE FILE PER CORE FOR PARELLEL EXECUTION) |
---|
2823 | files_for_pes=false; datentyp=file |
---|
2824 | if [[ "${actionin[$i]}" = pe && -n $numprocs ]] |
---|
2825 | then |
---|
2826 | files_for_pes=true; datentyp=directory |
---|
2827 | actionin[$i]="" |
---|
2828 | elif [[ "${actionin[$i]}" = pe && ! -n $numprocs ]] |
---|
2829 | then |
---|
2830 | actionin[$i]="" |
---|
2831 | elif [[ "${actionin[$i]}" = arpe && -n $numprocs ]] |
---|
2832 | then |
---|
2833 | files_for_pes=true; datentyp=directory |
---|
2834 | actionin[$i]="ar" |
---|
2835 | elif [[ "${actionin[$i]}" = arpe && ! -n $numprocs ]] |
---|
2836 | then |
---|
2837 | actionin[$i]="ar" |
---|
2838 | elif [[ "${actionin[$i]}" = flpe && -n $numprocs ]] |
---|
2839 | then |
---|
2840 | files_for_pes=true; datentyp=directory |
---|
2841 | actionin[$i]="fl" |
---|
2842 | elif [[ "${actionin[$i]}" = flpe && ! -n $numprocs ]] |
---|
2843 | then |
---|
2844 | actionin[$i]="fl" |
---|
2845 | fi |
---|
2846 | |
---|
2847 | if [[ $files_for_pes = true ]] |
---|
2848 | then |
---|
2849 | printf "\n >>> INPUT: ${absnamein[$i]}/.... to ${localin[$i]}" |
---|
2850 | else |
---|
2851 | printf "\n >>> INPUT: ${absnamein[$i]} to ${localin[$i]}" |
---|
2852 | fi |
---|
2853 | |
---|
2854 | # INPUT-FILE FOR A RESTART RUN. |
---|
2855 | # CHECK, IF THIS FILE STILL EXISTS ON THE TEMPORARY DATA DIRECTORY. |
---|
2856 | # IF NOT, TRY TO GET IT FROM THE ARCHIVE SYSTEM |
---|
2857 | if [[ "${actionin[$i]}" = fl ]] |
---|
2858 | then |
---|
2859 | printf "\n $datentyp will be fetched from temporary directory \"${tmp_data_catalog}\" !" |
---|
2860 | if [[ $files_for_pes = false ]] |
---|
2861 | then |
---|
2862 | if [[ -f "$tmp_data_catalog/${frelin[$i]}" ]] |
---|
2863 | then |
---|
2864 | ln $tmp_data_catalog/${frelin[$i]} ${localin[$i]} |
---|
2865 | got_tmp[$i]=true |
---|
2866 | elif [[ -f "$WORK/${frelin[$i]}" && $ignore_archive_error = true ]] |
---|
2867 | then |
---|
2868 | printf "\n +++ $datentyp not found in \"$tmp_data_catalog\" !" |
---|
2869 | printf "\n *** trying to use backup copy in \"$WORK\" " |
---|
2870 | cp $WORK/${frelin[$i]} ${localin[$i]} |
---|
2871 | else |
---|
2872 | printf "\n +++ $datentyp not found in \"$tmp_data_catalog\" " |
---|
2873 | printf "\n or \"$tmp_data_catalog\" does not exist!" |
---|
2874 | printf "\n *** trying to get copy from archive" |
---|
2875 | actionin[$i]=ar |
---|
2876 | fi |
---|
2877 | else |
---|
2878 | if [[ -d "$tmp_data_catalog/${frelin[$i]}" ]] |
---|
2879 | then |
---|
2880 | mkdir ${localin[$i]} |
---|
2881 | cd $tmp_data_catalog/${frelin[$i]} |
---|
2882 | for file in $(ls *) |
---|
2883 | do |
---|
2884 | ln $file $TEMPDIR/${localin[$i]} |
---|
2885 | done |
---|
2886 | cd $TEMPDIR |
---|
2887 | got_tmp[$i]=true |
---|
2888 | elif [[ -d "$WORK/${frelin[$i]}" && $ignore_archive_error = true ]] |
---|
2889 | then |
---|
2890 | printf "\n +++ $datentyp not found in \"$tmp_data_catalog\" !" |
---|
2891 | printf "\n *** trying to use backup copy in \"$WORK\" " |
---|
2892 | cp -r $WORK/${frelin[$i]} ${localin[$i]} |
---|
2893 | else |
---|
2894 | printf "\n +++ $datentyp not found in \"$tmp_data_catalog\" " |
---|
2895 | printf "\n or \"$tmp_data_catalog\" does not exist!" |
---|
2896 | printf "\n *** trying to get copy from archive" |
---|
2897 | actionin[$i]=ar |
---|
2898 | fi |
---|
2899 | fi |
---|
2900 | fi |
---|
2901 | |
---|
2902 | |
---|
2903 | # FILE IS STORED ON THE ARCHIVE SYSTEM |
---|
2904 | if [[ "${actionin[$i]}" = ar ]] |
---|
2905 | then |
---|
2906 | |
---|
2907 | if [[ $files_for_pes = false ]] |
---|
2908 | then |
---|
2909 | printf "\n file will be restored from archive-system ($archive_system)!" |
---|
2910 | else |
---|
2911 | printf "\n directory will be restored from archive-system ($archive_system)!" |
---|
2912 | fi |
---|
2913 | |
---|
2914 | file_restored=false |
---|
2915 | |
---|
2916 | if [[ $archive_system = asterix ]] |
---|
2917 | then |
---|
2918 | do_stagein=true |
---|
2919 | (( stagein_anz = 0 )) |
---|
2920 | while [[ $do_stagein = true ]] |
---|
2921 | do |
---|
2922 | if [[ $files_for_pes = false ]] |
---|
2923 | then |
---|
2924 | stagein -O ${frelin[$i]} > STAGEIN_OUTPUT |
---|
2925 | else |
---|
2926 | stagein -t -O ${frelin[$i]} > STAGEIN_OUTPUT |
---|
2927 | fi |
---|
2928 | cat STAGEIN_OUTPUT |
---|
2929 | if [[ $(grep -c "st.msg:i24" STAGEIN_OUTPUT) != 0 ]] |
---|
2930 | then |
---|
2931 | file_restored=true |
---|
2932 | do_stagein=false |
---|
2933 | else |
---|
2934 | (( stagein_anz = stagein_anz + 1 )) |
---|
2935 | if (( stagein_anz == 10 )) |
---|
2936 | then |
---|
2937 | printf "\n +++ stagein stoped after 10 tries" |
---|
2938 | locat=stage |
---|
2939 | exit |
---|
2940 | fi |
---|
2941 | printf "\n +++ restoring from archive failed, trying again:" |
---|
2942 | sleep 900 |
---|
2943 | fi |
---|
2944 | done |
---|
2945 | elif [[ $archive_system = DMF ]] |
---|
2946 | then |
---|
2947 | if [[ $files_for_pes = false ]] |
---|
2948 | then |
---|
2949 | printf "\n +++ restoring of single files impossible with $archive_system !\n" |
---|
2950 | locat=DMF |
---|
2951 | exit |
---|
2952 | else |
---|
2953 | find $ARCHIVE/${frelin[$i]} -type m -print | dmget |
---|
2954 | cp -r $ARCHIVE/${frelin[$i]} $PWD |
---|
2955 | file_restored=true |
---|
2956 | fi |
---|
2957 | elif [[ $archive_system = tivoli ]] |
---|
2958 | then |
---|
2959 | if [[ $files_for_pes = false ]] |
---|
2960 | then |
---|
2961 | ssh $SSH_PORTOPT $usern@bicedata.hlrn.de "cp $PERM/${frelin[$i]} $PWD" |
---|
2962 | else |
---|
2963 | (( inode = 0 )) |
---|
2964 | while (( inode < nodes )) |
---|
2965 | do |
---|
2966 | ssh $SSH_PORTOPT $usern@bicedata.hlrn.de "cd $PWD; tar xf $PERM/${frelin[$i]}/${frelin[$i]}.node_$inode.tar" |
---|
2967 | (( inode = inode + 1 )) |
---|
2968 | done |
---|
2969 | fi |
---|
2970 | file_restored=true |
---|
2971 | elif [[ $archive_system = ut ]] |
---|
2972 | then |
---|
2973 | if [[ $files_for_pes = false ]] |
---|
2974 | then |
---|
2975 | cp $UT/${frelin[$i]} . |
---|
2976 | else |
---|
2977 | (( inode = 0 )) |
---|
2978 | while (( inode < nodes )) |
---|
2979 | do |
---|
2980 | tar xf $UT/${frelin[$i]}/${frelin[$i]}.node_$inode.tar |
---|
2981 | (( inode = inode + 1 )) |
---|
2982 | done |
---|
2983 | fi |
---|
2984 | file_restored=true |
---|
2985 | else |
---|
2986 | printf "\n +++ archive_system=\"$archive_system\" restore impossible!" |
---|
2987 | locat=rearchive |
---|
2988 | exit |
---|
2989 | fi |
---|
2990 | |
---|
2991 | if [[ $file_restored = true ]] |
---|
2992 | then |
---|
2993 | |
---|
2994 | # PUT FILE ON THE TEMPORARY DATA DIRECTORY TOO. |
---|
2995 | # THIS WILL MAKE FILE ACCESS EASIER FOR LATER RUNS |
---|
2996 | [[ ! -d $tmp_data_catalog ]] && mkdir -p $tmp_data_catalog; chmod g+rx $tmp_data_catalog |
---|
2997 | if [[ $files_for_pes = false ]] |
---|
2998 | then |
---|
2999 | ln -f ${frelin[$i]} $tmp_data_catalog/${frelin[$i]} |
---|
3000 | else |
---|
3001 | mkdir $tmp_data_catalog/${frelin[$i]} |
---|
3002 | ln -f ${frelin[$i]}/* $tmp_data_catalog/${frelin[$i]} |
---|
3003 | fi |
---|
3004 | got_tmp[$i]=true |
---|
3005 | |
---|
3006 | # PROVIDE THE FILE UNDER ITS LOCAL NAME |
---|
3007 | mv ${frelin[$i]} ${localin[$i]} |
---|
3008 | |
---|
3009 | fi |
---|
3010 | fi |
---|
3011 | |
---|
3012 | |
---|
3013 | # FILE IS STORED IN THE RESPECTIVE DIRECTORY GIVEN IN THE CONFIGURATION FILE |
---|
3014 | if [[ "${actionin[$i]}" = "" || "${actionin[$i]}" = "di" || "${actionin[$i]}" = "npe" ]] |
---|
3015 | then |
---|
3016 | |
---|
3017 | if [[ "${actionin[$i]}" = "npe" && -n $numprocs ]] |
---|
3018 | then |
---|
3019 | |
---|
3020 | # FILE COPIES ARE PROVIDED FOR ALL CORES |
---|
3021 | # EACH FILE GETS A UNIQUE FILENAME WITH A FOUR DIGIT NUMBER |
---|
3022 | printf "\n file will be provided for $numprocs processors" |
---|
3023 | mkdir ${localin[$i]} |
---|
3024 | ival=$numprocs |
---|
3025 | (( ii = 0 )) |
---|
3026 | while (( ii <= ival-1 )) |
---|
3027 | do |
---|
3028 | if (( ii < 10 )) |
---|
3029 | then |
---|
3030 | cp ${absnamein[$i]} ${localin[$i]}/_000$ii |
---|
3031 | elif (( ii < 100 )) |
---|
3032 | then |
---|
3033 | cp ${absnamein[$i]} ${localin[$i]}/_00$ii |
---|
3034 | elif (( ii < 1000 )) |
---|
3035 | then |
---|
3036 | cp ${absnamein[$i]} ${localin[$i]}/_0$ii |
---|
3037 | else |
---|
3038 | cp ${absnamein[$i]} ${localin[$i]}/_$ii |
---|
3039 | fi |
---|
3040 | (( ii = ii + 1 )) |
---|
3041 | done |
---|
3042 | |
---|
3043 | else |
---|
3044 | |
---|
3045 | if [[ $files_for_pes = true ]] |
---|
3046 | then |
---|
3047 | |
---|
3048 | # PROVIDE FILES FOR EACH CORE |
---|
3049 | # FIRST CREATE THE LOCAL DIRECTORY, THEN COPY FILES |
---|
3050 | # FROM THE PERMANENT DIRECTORY BY LINKING THEM TO THE LOCAL ONE |
---|
3051 | printf "\n providing $numprocs files for the respective processors" |
---|
3052 | mkdir ${localin[$i]} |
---|
3053 | if [[ $link_local_input = true ]] |
---|
3054 | then |
---|
3055 | printf " using ln -f\n" |
---|
3056 | cd ${absnamein[$i]} |
---|
3057 | for file in $(ls *) |
---|
3058 | do |
---|
3059 | ln -f $file ${localin[$i]} |
---|
3060 | done |
---|
3061 | cd $TEMPDIR |
---|
3062 | fi |
---|
3063 | |
---|
3064 | # IF "ln -f" FAILED OR IF "$link_local_input = false" DO A NORMAL "cp -r" |
---|
3065 | if [[ ! -f "${localin[$i]}/_0000" ]] |
---|
3066 | then |
---|
3067 | if [[ $link_local_input = true ]] |
---|
3068 | then |
---|
3069 | printf " ln failed for .../_0000, using cp...\n" |
---|
3070 | fi |
---|
3071 | cp -r ${absnamein[$i]}/* ${localin[$i]} |
---|
3072 | fi |
---|
3073 | |
---|
3074 | else |
---|
3075 | |
---|
3076 | # PROVIDE FILE FOR RUNS ON A SINGLE CORE |
---|
3077 | if [[ $link_local_input = true ]] |
---|
3078 | then |
---|
3079 | printf " using ln -f\n" |
---|
3080 | ln -f ${absnamein[$i]} ${localin[$i]} |
---|
3081 | fi |
---|
3082 | # If "ln -f" fails of if "$link_local_input = false" do a normal "cp" |
---|
3083 | if [[ ! -f "${localin[$i]}" ]] |
---|
3084 | then |
---|
3085 | if [[ $link_local_input = true ]] |
---|
3086 | then |
---|
3087 | printf " ln failed, using cp...\n" |
---|
3088 | fi |
---|
3089 | cp ${absnamein[$i]} ${localin[$i]} |
---|
3090 | fi |
---|
3091 | fi |
---|
3092 | fi |
---|
3093 | fi |
---|
3094 | |
---|
3095 | done |
---|
3096 | if (( i != 0 )) |
---|
3097 | then |
---|
3098 | printf "\n$dashes\n *** all INPUT-files provided \n" |
---|
3099 | fi |
---|
3100 | |
---|
3101 | |
---|
3102 | # EXECUTE INPUT-COMMANDS GIVEN IN THE CONFIGURATION FILE |
---|
3103 | (( i = 0 )) |
---|
3104 | while (( i < iic )) |
---|
3105 | do |
---|
3106 | (( i = i + 1 )) |
---|
3107 | if (( i == 1 )) |
---|
3108 | then |
---|
3109 | printf "\n\n *** execution of INPUT-commands:\n$dashes" |
---|
3110 | fi |
---|
3111 | printf "\n >>> ${in_command[$i]}" |
---|
3112 | eval ${in_command[$i]} |
---|
3113 | if (( i == iic )) |
---|
3114 | then |
---|
3115 | printf "\n$dashes\n" |
---|
3116 | fi |
---|
3117 | done |
---|
3118 | |
---|
3119 | |
---|
3120 | # SET THE REMAINING CPU-TIME |
---|
3121 | cpurest=${cpumax}. |
---|
3122 | |
---|
3123 | |
---|
3124 | # START DVR STREAMING SERVER |
---|
3125 | if [[ $(echo $package_list | grep -c dvrp_graphics) != 0 ]] |
---|
3126 | then |
---|
3127 | if [[ "$dvr_server" != "" ]] |
---|
3128 | then |
---|
3129 | |
---|
3130 | printf "\n\n *** preparing the dvr streaming server configuration file" |
---|
3131 | |
---|
3132 | # CHECK, IF A DVR SERVER IS ALREADY RUNNING |
---|
3133 | running_dvrserver_id=`echo $(ps -edaf | grep .dvrserver.config | grep -v grep) | cut -d" " -f2` |
---|
3134 | if [[ "$running_dvrserver_id" != "" ]] |
---|
3135 | then |
---|
3136 | |
---|
3137 | printf "\n\n +++ WARNING: A dvr server with id=$running_dvrserver_id is already running!" |
---|
3138 | printf "\n This server is used instead starting a new one!" |
---|
3139 | printf "\n If required, script \"process_dvr_output\" has to be run manually." |
---|
3140 | |
---|
3141 | else |
---|
3142 | |
---|
3143 | # COPY CONFIGURATION FILE FOR STREAMING SERVER FROM REPOSITORY TO HERE |
---|
3144 | if [[ -f ${PALM_BIN}/.dvrserver.config ]] |
---|
3145 | then |
---|
3146 | cp ${PALM_BIN}/.dvrserver.config . |
---|
3147 | |
---|
3148 | # ENTERING THE BASEDIR, UID AND GID INTO THIS FILE |
---|
3149 | user_id=`id -u` |
---|
3150 | group_id=`id -g` |
---|
3151 | |
---|
3152 | # "&" IS REQUIRED AS A SEPERATOR, BECAUSE TEMPDIR CONTAINS "/" |
---|
3153 | sed "s&<replace by dvr data directory>&${TEMPDIR}&g" .dvrserver.config > .dvrserver.1 |
---|
3154 | sed "s/<replace by user id>/$user_id/g" .dvrserver.1 > .dvrserver.2 |
---|
3155 | sed "s/<replace by group id>/$group_id/g" .dvrserver.2 > .dvrserver.3 |
---|
3156 | mv .dvrserver.3 .dvrserver.config |
---|
3157 | rm .dvrserver.1 .dvrserver.2 |
---|
3158 | |
---|
3159 | # START DVR SERVER IN BACKGROUND, GET HIS ID AND PRINT ON TERMINAL |
---|
3160 | $dvr_server .dvrserver.config >> DVR_LOGFILE 2>&1 & |
---|
3161 | dvrserver_id=`echo $(ps -edaf | grep .dvrserver.config) | cut -d" " -f2` |
---|
3162 | printf "\n *** streaming server with id=$dvrserver_id is started in background" |
---|
3163 | local_dvrserver_running=.TRUE. |
---|
3164 | else |
---|
3165 | printf "\n +++ missing file \".dvrserver.config\" in directory:" |
---|
3166 | printf "\n \"$PALM_BIN\" " |
---|
3167 | locat=dvr |
---|
3168 | exit |
---|
3169 | fi |
---|
3170 | |
---|
3171 | fi |
---|
3172 | |
---|
3173 | else |
---|
3174 | printf "\n\n --- INFORMATIVE: no dvr streaming server will be started" |
---|
3175 | fi |
---|
3176 | fi |
---|
3177 | |
---|
3178 | |
---|
3179 | # CREATE THE NAMELIST-FILE WITH VALUES OF ENVIRONMENT-VARIABLES REQUIRED BY PALM |
---|
3180 | # (FILE ENVPAR WILL BE READ BY PALM) |
---|
3181 | cat > ENVPAR << %%END%% |
---|
3182 | &envpar run_identifier = '$fname', host = '$localhost', |
---|
3183 | write_binary = '$write_binary', tasks_per_node = $tasks_per_node, |
---|
3184 | maximum_parallel_io_streams = $maximum_parallel_io_streams, |
---|
3185 | maximum_cpu_time_allowed = ${cpumax}., |
---|
3186 | revision = '$global_revision', |
---|
3187 | local_dvrserver_running = $local_dvrserver_running, |
---|
3188 | batch_job = $batch_job / |
---|
3189 | |
---|
3190 | %%END%% |
---|
3191 | |
---|
3192 | |
---|
3193 | # STARTING THE EXECUTABLE |
---|
3194 | printf "\n\n *** execution starts in directory\n \"`pwd`\"\n$dashes\n" |
---|
3195 | PATH=$PATH:$TEMPDIR |
---|
3196 | |
---|
3197 | # MPI DEBUG OPTION (ARGUMENT CHECKING, SLOWS DOWN EXECUTION DUE TO INCREASED LATENCY) |
---|
3198 | if [[ "$mpi_debug" = true ]] |
---|
3199 | then |
---|
3200 | export MPI_CHECK_ARGS=1 |
---|
3201 | printf "\n +++ MPI_CHECK_ARGS=$MPI_CHECK_ARGS" |
---|
3202 | fi |
---|
3203 | |
---|
3204 | if [[ "$totalview" = true ]] |
---|
3205 | then |
---|
3206 | printf "\n *** totalview debugger will be used" |
---|
3207 | tv_opt="-tv" |
---|
3208 | else |
---|
3209 | tv_opt="" |
---|
3210 | fi |
---|
3211 | |
---|
3212 | if [[ "$cond1" = debug || "$cond2" = debug ]] |
---|
3213 | then |
---|
3214 | if [[ "$ENVIRONMENT" = BATCH ]] |
---|
3215 | then |
---|
3216 | continue |
---|
3217 | fi |
---|
3218 | if [[ $localhost = ibmh ]] |
---|
3219 | then |
---|
3220 | |
---|
3221 | # SETUP THE IBM MPI ENVIRONMENT |
---|
3222 | export MP_SHARED_MEMORY=yes |
---|
3223 | export AIXTHREADS_SCOPE=S |
---|
3224 | export OMP_NUM_THREADS=$threads_per_task |
---|
3225 | export AUTHSTATE=files |
---|
3226 | export XLFRTEOPTS="nlwidth=132:err_recovery=no" # RECORD-LENGTH OF NAMELIST-OUTPUT |
---|
3227 | |
---|
3228 | # FOLLOWING OPTIONS ARE MANDATORY FOR TOTALVIEW |
---|
3229 | export MP_ADAPTER_USE=shared |
---|
3230 | export MP_CPU_USE=multiple |
---|
3231 | export MP_TIMEOUT=1200 |
---|
3232 | |
---|
3233 | unset MP_TASK_AFFINITY |
---|
3234 | |
---|
3235 | # SO FAR, TOTALVIEW NEEDS HOSTFILE MECHANISM FOR EXECUTION |
---|
3236 | #(( ii = 1 )) |
---|
3237 | #while (( ii <= $numprocs )) |
---|
3238 | #do |
---|
3239 | # echo $localhost_realname >> hostfile |
---|
3240 | # (( ii = ii + 1 )) |
---|
3241 | #done |
---|
3242 | #export MP_HOSTFILE=hostfile |
---|
3243 | |
---|
3244 | if [[ "$LOADLBATCH" = yes ]] |
---|
3245 | then |
---|
3246 | totalview poe a.out $ROPTS |
---|
3247 | else |
---|
3248 | echo totalview poe -a a.out -procs $numprocs -rmpool 0 -nodes 1 $ROPTS |
---|
3249 | export TVDSVRLAUNCHCMD=ssh |
---|
3250 | totalview poe -a a.out -procs $numprocs -rmpool 0 -nodes 1 $ROPTS |
---|
3251 | fi |
---|
3252 | |
---|
3253 | fi # END DEBUG MODE |
---|
3254 | |
---|
3255 | else |
---|
3256 | |
---|
3257 | # NORMAL EXECUTION |
---|
3258 | if [[ -n $numprocs ]] |
---|
3259 | then |
---|
3260 | |
---|
3261 | # RUNNING THE PROGRAM ON PARALLEL MACHINES |
---|
3262 | if [[ $(echo $host | cut -c1-3) = ibm ]] |
---|
3263 | then |
---|
3264 | |
---|
3265 | # SETUP THE IBM MPI ENVIRONMENT |
---|
3266 | if [[ $host != ibmh && $host != ibmkisti ]] |
---|
3267 | then |
---|
3268 | export MP_SHARED_MEMORY=yes |
---|
3269 | export AIXTHREAD_SCOPE=S |
---|
3270 | export OMP_NUM_THREADS=$threads_per_task |
---|
3271 | export XLSMPOPTS="spins=0:yields=0:stack=20000000" |
---|
3272 | export AUTHSTATE=files |
---|
3273 | export XLFRTEOPTS="nlwidth=132:err_recovery=no" # RECORD-LENGTH OF NAMELIST-OUTPUT |
---|
3274 | # export MP_PRINTENV=yes |
---|
3275 | |
---|
3276 | # TUNING-VARIABLES TO IMPROVE COMMUNICATION SPEED |
---|
3277 | # DO NOT SHOW SIGNIFICANT EFFECTS (SEP 04, FEDERATION-SWITCH) |
---|
3278 | export MP_WAIT_MODE=poll |
---|
3279 | [[ $node_usage = not_shared ]] && export MP_SINGLE_THREAD=yes |
---|
3280 | fi |
---|
3281 | |
---|
3282 | if [[ $host = ibmkisti ]] |
---|
3283 | then |
---|
3284 | export LANG=en_US |
---|
3285 | export MP_SHARED_MEMORY=yes |
---|
3286 | if [[ $threads_per_task = 1 ]] |
---|
3287 | then |
---|
3288 | export MP_SINGLE_THREAD=yes |
---|
3289 | export MEMORY_AFFINITY=MCM |
---|
3290 | else |
---|
3291 | export OMP_NUM_THREADS=$threads_per_task |
---|
3292 | fi |
---|
3293 | fi |
---|
3294 | |
---|
3295 | if [[ "$LOADLBATCH" = yes ]] |
---|
3296 | then |
---|
3297 | printf "\n--- Control: OMP_NUM_THREADS = \"$OMP_NUM_THREADS\" \n" |
---|
3298 | if [[ "$cond1" = hpmcount || "$cond2" = hpmcount ]] |
---|
3299 | then |
---|
3300 | /opt/optibm/HPM_2_4_1/bin/hpmcount a.out $ROPTS |
---|
3301 | else |
---|
3302 | if [[ $run_coupled_model = false ]] |
---|
3303 | then |
---|
3304 | if [[ "$ocean_file_appendix" = true ]] |
---|
3305 | then |
---|
3306 | echo "precursor_ocean" > runfile_atmos |
---|
3307 | else |
---|
3308 | echo "precursor_atmos" > runfile_atmos |
---|
3309 | fi |
---|
3310 | else |
---|
3311 | (( iia = $numprocs_atmos / $threads_per_task )) |
---|
3312 | (( iio = $numprocs_ocean / $threads_per_task )) |
---|
3313 | printf "\n coupled run ($iia atmosphere, $iio ocean)" |
---|
3314 | printf "\n using $coupled_mode coupling" |
---|
3315 | printf "\n\n" |
---|
3316 | echo "coupled_run $iia $iio" > runfile_atmos |
---|
3317 | fi |
---|
3318 | poe ./a.out $ROPTS < runfile_atmos |
---|
3319 | fi |
---|
3320 | else |
---|
3321 | if [[ $localhost = ibmh || $localhost = ibms ]] |
---|
3322 | then |
---|
3323 | poe a.out -procs $numprocs -nodes 1 -rmpool 0 $ROPTS |
---|
3324 | elif [[ $localhost = ibmkisti || $localhost = ibmku ]] |
---|
3325 | then |
---|
3326 | if [[ -f $hostfile ]] |
---|
3327 | then |
---|
3328 | cp $hostfile hostfile |
---|
3329 | else |
---|
3330 | (( ii = 1 )) |
---|
3331 | while (( ii <= $numprocs )) |
---|
3332 | do |
---|
3333 | echo $localhost_realname >> hostfile |
---|
3334 | (( ii = ii + 1 )) |
---|
3335 | done |
---|
3336 | fi |
---|
3337 | export MP_HOSTFILE=hostfile |
---|
3338 | if [[ $run_coupled_model = false ]] |
---|
3339 | then |
---|
3340 | if [[ "$ocean_file_appendix" = true ]] |
---|
3341 | then |
---|
3342 | echo "precursor_ocean" > runfile_atmos |
---|
3343 | else |
---|
3344 | echo "precursor_atmos" > runfile_atmos |
---|
3345 | fi |
---|
3346 | else |
---|
3347 | (( iia = $numprocs_atmos / $threads_per_task )) |
---|
3348 | (( iio = $numprocs_ocean / $threads_per_task )) |
---|
3349 | printf "\n coupled run ($iia atmosphere, $iio ocean)" |
---|
3350 | printf "\n using $coupled_mode coupling" |
---|
3351 | printf "\n\n" |
---|
3352 | echo "coupled_run $iia $iio" > runfile_atmos |
---|
3353 | fi |
---|
3354 | |
---|
3355 | poe ./a.out -procs $numprocs $ROPTS < runfile_atmos |
---|
3356 | |
---|
3357 | else |
---|
3358 | if [[ "$host_file" = "" ]] |
---|
3359 | then |
---|
3360 | printf "\n +++ no hostfile given in configuration file" |
---|
3361 | locat=config_file |
---|
3362 | exit |
---|
3363 | else |
---|
3364 | eval host_file=$host_file |
---|
3365 | fi |
---|
3366 | export MP_HOSTFILE=$host_file |
---|
3367 | poe a.out -procs $numprocs -tasks_per_node $numprocs $ROPTS |
---|
3368 | fi |
---|
3369 | fi |
---|
3370 | elif [[ $host = nech ]] |
---|
3371 | then |
---|
3372 | (( ii = nodes )) |
---|
3373 | if [[ $ii = 1 ]] |
---|
3374 | then |
---|
3375 | export F_ERRCNT=0 # acceptable number of errors before program is stopped |
---|
3376 | export MPIPROGINF=YES |
---|
3377 | # export F_TRACE=YES|FMT1|FMT2 # output of ftrace informations to job protocol |
---|
3378 | echo "*** execution on single node with mpirun" |
---|
3379 | mpirun -np $numprocs ./a.out $ROPTS |
---|
3380 | else |
---|
3381 | (( i = 0 )) |
---|
3382 | while (( i < ii )) |
---|
3383 | do |
---|
3384 | echo "-h $i -p $tasks_per_node -e ./mpi_exec_shell" >> multinode_config |
---|
3385 | (( i = i + 1 )) |
---|
3386 | done |
---|
3387 | |
---|
3388 | echo "#!/bin/sh" > mpi_exec_shell |
---|
3389 | echo " " >> mpi_exec_shell |
---|
3390 | echo "set -u" >> mpi_exec_shell |
---|
3391 | echo "F_ERRCNT=0" >> mpi_exec_shell |
---|
3392 | echo "MPIPROGINV=YES" >> mpi_exec_shell |
---|
3393 | echo "OMP_NUM_THREADS=$threads_per_task" >> mpi_exec_shell |
---|
3394 | echo "cpurest=$cpurest" >> mpi_exec_shell |
---|
3395 | echo "fname=$fname" >> mpi_exec_shell |
---|
3396 | echo "localhost=$localhost" >> mpi_exec_shell |
---|
3397 | echo "return_addres=$return_addres" >> mpi_exec_shell |
---|
3398 | echo "return_username=$return_username" >> mpi_exec_shell |
---|
3399 | echo "tasks_per_node=$tasks_per_node" >> mpi_exec_shell |
---|
3400 | echo "write_binary=$write_binary" >> mpi_exec_shell |
---|
3401 | echo "use_seperate_pe_for_dvrp_output=$use_seperate_pe_for_dvrp_output" >> mpi_exec_shell |
---|
3402 | echo " " >> mpi_exec_shell |
---|
3403 | echo "export F_ERRCNT" >> mpi_exec_shell |
---|
3404 | echo "export MPIPROGINV" >> mpi_exec_shell |
---|
3405 | echo "export OMP_NUM_THREADS" >> mpi_exec_shell |
---|
3406 | echo "export cpurest" >> mpi_exec_shell |
---|
3407 | echo "export fname" >> mpi_exec_shell |
---|
3408 | echo "export localhost" >> mpi_exec_shell |
---|
3409 | echo "export return_addres" >> mpi_exec_shell |
---|
3410 | echo "export return_username" >> mpi_exec_shell |
---|
3411 | echo "export tasks_per_node" >> mpi_exec_shell |
---|
3412 | echo "export write_binary" >> mpi_exec_shell |
---|
3413 | echo "export use_seperate_pe_for_dvrp_output" >> mpi_exec_shell |
---|
3414 | echo " " >> mpi_exec_shell |
---|
3415 | echo "exec ./a.out" >> mpi_exec_shell |
---|
3416 | |
---|
3417 | chmod u+x mpi_exec_shell |
---|
3418 | export MPIPROGINF=YES |
---|
3419 | mpirun -f multinode_config & |
---|
3420 | wait |
---|
3421 | |
---|
3422 | fi |
---|
3423 | elif [[ $(echo $host | cut -c1-2) = lc && $host != lckyoto && $host != lctit ]] |
---|
3424 | then |
---|
3425 | |
---|
3426 | # COPY HOSTFILE FROM SOURCE DIRECTORY OR CREATE IT, IF IT |
---|
3427 | # DOES NOT EXIST |
---|
3428 | if [[ $host != lccrayb &&$host != lccrayf && $host != lccrayh && $host != lckyuh && $host != lckyut ]] |
---|
3429 | then |
---|
3430 | if [[ -f $hostfile ]] |
---|
3431 | then |
---|
3432 | cp $hostfile hostfile |
---|
3433 | (( ii = $numprocs / $threads_per_task )) |
---|
3434 | else |
---|
3435 | (( ii = 1 )) |
---|
3436 | while (( ii <= $numprocs / $threads_per_task )) |
---|
3437 | do |
---|
3438 | echo $localhost_realname >> hostfile |
---|
3439 | (( ii = ii + 1 )) |
---|
3440 | done |
---|
3441 | fi |
---|
3442 | eval zeile=\"`head -n $ii hostfile`\" |
---|
3443 | printf "\n *** running on: $zeile" |
---|
3444 | fi |
---|
3445 | |
---|
3446 | (( ii = $numprocs / $threads_per_task )) |
---|
3447 | export OMP_NUM_THREADS=$threads_per_task |
---|
3448 | |
---|
3449 | if [[ $threads_per_task != 1 ]] |
---|
3450 | then |
---|
3451 | # INCREASE STACK SIZE TO UNLIMITED, BECAUSE OTHERWISE LARGE RUNS |
---|
3452 | # MAY ABORT |
---|
3453 | ulimit -s unlimited |
---|
3454 | printf "\n threads per task: $threads_per_task stacksize: unlimited" |
---|
3455 | fi |
---|
3456 | if [[ $run_coupled_model = false ]] |
---|
3457 | then |
---|
3458 | if [[ "$ocean_file_appendix" = true ]] |
---|
3459 | then |
---|
3460 | echo "precursor_ocean" > runfile_atmos |
---|
3461 | else |
---|
3462 | echo "precursor_atmos" > runfile_atmos |
---|
3463 | fi |
---|
3464 | printf "\n\n" |
---|
3465 | |
---|
3466 | if [[ $host = lccrayb || $host = lccrayh ]] |
---|
3467 | then |
---|
3468 | echo "--- aprun -n $ii -N $tasks_per_node a.out $ROPTS < runfile_atmos" |
---|
3469 | aprun -n $ii -N $tasks_per_node a.out $ROPTS < runfile_atmos |
---|
3470 | # aprun -n $ii -ss -r2 -j1 a.out $ROPTS < runfile_atmos |
---|
3471 | elif [[ $host = lccrayf ]] |
---|
3472 | then |
---|
3473 | aprun -j1 -n $ii -N $tasks_per_node -m ${memory}M a.out $ROPTS < runfile_atmos |
---|
3474 | elif [[ $host = lcxe6 || $host = lcxt5m ]] |
---|
3475 | then |
---|
3476 | aprun -n $ii -N $tasks_per_node a.out $ROPTS < runfile_atmos |
---|
3477 | elif [[ $host = lcflow ]] |
---|
3478 | then |
---|
3479 | mpirun -bootstrap sge -np $ii -env I_MPI_FABRICS shm:ofa a.out < runfile_atmos $ROPTS |
---|
3480 | elif [[ $host = lcsb ]] |
---|
3481 | then |
---|
3482 | mpirun_rsh -hostfile $PBS_NODEFILE -np `cat $PBS_NODEFILE | wc -l` a.out < runfile_atmos $ROPTS |
---|
3483 | elif [[ $host = lckiaps ]] |
---|
3484 | then |
---|
3485 | mpirun -np $ii -f $PBS_NODEFILE a.out < runfile_atmos $ROPTS |
---|
3486 | elif [[ $host = lckyu* ]] |
---|
3487 | then |
---|
3488 | mpiexec -n $ii --stdin runfile_atmos ./a.out $ROPTS |
---|
3489 | else |
---|
3490 | mpiexec -machinefile hostfile -n $ii a.out < runfile_atmos $ROPTS |
---|
3491 | fi |
---|
3492 | else |
---|
3493 | |
---|
3494 | # CURRENTLY THERE IS NO FULL MPI-2 SUPPORT ON ICE AND XT4 |
---|
3495 | (( iia = $numprocs_atmos / $threads_per_task )) |
---|
3496 | (( iio = $numprocs_ocean / $threads_per_task )) |
---|
3497 | printf "\n coupled run ($iia atmosphere, $iio ocean)" |
---|
3498 | printf "\n using $coupled_mode coupling" |
---|
3499 | printf "\n\n" |
---|
3500 | |
---|
3501 | if [[ $coupled_mode = "mpi2" ]] |
---|
3502 | then |
---|
3503 | echo "atmosphere_to_ocean $iia $iio" > runfile_atmos |
---|
3504 | echo "ocean_to_atmosphere $iia $iio" > runfile_ocean |
---|
3505 | |
---|
3506 | if [[ $host = lccrayf || $host = lcxe6 || $host = lcxt5m ]] |
---|
3507 | then |
---|
3508 | |
---|
3509 | aprun -n $iia -N $tasks_per_node a.out < runfile_atmos $ROPTS & |
---|
3510 | aprun -n $iio -N $tasks_per_node a.out < runfile_ocean $ROPTS & |
---|
3511 | |
---|
3512 | else |
---|
3513 | # WORKAROUND BECAUSE mpiexec WITH -env option IS NOT AVAILABLE ON SOME SYSTEMS |
---|
3514 | mpiexec -machinefile hostfile -n $iia a.out $ROPTS < runfile_atmos & |
---|
3515 | mpiexec -machinefile hostfile -n $iio a.out $ROPTS < runfile_ocean & |
---|
3516 | # mpiexec -machinefile hostfile -n $iia -env coupling_mode atmosphere_to_ocean a.out $ROPTS & |
---|
3517 | # mpiexec -machinefile hostfile -n $iio -env coupling_mode ocean_to_atmosphere a.out $ROPTS & |
---|
3518 | fi |
---|
3519 | wait |
---|
3520 | |
---|
3521 | else |
---|
3522 | |
---|
3523 | echo "coupled_run $iia $iio" > runfile_atmos |
---|
3524 | |
---|
3525 | if [[ $host = lccrayf || $host = lcxe6 || $host = lcxt5m ]] |
---|
3526 | then |
---|
3527 | |
---|
3528 | aprun -n $ii -N $tasks_per_node a.out < runfile_atmos $ROPTS |
---|
3529 | |
---|
3530 | elif [[ $host = lck || $host = lckordi ]] |
---|
3531 | then |
---|
3532 | |
---|
3533 | mpiexec -n $ii ./a.out $ROPTS < runfile_atmos & |
---|
3534 | |
---|
3535 | elif [[ $host = lckyu* ]] |
---|
3536 | then |
---|
3537 | |
---|
3538 | mpiexec -n $ii --stdin runfile_atmos ./a.out $ROPTS |
---|
3539 | |
---|
3540 | fi |
---|
3541 | wait |
---|
3542 | fi |
---|
3543 | |
---|
3544 | fi |
---|
3545 | |
---|
3546 | elif [[ $host = lckyoto ]] |
---|
3547 | then |
---|
3548 | set -xv |
---|
3549 | export P4_RSHCOMMAND=plesh |
---|
3550 | echo " P4_RSHCOMMAND = $P4_RSHCOMMAND" |
---|
3551 | if [[ "$ENVIRONMENT" = BATCH ]] |
---|
3552 | then |
---|
3553 | if [[ "$cond2" = fujitsu ]] |
---|
3554 | then |
---|
3555 | mpiexec -n $numprocs ./a.out $ROPTS # for fujitsu-compiler |
---|
3556 | elif [[ "cond2" = pgi ]] |
---|
3557 | then |
---|
3558 | mpirun -np $numprocs -machinefile ${QSUB_NODEINF} ./a.out $ROPTS |
---|
3559 | else |
---|
3560 | mpirun_rsh -np $numprocs -hostfile ${QSUB_NODEINF} MV2_USE_SRQ=0 ./a.out ${ROPTS} || /bin/true |
---|
3561 | fi |
---|
3562 | else |
---|
3563 | if [[ "$cond2" = "" ]] |
---|
3564 | then |
---|
3565 | mpiruni_rsh -np $numprocs ./a.out $ROPTS # for intel |
---|
3566 | else |
---|
3567 | mpirun -np $numprocs ./a.out $ROPTS |
---|
3568 | fi |
---|
3569 | fi |
---|
3570 | set +xv |
---|
3571 | |
---|
3572 | elif [[ $host = lctit ]] |
---|
3573 | then |
---|
3574 | export OMP_NUM_THREADS=$threads_per_task |
---|
3575 | echo "OMP_NUM_THREADS=$OMP_NUM_THREADS" |
---|
3576 | if [[ "$threads_per_task" != 1 ]] |
---|
3577 | then |
---|
3578 | export MV2_ENABLE_AFFINITY=0 |
---|
3579 | fi |
---|
3580 | echo "----- PBS_NODEFILE content:" |
---|
3581 | cat $PBS_NODEFILE |
---|
3582 | echo "-----" |
---|
3583 | (( ii = $numprocs / $threads_per_task )) |
---|
3584 | echo "mpirun -np $ii -hostfile $PBS_NODEFILE ./a.out $ROPTS" |
---|
3585 | mpirun -np $ii -hostfile $PBS_NODEFILE ./a.out $ROPTS |
---|
3586 | else |
---|
3587 | mpprun -n $numprocs a.out $ROPTS |
---|
3588 | fi |
---|
3589 | else |
---|
3590 | a.out $ROPTS |
---|
3591 | fi |
---|
3592 | fi |
---|
3593 | |
---|
3594 | if [[ $? != 0 ]] |
---|
3595 | then |
---|
3596 | |
---|
3597 | # ABORT IN CASE OF RUNTIME ERRORS |
---|
3598 | printf "\n +++ runtime error occured" |
---|
3599 | locat=execution |
---|
3600 | exit |
---|
3601 | |
---|
3602 | else |
---|
3603 | |
---|
3604 | printf "\n$dashes\n *** execution finished \n" |
---|
3605 | |
---|
3606 | # STOP THE DVR STREAMING SERVER AND PROCESS THE DVR OUTPUT IN ORDER |
---|
3607 | # TO CREAT DVRS- AND HTML-FILES CONTAINING ALL STREAMS |
---|
3608 | if [[ "$dvrserver_id" != "" ]] |
---|
3609 | then |
---|
3610 | kill $dvrserver_id |
---|
3611 | printf "\n *** dvr server with id=$dvrserver_id has been stopped" |
---|
3612 | |
---|
3613 | # IF THERE IS A DIRECTORY, DATA HAVE BEEN OUTPUT BY THE |
---|
3614 | # STREAMING SERVER. OTHERWISE, USER HAS CHOSEN dvrp_output=local |
---|
3615 | if [[ -d DATA_DVR ]] |
---|
3616 | then |
---|
3617 | |
---|
3618 | # ADD THE CURRENT DVR CONFIGURATION FILE TO THE DVR OUTPUT |
---|
3619 | # DIRECTORY |
---|
3620 | cp .dvrserver.config DATA_DVR |
---|
3621 | |
---|
3622 | # PROCESS THE DVR OUTPUT (OPTION -s FOR GENERATING |
---|
3623 | # SEQUENCE MODE DATA TOO) |
---|
3624 | process_dvr_output -d DATA_DVR -f $fname -s |
---|
3625 | |
---|
3626 | else |
---|
3627 | |
---|
3628 | # PROCESS THE LOCAL OUTPUT |
---|
3629 | process_dvr_output -l -d DATA_DVR -f $fname |
---|
3630 | |
---|
3631 | fi |
---|
3632 | |
---|
3633 | elif [[ $(echo $package_list | grep -c dvrp_graphics) != 0 ]] |
---|
3634 | then |
---|
3635 | |
---|
3636 | # PROCESS DVR OUTPUT GENERATD IN LOCAL MODE (dvrp_output=local) |
---|
3637 | process_dvr_output -l -d DATA_DVR -f $fname |
---|
3638 | |
---|
3639 | fi |
---|
3640 | fi |
---|
3641 | |
---|
3642 | |
---|
3643 | |
---|
3644 | # CALL OF combine_plot_fields IN ORDER TO MERGE SINGLE FILES WRITTEN |
---|
3645 | # BY EACH CORE INTO ONE FILE |
---|
3646 | if [[ ! -f ${PALM_BIN}/combine_plot_fields${block}.x ]] |
---|
3647 | then |
---|
3648 | printf "\n\n\n +++ WARNING: no combine_plot_fields found for given block \"$cond1 $cond2\"" |
---|
3649 | printf "\n 2d- and/or 3d-data may be incomplete!" |
---|
3650 | printf "\n Run \"mbuild -u -h $localhost\" to generate utilities for this block.\n" |
---|
3651 | elif [[ "$combine_plot_fields" == true ]] |
---|
3652 | then |
---|
3653 | if [[ $localhost = lccrayh || $localhost = lccrayb ]] |
---|
3654 | then |
---|
3655 | printf "\n\n\n *** post-processing: now executing \"aprun -n 1 -N 1 combine_plot_fields${block}.x\" ..." |
---|
3656 | aprun -n 1 -N 1 combine_plot_fields${block}.x #$ROPTS < runfile_atmos |
---|
3657 | else |
---|
3658 | printf "\n\n\n *** post-processing: now executing \"combine_plot_fields${block}.x\" ..." |
---|
3659 | combine_plot_fields${block}.x |
---|
3660 | fi |
---|
3661 | else |
---|
3662 | |
---|
3663 | # TEMPORARY SOLUTION TO SKIP combine_plot_fields. THIS IS REQUIRED IN CASE OF HUGE AMOUNT OF |
---|
3664 | # DATA OUTPUT. TO DO: EXTEND THIS BRANCH BY CREATING A BATCH JOB for combine_plot_fields. |
---|
3665 | # ??? koennen wir das streichen ??? |
---|
3666 | printf "\n\n\n *** post-processing: skipping combine_plot_fields (-Z option set) ..." |
---|
3667 | fi |
---|
3668 | |
---|
3669 | |
---|
3670 | |
---|
3671 | # EXECUTE OUTPUT-COMMANDS GIVEN IN THE CONFIGURATION FILE |
---|
3672 | (( i = 0 )) |
---|
3673 | while (( i < ioc )) |
---|
3674 | do |
---|
3675 | (( i = i + 1 )) |
---|
3676 | if (( i == 1 )) |
---|
3677 | then |
---|
3678 | printf "\n\n *** execution of OUTPUT-commands:\n$dashes" |
---|
3679 | fi |
---|
3680 | printf "\n >>> ${out_command[$i]}" |
---|
3681 | eval ${out_command[$i]} |
---|
3682 | if (( i == ioc )) |
---|
3683 | then |
---|
3684 | printf "\n$dashes\n" |
---|
3685 | fi |
---|
3686 | done |
---|
3687 | |
---|
3688 | |
---|
3689 | # IN TRACE-MODE PRINT CONTENTS OF THE CURRENT (TEMPORARY) WORKING DIRECTORY |
---|
3690 | if [[ $do_trace = true ]] |
---|
3691 | then |
---|
3692 | printf "\n\n" |
---|
3693 | ls -al |
---|
3694 | fi |
---|
3695 | |
---|
3696 | |
---|
3697 | |
---|
3698 | # COPY LOCAL OUTPUT-FILES TO THEIR PERMANENT DESTINATIONS |
---|
3699 | (( i = 0 )) |
---|
3700 | while (( i < iout )) |
---|
3701 | do |
---|
3702 | (( i = i + 1 )) |
---|
3703 | if (( i == 1 )) |
---|
3704 | then |
---|
3705 | printf "\n\n *** saving OUTPUT-files:\n$dashes" |
---|
3706 | fi |
---|
3707 | |
---|
3708 | # CHECK FOR SINGLE FILE (SERIAL RUN) OR DIRECTORY (ONE FILE PER CORE FOR PARELLEL EXECUTION) |
---|
3709 | files_for_pes=false; filetyp=file |
---|
3710 | if [[ "${actionout[$i]}" = pe && -n $numprocs ]] |
---|
3711 | then |
---|
3712 | files_for_pes=true; filetyp=directory |
---|
3713 | actionout[$i]="" |
---|
3714 | elif [[ "${actionout[$i]}" = pe && ! -n $numprocs ]] |
---|
3715 | then |
---|
3716 | actionout[$i]="" |
---|
3717 | elif [[ "${actionout[$i]}" = arpe && -n $numprocs ]] |
---|
3718 | then |
---|
3719 | files_for_pes=true; filetyp=directory |
---|
3720 | actionout[$i]="ar" |
---|
3721 | elif [[ "${actionout[$i]}" = arpe && ! -n $numprocs ]] |
---|
3722 | then |
---|
3723 | actionout[$i]="ar" |
---|
3724 | elif [[ "${actionout[$i]}" = flpe && -n $numprocs ]] |
---|
3725 | then |
---|
3726 | files_for_pes=true; filetyp=directory |
---|
3727 | actionout[$i]="fl" |
---|
3728 | elif [[ "${actionout[$i]}" = flpe && ! -n $numprocs ]] |
---|
3729 | then |
---|
3730 | actionout[$i]="fl" |
---|
3731 | elif [[ "${actionout[$i]}" = trpe && -n $numprocs ]] |
---|
3732 | then |
---|
3733 | files_for_pes=true; filetyp=directory |
---|
3734 | actionout[$i]="tr" |
---|
3735 | elif [[ "${actionout[$i]}" = trpe && ! -n $numprocs ]] |
---|
3736 | then |
---|
3737 | actionout[$i]="tr" |
---|
3738 | fi |
---|
3739 | |
---|
3740 | if [[ ! -f ${localout[$i]} && $files_for_pes = false ]] |
---|
3741 | then |
---|
3742 | printf "\n +++ temporary OUTPUT-file ${localout[$i]} does not exist\n" |
---|
3743 | elif [[ ! -d ${localout[$i]} && $files_for_pes = true ]] |
---|
3744 | then |
---|
3745 | printf "\n +++ temporary OUTPUT-file ${localout[$i]}/.... does not exist\n" |
---|
3746 | else |
---|
3747 | |
---|
3748 | |
---|
3749 | # COPY VIA SCP TO LOCAL HOST (ALWAYS IN BINARY MODE USING batch_scp option -m) |
---|
3750 | # IF TARGET DIRECTORY DOES NOT EXISTS, TRY TO CREATE IT |
---|
3751 | if [[ "${actionout[$i]}" = tr ]] |
---|
3752 | then |
---|
3753 | if [[ $localhost != $fromhost ]] |
---|
3754 | then |
---|
3755 | if [[ $files_for_pes = false ]] |
---|
3756 | then |
---|
3757 | cps="" |
---|
3758 | cst="" |
---|
3759 | else |
---|
3760 | cps=-c |
---|
3761 | cst="/" |
---|
3762 | fi |
---|
3763 | if [[ $localhost = nech ]] |
---|
3764 | then |
---|
3765 | |
---|
3766 | # TRANSFER IN SEPERATE JOB |
---|
3767 | # FIRST COPY FILE TO TEMPORY DATA DIRECTORY |
---|
3768 | [[ ! -d $tmp_data_catalog/TRANSFER ]] && mkdir -p $tmp_data_catalog/TRANSFER |
---|
3769 | file_to_transfer=${fname}_${localout[$i]}_to_transfer_$kennung |
---|
3770 | if [[ $files_for_pes = false ]] |
---|
3771 | then |
---|
3772 | ln -f ${localout[$i]} $tmp_data_catalog/TRANSFER/$file_to_transfer |
---|
3773 | else |
---|
3774 | mkdir $tmp_data_catalog/TRANSFER/$file_to_transfer |
---|
3775 | ln ${localout[$i]}/* $tmp_data_catalog/TRANSFER/$file_to_transfer |
---|
3776 | fi |
---|
3777 | |
---|
3778 | echo "set -x" > transfer_${localout[$i]} |
---|
3779 | echo "cd $tmp_data_catalog/TRANSFER" >> transfer_${localout[$i]} |
---|
3780 | |
---|
3781 | printf "\n >>> OUTPUT: ${localout[$i]}$cst by SCP in seperate job to" |
---|
3782 | printf "\n ${pathout[$i]}/${localhost}_${fname}${endout[$i]}$cst" |
---|
3783 | printf "\n or higher cycle\n" |
---|
3784 | echo "batch_scp $PORTOPT $cps -b -m -u $return_username $return_addres $file_to_transfer \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" >> transfer_${localout[$i]} |
---|
3785 | |
---|
3786 | echo "[[ \$? = 0 ]] && rm $file_to_transfer" >> transfer_${localout[$i]} |
---|
3787 | |
---|
3788 | if [[ $localhost = nech ]] |
---|
3789 | then |
---|
3790 | subjob -d -c /pf/b/$usern/job_queue -v -q pp -X 0 -m 1000 -t 900 $PORTOPT transfer_${localout[$i]} |
---|
3791 | else |
---|
3792 | if [[ "$LOGNAME" = b323013 ]] |
---|
3793 | then |
---|
3794 | subjob -v -q c1 -X 0 -m 1000 -t 900 -c $job_catalog $PORTOPT transfer_${localout[$i]} |
---|
3795 | else |
---|
3796 | subjob -d -v -q c1 -X 0 -m 1000 -t 900 -c $job_catalog $PORTOPT transfer_${localout[$i]} |
---|
3797 | fi |
---|
3798 | fi |
---|
3799 | |
---|
3800 | else |
---|
3801 | |
---|
3802 | # TRANSFER WITHIN THIS JOB |
---|
3803 | transfer_failed=false |
---|
3804 | printf "\n >>> OUTPUT: ${localout[$i]}$cst by SCP to" |
---|
3805 | printf "\n ${pathout[$i]}/${localhost}_${fname}${endout[$i]}$cst\n" |
---|
3806 | if [[ $localhost = lccrayb ]] |
---|
3807 | then |
---|
3808 | ssh $usern@blogin1 "cd $TEMPDIR; batch_scp $PORTOPT $cps -b -m -u $return_username $return_addres ${localout[$i]} \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" |
---|
3809 | elif [[ $localhost = lccrayh ]] |
---|
3810 | then |
---|
3811 | ssh $usern@hlogin1 "cd $TEMPDIR; batch_scp $PORTOPT $cps -b -m -u $return_username $return_addres ${localout[$i]} \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" |
---|
3812 | else |
---|
3813 | batch_scp $PORTOPT $cps -b -m -u $return_username $return_addres ${localout[$i]} "${pathout[$i]}" ${localhost}_${fname}${endout[$i]} ${extout[$i]} |
---|
3814 | fi |
---|
3815 | [[ $? != 0 ]] && transfer_failed=true |
---|
3816 | |
---|
3817 | # IF TRANSFER FAILED, CREATE BACKUP COPY ON THIS MACHINE |
---|
3818 | if [[ $transfer_failed = true ]] |
---|
3819 | then |
---|
3820 | printf " +++ transfer failed. Trying to save a copy on this host under:\n" |
---|
3821 | printf " ${pathout[$i]}/${localhost}_${fname}${endout[$i]}_$kennung\n" |
---|
3822 | |
---|
3823 | # FIRST CHECK, IF DIRECTORY EXISTS, AND CREATE IT, IF NECESSARY |
---|
3824 | eval local_catalog=${pathout[$i]} |
---|
3825 | if [[ ! -d $local_catalog ]] |
---|
3826 | then |
---|
3827 | printf " *** local directory does not exist. Trying to create:\n" |
---|
3828 | printf " $local_catalog \n" |
---|
3829 | mkdir -p $local_catalog |
---|
3830 | fi |
---|
3831 | eval cp ${localout[$i]} ${pathout[$i]}/${localhost}_${fname}${endout[$i]}_$kennung |
---|
3832 | transfer_problems=true |
---|
3833 | fi |
---|
3834 | fi |
---|
3835 | else |
---|
3836 | |
---|
3837 | # UNSET actionout. DUE TO THIS SETTING, FILE WILL LATER JUST BE COPIED ON THIS MACHINE |
---|
3838 | actionout[$i]="" |
---|
3839 | fi |
---|
3840 | fi |
---|
3841 | |
---|
3842 | |
---|
3843 | # APPEND VIA SCP TO LOCAL HOST (ALWAYS IN BINARY MODE USING batch_scp option -m) |
---|
3844 | # IF TARGET DIRECTORY DOES NOT EXISTS, TRY TO CREATE IT |
---|
3845 | if [[ "${actionout[$i]}" = tra ]] |
---|
3846 | then |
---|
3847 | if [[ $localhost != $fromhost ]] |
---|
3848 | then |
---|
3849 | if [[ $localhost = ibmh || $localhost = nech ]] |
---|
3850 | then |
---|
3851 | |
---|
3852 | # TRANSFER IN SEPERATE JOB |
---|
3853 | # FIRST COPY FILE TO TEMPORY DATA DIRECTORY |
---|
3854 | [[ ! -d $tmp_data_catalog/TRANSFER ]] && mkdir -p $tmp_data_catalog/TRANSFER |
---|
3855 | file_to_transfer=${fname}_${localout[$i]}_to_transfer_$kennung |
---|
3856 | ln -f ${localout[$i]} $tmp_data_catalog/TRANSFER/$file_to_transfer |
---|
3857 | |
---|
3858 | echo "set -x" > transfer_${localout[$i]} |
---|
3859 | echo "cd $tmp_data_catalog/TRANSFER" >> transfer_${localout[$i]} |
---|
3860 | |
---|
3861 | printf "\n >>> OUTPUT: ${localout[$i]} append by SCP in seperate job to" |
---|
3862 | printf "\n ${pathout[$i]}/${localhost}_${fname}${endout[$i]}" |
---|
3863 | printf "\n or higher cycle\n" |
---|
3864 | echo "batch_scp $PORTOPT -A -b -m -u $return_username $return_addres $file_to_transfer \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" >> transfer_${localout[$i]} |
---|
3865 | |
---|
3866 | echo "[[ \$? = 0 ]] && rm $file_to_transfer" >> transfer_${localout[$i]} |
---|
3867 | |
---|
3868 | if [[ $localhost = nech ]] |
---|
3869 | then |
---|
3870 | subjob -d -c /pf/b/$usern/job_queue -v -q pp -X 0 -m 1000 -t 900 $PORTOPT transfer_${localout[$i]} |
---|
3871 | else |
---|
3872 | if [[ $LOGNAME = b323013 ]] |
---|
3873 | then |
---|
3874 | subjob -v -q c1 -X 0 -m 1000 -t 900 -c $job_catalog $PORTOPT transfer_${localout[$i]} |
---|
3875 | else |
---|
3876 | subjob -d -v -q c1 -X 0 -m 1000 -t 900 -c $job_catalog $PORTOPT transfer_${localout[$i]} |
---|
3877 | fi |
---|
3878 | fi |
---|
3879 | |
---|
3880 | else |
---|
3881 | |
---|
3882 | # TRANSFER WITHIN THIS JOB |
---|
3883 | transfer_failed=false |
---|
3884 | printf "\n >>> OUTPUT: ${localout[$i]} append by SCP to" |
---|
3885 | printf "\n ${pathout[$i]}/${localhost}_${fname}${endout[$i]}\n" |
---|
3886 | if [[ $localhost = lccrayb ]] |
---|
3887 | then |
---|
3888 | ssh $usern@blogin1 "cd $TEMPDIR; batch_scp $PORTOPT -A -b -m -u $return_username $return_addres ${localout[$i]} \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" |
---|
3889 | elif [[ $localhost = lccrayh ]] |
---|
3890 | then |
---|
3891 | ssh $usern@hlogin1 "cd $TEMPDIR; batch_scp $PORTOPT -A -b -m -u $return_username $return_addres ${localout[$i]} \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" |
---|
3892 | else |
---|
3893 | batch_scp $PORTOPT -A -b -m -u $return_username $return_addres ${localout[$i]} "${pathout[$i]}" ${localhost}_${fname}${endout[$i]} ${extout[$i]} |
---|
3894 | fi |
---|
3895 | [[ $? != 0 ]] && transfer_failed=true |
---|
3896 | |
---|
3897 | # IF TRANSFER FAILED, CREATE BACKUP COPY ON THIS MACHINE |
---|
3898 | if [[ $transfer_failed = true ]] |
---|
3899 | then |
---|
3900 | printf " +++ transfer failed. Trying to save a copy on this host under:\n" |
---|
3901 | printf " ${pathout[$i]}/${localhost}_${fname}${endout[$i]}_$kennung\n" |
---|
3902 | |
---|
3903 | # FIRST CHECK, IF DIRECTORY EXISTS, AND CREATE IT, IF NECESSARY |
---|
3904 | eval local_catalog=${pathout[$i]} |
---|
3905 | if [[ ! -d $local_catalog ]] |
---|
3906 | then |
---|
3907 | printf " *** local directory does not exist. Trying to create:\n" |
---|
3908 | printf " $local_catalog \n" |
---|
3909 | mkdir -p $local_catalog |
---|
3910 | fi |
---|
3911 | |
---|
3912 | eval cp ${localout[$i]} ${pathout[$i]}/${localhost}_${fname}${endout[$i]}_$kennung |
---|
3913 | transfer_problems=true |
---|
3914 | fi |
---|
3915 | fi |
---|
3916 | else |
---|
3917 | |
---|
3918 | # RESET actionout. DUE TO THIS SETTING, FILE WILL LATER JUST BE APPENDED ON THIS MACHINE |
---|
3919 | actionout[$i]=a |
---|
3920 | fi |
---|
3921 | fi |
---|
3922 | |
---|
3923 | |
---|
3924 | # OUTPUT-FILE FOR A RESTART-RUN. |
---|
3925 | # FILE IS MOVED TO THE TEMPORARY DATA DIRECTORY USING link COMMAND. |
---|
3926 | # OPTION -f IS USED TO OVERWRITE EXISTING FILES. |
---|
3927 | # AS LAST ACTION, ARCHIVING IS INITIATED. |
---|
3928 | if [[ "${actionout[$i]}" = fl ]] |
---|
3929 | then |
---|
3930 | [[ ! -d $tmp_data_catalog ]] && mkdir -p $tmp_data_catalog |
---|
3931 | chmod g+rx $tmp_data_catalog |
---|
3932 | if [[ $files_for_pes = false ]] |
---|
3933 | then |
---|
3934 | printf "\n >>> OUTPUT: ${localout[$i]} to" |
---|
3935 | printf "\n $tmp_data_catalog/${frelout[$i]} (temporary data catalog)\n" |
---|
3936 | ln -f ${localout[$i]} $tmp_data_catalog/${frelout[$i]} |
---|
3937 | else |
---|
3938 | printf "\n >>> OUTPUT: ${localout[$i]}/.... to" |
---|
3939 | printf "\n $tmp_data_catalog/${frelout[$i]} (temporary data catalog)\n" |
---|
3940 | mkdir $tmp_data_catalog/${frelout[$i]} |
---|
3941 | cd ${localout[$i]} |
---|
3942 | for file in $(ls *) |
---|
3943 | do |
---|
3944 | ln -f $file $tmp_data_catalog/${frelout[$i]} |
---|
3945 | done |
---|
3946 | cd $TEMPDIR |
---|
3947 | fi |
---|
3948 | |
---|
3949 | |
---|
3950 | # CREATE AND SUBMIT ARCHIVING-JOB |
---|
3951 | if [[ $store_on_archive_system = true ]] |
---|
3952 | then |
---|
3953 | |
---|
3954 | if [[ $archive_system = asterix ]] |
---|
3955 | then |
---|
3956 | echo "cd $tmp_data_catalog" >> archive_${frelout[$i]} |
---|
3957 | if [[ $files_for_pes = false ]] |
---|
3958 | then |
---|
3959 | echo "stageout ${frelout[$i]} > STAGE_OUTPUT${i}_$kennung" >> archive_${frelout[$i]} |
---|
3960 | else |
---|
3961 | echo "stageout -t ${frelout[$i]} > STAGE_OUTPUT${i}_$kennung" >> archive_${frelout[$i]} |
---|
3962 | fi |
---|
3963 | echo "cat STAGE_OUTPUT${i}_$kennung" >> archive_${frelout[$i]} |
---|
3964 | echo "if [[ \$(grep -c \"st.msg:150\" STAGE_OUTPUT${i}_$kennung) != 0 ]]" >> archive_${frelout[$i]} |
---|
3965 | echo "then" >> archive_${frelout[$i]} |
---|
3966 | echo " do_stageout=false" >> archive_${frelout[$i]} |
---|
3967 | echo "else" >> archive_${frelout[$i]} |
---|
3968 | echo " echo \" +++ $filetyp ${frelout[$i]} could not be stored on archive-system\" " >> archive_${frelout[$i]} |
---|
3969 | echo " cat /dev/null > ~/job_queue/ARCHIVE_ERROR_$fname" >> archive_${frelout[$i]} |
---|
3970 | echo " cat STAGE_OUTPUT${i}_$kennung > ~/job_queue/archive_${frelout[$i]}_error" >> archive_${frelout[$i]} |
---|
3971 | echo " echo \" *** $filetyp ${frelout[$i]} will be copied to \$WORK as backup\" " >> archive_${frelout[$i]} |
---|
3972 | if [[ $files_for_pes = false ]] |
---|
3973 | then |
---|
3974 | echo " cp ${frelout[$i]} \$WORK" >> archive_${frelout[$i]} |
---|
3975 | else |
---|
3976 | echo " cp -r ${frelout[$i]} \$WORK/${frelout[$i]}" >> archive_${frelout[$i]} |
---|
3977 | fi |
---|
3978 | echo " echo \" *** $filetyp ${frelout[$i]} saved\" " >> archive_${frelout[$i]} |
---|
3979 | echo "fi" >> archive_${frelout[$i]} |
---|
3980 | echo "rm STAGE_OUTPUT${i}_$kennung" >> archive_${frelout[$i]} |
---|
3981 | elif [[ $archive_system = DMF ]] |
---|
3982 | then |
---|
3983 | echo "cd $tmp_data_catalog" >> archive_${frelout[$i]} |
---|
3984 | if [[ $files_for_pes = false ]] |
---|
3985 | then |
---|
3986 | printf "\n +++ archiving of single files impossible with $archive_system !\n" |
---|
3987 | locat=DMF |
---|
3988 | exit |
---|
3989 | else |
---|
3990 | # ??? nicht benötigte Archiv-Systeme entfernen ??? |
---|
3991 | # FUER RECHNER IN JUELICH. DORT KOENNTEN AUCH |
---|
3992 | # EINZELNE DATEIEN GESICHERT WERDEN (SPAETER KORR.) |
---|
3993 | echo "rm -rf \$ARCHIVE/${frelout[$i]}" >> archive_${frelout[$i]} |
---|
3994 | echo "cp -r ${frelout[$i]} \$ARCHIVE" >> archive_${frelout[$i]} |
---|
3995 | fi |
---|
3996 | elif [[ $archive_system = tivoli ]] |
---|
3997 | then |
---|
3998 | echo "cd $tmp_data_catalog" >> archive_${frelout[$i]} |
---|
3999 | if [[ $files_for_pes = false ]] |
---|
4000 | then |
---|
4001 | # REMOVE EXISTING OLD FILES FROM THE ARCHIVE |
---|
4002 | echo "set -x" >> archive_${frelout[$i]} |
---|
4003 | echo "rm -rf \$PERM/${frelout[$i]}" >> archive_${frelout[$i]} |
---|
4004 | echo "cp ${frelout[$i]} \$PERM/${frelout[$i]}" >> archive_${frelout[$i]} |
---|
4005 | else |
---|
4006 | |
---|
4007 | echo "set -x" >> archive_${frelout[$i]} |
---|
4008 | echo "rm -rf \$PERM/${frelout[$i]}/*" >> archive_${frelout[$i]} |
---|
4009 | echo "[[ ! -d \$PERM/${frelout[$i]} ]] && mkdir $PERM/${frelout[$i]}" >> archive_${frelout[$i]} |
---|
4010 | cd $tmp_data_catalog |
---|
4011 | all_files=`ls -1 ${frelout[$i]}/*` |
---|
4012 | cd - > /dev/null |
---|
4013 | (( inode = 0 )) |
---|
4014 | (( tp1 = tasks_per_node + 1 )) |
---|
4015 | while (( inode < nodes )) |
---|
4016 | do |
---|
4017 | files=`echo $all_files | cut -d" " -f1-$tasks_per_node` |
---|
4018 | all_files=`echo $all_files | cut -d" " -f$tp1-` |
---|
4019 | echo "tar cvf \$PERM/${frelout[$i]}/${frelout[$i]}.node_$inode.tar $files" >> archive_${frelout[$i]} |
---|
4020 | (( inode = inode + 1 )) |
---|
4021 | done |
---|
4022 | fi |
---|
4023 | elif [[ $archive_system = ut ]] |
---|
4024 | then |
---|
4025 | echo "cd $tmp_data_catalog" >> archive_${frelout[$i]} |
---|
4026 | if [[ $files_for_pes = false ]] |
---|
4027 | then |
---|
4028 | # REMOVE EXISTING OLD FILES FROM THE ARCHIVE |
---|
4029 | echo "set -x" >> archive_${frelout[$i]} |
---|
4030 | echo "rm -rf \$UT/${frelout[$i]}" >> archive_${frelout[$i]} |
---|
4031 | echo "cp ${frelout[$i]} \$UT/${frelout[$i]}" >> archive_${frelout[$i]} |
---|
4032 | else |
---|
4033 | |
---|
4034 | echo "set -x" >> archive_${frelout[$i]} |
---|
4035 | echo "rm -rf \$UT/${frelout[$i]}/*" >> archive_${frelout[$i]} |
---|
4036 | echo "[[ ! -d \$UT/${frelout[$i]} ]] && mkdir $UT/${frelout[$i]}" >> archive_${frelout[$i]} |
---|
4037 | cd $tmp_data_catalog |
---|
4038 | all_files=`ls -1 ${frelout[$i]}/*` |
---|
4039 | cd - > /dev/null |
---|
4040 | (( inode = 0 )) |
---|
4041 | (( tp1 = tasks_per_node + 1 )) |
---|
4042 | while (( inode < nodes )) |
---|
4043 | do |
---|
4044 | files=`echo $all_files | cut -d" " -f1-$tasks_per_node` |
---|
4045 | all_files=`echo $all_files | cut -d" " -f$tp1-` |
---|
4046 | echo "tar cvf \$UT/${frelout[$i]}/${frelout[$i]}.node_$inode.tar $files" >> archive_${frelout[$i]} |
---|
4047 | (( inode = inode + 1 )) |
---|
4048 | done |
---|
4049 | fi |
---|
4050 | elif [[ $archive_system = none ]] |
---|
4051 | then |
---|
4052 | printf " +++ archiving on $localhost not available!\n" |
---|
4053 | fi |
---|
4054 | |
---|
4055 | if [[ $archive_system != none ]] |
---|
4056 | then |
---|
4057 | if [[ $localhost = nech ]] |
---|
4058 | then |
---|
4059 | subjob -d -c /pf/b/$usern/job_queue -v -q pp -X 0 -m 1000 -t 7200 $PORTOPT archive_${frelout[$i]} |
---|
4060 | fi |
---|
4061 | printf " Archiving of $tmp_data_catalog/${frelout[$i]} initiated (batch job submitted)\n" |
---|
4062 | fi |
---|
4063 | else |
---|
4064 | printf " +++ caution: option -A is switched off. No archiving on $archive_system!\n" |
---|
4065 | fi |
---|
4066 | |
---|
4067 | |
---|
4068 | # CREATE AN EMPTY DIRECTORY IN THE USERS PERMANENT DIRECTORY, |
---|
4069 | # IN ORDER TO NOTE THE RESPECTIVE CYCLE NUMBER ON THE ARCHIVE SYSTEM |
---|
4070 | # RESTART-JOBS ARE USING THESE EMPTY-DIRECTORIES TO GET THE CURRENT HIGHEST |
---|
4071 | # CYCLE NUMBER ON THE ARCHIVE SYSTEM (IN CASE THAT INFORMATIONS ARE DIFFICULT TO |
---|
4072 | # TO ACCESS FROM THE ARCHIVE-SYSTEM DIRECTLY)) |
---|
4073 | if [[ $files_for_pes = false ]] |
---|
4074 | then |
---|
4075 | cat /dev/null > ${pathout[$i]} |
---|
4076 | else |
---|
4077 | mkdir -p ${pathout[$i]} |
---|
4078 | fi |
---|
4079 | |
---|
4080 | fi |
---|
4081 | |
---|
4082 | |
---|
4083 | # COPY FROM THIS HOST TO THE ARCHIVE-SYSTEM |
---|
4084 | # IF ANY ARCHIVING FAILS, AN ERROR-FLAG-FILE IS SET |
---|
4085 | # THIS FILE REMAINS TO BE SET, EVEN IF ARCHIVING OF FURTHER FILES IS SUCCESSFULL |
---|
4086 | if [[ "${actionout[$i]}" = ar ]] |
---|
4087 | then |
---|
4088 | if [[ $files_for_pes = false ]] |
---|
4089 | then |
---|
4090 | printf "\n >>> OUTPUT: ${localout[$i]} to" |
---|
4091 | printf "\n ${pathout[$i]}" |
---|
4092 | printf "\n File will be copied to archive-system ($archive_system) !\n" |
---|
4093 | else |
---|
4094 | printf "\n >>> OUTPUT: ${localout[$i]}/_.... to" |
---|
4095 | printf "\n ${pathout[$i]}" |
---|
4096 | printf "\n Directory will be copied to archive-system ($archive_system) !\n" |
---|
4097 | fi |
---|
4098 | mv ${localout[$i]} ${frelout[$i]} |
---|
4099 | |
---|
4100 | file_saved=false |
---|
4101 | |
---|
4102 | if [[ $archive_system = asterix ]] |
---|
4103 | then |
---|
4104 | do_stageout=true |
---|
4105 | (( stageout_anz = 0 )) |
---|
4106 | while [[ $do_stageout = true ]] |
---|
4107 | do |
---|
4108 | if [[ $files_for_pes = false ]] |
---|
4109 | then |
---|
4110 | stageout ${frelout[$i]} > STAGE_OUTPUT |
---|
4111 | else |
---|
4112 | stageout -t ${frelout[$i]} > STAGE_OUTPUT |
---|
4113 | fi |
---|
4114 | cat STAGE_OUTPUT |
---|
4115 | if [[ $(grep -c "st.msg:150" STAGE_OUTPUT) != 0 ]] |
---|
4116 | then |
---|
4117 | file_saved=true |
---|
4118 | do_stageout=false |
---|
4119 | else |
---|
4120 | if [[ $files_for_pes = false ]] |
---|
4121 | then |
---|
4122 | printf "\n +++ file ${frelout[$i]} could not be saved on archive-system" |
---|
4123 | else |
---|
4124 | printf "\n +++ directory ${frelout[$i]} could not be saved on archive-system" |
---|
4125 | fi |
---|
4126 | (( stageout_anz = stageout_anz + 1 )) |
---|
4127 | if (( stageout_anz == 10 )) |
---|
4128 | then |
---|
4129 | printf "\n +++ stoped after 10 unsuccessful tries!" |
---|
4130 | archive_save=false |
---|
4131 | do_stageout=false |
---|
4132 | else |
---|
4133 | printf "\n *** new try to store on archive after 15 min:" |
---|
4134 | sleep 900 |
---|
4135 | fi |
---|
4136 | fi |
---|
4137 | done |
---|
4138 | elif [[ $archive_system = DMF ]] |
---|
4139 | then |
---|
4140 | if [[ $files_for_pes = false ]] |
---|
4141 | then |
---|
4142 | printf "\n +++ archiving of single files impossible on $archive_system!\n" |
---|
4143 | locat=DMF |
---|
4144 | exit |
---|
4145 | else |
---|
4146 | rm -rf $ARCHIVE/${frelout[$i]} |
---|
4147 | cp -r ${frelout[$i]} $ARCHIVE |
---|
4148 | fi |
---|
4149 | file_saved=true |
---|
4150 | elif [[ $archive_system = tivoli ]] |
---|
4151 | then |
---|
4152 | # ARCHIVING ONLY POSSIBLE VIA BATCH-JOB |
---|
4153 | # IN THE MEANTIME, FILE IS STORED IN THE TEMPORARY DATA DIRECTORY, |
---|
4154 | # BECAUSE MRUN'S CURRENT TEMPORARY WORKING DIRECTORY MAY ALREADY BE DELETED |
---|
4155 | # WHEN THE ARCHIVE-JOB IS EXECUTED |
---|
4156 | [[ ! -d $tmp_data_catalog ]] && mkdir -p $tmp_data_catalog |
---|
4157 | chmod g+rx $tmp_data_catalog |
---|
4158 | if [[ $files_for_pes = false ]] |
---|
4159 | then |
---|
4160 | ln -f ${frelout[$i]} $tmp_data_catalog/${frelout[$i]} |
---|
4161 | else |
---|
4162 | mkdir $tmp_data_catalog/${frelout[$i]} |
---|
4163 | ln -f ${frelout[$i]}/* $tmp_data_catalog/${frelout[$i]} |
---|
4164 | fi |
---|
4165 | |
---|
4166 | # GENERATE AND SUBMIT BATCH-JOB |
---|
4167 | # FILE HAS TO BE DELETED FROM THE TEMPORARY DATA DIRECTORY |
---|
4168 | # DELETE OLD EXISTING FILES FROM THE ARCHIVE |
---|
4169 | echo "cd $tmp_data_catalog" > archive_${frelout[$i]} |
---|
4170 | if [[ $files_for_pes = false ]] |
---|
4171 | then |
---|
4172 | echo "rm -rf \$PERM/${frelout[$i]}" >> archive_${frelout[$i]} |
---|
4173 | echo "cp ${frelout[$i]} \$PERM/${frelout[$i]}" >> archive_${frelout[$i]} |
---|
4174 | echo "rm -rf ${frelout[$i]}" >> archive_${frelout[$i]} |
---|
4175 | else |
---|
4176 | echo "rm -rf \$PERM/${frelout[$i]}.tar" >> archive_${frelout[$i]} |
---|
4177 | echo "tar cvf \$PERM/${frelout[$i]}.tar ${frelout[$i]}" >> archive_${frelout[$i]} |
---|
4178 | echo "rm -rf ${frelout[$i]}" >> archive_${frelout[$i]} |
---|
4179 | fi |
---|
4180 | |
---|
4181 | subjob -v -d -q cdata -X 0 -m 1000 -t 43200 -c $job_catalog $PORTOPT archive_${frelout[$i]} |
---|
4182 | printf " Archiving of $tmp_data_catalog/${frelout[$i]} initiated (batch job submitted)\n" |
---|
4183 | file_saved=true |
---|
4184 | |
---|
4185 | elif [[ $archive_system = ut ]] |
---|
4186 | then |
---|
4187 | # ARCHIVING ONLY POSSIBLE VIA BATCH-JOB |
---|
4188 | # IN THE MEANTIME, FILE IS STORED IN THE TEMPORARY DATA DIRECTORY, |
---|
4189 | # BECAUSE MRUN'S CURRENT TEMPORARY WORKING DIRECTORY MAY ALREADY BE DELETED |
---|
4190 | # WHEN THE ARCHIVE-JOB IS EXECUTED |
---|
4191 | [[ ! -d $tmp_data_catalog ]] && mkdir -p $tmp_data_catalog |
---|
4192 | chmod g+rx $tmp_data_catalog |
---|
4193 | if [[ $files_for_pes = false ]] |
---|
4194 | then |
---|
4195 | ln -f ${frelout[$i]} $tmp_data_catalog/${frelout[$i]} |
---|
4196 | else |
---|
4197 | mkdir $tmp_data_catalog/${frelout[$i]} |
---|
4198 | ln -f ${frelout[$i]}/* $tmp_data_catalog/${frelout[$i]} |
---|
4199 | fi |
---|
4200 | |
---|
4201 | # GENERATE AND SUBMIT BATCH-JOB |
---|
4202 | # FILE HAS TO BE DELETED FROM THE TEMPORARY DATA DIRECTORY |
---|
4203 | # DELETE OLD EXISTING FILES FROM THE ARCHIVE |
---|
4204 | echo "cd $tmp_data_catalog" > archive_${frelout[$i]} |
---|
4205 | if [[ $files_for_pes = false ]] |
---|
4206 | then |
---|
4207 | echo "rm -rf \$UT/${frelout[$i]}" >> archive_${frelout[$i]} |
---|
4208 | echo "cp ${frelout[$i]} \$UT/${frelout[$i]}" >> archive_${frelout[$i]} |
---|
4209 | echo "rm -rf ${frelout[$i]}" >> archive_${frelout[$i]} |
---|
4210 | else |
---|
4211 | echo "rm -rf \$UT/${frelout[$i]}.tar" >> archive_${frelout[$i]} |
---|
4212 | echo "tar cvf \$UT/${frelout[$i]}.tar ${frelout[$i]}" >> archive_${frelout[$i]} |
---|
4213 | echo "rm -rf ${frelout[$i]}" >> archive_${frelout[$i]} |
---|
4214 | fi |
---|
4215 | |
---|
4216 | subjob -v -c /pf/b/$usern/job_queue -d -q pp -X 0 -m 1000 -t 7200 $PORTOPT archive_${frelout[$i]} |
---|
4217 | printf " Archiving of $tmp_data_catalog/${frelout[$i]} initiated (batch job submitted)\n" |
---|
4218 | file_saved=true |
---|
4219 | |
---|
4220 | else |
---|
4221 | printf "\n +++ archive_system=\"$archive_system\" archiving impossible!" |
---|
4222 | archive_save=false |
---|
4223 | fi |
---|
4224 | |
---|
4225 | # CREATE EMPTY FLAG-FILE OR -DIRECTORY |
---|
4226 | # IN ORDER TO NOTE THE RESPECTIVE CYCLE NUMBER ON THE ARCHIVE SYSTEM |
---|
4227 | # RESTART-JOBS ARE USING THESE EMPTY-DIRECTORIES TO GET THE CURRENT HIGHEST |
---|
4228 | # CYCLE NUMBER ON THE ARCHIVE SYSTEM (IN CASE THAT INFORMATIONS ARE DIFFICULT TO |
---|
4229 | # TO ACCESS FROM THE ARCHIVE-SYSTEM DIRECTLY)) |
---|
4230 | if [[ $file_saved = true ]] |
---|
4231 | then |
---|
4232 | if [[ $files_for_pes = false ]] |
---|
4233 | then |
---|
4234 | cat /dev/null > ${pathout[$i]} |
---|
4235 | else |
---|
4236 | mkdir -p ${pathout[$i]} |
---|
4237 | fi |
---|
4238 | fi |
---|
4239 | |
---|
4240 | fi |
---|
4241 | |
---|
4242 | # APPEND ON THIS MACHINE |
---|
4243 | if [[ "${actionout[$i]}" = "a" ]] |
---|
4244 | then |
---|
4245 | if [[ "${extout[$i]}" != " " && "${extout[$i]}" != "" ]] |
---|
4246 | then |
---|
4247 | printf "\n >>> OUTPUT: ${localout[$i]} append to ${pathout[$i]}.${extout[$i]}\n" |
---|
4248 | cat ${localout[$i]} >> ${pathout[$i]}.${extout[$i]} |
---|
4249 | else |
---|
4250 | printf "\n >>> OUTPUT: ${localout[$i]} append to ${pathout[$i]}\n" |
---|
4251 | cat ${localout[$i]} >> ${pathout[$i]} |
---|
4252 | fi |
---|
4253 | fi |
---|
4254 | |
---|
4255 | # COPY ON THIS MACHINE |
---|
4256 | # COPY HAS TO BE USED, BECAUSE MOVE DOES NOT WORK IF FILE-ORIGIN AND TARGET ARE |
---|
4257 | # ON DIFFERENT FILE-SYSTEMS |
---|
4258 | if [[ "${actionout[$i]}" = "" && $files_for_pes = false ]] |
---|
4259 | then |
---|
4260 | |
---|
4261 | # COPY IN CASE OF RUNS ON SINGLE CORES |
---|
4262 | if [[ "${extout[$i]}" != " " && "${extout[$i]}" != "" ]] |
---|
4263 | then |
---|
4264 | printf "\n >>> OUTPUT: ${localout[$i]} to ${pathout[$i]}.${extout[$i]}\n" |
---|
4265 | if [[ $link_local_output = true ]] |
---|
4266 | then |
---|
4267 | printf " using ln -f\n" |
---|
4268 | ln -f ${localout[$i]} ${pathout[$i]}.${extout[$i]} |
---|
4269 | fi |
---|
4270 | # If "ln -f" fails of if "$link_local_output = false" do a normal "cp" |
---|
4271 | if [[ ! -f "${pathout[$i]}.${extout[$i]}" ]] |
---|
4272 | then |
---|
4273 | if [[ $link_local_output = true ]] |
---|
4274 | then |
---|
4275 | printf " ln failed, using cp...\n" |
---|
4276 | fi |
---|
4277 | cp ${localout[$i]} ${pathout[$i]}.${extout[$i]} |
---|
4278 | fi |
---|
4279 | else |
---|
4280 | printf "\n >>> OUTPUT: ${localout[$i]} to ${pathout[$i]}\n" |
---|
4281 | if [[ $link_local_output = true ]] |
---|
4282 | then |
---|
4283 | printf " using ln -f\n" |
---|
4284 | ln -f ${localout[$i]} ${pathout[$i]} |
---|
4285 | fi |
---|
4286 | # If "ln -f" fails of if "$link_local_output = false" do a normal "cp" |
---|
4287 | if [[ ! -f "${pathout[$i]}" ]] |
---|
4288 | then |
---|
4289 | if [[ $link_local_output = true ]] |
---|
4290 | then |
---|
4291 | printf " ln failed, using cp...\n" |
---|
4292 | fi |
---|
4293 | cp ${localout[$i]} ${pathout[$i]} |
---|
4294 | fi |
---|
4295 | fi |
---|
4296 | |
---|
4297 | elif [[ "${actionout[$i]}" = "" && $files_for_pes = true ]] |
---|
4298 | then |
---|
4299 | |
---|
4300 | # FILES FROM THE DIFFERENT CORES ARE MOVED WITH ln-COMMAND TO THE PERMANENT DIRECTORY |
---|
4301 | # AS A FIRST STEP, THE PERMANENT DIRECTORY IS CREATED |
---|
4302 | printf "\n >>> OUTPUT: ${localout[$i]}/_.... to ${pathout[$i]}\n" |
---|
4303 | if [[ $link_local_output = true ]] |
---|
4304 | then |
---|
4305 | printf " using ln -f\n" |
---|
4306 | mkdir ${pathout[$i]} |
---|
4307 | cd ${localout[$i]} |
---|
4308 | for file in $(ls *) |
---|
4309 | do |
---|
4310 | ln -f $file ${pathout[$i]} |
---|
4311 | done |
---|
4312 | cd $TEMPDIR |
---|
4313 | fi |
---|
4314 | |
---|
4315 | # IF "ln -f" HAS FAILED OR IF "$link_local_output = false" DO A NORMAL COPY "cp -r" |
---|
4316 | if [[ ! -f "${pathout[$i]}/_0000" ]] |
---|
4317 | then |
---|
4318 | if [[ $link_local_output = true ]] |
---|
4319 | then |
---|
4320 | printf " ln failed for .../_0000, using cp...\n" |
---|
4321 | fi |
---|
4322 | cp -r ${localout[$i]} ${pathout[$i]} |
---|
4323 | fi |
---|
4324 | |
---|
4325 | fi |
---|
4326 | fi |
---|
4327 | done |
---|
4328 | if (( i != 0 )) |
---|
4329 | then |
---|
4330 | if [[ $transfer_problems = true ]] |
---|
4331 | then |
---|
4332 | printf "\n$dashes\n *** OUTPUT-files saved" |
---|
4333 | printf "\n +++ WARNING: some data transfers failed! \n" |
---|
4334 | else |
---|
4335 | printf "\n$dashes\n *** all OUTPUT-files saved \n" |
---|
4336 | fi |
---|
4337 | fi |
---|
4338 | |
---|
4339 | |
---|
4340 | # IF REQUIRED, START A RESTART-JOB |
---|
4341 | # FILE CONTINUE_RUN MUST HAVE BEEN CREATED BY THE EXECUTABLE (PALM) |
---|
4342 | if [[ -f CONTINUE_RUN ]] |
---|
4343 | then |
---|
4344 | |
---|
4345 | if [[ $archive_save = true ]] |
---|
4346 | then |
---|
4347 | |
---|
4348 | # ADD RESTART-OPTIONS TO THE MRUN-CALL (IF THEY ARE NOT USED ALREADY): |
---|
4349 | # -C TELLS MRUN THAT IT IS A RESTART-RUN |
---|
4350 | # -v SILENT MODE WITHOUT INTERACTIVE QUERIES |
---|
4351 | # -n BATCH-MODE (IMPORTANT ONLY IN CASE OF BATCH JOBS ON THE LOCAL MACHINE) |
---|
4352 | [[ $(echo $mc | grep -c "\-C") = 0 ]] && mc="$mc -C" |
---|
4353 | [[ $(echo $mc | grep -c "\-v") = 0 ]] && mc="$mc -v" |
---|
4354 | [[ $(echo $mc | grep -c "\-b") = 0 ]] && mc="$mc -b" |
---|
4355 | if [[ $(echo $mc | grep -c "#") != 0 ]] |
---|
4356 | then |
---|
4357 | mc=`echo $mc | sed 's/#/f/g'` |
---|
4358 | fi |
---|
4359 | |
---|
4360 | |
---|
4361 | # START THE RESTART-JOB |
---|
4362 | printf "\n\n *** initiating restart-run on \"$return_addres\" using command:\n" |
---|
4363 | echo " $mc" |
---|
4364 | printf "\n$dashes\n" |
---|
4365 | if [[ $localhost != $fromhost ]] |
---|
4366 | then |
---|
4367 | |
---|
4368 | if [[ $localhost = lccrayh || $localhost = nech || $localhost = ibmh || $localhost = ibmkisti || $localhost = ibmku || $localhost = ibms || $localhost = lcflow || $localhost = lckyu* ]] |
---|
4369 | then |
---|
4370 | echo "*** ssh will be used to initiate restart-runs!" |
---|
4371 | echo " return_addres=\"$return_addres\" " |
---|
4372 | echo " return_username=\"$return_username\" " |
---|
4373 | if [[ $(echo $return_addres | grep -c "130.75.105") = 1 ]] |
---|
4374 | then |
---|
4375 | if [[ $localhost = ibmh ]] |
---|
4376 | then |
---|
4377 | ssh $SSH_PORTOPT $usern@136.172.40.15 "ssh $SSH_PORTOPT $return_addres -l $return_username \"PATH=\\\$PATH:$LOCAL_MRUN_PATH;. /muksoft/packages/intel/bin/compilervars.sh intel64;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" " |
---|
4378 | elif [[ $localhost = lccrayb ]] |
---|
4379 | then |
---|
4380 | ssh $usern@blogin1 "ssh $SSH_PORTOPT $return_addres -l $return_username \"PATH=\\\$PATH:$LOCAL_MRUN_PATH;. /muksoft/packages/intel/bin/compilervars.sh intel64;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" " |
---|
4381 | elif [[ $localhost = lccrayh ]] |
---|
4382 | then |
---|
4383 | ssh $usern@hlogin1 "ssh $SSH_PORTOPT $return_addres -l $return_username \"PATH=\\\$PATH:$LOCAL_MRUN_PATH;. /muksoft/packages/intel/bin/compilervars.sh intel64;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" " |
---|
4384 | |
---|
4385 | else |
---|
4386 | ssh $SSH_PORTOPT $return_addres -l $return_username "PATH=\$PATH:$LOCAL_MRUN_PATH;. /muksoft/packages/intel/bin/compilervars.sh intel64;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc " |
---|
4387 | fi |
---|
4388 | else |
---|
4389 | if [[ $localhost = ibmkisti ]] |
---|
4390 | then |
---|
4391 | ssh $SSH_PORTOPT $usern@gaiad "ssh $SSH_PORTOPT $return_addres -l $return_username \"PATH=\\\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" " |
---|
4392 | elif [[ $localhost = lcflow ]] |
---|
4393 | then |
---|
4394 | /usr/bin/ssh $SSH_PORTOPT $return_addres -l $return_username "PATH=\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc " |
---|
4395 | elif [[ $localhost = lccrayb ]] |
---|
4396 | then |
---|
4397 | ssh $usern@blogin1 "ssh $SSH_PORTOPT $return_addres -l $return_username \"PATH=\\\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" " |
---|
4398 | elif [[ $localhost = lccrayh ]] |
---|
4399 | then |
---|
4400 | ssh $usern@hlogin1 "ssh $SSH_PORTOPT $return_addres -l $return_username \"PATH=\\\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" " |
---|
4401 | else |
---|
4402 | ssh $SSH_PORTOPT $return_addres -l $return_username "PATH=\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc " |
---|
4403 | fi |
---|
4404 | fi |
---|
4405 | else |
---|
4406 | printf "\n +++ no restart mechanism available for host \"$localhost\" " |
---|
4407 | locat=restart; exit |
---|
4408 | fi |
---|
4409 | |
---|
4410 | # WAIT TO ALLOW THE RESTART-JOB TO BE QUEUED, BEFORE THE CURRENT JOB IS FINISHED |
---|
4411 | if [[ $queue = special1q ]] |
---|
4412 | then |
---|
4413 | sleep 120 |
---|
4414 | else |
---|
4415 | sleep 30 |
---|
4416 | fi |
---|
4417 | |
---|
4418 | else |
---|
4419 | |
---|
4420 | # JOBS RUNNING (AND STARTED) ON THE LOCAL MACHINE CAN DIRECTLY CALL MRUN (WITHOUT |
---|
4421 | # USING SSH) |
---|
4422 | cd $LOCAL_PWD |
---|
4423 | if [[ $localhost = lckyuh ]] |
---|
4424 | then |
---|
4425 | printf "\n +++ WARNING: no restart mechanism available for host \"$localhost\" " |
---|
4426 | printf "\n please restart job manually using command:\n" |
---|
4427 | printf "\n \"$mc\" " |
---|
4428 | else |
---|
4429 | eval $mc # THE ' MUST BE EVALUATED |
---|
4430 | fi |
---|
4431 | cd - > /dev/null |
---|
4432 | fi |
---|
4433 | if [[ $localhost = lckyuh ]] |
---|
4434 | then |
---|
4435 | printf "\n$dashes\n *** restart-run to be initiated manually\n" |
---|
4436 | else |
---|
4437 | printf "\n$dashes\n *** restart-run initiated \n" |
---|
4438 | fi |
---|
4439 | |
---|
4440 | |
---|
4441 | # DELETE INPUT-(RESTART)FILES, WHICH HAVE BEEN FETCHED FROM THE TEMPORARY DATA |
---|
4442 | # DIRECTORY, BACAUSE THEY ARE NOT REQUIRED BY THE RESTART-JOB. |
---|
4443 | # THIS IS DONE IN ORDER TO AVOID EXCEEDING DISC QUOTAS OR DISC SPACE (RESTART-FILES |
---|
4444 | # MAY BE VERY HUGE) |
---|
4445 | (( i = 0 )) |
---|
4446 | while (( i < iin )) |
---|
4447 | do |
---|
4448 | (( i = i + 1 )) |
---|
4449 | if [[ "${got_tmp[$i]}" = true && $keep_data_from_previous_run = false ]] |
---|
4450 | then |
---|
4451 | rm -r $tmp_data_catalog/${frelin[$i]} |
---|
4452 | fi |
---|
4453 | done |
---|
4454 | |
---|
4455 | else |
---|
4456 | |
---|
4457 | printf "\n +++ no restart-run possible, since errors occured" |
---|
4458 | printf "\n during the archive process" |
---|
4459 | fi |
---|
4460 | |
---|
4461 | fi |
---|
4462 | |
---|
4463 | |
---|
4464 | |
---|
4465 | # SEND EMAIL NOTIFICATION ABOUT THE FINISHED RUN |
---|
4466 | if [[ "$email_notification" != "none" ]] |
---|
4467 | then |
---|
4468 | |
---|
4469 | if [[ $localhost != $fromhost ]] |
---|
4470 | then |
---|
4471 | if [[ -f CONTINUE_RUN ]] |
---|
4472 | then |
---|
4473 | echo "PALM restart run necessary" > email_text |
---|
4474 | echo "description header of actual run:" >> email_text |
---|
4475 | cat CONTINUE_RUN >> email_text |
---|
4476 | echo "mrun-command to restart:" >> email_text |
---|
4477 | echo "$mc" >> email_text |
---|
4478 | else |
---|
4479 | echo "PALM run with base filename \"$fname\" on host \"$localhost\" finished" > email_text |
---|
4480 | fi |
---|
4481 | mail $email_notification < email_text |
---|
4482 | printf "\n *** email notification sent to \"$email_notification\" " |
---|
4483 | fi |
---|
4484 | fi |
---|
4485 | |
---|
4486 | |
---|
4487 | |
---|
4488 | # ALL ACTIONS FINISHED, TEMPORARY WORKING-DIRECTORY CAN BE DELETED |
---|
4489 | cd $HOME |
---|
4490 | [[ $delete_temporary_catalog = true ]] && rm -rf $TEMPDIR |
---|
4491 | |
---|
4492 | else |
---|
4493 | |
---|
4494 | |
---|
4495 | # PREPARING ACTIONS, |
---|
4496 | # IF A BATCH-JOB IS TO BE GENERATED AND STARTED ON A REMOTE-MACHINE GERECHNET |
---|
4497 | |
---|
4498 | # BUILD THE MRUN-COMMAND TO BE CALLED IN THE BATCH-JOB ON THE REMOTE-MACHINE |
---|
4499 | mrun_com="$mrun_script_name -a $afname -c $config_file -d $fname -h $host -H $fromhost -m $memory -t $cpumax -q $queue -R $return_addres -U $return_username -u $remote_username" |
---|
4500 | [[ "$cpp_opts" != "" ]] && mrun_com=${mrun_com}" -D \"$cpp_opts\"" |
---|
4501 | [[ "$global_revision" != "" ]] && mrun_com=${mrun_com}" -G \"$global_revision\"" |
---|
4502 | [[ $group_number != none ]] && mrun_com=${mrun_com}" -g $group_number" |
---|
4503 | [[ $do_compile = true ]] && mrun_com=${mrun_com}" -s \"$source_list\"" |
---|
4504 | [[ "$input_list" != "" ]] && mrun_com=${mrun_com}" -i \"$input_list\"" |
---|
4505 | [[ $ignore_archive_error = true ]] && mrun_com=${mrun_com}" -I" |
---|
4506 | [[ $keep_data_from_previous_run = true ]] && mrun_com=${mrun_com}" -k" |
---|
4507 | [[ "$additional_conditions" != "" ]] && mrun_com=${mrun_com}" -K \"$additional_conditions\"" |
---|
4508 | [[ "$output_list" != "" ]] && mrun_com=${mrun_com}" -o \"$output_list\"" |
---|
4509 | [[ "$read_from_config" = false ]] && mrun_com=${mrun_com}" -S" |
---|
4510 | [[ $do_trace = true ]] && mrun_com=${mrun_com}" -x" |
---|
4511 | [[ "$numprocs" != "" ]] && mrun_com=${mrun_com}" -X $numprocs" |
---|
4512 | if [[ $use_openmp = true ]] |
---|
4513 | then |
---|
4514 | mrun_com=${mrun_com}" -O $threads_per_task" |
---|
4515 | fi |
---|
4516 | [[ "$tasks_per_node" != "" ]] && mrun_com=${mrun_com}" -T $tasks_per_node" |
---|
4517 | [[ $store_on_archive_system = true ]] && mrun_com=${mrun_com}" -A" |
---|
4518 | [[ $package_list != "" ]] && mrun_com=${mrun_com}" -p \"$package_list\"" |
---|
4519 | [[ $return_password != "" ]] && mrun_com=${mrun_com}" -P $return_password" |
---|
4520 | [[ $delete_temporary_catalog = false ]] && mrun_com=${mrun_com}" -B" |
---|
4521 | [[ $node_usage != default && "$(echo $node_usage | cut -c1-3)" != "sla" && $node_usage != novice ]] && mrun_com=${mrun_com}" -n $node_usage" |
---|
4522 | [[ "$ocean_file_appendix" = true ]] && mrun_com=${mrun_com}" -y" |
---|
4523 | [[ $run_coupled_model = true ]] && mrun_com=${mrun_com}" -Y \"$coupled_dist\"" |
---|
4524 | [[ "$check_namelist_files" = false ]] && mrun_com=${mrun_com}" -z" |
---|
4525 | [[ "$combine_plot_fields" = false ]] && mrun_com=${mrun_com}" -Z" |
---|
4526 | [[ "$max_par_io_str" != "" ]] && mrun_com=${mrun_com}" -w $max_par_io_str" |
---|
4527 | if [[ $do_remote = true ]] |
---|
4528 | then |
---|
4529 | printf "\n>>>> MRUN-command on execution host:\n>>>> $mrun_com \n" |
---|
4530 | fi |
---|
4531 | |
---|
4532 | |
---|
4533 | # CREATE EXECUTABLE FOR BATCH JOB |
---|
4534 | if [[ $create_executable_for_batch = true && $restart_run != true ]] |
---|
4535 | then |
---|
4536 | |
---|
4537 | printf "\n *** creating the executable for batch job\n" |
---|
4538 | |
---|
4539 | # METHOD ONLY WORKS FOR BATCH JOBS ON LOCAL HOSTS |
---|
4540 | if [[ $host != $localhost ]] |
---|
4541 | then |
---|
4542 | printf "\n +++ creation of executables is only allowed for batch jobs on local hosts." |
---|
4543 | printf "\n Please set create_executable_for_batch = false in the config-file.\n" |
---|
4544 | locat=create_executable; exit |
---|
4545 | fi |
---|
4546 | |
---|
4547 | mkdir $working_directory/SOURCES_FOR_RUN_${fname}/TMPDIR_FOR_CREATING_EXECUTABLE |
---|
4548 | cd $working_directory/SOURCES_FOR_RUN_${fname}/TMPDIR_FOR_CREATING_EXECUTABLE |
---|
4549 | |
---|
4550 | cp $make_depository . |
---|
4551 | tar -xf $make_depository > /dev/null 2>&1 |
---|
4552 | cp ../* . > /dev/null 2>&1 |
---|
4553 | |
---|
4554 | make $mopts -f Makefile PROG=a.out F90=$compiler_name COPT="$cpp_options" F90FLAGS="$fopts" LDFLAGS="$lopts" |
---|
4555 | |
---|
4556 | if [[ $? != 0 || "$compile_error" = true || "$module_compile_error" = true ]] |
---|
4557 | then |
---|
4558 | printf "\n +++ error occured while compiling or linking" |
---|
4559 | locat=compile |
---|
4560 | exit |
---|
4561 | fi |
---|
4562 | |
---|
4563 | mv a.out .. |
---|
4564 | cd - > /dev/null 2>&1 |
---|
4565 | rm -rf $working_directory/SOURCES_FOR_RUN_${fname}/TMPDIR_FOR_CREATING_EXECUTABLE |
---|
4566 | |
---|
4567 | printf " *** executable created in \"$working_directory/SOURCES_FOR_RUN_${fname}\"\n " |
---|
4568 | |
---|
4569 | fi |
---|
4570 | |
---|
4571 | |
---|
4572 | # BUILD THE JOB-SCRIPTS ON FILE jobfile |
---|
4573 | jobfile=jobfile.$RANDOM |
---|
4574 | |
---|
4575 | |
---|
4576 | # CREATE TEMPORARY DIRECTORY AND SWITCH TO IT |
---|
4577 | echo "mkdir $TEMPDIR" >> $jobfile |
---|
4578 | echo "cd $TEMPDIR" >> $jobfile |
---|
4579 | |
---|
4580 | |
---|
4581 | # ACTIVATE ERROR-TRACEBACK |
---|
4582 | if [[ $do_trace = true ]] |
---|
4583 | then |
---|
4584 | echo "set -x" >> $jobfile |
---|
4585 | else |
---|
4586 | echo "set +vx" >> $jobfile |
---|
4587 | fi |
---|
4588 | |
---|
4589 | |
---|
4590 | # INITIALIZE THE ENVIRONMENT AND LOAD MODULES |
---|
4591 | if [[ "$init_cmds" != "" ]] |
---|
4592 | then |
---|
4593 | echo "$init_cmds" >> $jobfile |
---|
4594 | fi |
---|
4595 | if [[ "$module_calls" != "" ]] |
---|
4596 | then |
---|
4597 | echo "$module_calls" >> $jobfile |
---|
4598 | fi |
---|
4599 | |
---|
4600 | |
---|
4601 | # PROVIDE SOURCE-CODE FILES, MRUN-SCRIPT AND CONFIGURATION-FILE FOR THE JOB |
---|
4602 | # then-CLAUSE: FILES ARE COLLECTED IN THE SOURCES_FOR_RUN_... DIRECTORY ON THE LOCAL HOST, |
---|
4603 | # WHICH IS THEN FETCHED FROM THE BATCH-JOB BY USING cp/scp |
---|
4604 | # THE SOURCE-CODE FILES ALREADY EXIST IN THIS DIRECTORY |
---|
4605 | # else-CLAUSE: FILE-CONTENTS ARE PUT INTO THE JOB-FILE AS HERE-DOCUMENTS |
---|
4606 | # THIS MAY CREATE A QUITE LARGE JOB-FILE, WHICH CAN CAUSE PROBLEMS WITH SOME |
---|
4607 | # QUEUEING-SYSTEMS |
---|
4608 | if [[ $host = ibmkisti || $host = lccrayb || $host = lccrayf || $host = lccrayh ]] |
---|
4609 | then |
---|
4610 | |
---|
4611 | # COPY CONFIGURATION-FILE AND MRUN-SCRIPT INTO THE SOURCES_FOR_RUN... DIRECTORY |
---|
4612 | if [[ $restart_run != true ]] |
---|
4613 | then |
---|
4614 | cp $config_file $working_directory/SOURCES_FOR_RUN_$fname |
---|
4615 | cp ${PALM_BIN}/$mrun_script_name $working_directory/SOURCES_FOR_RUN_$fname |
---|
4616 | fi |
---|
4617 | |
---|
4618 | # COPY THE SOURCES_FOR_RUN... DIRECTORY FROM THE LOCAL HOST TO THE JOB VIA scp |
---|
4619 | # (then-CLAUSE: JOBS ON THE LOCAL HOST CAN JUST USE cp) |
---|
4620 | echo "set -x" >> $jobfile |
---|
4621 | if [[ $host = $localhost ]] |
---|
4622 | then |
---|
4623 | |
---|
4624 | # DUE TO UNKNOWN REASONS, COPY WITH cp COMMAND CREATES CORRUPT |
---|
4625 | # FILES ON CRAY XC30 SYSTEMS (CSC HELSINKI), rsync IS USED INSTEAD |
---|
4626 | if [[ $(echo $host | cut -c1-6) = lccray ]] |
---|
4627 | then |
---|
4628 | echo "rsync -av -t $working_directory/SOURCES_FOR_RUN_$fname ." >> $jobfile |
---|
4629 | else |
---|
4630 | echo "cp -r $working_directory/SOURCES_FOR_RUN_$fname ." >> $jobfile |
---|
4631 | fi |
---|
4632 | |
---|
4633 | else |
---|
4634 | if [[ $host = ibmkisti ]] |
---|
4635 | then |
---|
4636 | # ON KISTI'S IBM FIREWALL IS ONLY OPENED ON INTERACTIVE NODE |
---|
4637 | echo "localdir=\`pwd\`" >> $jobfile |
---|
4638 | echo "ssh $SSH_PORTOPT $remote_username@gaiad \"cd \$localdir; scp $PORTOPT -r $return_username@$return_addres:$working_directory/SOURCES_FOR_RUN_$fname .\" " >> $jobfile |
---|
4639 | elif [[ $host = lccrayb ]] |
---|
4640 | then |
---|
4641 | echo "localdir=\`pwd\`" >> $jobfile |
---|
4642 | echo "ssh $SSH_PORTOPT $remote_username@blogin1 \"cd \$localdir; scp $PORTOPT -r $return_username@$return_addres:$working_directory/SOURCES_FOR_RUN_$fname .\" " >> $jobfile |
---|
4643 | elif [[ $host = lccrayh ]] |
---|
4644 | then |
---|
4645 | echo "localdir=\`pwd\`" >> $jobfile |
---|
4646 | echo "ssh $SSH_PORTOPT $remote_username@hlogin1 \"cd \$localdir; scp $PORTOPT -r $return_username@$return_addres:$working_directory/SOURCES_FOR_RUN_$fname .\" " >> $jobfile |
---|
4647 | |
---|
4648 | else |
---|
4649 | echo "scp $PORTOPT -r $return_username@$return_addres:$working_directory/SOURCES_FOR_RUN_$fname ." >> $jobfile |
---|
4650 | fi |
---|
4651 | fi |
---|
4652 | echo "export SOURCES_COMPLETE=true" >> $jobfile |
---|
4653 | |
---|
4654 | # MOVE MRUN-SCRIPT AND CONFIGURATION-FILE FROM THE SOURCES_FOR_RUN... DIRECTORY TO THE |
---|
4655 | # WORKING DIRECTORY OF THE JOB |
---|
4656 | echo "mv SOURCES_FOR_RUN_$fname/$config_file . " >> $jobfile |
---|
4657 | echo "mv SOURCES_FOR_RUN_$fname/$mrun_script_name . " >> $jobfile |
---|
4658 | echo "chmod u+rwx $mrun_script_name" >> $jobfile |
---|
4659 | echo "execute_mrun=true" >> $jobfile |
---|
4660 | echo " " >> $jobfile |
---|
4661 | |
---|
4662 | else |
---|
4663 | |
---|
4664 | # PROVIDE SOURCE-CODE FILES AND MAKEFILE AS HERE DOCUMENT |
---|
4665 | if [[ $do_compile = true ]] |
---|
4666 | then |
---|
4667 | |
---|
4668 | source_catalog=SOURCES_FOR_RUN_$fname |
---|
4669 | |
---|
4670 | # CREATE SOURCES_FOR_RUN... DIRECTORY TO STORE THE SOURCE CODE FILES AND THE MAKEFILE |
---|
4671 | echo "mkdir SOURCES_FOR_RUN_$fname" >> $jobfile |
---|
4672 | echo "export SOURCES_COMPLETE=true" >> $jobfile |
---|
4673 | echo "cd SOURCES_FOR_RUN_$fname" >> $jobfile |
---|
4674 | |
---|
4675 | for filename in $source_list |
---|
4676 | do |
---|
4677 | # BACKSLASH IS USED FOR MASKING |
---|
4678 | echo "cat > $filename << \"%END%\"" >> $jobfile |
---|
4679 | cat $source_catalog/$filename >> $jobfile |
---|
4680 | echo " " >> $jobfile |
---|
4681 | echo "%END%" >> $jobfile |
---|
4682 | echo " " >> $jobfile |
---|
4683 | done |
---|
4684 | |
---|
4685 | # BACKSLASH IS USED FOR MASKING |
---|
4686 | echo "cat > Makefile << \"%END%\"" >> $jobfile |
---|
4687 | cat $source_catalog/Makefile >> $jobfile |
---|
4688 | echo " " >> $jobfile |
---|
4689 | echo "%END%" >> $jobfile |
---|
4690 | echo " " >> $jobfile |
---|
4691 | |
---|
4692 | echo "cd - > /dev/null" >> $jobfile |
---|
4693 | |
---|
4694 | fi |
---|
4695 | |
---|
4696 | |
---|
4697 | # PROVIDE THE CONFIGURATION-FILE AS HERE-DOCUMENT |
---|
4698 | # BACKSLASH IS USED FOR MASKING |
---|
4699 | # LINES WITH #$ IN THE CONFIGURATION-FILE, COMING FROM THE SVN KEYWORD SUBSTITUTION, |
---|
4700 | # ARE REMOVED FROM THE FILE IN ORDER TO AVOID PROBLEMS WITH THE SGE BATCH SYSTEM |
---|
4701 | echo "cat > $config_file << \"%END%\"" >> $jobfile |
---|
4702 | if [[ $host = lckyuh ]] |
---|
4703 | then |
---|
4704 | # NO CROSS-COMPILER ON COMPUTE NODE |
---|
4705 | sed 's/frtpx/frt/g' $config_file >> $jobfile |
---|
4706 | else |
---|
4707 | sed 's/#$.*//g' $config_file >> $jobfile |
---|
4708 | fi |
---|
4709 | echo "%END%" >> $jobfile |
---|
4710 | echo " " >> $jobfile |
---|
4711 | |
---|
4712 | |
---|
4713 | # PROVIDE THE MRUN-SCRIPTS AS HERE-DOCUMENT |
---|
4714 | # BACKSLASH IS USED FOR MASKING |
---|
4715 | echo "cat > $mrun_script_name <<\"%END%\"" >> $jobfile |
---|
4716 | if [[ $host = lckyuh ]] |
---|
4717 | then |
---|
4718 | sed 's/\/bin\/ksh/\/bin\/bash/g' ${PALM_BIN}/$mrun_script_name >> $jobfile |
---|
4719 | else |
---|
4720 | cat ${PALM_BIN}/$mrun_script_name >> $jobfile |
---|
4721 | fi |
---|
4722 | echo "%END%" >> $jobfile |
---|
4723 | echo "chmod u+x $mrun_script_name" >> $jobfile |
---|
4724 | echo "execute_mrun=true" >> $jobfile |
---|
4725 | echo " " >> $jobfile |
---|
4726 | |
---|
4727 | fi |
---|
4728 | |
---|
4729 | |
---|
4730 | # GET REQUIRED INPUT-FILES BY SCP OR BY SENDING THEM WITH THE JOB AS HERE-DOCUMENT |
---|
4731 | # PUT THESE FILES INTO THE USER'S RESPECTIVE PERMANENT DIRECTORIES ON THE REMOTE-HOST |
---|
4732 | # IF THE DIRECTORIES DO NOT EXIST, TRY TO CREATE THEM |
---|
4733 | if [[ $do_remote = true ]] |
---|
4734 | then |
---|
4735 | (( i = 0 )) |
---|
4736 | while (( i < iin )) |
---|
4737 | do |
---|
4738 | (( i = i + 1 )) |
---|
4739 | echo "[[ ! -d ${pathin[$i]} ]] && mkdir -p ${pathin[$i]}" >> $jobfile |
---|
4740 | if [[ "${transin[$i]}" = job ]] |
---|
4741 | then |
---|
4742 | echo "cat > ${remotepathin[$i]} <<\"%END%\"" >> $jobfile |
---|
4743 | eval cat ${pathin[$i]}/${frelin[$i]} >> $jobfile |
---|
4744 | echo " " >> $jobfile |
---|
4745 | echo "%END%" >> $jobfile |
---|
4746 | else |
---|
4747 | echo "batch_scp $PORTOPT -b -o -g -s -u $return_username $return_addres ${remotepathin[$i]} \"${pathin[$i]}\" ${frelin[$i]}" >> $jobfile |
---|
4748 | fi |
---|
4749 | |
---|
4750 | # CHECK, IF FILE COULD BE CREATED |
---|
4751 | echo "if [[ \$? = 1 ]]" >> $jobfile |
---|
4752 | echo "then" >> $jobfile |
---|
4753 | echo " echo \" \" " >> $jobfile |
---|
4754 | echo " echo \"+++ file ${remotepathin[$i]} could not be created\" " >> $jobfile |
---|
4755 | echo " echo \" please check, if directory exists on $host!\" " >> $jobfile |
---|
4756 | echo " echo \"+++ MRUN will not be continued\" " >> $jobfile |
---|
4757 | echo " execute_mrun=false" >> $jobfile |
---|
4758 | echo "fi" >> $jobfile |
---|
4759 | done |
---|
4760 | fi |
---|
4761 | |
---|
4762 | # PROVIDE NAME OF THE CURRENT WORKING-DIRECTORY ON THE LOCAL MACHINE (FROM WHERE THE JOB IS |
---|
4763 | # STARTED) BY SETTING AN ENVIRONMENT-VARIABLE. THIS INFORMATION IS USED IN THE JOB BY MRUN |
---|
4764 | # IN CASE THAT RESTART-RUNS HAVE TO BE GENERATED |
---|
4765 | echo "LOCAL_PWD=$working_directory" >> $jobfile |
---|
4766 | echo "export LOCAL_PWD" >> $jobfile |
---|
4767 | |
---|
4768 | # PROVIDE THE PATH OF THE LOCAL MRUN-SCRIPT FOR THE SAME REASON |
---|
4769 | echo "LOCAL_MRUN_PATH=$PALM_BIN" >> $jobfile |
---|
4770 | echo "export LOCAL_MRUN_PATH" >> $jobfile |
---|
4771 | |
---|
4772 | # lcflow ALSO REQUIRES TO PROVIDE PATH FOR THE PALM-SCRIPTS |
---|
4773 | if [[ $host = lcflow || $localhost = lcflow ]] |
---|
4774 | then |
---|
4775 | echo "export PALM_BIN=$PALM_BIN" | sed -e 's:'$HOME':$HOME:' >> $jobfile |
---|
4776 | echo "export PATH=\$PATH:\$PALM_BIN" >> $jobfile |
---|
4777 | fi |
---|
4778 | |
---|
4779 | # CALL MRUN WITHIN THE JOB (SETTING QUEUE IS A WORKAROUND FOR ibmkisti) |
---|
4780 | # AS FINAL ACTION, REMOVE THE TEMPORARY DIRECTORY CREATED AT THE BEGINNING OF THE JOB |
---|
4781 | echo "set -x" >> $jobfile |
---|
4782 | echo "queue=$queue" >> $jobfile |
---|
4783 | echo "[[ \$execute_mrun = true ]] && ./$mrun_com" >> $jobfile |
---|
4784 | echo 'ls -al; echo `pwd`' >> $jobfile |
---|
4785 | echo "cd \$HOME" >> $jobfile |
---|
4786 | echo "rm -rf $TEMPDIR" >> $jobfile |
---|
4787 | |
---|
4788 | |
---|
4789 | |
---|
4790 | |
---|
4791 | # START THE JOB USING SUBJOB-COMMAND |
---|
4792 | if [[ $silent = false ]] |
---|
4793 | then |
---|
4794 | printf "\n " |
---|
4795 | else |
---|
4796 | printf "\n\n" |
---|
4797 | fi |
---|
4798 | |
---|
4799 | subjob $job_on_file -h $host -u $remote_username -g $group_number -q $queue -m $memory -N $node_usage -t $cpumax $XOPT $TOPT $OOPT -n $fname -v -c $job_catalog -e $email_notification $PORTOPT $jobfile |
---|
4800 | rm -rf $jobfile |
---|
4801 | |
---|
4802 | |
---|
4803 | fi # END OF REMOTE-PART |
---|