11 |
echo |
echo |
12 |
echo "where possible OPTIONS are:" |
echo "where possible OPTIONS are:" |
13 |
echo " (-help|-h) print usage" |
echo " (-help|-h) print usage" |
14 |
echo " (-mth) run multi threaded (using eedata.mth)" |
echo " (-mth) run multi-threaded (using eedata.mth)" |
15 |
echo " (-mpi) compile and run using MPI" |
echo " (-mpi) use MPI to compile and run on 2 processors" |
16 |
echo " (-ieee|-noieee) if possible, use IEEE compiler flags" |
echo " (-MPI) NUMBER use MPI to compile and run on max NUMBER procs" |
17 |
|
echo " (-mfile|-mf) STRING MPI: file with list of possible machines to run on" |
18 |
|
echo " (-ieee/-noieee) if possible, use IEEE compiler flags" |
19 |
echo " (DEF=\"-ieee\")" |
echo " (DEF=\"-ieee\")" |
20 |
echo " (-gsl) compile with \"-gsl\" flag" |
echo " (-gsl) compile with \"-gsl\" flag" |
21 |
echo " (-of=|-optfile=)STRING list of optfiles to use" |
echo " (-use_r4|-ur4) if allowed, use real*4 type for '_RS' variable" |
22 |
echo " (-a|-addr) STRING list of email recipients" |
echo " (-optfile|-of) STRING list of optfiles to use" |
23 |
|
echo " (-addr|-a) STRING list of email recipients" |
24 |
echo " (DEF=\"\" no email is sent)" |
echo " (DEF=\"\" no email is sent)" |
25 |
echo " (-mpd|-mpackdir) DIR location of the mpack utility" |
echo " (-mpackdir|-mpd) DIR location of the mpack utility" |
26 |
echo " (DEF=\"../tools/mpack-1.6\")" |
echo " (DEF=\"../tools/mpack-1.6\")" |
27 |
echo " (-t|-tdir) STRING list of group and/or exp. dirs to test" |
echo " (-tdir|-t) STRING list of group and/or exp. dirs to test" |
28 |
echo " (recognized groups: basic, tutorials)" |
echo " (recognized groups: basic, tutorials)" |
29 |
echo " (DEF=\"\" which test all)" |
echo " (DEF=\"\" which test all)" |
30 |
echo " (-skd|-skipdir) STRING list of exp. dirs to skip" |
echo " (if list= 'start_from THIS_EXP' then" |
31 |
|
echo " test THIS_EXP + all the following)" |
32 |
|
echo " (-skipdir|-skd) STRING list of exp. dirs to skip" |
33 |
echo " (DEF=\"\" which test all)" |
echo " (DEF=\"\" which test all)" |
34 |
echo " (-b|-bash) STRING preferred location of a \"bash\" or" |
echo " (-bash|-b) STRING preferred location of a \"bash\" or" |
35 |
echo " Bourne-compatible \"sh\" shell" |
echo " Bourne-compatible \"sh\" shell" |
36 |
echo " (DEF=\"\" for \"bash\")" |
echo " (DEF=\"\" for \"bash\")" |
37 |
echo " (-adm|-ad) perform an adjoint run" |
echo " (-adm|-ad) perform an adjoint run" |
38 |
echo " (-command) STRING command to run" |
echo " (-oad) perform an OpenAD adjoint run" |
39 |
echo " (DEF=\"make output.txt\")" |
echo " (-command|-c) STRING command to run" |
40 |
echo " (-m|-make) STRING command to use for \"make\"" |
echo " (-makedepend|-md) STRING command to use for \"makedepend\"" |
41 |
|
echo " (-make|-m) STRING command to use for \"make\"" |
42 |
echo " (DEF=\"make\")" |
echo " (DEF=\"make\")" |
43 |
echo " (-odir) STRING used to build output directory name" |
echo " (-odir) STRING used to build output directory name" |
44 |
echo " (DEF=\"hostname\")" |
echo " (DEF=\"hostname\")" |
45 |
echo " (-ptr|-ptracers) STRING specify which ptracers to test" |
# echo " (-ptracers|-ptr) STRING specify which ptracers to test" |
46 |
echo " (DEF=\"1 2 3 4 5\")" |
# echo " (DEF=\"1 2 3 4 5\")" |
47 |
echo " (-match) NUMBER Matching Criteria (number of digits)" |
echo " (-match) NUMBER Matching Criteria (number of digits)" |
48 |
echo " (DEF=\"12\")" |
echo " (DEF=\"$MATCH_CRIT\")" |
49 |
echo " (-j) JOBS use \"make -j JOBS\" for parallel builds" |
echo " (-j) JOBS use \"make -j JOBS\" for parallel builds" |
50 |
echo " (-clean) *ONLY* run \"make CLEAN\"" |
echo " (-clean) *ONLY* run \"make CLEAN\" & clean run-dir" |
51 |
|
echo " (-norun|-nr) skip the \"runmodel\" stage (stop after make)" |
52 |
|
echo " (-runonly|-ro) *ONLY* run stage (=\"-quick\" without make)" |
53 |
echo " (-quick|-q) same as \"-nogenmake -noclean -nodepend\"" |
echo " (-quick|-q) same as \"-nogenmake -noclean -nodepend\"" |
54 |
echo " (-nogenmake|-ng) skip the genmake stage" |
echo " (-nogenmake|-ng) skip the genmake stage" |
55 |
echo " (-noclean|-nc) skip the \"make clean\" stage" |
echo " (-noclean|-nc) skip the \"make clean\" stage" |
56 |
echo " (-nodepend|-nd) skip the \"make depend\" stage" |
echo " (-nodepend|-nd) skip the \"make depend\" stage" |
57 |
|
echo " (-postclean|-pc) after each exp. test, clean build-dir & run-dir" |
58 |
|
echo " (-deloutp|-do) delete output files after successful run" |
59 |
echo " (-deldir|-dd) on success, delete the output directory" |
echo " (-deldir|-dd) on success, delete the output directory" |
60 |
echo " (-ts) provide timing information per timestep" |
echo " (-ts) provide timing information per timestep" |
61 |
echo " (-papis) provide MFlop/s per timestep using PAPI" |
echo " (-papis) provide MFlop/s per timestep using PAPI" |
113 |
{ |
{ |
114 |
# testoutput_var dir s1 label subdir reference_output |
# testoutput_var dir s1 label subdir reference_output |
115 |
# |
# |
116 |
# compares 1 variable output selected from file $dir/$subdir/$OUTPUTFILE |
# compares 1 variable output selected from file $dir/$subdir/$OUTPUTFILE |
117 |
# with same output from reference file $dir/results/$reference_output |
# with same output from reference file $dir/results/$reference_output |
118 |
# using search strings s1 and text label |
# using search strings s1 and text label |
119 |
|
|
185 |
fi |
fi |
186 |
fi |
fi |
187 |
rm -f tmp1.txt tmp2.txt tmp3.txt tmp4.txt |
rm -f tmp1.txt tmp2.txt tmp3.txt tmp4.txt |
188 |
|
|
189 |
return $digits_of_similarity |
return $digits_of_similarity |
190 |
} |
} |
191 |
|
|
221 |
eval "HAVE_PTR0"$ii"=t" |
eval "HAVE_PTR0"$ii"=t" |
222 |
else |
else |
223 |
eval "HAVE_PTR0"$ii"=f" |
eval "HAVE_PTR0"$ii"=f" |
224 |
if test "x$ADM" = x ; then |
if test "x$ADM" = x -a "x$OADM" = x; then |
225 |
# remove this ptr from the list of output variable to check |
# remove this ptr from the list of output variable to check |
226 |
# echo "-- ptr test=" $tst "number of var=" `echo $listVar | awk '{print NF}'` 1>&2 |
# echo "-- ptr test=" $tst "number of var=" `echo $listVar | awk '{print NF}'` 1>&2 |
227 |
listVar=`echo "$listVar" | sed "s/ pt$ii..//g"` |
listVar=`echo "$listVar" | sed "s/ pt$ii..//g"` |
238 |
listVar=" $sVar "`echo "$listVar " | sed "s/ $sVar / /g"` |
listVar=" $sVar "`echo "$listVar " | sed "s/ $sVar / /g"` |
239 |
fi |
fi |
240 |
if [ $debug -gt 0 ]; then echo "testoutput_run: listVar(M)='$listVar'" 1>&2 ; fi |
if [ $debug -gt 0 ]; then echo "testoutput_run: listVar(M)='$listVar'" 1>&2 ; fi |
241 |
echo "listVar='$listVar'" > $CDIR"/summary.txt" |
echo "listVar='$listVar'" >> $locDIR"/summary.txt" |
242 |
|
#--- |
243 |
allargs="" |
allargs="" |
244 |
for xx in $listVar |
for xx in $listVar |
245 |
do |
do |
274 |
testoutput_var $1 "trcstat_ptracer0"$ii"_mean" "p0"$ii"_mean" $2 $3; yy=$? ;; |
testoutput_var $1 "trcstat_ptracer0"$ii"_mean" "p0"$ii"_mean" $2 $3; yy=$? ;; |
275 |
'pt1sd'|'pt2sd'|'pt3sd'|'pt4sd'|'pt5sd') ii=`echo $xx | sed 's/pt//' | sed 's/..$//'` |
'pt1sd'|'pt2sd'|'pt3sd'|'pt4sd'|'pt5sd') ii=`echo $xx | sed 's/pt//' | sed 's/..$//'` |
276 |
testoutput_var $1 "trcstat_ptracer0"$ii"_sd" "p0"$ii"_StDv" $2 $3; yy=$? ;; |
testoutput_var $1 "trcstat_ptracer0"$ii"_sd" "p0"$ii"_StDv" $2 $3; yy=$? ;; |
277 |
'Qntmn') testoutput_var $1 "extforcing_qnet_min" "Qnet minimum" $2 $3; yy=$? ;; |
'Qntmn') testoutput_var $1 "forcing_qnet_min" "Qnet minimum" $2 $3; yy=$? ;; |
278 |
'Qntmx') testoutput_var $1 "extforcing_qnet_max" "Qnet maximum" $2 $3; yy=$? ;; |
'Qntmx') testoutput_var $1 "forcing_qnet_max" "Qnet maximum" $2 $3; yy=$? ;; |
279 |
'Qntav') testoutput_var $1 "extforcing_qnet_mean" "Qnet mean" $2 $3; yy=$? ;; |
'Qntav') testoutput_var $1 "forcing_qnet_mean" "Qnet mean" $2 $3; yy=$? ;; |
280 |
'Qntsd') testoutput_var $1 "extforcing_qnet_sd" "Qnet Std.Dev" $2 $3; yy=$? ;; |
'Qntsd') testoutput_var $1 "forcing_qnet_sd" "Qnet Std.Dev" $2 $3; yy=$? ;; |
281 |
'aSImn') testoutput_var $1 "seaice_area_min" "SIce Area min" $2 $3; yy=$? ;; |
'aSImn') testoutput_var $1 "seaice_area_min" "SIce Area min" $2 $3; yy=$? ;; |
282 |
'aSImx') testoutput_var $1 "seaice_area_max" "SIce Area max" $2 $3; yy=$? ;; |
'aSImx') testoutput_var $1 "seaice_area_max" "SIce Area max" $2 $3; yy=$? ;; |
283 |
'aSIav') testoutput_var $1 "seaice_area_mean" "SIce Area mean" $2 $3; yy=$? ;; |
'aSIav') testoutput_var $1 "seaice_area_mean" "SIce Area mean" $2 $3; yy=$? ;; |
284 |
'aSIsd') testoutput_var $1 "seaice_area_sd" "SIce Area StDv" $2 $3; yy=$? ;; |
'aSIsd') testoutput_var $1 "seaice_area_sd" "SIce Area StDv" $2 $3; yy=$? ;; |
285 |
'hSImn') testoutput_var $1 "seaice_heff_min" "SIce Heff min" $2 $3; yy=$? ;; |
'hSImn') testoutput_var $1 "seaice_heff_min" "SIce Heff min" $2 $3; yy=$? ;; |
286 |
'hSImx') testoutput_var $1 "seaice_heff_max" "SIce Hell max" $2 $3; yy=$? ;; |
'hSImx') testoutput_var $1 "seaice_heff_max" "SIce Heff max" $2 $3; yy=$? ;; |
287 |
'hSIav') testoutput_var $1 "seaice_heff_mean" "SIce Hell mean" $2 $3; yy=$? ;; |
'hSIav') testoutput_var $1 "seaice_heff_mean" "SIce Heff mean" $2 $3; yy=$? ;; |
288 |
'hSIsd') testoutput_var $1 "seaice_heff_sd" "SIce Hell StDv" $2 $3; yy=$? ;; |
'hSIsd') testoutput_var $1 "seaice_heff_sd" "SIce Heff StDv" $2 $3; yy=$? ;; |
289 |
'AthSiG') testoutput_var $1 "thSI_Ice_Area_G" "thSIc Area Global" $2 $3; yy=$? ;; |
'AthSiG') testoutput_var $1 "thSI_Ice_Area_G" "thSIc Area Global" $2 $3; yy=$? ;; |
290 |
'AthSiS') testoutput_var $1 "thSI_Ice_Area_S" "thSIc Area South" $2 $3; yy=$? ;; |
'AthSiS') testoutput_var $1 "thSI_Ice_Area_S" "thSIc Area South" $2 $3; yy=$? ;; |
291 |
'AthSiN') testoutput_var $1 "thSI_Ice_Area_N" "thSIc Area North" $2 $3; yy=$? ;; |
'AthSiN') testoutput_var $1 "thSI_Ice_Area_N" "thSIc Area North" $2 $3; yy=$? ;; |
301 |
done |
done |
302 |
|
|
303 |
nbVar=`echo $listVar | awk '{print NF}'` |
nbVar=`echo $listVar | awk '{print NF}'` |
304 |
if [ $nbVar -lt $LEN_CHECK_LIST ] ; then |
if [ $nbVar -lt $LEN_CHECK_LIST ] ; then |
305 |
#-- fill line (up to standard length) with dot: |
#-- fill line (up to standard length) with dot: |
306 |
adNul=`expr $LEN_CHECK_LIST - $nbVar | awk '{for(i=1;i<=$1;i++){print "."}}'` |
adNul=`expr $LEN_CHECK_LIST - $nbVar | awk '{for(i=1;i<=$1;i++){print "."}}'` |
307 |
echo $allargs $adNul |
echo $allargs $adNul |
308 |
else |
else |
309 |
echo $allargs |
echo $allargs |
310 |
fi |
fi |
311 |
# <-- same processing for adjoint & forward test |
# <-- same processing for adjoint & forward test |
312 |
} |
} |
313 |
|
|
325 |
( |
( |
326 |
cd $1; |
cd $1; |
327 |
command="$GENMAKE2 -ds -m $MAKE" |
command="$GENMAKE2 -ds -m $MAKE" |
328 |
if test "x$ADM" = x ; then |
if test "x$MKDEPEND" != x ; then |
329 |
command="$command --mods=../code" |
command="$command -makedepend=$MKDEPEND" |
330 |
else |
fi |
331 |
|
if test "x$ADM" = xt ; then |
332 |
command="$command --mods=../code_ad" |
command="$command --mods=../code_ad" |
333 |
|
elif test "x$OADM" = xt ; then |
334 |
|
command="$command -adof ../../../tools/adjoint_options/adjoint_oad -mods '../code_oad ../../OpenAD/code_oad_all'" |
335 |
|
else |
336 |
|
command="$command -mods=../code" |
337 |
fi |
fi |
338 |
if test "x$OPTFILE" != xNONE ; then |
if test "x$OPTFILE" != xNONE ; then |
339 |
command="$command --optfile=$OPTFILE" |
command="$command -optfile=$OPTFILE" |
340 |
fi |
fi |
341 |
if test "x$IEEE" != x ; then |
if test "x$IEEE" != x ; then |
342 |
command="$command -ieee" |
command="$command -ieee" |
344 |
if test "x$GSL" = xt ; then |
if test "x$GSL" = xt ; then |
345 |
command="$command -gsl" |
command="$command -gsl" |
346 |
fi |
fi |
347 |
if test "x$MPI" = xt ; then |
if test "x$MPI" != x0 ; then |
348 |
command="$command -mpi" |
command="$command -mpi" |
349 |
fi |
fi |
350 |
|
if test "x$MULTI_THREAD" = xt ; then |
351 |
|
#- run multi-threaded using OpenMP: |
352 |
|
command="$command -omp" |
353 |
|
fi |
354 |
|
if test "x$USE_R4" = xt ; then |
355 |
|
command="$command -use_r4" |
356 |
|
fi |
357 |
if test "x$TS" = xt ; then |
if test "x$TS" = xt ; then |
358 |
command="$command -ts" |
command="$command -ts" |
359 |
fi |
fi |
360 |
if test "x$PAPIS" = xt ; then |
if test "x$PAPIS" = xt ; then |
361 |
command="$command -papis" |
command="$command -papis" |
362 |
else |
else |
363 |
if test "x$PCLS" = xt ; then |
if test "x$PCLS" = xt ; then |
364 |
command="$command -pcls" |
command="$command -pcls" |
365 |
fi |
fi |
366 |
fi |
fi |
367 |
printf 'genmake ... ' 1>&2 |
printf 'genmake ... ' |
368 |
$command > make.log 2>&1 |
eval $command > genmake.tr_log 2>&1 |
369 |
RETVAL=$? |
RETVAL=$? |
370 |
# Reduce the size of the testing emails! |
# Reduce the size of the testing emails! |
371 |
head -100 Makefile > $CDIR/Makefile_head |
head -100 Makefile > $CDIR/Makefile_head |
372 |
if test "x$RETVAL" != x0 ; then |
if test "x$RETVAL" != x0 ; then |
373 |
tail make.log |
tail genmake.tr_log |
374 |
echo "genmakemodel: genmake failed" 1>&2 |
echo "genmakemodel: genmake failed" |
375 |
cp genmake_* make.log $CDIR |
cp genmake.log genmake_* genmake.tr_log $CDIR |
376 |
return 1 |
return 1 |
377 |
else |
else |
378 |
echo "successful" 1>&2 |
echo "successful" |
379 |
fi |
fi |
380 |
) |
) |
381 |
fi |
fi |
384 |
makeclean() |
makeclean() |
385 |
{ |
{ |
386 |
# makeclean directory |
# makeclean directory |
387 |
|
if test "x$NODEPEND" = xf ; then rm -f $1/make.tr_log ; fi |
388 |
if test "x$NOCLEAN" = xt ; then |
if test "x$NOCLEAN" = xt ; then |
389 |
echo "make Clean skipped!" |
echo "make Clean skipped!" |
390 |
else |
else |
392 |
cd $1; |
cd $1; |
393 |
#if test -e $OUTPUTFILE ; then rm -f $OUTPUTFILE ; fi |
#if test -e $OUTPUTFILE ; then rm -f $OUTPUTFILE ; fi |
394 |
if test -r Makefile ; then |
if test -r Makefile ; then |
395 |
printf 'clean build-dir: make Clean ... ' 2>&1 |
printf 'clean build-dir: make Clean ... ' |
396 |
$MAKE Clean >> make.log 2>&1 |
$MAKE Clean >> make.tr_log 2>&1 |
397 |
RETVAL=$? |
RETVAL=$? |
398 |
if test "x$RETVAL" != x0 ; then |
if test "x$RETVAL" != x0 ; then |
399 |
tail make.log |
tail make.tr_log |
400 |
echo "makeclean: \"make Clean\" failed" 1>&2 |
echo "makeclean: \"make Clean\" failed" |
401 |
cp make.log $CDIR"/make.log" |
cp make.tr_log genmake.log genmake.tr_log $CDIR |
402 |
return 1 |
return 1 |
403 |
fi |
fi |
404 |
|
echo successful |
405 |
|
else |
406 |
|
echo '' |
407 |
fi |
fi |
|
echo successful 1>&2 |
|
408 |
exit 0 |
exit 0 |
409 |
) |
) |
410 |
fi |
fi |
418 |
else |
else |
419 |
( |
( |
420 |
cd $1; |
cd $1; |
421 |
printf 'clean run-dir ... ' 2>&1 |
printf 'clean run-dir ... ' |
422 |
# part of what is done after "make clean" when doing "make CLEAN" |
# part of what is done after "make clean" when doing "make CLEAN" |
423 |
find . -name "*.meta" -exec rm {} \; |
find . -name "*.meta" -exec rm {} \; |
424 |
find . -name "*.data" -exec rm {} \; |
find . -name "*.data" -exec rm {} \; |
425 |
find . -name "fort.*" -exec rm {} \; |
find . -name "fort.*" -exec rm {} \; |
426 |
find . -type l -exec rm {} \; |
find . -type l -exec rm {} \; |
427 |
rm -f $EXECUTABLE *.txt STD* *diagnostics.log datetime |
#- should remove executable only if sym-link (alredy done above) |
428 |
|
rm -f $RUNLOG *.txt STD* *diagnostics.log datetime |
429 |
rm -rf mnc_test_* |
rm -rf mnc_test_* |
430 |
rm -f *_MIT_CE_000.opt0000 costfunction*0000 |
rm -f *_MIT_CE_000.opt0000 costfunction*0000 |
431 |
echo successful 1>&2 |
echo successful |
432 |
exit 0 |
exit 0 |
433 |
) |
) |
434 |
fi |
fi |
442 |
else |
else |
443 |
( |
( |
444 |
cd $1; |
cd $1; |
445 |
printf 'make depend ... ' 1>&2 |
printf 'make depend ... ' |
446 |
$MAKE depend >> make.log 2>&1 |
$MAKE depend >> make.tr_log 2>&1 |
447 |
RETVAL=$? |
RETVAL=$? |
448 |
if test "x$RETVAL" != x0 ; then |
if test "x$RETVAL" != x0 ; then |
449 |
tail make.log |
tail make.tr_log |
450 |
echo "makedependmodel: make depend failed" 1>&2 |
echo "makedependmodel: make depend failed" |
451 |
cp make.log $CDIR"/make.log" |
cp make.tr_log genmake.log genmake.tr_log $CDIR |
452 |
return 1 |
return 1 |
453 |
else |
else |
454 |
echo successful 1>&2 |
echo successful |
455 |
fi |
fi |
456 |
) |
) |
457 |
fi |
fi |
461 |
{ |
{ |
462 |
# makemodel directory |
# makemodel directory |
463 |
( |
( |
464 |
|
mk_fail=0 |
465 |
|
if test "x$NOMAKE" = xt ; then |
466 |
|
cd $1; |
467 |
|
if test -x $EXECUTABLE ; then |
468 |
|
echo "make skipped!" |
469 |
|
else |
470 |
|
echo "no executable!" |
471 |
|
mk_fail=3 |
472 |
|
fi |
473 |
|
else |
474 |
cd $1; |
cd $1; |
475 |
if test -r Makefile ; then |
if test -r Makefile ; then |
476 |
printf 'make ... ' 1>&2 |
printf 'make ... ' |
477 |
if test "x$ADM" = x ; then |
if test "x$ADM" = xt ; then |
478 |
|
$MAKE adall >> make.tr_log 2>&1 |
479 |
|
elif test "x$OADM" = xt ; then |
480 |
|
$MAKE adAll >> make.tr_log 2>&1 |
481 |
|
else |
482 |
if test "x$JOBS" = x ; then |
if test "x$JOBS" = x ; then |
483 |
$MAKE >> make.log 2>&1 |
$MAKE >> make.tr_log 2>&1 |
484 |
else |
else |
485 |
$MAKE -j $JOBS >> make.log 2>&1 |
$MAKE -j $JOBS >> make.tr_log 2>&1 |
486 |
fi |
fi |
|
else |
|
|
$MAKE adall >> make.log 2>&1 |
|
487 |
fi |
fi |
488 |
RETVAL=$? |
RETVAL=$? |
489 |
if test "x$RETVAL" != x0 ; then |
if test "x$RETVAL" != x0 ; then |
490 |
tail make.log |
tail make.tr_log |
491 |
echo failed 1>&2 |
echo failed |
492 |
cp make.log $CDIR"/make.log" |
cp genmake.log genmake.tr_log $CDIR |
493 |
return 1 |
tail -$NBLINES_MKLOG make.tr_log > $CDIR"/make.tr_log_tail" |
494 |
|
rm -f $EXECUTABLE |
495 |
|
mk_fail=1 |
496 |
else |
else |
497 |
echo successful 1>&2 |
echo successful |
498 |
fi |
fi |
499 |
|
else |
500 |
|
echo "no Makefile !" |
501 |
|
mk_fail=2 |
502 |
fi |
fi |
503 |
|
fi |
504 |
|
if test "x$ADM" = xt -a -f taf_ad.log ; then |
505 |
|
head -1 taf_ad.log >> $CDIR"/summary.txt" |
506 |
|
nerr=`grep -c 'TAF *.* ERROR ' taf_ad.log` |
507 |
|
nwar=`grep -c 'TAF RECOMPUTATION *.* WARNING ' taf_ad.log` |
508 |
|
echo " TAF reports $nerr Errors and $nwar Recomputation Warnings" \ |
509 |
|
>> $CDIR"/summary.txt" |
510 |
|
fi |
511 |
|
if test $mk_fail != 0 ; then return $mk_fail ; fi |
512 |
) |
) |
513 |
} |
} |
514 |
|
|
515 |
|
mk_mpi_size() |
516 |
|
{ |
517 |
|
# mk_mpi_size input_file output_file proc_Nb prefer_to_split_X |
518 |
|
# |
519 |
|
# make new SIZE.h (=output_file) from SIZE.h_mpi (=input_file) |
520 |
|
# for an MPI build with no more than proc_Nb processors ; |
521 |
|
# return the effective number of processors. |
522 |
|
|
523 |
|
inp=$1 |
524 |
|
out=$2 |
525 |
|
np=$3 |
526 |
|
dirX=$4 |
527 |
|
tmp=TTT.$$ |
528 |
|
|
529 |
|
px=`grep "^ & *nPx *=" $inp | sed "s/^ & *nPx *= *//" | sed 's/, *$//'` |
530 |
|
py=`grep "^ & *nPy *=" $inp | sed "s/^ & *nPy *= *//" | sed 's/, *$//'` |
531 |
|
sx=`grep "^ & *nSx *=" $inp | sed "s/^ & *nSx *= *//" | sed 's/, *$//'` |
532 |
|
sy=`grep "^ & *nSy *=" $inp | sed "s/^ & *nSy *= *//" | sed 's/, *$//'` |
533 |
|
|
534 |
|
#- find the largest divisor of input_file proc Nb, but not larger than $np |
535 |
|
pp=0 |
536 |
|
i=1 |
537 |
|
while [ $i -le $px ] ; do |
538 |
|
if [ `expr $px % $i` -eq 0 ] ; then |
539 |
|
j=1 |
540 |
|
while [ $j -le $py ] ; do |
541 |
|
if [ `expr $py % $j` -eq 0 ] ; then |
542 |
|
ij=`expr $i \* $j` |
543 |
|
if [ $ij -gt $pp ] ; then |
544 |
|
flag=1 |
545 |
|
elif [ $ij -eq $pp ] ; then |
546 |
|
flag=$dirX |
547 |
|
else |
548 |
|
flag=0 |
549 |
|
fi |
550 |
|
if test $flag = 1 ; then |
551 |
|
if [ $ij -le $np ] ; then |
552 |
|
ix=$i ; jy=$j ; pp=$ij |
553 |
|
#echo " ix,jy= $ix,$jy" |
554 |
|
fi |
555 |
|
fi |
556 |
|
fi |
557 |
|
j=`expr $j + 1` |
558 |
|
done |
559 |
|
fi |
560 |
|
i=`expr $i + 1` |
561 |
|
done |
562 |
|
|
563 |
|
#- create new SIZE.h type file: |
564 |
|
sx=`expr $sx \* $px / $ix` |
565 |
|
sy=`expr $sy \* $py / $jy` |
566 |
|
if [ $verbose -gt 1 ]; then |
567 |
|
echo " px,py,np= $px,$py,$np : New MPI size: px,py= $ix,$jy : sx,sy= $sx,$sy" |
568 |
|
fi |
569 |
|
sed "/^ \& *nPx *=/s/[0-9]*,/$ix,/" $inp > $tmp |
570 |
|
sed "/^ \& *nPy *=/s/[0-9]*,/$jy,/" $tmp > $out |
571 |
|
sed "/^ \& *nSx *=/s/[0-9]*,/$sx,/" $out > $tmp |
572 |
|
sed "/^ \& *nSy *=/s/[0-9]*,/$sy,/" $tmp > $out |
573 |
|
rm -f $tmp |
574 |
|
return $pp |
575 |
|
} |
576 |
|
|
577 |
symlink_mpifiles() |
symlink_mpifiles() |
578 |
{ |
{ |
579 |
# Put special links so that MPI specific files are used |
# Put special links so that MPI specific files are used |
582 |
|
|
583 |
dir=$1 |
dir=$1 |
584 |
code_dir=$2 |
code_dir=$2 |
585 |
BUILD_DIR=$dir/$3 |
build_dir=$dir/$3 |
586 |
CODE_DIR=$dir/$code_dir |
|
|
|
|
587 |
# These are files that should replace their counter-part when using -mpi |
# These are files that should replace their counter-part when using -mpi |
588 |
MPI_FILES=`(cd $CODE_DIR; find . -name "*_mpi" -print)` |
MPI_FILES=`(cd $dir/$code_dir; find . -name "*_mpi" -print)` |
589 |
|
|
590 |
# Is this an MPI run? |
for ii in $MPI_FILES ; do |
591 |
if test "x$MPI" = xt ; then |
i=`echo $ii | sed 's:^\./::'` |
592 |
# YES: We symbolically link these files to the build |
name=`echo $i | sed 's:_mpi::'` |
593 |
# dir so long as there is no real file in place |
file="../$code_dir/$i" |
594 |
for ii in $MPI_FILES ; do |
if test $name = 'SIZE.h' ; then file="SIZE.h.mpi" ; fi |
595 |
i=`echo $ii | sed 's:^\./::'` |
|
596 |
name=`echo $i | sed 's:_mpi::' ` |
# Is this an MPI run? |
597 |
cmp $CODE_DIR/$i $BUILD_DIR/$name > /dev/null 2>&1 |
if test "x$MPI" = x0 ; then |
598 |
RETVAL=$? |
# NO: We undo any _mpi symbolically linked files |
599 |
if test "x$RETVAL" != x0 ; then |
if test -L $build_dir/$name ; then |
600 |
if ! test -f $BUILD_DIR/$i ; then |
( cd $build_dir ; cmp $name $file > /dev/null 2>&1 ) |
|
#echo Linking $name to $i |
|
|
(cd $BUILD_DIR; ln -sf ../$code_dir/$i $name) |
|
|
fi |
|
|
fi |
|
|
done |
|
|
else |
|
|
# NO: We undo any _mpi symbolically linked files |
|
|
for ii in $MPI_FILES ; do |
|
|
i=`echo $ii | sed 's:^\./::'` |
|
|
name=`echo $i | sed 's:_mpi::' ` |
|
|
if test -L $BUILD_DIR/$name ; then |
|
|
cmp $BUILD_DIR/$name "../$code_dir/$name"_mpi > /dev/null 2>&1 |
|
601 |
RETVAL=$? |
RETVAL=$? |
602 |
if test "x$RETVAL" = x0 ; then |
if test "x$RETVAL" = x0 ; then |
603 |
#echo Un-linking $name from $linktarg |
if [ $verbose -gt 1 ]; then |
604 |
rm -f $BUILD_DIR/$name |
echo " Un-linking $name from ../$code_dir" ; fi |
605 |
|
rm -f $build_dir/$name |
606 |
fi |
fi |
607 |
fi |
fi |
608 |
done |
else |
609 |
fi |
# YES: We symbolically link these files to the build |
610 |
|
# dir so long as there is no real file in place |
611 |
|
( cd $build_dir ; cmp $name $file > /dev/null 2>&1 ) |
612 |
|
RETVAL=$? |
613 |
|
if [ $verbose -gt 1 ]; then echo " cmp $name $file returns: $RETVAL" ; fi |
614 |
|
if test "x$RETVAL" != x0 ; then |
615 |
|
if test -h $build_dir/$name ; then rm -f $build_dir/$name ; fi |
616 |
|
if test ! -r $build_dir/$name ; then |
617 |
|
if [ $verbose -gt 1 ]; then echo " Linking $name to $file" ; fi |
618 |
|
(cd $build_dir; ln -sf $file $name) |
619 |
|
fi |
620 |
|
fi |
621 |
|
fi |
622 |
|
done |
623 |
} |
} |
624 |
|
|
625 |
linkdata() |
linkdata() |
630 |
if test -d $1 ; then |
if test -d $1 ; then |
631 |
( |
( |
632 |
cd $1 ; shift |
cd $1 ; shift |
633 |
|
echo 'linkdata from dirs:' $* |
634 |
|
inpMPI=`(cd ../$1 ; find . -name "*.mpi" -print | sed 's:^\./::')` |
635 |
|
for xx in $inpMPI ; do |
636 |
|
if test -r "../"$1"/"$xx ; then |
637 |
|
# found 1 _mpi sfx file in 1rst input dir and it is readable |
638 |
|
yy=`echo $xx | sed 's:\.mpi$::'` |
639 |
|
if test "x$MPI" = "x0" ; then |
640 |
|
# not mpi test: remove symbolic link |
641 |
|
if test -h $yy ; then rm -f $yy ; fi |
642 |
|
else |
643 |
|
# mpi test: remove symbolic link & link .mpi sfx file |
644 |
|
if test -h $yy ; then rm -f $yy ; fi |
645 |
|
if test ! -r $yy ; then |
646 |
|
ln -sf "../"$1"/"$xx $yy ; |
647 |
|
printf " $xx" 1>&2 |
648 |
|
fi |
649 |
|
fi |
650 |
|
fi |
651 |
|
done |
652 |
if test -r "../"$1"/eedata.mth" ; then |
if test -r "../"$1"/eedata.mth" ; then |
653 |
# found eedata.mth in 1rst input dir and it is readable |
# found eedata.mth in 1rst input dir and it is readable |
654 |
if test "x$MULTI_THREAD" = "xt" ; then |
if test "x$MULTI_THREAD" = "xt" ; then |
655 |
# multi-threaded test: remove symbolic link & link eedata.mth |
# multi-threaded test: remove symbolic link & link eedata.mth |
656 |
if test -h eedata ; then rm -f eedata ; fi |
if test -h eedata ; then rm -f eedata ; fi |
657 |
if test ! -r eedata ; then |
if test ! -r eedata ; then |
658 |
ln -sf "../"$1"/eedata.mth" eedata ; |
ln -sf "../"$1"/eedata.mth" eedata ; |
659 |
printf 'eedata.mth ' 1>&2 |
printf ' eedata.mth' 1>&2 |
660 |
fi |
fi |
661 |
else |
else |
662 |
# not multi-threaded test: remove eedata symbolic link |
# not multi-threaded test: remove eedata symbolic link |
666 |
prevDir='NONE' |
prevDir='NONE' |
667 |
for ldir in $* ; do |
for ldir in $* ; do |
668 |
if test -d "../"$ldir -a $ldir != $prevDir ; then |
if test -d "../"$ldir -a $ldir != $prevDir ; then |
669 |
printf 'ldir='${ldir} 1>&2 |
printf " ldir=${ldir}:" 1>&2 |
670 |
files=`( cd "../"$ldir ; ls -1 | grep -v CVS )` |
files=`( cd "../"$ldir ; ls -1 | grep -v CVS )` |
671 |
for i in $files ; do |
for i in $files ; do |
672 |
if test ! -d "../"$ldir/$i ; then |
if test ! -d "../"$ldir/$i ; then |
676 |
fi |
fi |
677 |
fi |
fi |
678 |
done |
done |
679 |
|
printf ' ;' 1>&2 |
680 |
if test -x "../"$ldir"/"prepare_run ; then |
if test -x "../"$ldir"/"prepare_run ; then |
681 |
"../"$ldir"/"prepare_run |
"../"$ldir"/"prepare_run 1>&2 |
682 |
|
else |
683 |
|
echo '' 1>&2 |
684 |
fi |
fi |
|
printf ' ; ' 1>&2 |
|
685 |
fi |
fi |
686 |
prevDir=$ldir |
prevDir=$ldir |
687 |
done |
done |
693 |
{ |
{ |
694 |
# runmodel directory |
# runmodel directory |
695 |
# |
# |
696 |
# runs "$COMMAND in "directory" |
# runs $COMMAND in "directory" |
697 |
# (where "$COMMAND" is relative to "directory") |
# (where "$COMMAND" is relative to "directory") |
698 |
( |
( |
699 |
cd $1 |
cd $1 |
700 |
printf 'runmodel in %s ...' $1 1>&2 |
printf 'runmodel in %s ... ' $1 |
701 |
# make output.txt |
if test "x$MPI" != x0 ; then |
702 |
echo |
#- adjust the MPI run command with the right number of Procs |
703 |
if test -L $EXECUTABLE -a -x "../"$builddir"/"$EXECUTABLE ; then |
#echo '' ; echo " COMMAND='$COMMAND'" |
704 |
diff -q $EXECUTABLE "../"$builddir"/"$EXECUTABLE > /dev/null 2>&1 |
COMMAND=`echo $COMMAND | sed "s/ TR_NPROC / $LOC_NPROC /"` |
705 |
outD=$? ; if test $outD != 0 ; then rm -f $EXECUTABLE ; fi |
if test "x$MPI_MFILE" != x ; then |
706 |
|
COMMAND=`echo $COMMAND | sed "s/ TR_MFILE / ..\/..\/$LOC_MFILE /"` |
707 |
|
fi |
708 |
|
#echo " COMMAND='$COMMAND'" |
709 |
|
fi |
710 |
|
if test -L $EXECUTABLE ; then |
711 |
|
if test -x "../"$builddir"/"$EXECUTABLE ; then |
712 |
|
cmp $EXECUTABLE "../"$builddir"/"$EXECUTABLE > /dev/null 2>&1 |
713 |
|
outD=$? ; if test "x$outD" != x0 ; then rm -f $EXECUTABLE ; fi |
714 |
|
else rm -f $EXECUTABLE |
715 |
|
fi |
716 |
fi |
fi |
717 |
if test ! -x $EXECUTABLE -a -x "../"$builddir"/"$EXECUTABLE ; then |
if test ! -x $EXECUTABLE -a -x "../"$builddir"/"$EXECUTABLE ; then |
718 |
echo " link" $EXECUTABLE "from dir ../"$builddir > run.log_tmp |
echo " link" $EXECUTABLE "from dir ../"$builddir > run.log_tmp |
719 |
ln -sf "../"$builddir"/"$EXECUTABLE . |
ln -sf "../"$builddir"/"$EXECUTABLE . |
720 |
fi |
fi |
721 |
if test ! -x $EXECUTABLE ; then |
if test ! -x $EXECUTABLE ; then |
722 |
rm -f $RUNLOG ; touch $RUNLOG |
rm -f $RUNLOG ; touch $RUNLOG |
723 |
if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi |
if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi |
724 |
echo " no executable:" $EXECUTABLE >> $RUNLOG |
echo " no executable:" $EXECUTABLE >> $RUNLOG |
725 |
RETVAL=8 |
RETVAL=8 |
726 |
ENDVAL=-1 |
ENDVAL=-1 |
727 |
else |
else |
728 |
if test ! -f $OUTPUTFILE -o $OUTPUTFILE -ot $EXECUTABLE ; then |
if test ! -f $OUTPUTFILE -o $OUTPUTFILE -ot $EXECUTABLE ; then |
729 |
# output do not exist or is older than executable: |
# output do not exist or is older than executable: |
730 |
rm -f $RUNLOG ; touch $RUNLOG |
rm -f $OUTPUTFILE $RUNLOG ; touch $RUNLOG |
731 |
if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi |
if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi |
732 |
( eval $COMMAND ) >> $RUNLOG 2>&1 |
( eval $COMMAND ) >> $RUNLOG 2>&1 |
733 |
RETVAL=$? |
RETVAL=$? |
734 |
else |
ENDVAL=`tail $OUTPUTFILE | grep -c 'PROGRAM MAIN: Execution ended Normally'` |
735 |
RETVAL=0 |
if [ $POSTCLEAN -eq 1 -a $ENDVAL -gt 0 ] ; then |
736 |
if test -f $RUNLOG ; then |
find . -name "*.meta" -exec rm {} \; |
737 |
if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi |
find . -name "*.data" -exec rm {} \; |
738 |
echo "---------->> $OUTPUTFILE is up to date " >> $RUNLOG 2>&1 |
rm -rf mnc_test_* |
739 |
else |
fi |
740 |
touch $RUNLOG |
else |
741 |
if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi |
RETVAL=0 |
742 |
echo "---------->> $OUTPUTFILE is up to date " >> $RUNLOG 2>&1 |
ENDVAL=`tail $OUTPUTFILE | grep -c 'PROGRAM MAIN: Execution ended Normally'` |
743 |
echo " no previous $RUNLOG: assume NORMAL END" >> $RUNLOG 2>&1 |
touch $RUNLOG |
744 |
fi |
if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi |
745 |
fi |
echo "---------->> $OUTPUTFILE is up to date " >> $RUNLOG 2>&1 |
746 |
ENDVAL=`cat $RUNLOG | grep -v 'ABNORMAL END' | grep -c 'NORMAL END'` |
fi |
747 |
fi |
fi |
748 |
rm -f run.log_tmp |
rm -f run.log_tmp |
749 |
#if test "x$RETVAL" = x0 ; then |
#- in all cases where OutputFile exists, report SIZE (and AD time) |
750 |
|
if test -f $OUTPUTFILE ; then |
751 |
|
grep '(PID\.TID 0000\.0001) n.. =' $OUTPUTFILE \ |
752 |
|
| sed 's/(PID.TID 0000.0001) //' >> $CDIR"/summary.txt" |
753 |
|
if test "x$ADM" = xt ; then |
754 |
|
grep -A3 'Seconds in section "ALL' $OUTPUTFILE >> $CDIR"/summary.txt" |
755 |
|
fi |
756 |
|
fi |
757 |
|
if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi |
758 |
if [ $RETVAL -eq 0 -a $ENDVAL -gt 0 ] ; then |
if [ $RETVAL -eq 0 -a $ENDVAL -gt 0 ] ; then |
759 |
tail $RUNLOG |
echo successful |
760 |
echo successful 1>&2 |
printf '=> output from running in %s :\n' $1 1>&2 |
761 |
# === Reduce the size of the testing emails! |
tail $RUNLOG | sed 's/^.*/> &/g' 1>&2 |
762 |
#cp $OUTPUTFILE $CDIR"/"$OUTPUTFILE |
return 0 |
763 |
if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi |
elif [ $RETVAL -ne 0 -a $ENDVAL -gt 0 ] ; then |
764 |
|
#-- for some weird cases (run is finihed but with error code) |
765 |
|
echo 'finished with error (run:' $RETVAL ' end:' $ENDVAL ')' |
766 |
|
printf '=> output from running in %s :\n' $1 1>&2 |
767 |
|
tail $RUNLOG | sed 's/^.*/> &/g' 1>&2 |
768 |
return 0 |
return 0 |
769 |
else |
else |
770 |
tail $RUNLOG |
echo 'failed (run:' $RETVAL ' end:' $ENDVAL ')' |
771 |
echo failed '(run:' $RETVAL ' end:' $ENDVAL ')' 1>&2 |
printf '=> output from running in %s :\n' $1 1>&2 |
772 |
|
tail $RUNLOG | sed 's/^.*/> &/g' 1>&2 |
773 |
cp $RUNLOG $CDIR"/"$RUNLOG |
cp $RUNLOG $CDIR"/"$RUNLOG |
|
if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi |
|
774 |
return 1 |
return 1 |
775 |
fi |
fi |
776 |
) |
) |
820 |
return 0 |
return 0 |
821 |
else |
else |
822 |
echo |
echo |
823 |
echo "ERROR: failed to compile comparison code -- please specify" |
echo "ERROR: failed to compile comparison code -- please specify" |
824 |
echo " a C compiler using the CC environment variable." |
echo " a C compiler using the CC environment variable." |
825 |
exit 1 |
exit 1 |
826 |
fi |
fi |
839 |
printf '%3s' $listPrt |
printf '%3s' $listPrt |
840 |
# line below does not work on hp-ux_ia64 : do those substitutions later on |
# line below does not work on hp-ux_ia64 : do those substitutions later on |
841 |
# printf '%3s' $listPrt | sed 's/ 99/ --/g' | sed 's/ > />/' | sed 's/ < /</' |
# printf '%3s' $listPrt | sed 's/ 99/ --/g' | sed 's/ > />/' | sed 's/ < /</' |
842 |
|
|
843 |
if [ $xx = '..' ]; then |
if [ $xx = '..' ]; then |
844 |
printf ' N/O ' |
printf ' N/O ' |
845 |
elif [ $xx = '--' ]; then |
elif [ $xx = '--' ]; then |
855 |
fi |
fi |
856 |
printf ' %s' $nm |
printf ' %s' $nm |
857 |
printf '\n' |
printf '\n' |
858 |
|
|
859 |
} |
} |
860 |
|
|
861 |
scandirs() |
scandirs() |
870 |
} |
} |
871 |
|
|
872 |
|
|
873 |
|
check_eedata() |
874 |
|
{ |
875 |
|
# check_eedata eedata size.h |
876 |
|
if [ $# -eq 2 ] ; then |
877 |
|
if test -f $1 -a -f $2 ; then |
878 |
|
nx=`grep "^ *nTx *=" $1 | tail -1 | sed 's/^ *nTx *= *//' | sed "s/, *$//"` |
879 |
|
sx=`grep "^ & *nSx *=" $2 | sed "s/^ & *nSx *=//" | sed 's/, *$//'` |
880 |
|
if test "x$nx" = x ; then |
881 |
|
rx=10 |
882 |
|
else |
883 |
|
rx=`expr $sx % $nx` |
884 |
|
fi |
885 |
|
ny=`grep "^ *nTy *=" $1 | tail -1 | sed 's/^ *nTy *= *//' | sed "s/, *$//"` |
886 |
|
sy=`grep "^ & *nSy *=" $2 | sed "s/^ & *nSy *=//" | sed 's/, *$//'` |
887 |
|
if test "x$ny" = x ; then |
888 |
|
ry=20 |
889 |
|
else |
890 |
|
ry=`expr $sy % $ny` |
891 |
|
fi |
892 |
|
echo `expr $rx + $ry` |
893 |
|
else |
894 |
|
echo '-1' |
895 |
|
fi |
896 |
|
elif [ $# -eq 1 ] ; then |
897 |
|
if test -f $1 ; then |
898 |
|
nx=`grep "^ *nTx *=" $1 | tail -1 | sed 's/^ *nTx *= *//' | sed "s/, *$//"` |
899 |
|
if test "x$nx" = x ; then nx=1 ; fi |
900 |
|
ny=`grep "^ *nTy *=" $1 | tail -1 | sed 's/^ *nTy *= *//' | sed "s/, *$//"` |
901 |
|
if test "x$ny" = x ; then ny=1 ; fi |
902 |
|
#echo $nx $ny |
903 |
|
echo $nx |
904 |
|
else |
905 |
|
echo '-1' |
906 |
|
fi |
907 |
|
else |
908 |
|
echo '-2' |
909 |
|
fi |
910 |
|
|
911 |
|
} |
912 |
|
|
913 |
############################################################################### |
############################################################################### |
914 |
|
|
915 |
|
|
916 |
# Default properties |
# Default properties |
917 |
debug=0 |
debug=0 |
918 |
verbose=1 |
verbose=1 |
919 |
clean=0 |
NBLINES_MKLOG=16000 |
920 |
|
|
921 |
IEEE=true |
IEEE=true |
922 |
if test "x$MITGCM_IEEE" != x ; then |
if test "x$MITGCM_IEEE" != x ; then |
925 |
GSL=f |
GSL=f |
926 |
|
|
927 |
CLEANUP=f |
CLEANUP=f |
928 |
|
NORUN=f |
929 |
QUICK=f |
QUICK=f |
930 |
|
NOMAKE=f |
931 |
NOGENMAKE=f |
NOGENMAKE=f |
932 |
NOCLEAN=f |
NOCLEAN=f |
933 |
NODEPEND=f |
NODEPEND=f |
934 |
POSTCLEAN=f |
POSTCLEAN=0 |
935 |
|
|
936 |
BASH= |
BASH= |
937 |
OPTFILE=NONE |
OPTFILE=NONE |
942 |
HAVE_MPACK= |
HAVE_MPACK= |
943 |
MPACK= |
MPACK= |
944 |
COMMAND= |
COMMAND= |
945 |
|
MKDEPEND= |
946 |
if test "x$MAKE" = x ; then |
if test "x$MAKE" = x ; then |
947 |
MAKE=make |
MAKE=make |
948 |
fi |
fi |
950 |
CC=cc |
CC=cc |
951 |
fi |
fi |
952 |
JOBS= |
JOBS= |
953 |
MPI=f |
MPI=0 |
954 |
|
MPI_MFILE= |
955 |
MULTI_THREAD=f |
MULTI_THREAD=f |
956 |
OUTDIR= |
OUTDIR= |
957 |
DELDIR= |
DELDIR= |
958 |
|
USE_R4= |
959 |
|
|
960 |
ADM= |
ADM= |
961 |
|
OADM= |
962 |
|
|
963 |
# list of pTracers to check for monitor output |
# list of pTracers to check for monitor output |
964 |
PTRACERS_NUM="1 2 3 4 5" |
PTRACERS_NUM="1 2 3 4 5" |
965 |
|
|
966 |
MATCH_CRIT=13 |
MATCH_CRIT=10 |
967 |
|
|
968 |
printf "parsing options... " |
printf "parsing options... " |
969 |
|
|
978 |
fi |
fi |
979 |
|
|
980 |
ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` |
ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` |
981 |
|
|
982 |
case $ac_option in |
case $ac_option in |
983 |
|
|
984 |
-help | --help | -h | --h) |
-help | --help | -h | --h) usage ;; |
985 |
usage ;; |
|
986 |
|
-optfile | --optfile | -of | --of) ac_prev=OPTFILE ;; |
987 |
-optfile | --optfile | -of | --of) |
-optfile=* | --optfile=* | -of=* | --of=*) OPTFILE=$ac_optarg ;; |
988 |
ac_prev=OPTFILE ;; |
|
989 |
-optfile=* | --optfile=* | -of=* | --of=*) |
-addr | --addr | -a | --a) ac_prev=ADDRESSES ;; |
990 |
OPTFILE=$ac_optarg ;; |
-addr=* | --addr=* | -a=* | --a=*) ADDRESSES=$ac_optarg ;; |
991 |
|
-mpackdir | --mpackdir | -mpd | --mpd) ac_prev=MPACKDIR ;; |
992 |
-addr | --addr | -a | --a) |
-mpackdir=* | --mpackdir=* | -mpd=* | --mpd=*) MPACKDIR=$ac_optarg ;; |
993 |
ac_prev=ADDRESSES ;; |
|
994 |
-addr=* | --addr=*) |
-tdir | --tdir | -t | --t) ac_prev=TESTDIRS ;; |
995 |
ADDRESSES=$ac_optarg ;; |
-tdir=* | --tdir=* | -t=* | --t=*) TESTDIRS=$ac_optarg ;; |
996 |
-mpackdir | --mpackdir | -mpd | --mpd) |
-skipdir | --skipdir | -skd | --skd) ac_prev=SKIPDIRS ;; |
997 |
ac_prev=MPACKDIR ;; |
-skipdir=* | --skipdir=* | -skd=* | --skd=*) SKIPDIRS=$ac_optarg ;; |
998 |
-mpackdir=* | --mpackdir=* | -mpd=* | --mpd=*) |
|
999 |
MPACKDIR=$ac_optarg ;; |
-bash | --bash | -b | --b) ac_prev=BASH ;; |
1000 |
|
-bash=* | --bash=* | -b=* | --b=*) BASH=$ac_optarg ;; |
1001 |
-tdir | --tdir | -t | --t) |
|
1002 |
ac_prev=TESTDIRS ;; |
-command | --command | -c | --c) ac_prev=COMMAND ;; |
1003 |
-tdir=* | --tdir=*) |
-command=* | --command=* | -c=* | --c=*) COMMAND=$ac_optarg ;; |
1004 |
TESTDIRS=$ac_optarg ;; |
|
1005 |
|
-makedepend | --makedepend | -md | --md) ac_prev=MKDEPEND ;; |
1006 |
-skipdir | --skipdir | -skd | --skd) |
-makedepend=* | --makedepend=* | -md=* | --md=*) MKDEPEND=$ac_optarg ;; |
1007 |
ac_prev=SKIPDIRS ;; |
|
1008 |
-skipdir=* | --skipdir=*) |
-make | --make | -m | --m) ac_prev=MAKE ;; |
1009 |
SKIPDIRS=$ac_optarg ;; |
-make=* | --make=* | -m=* | --m=*) MAKE=$ac_optarg ;; |
1010 |
|
|
1011 |
-bash | --bash | -b | --b) |
-odir | --odir) ac_prev=OUTDIR ;; |
1012 |
ac_prev=BASH ;; |
-odir=* | --odir=*) OUTDIR=$ac_optarg ;; |
1013 |
-bash=* | --bash=*) |
|
1014 |
BASH=$ac_optarg ;; |
-ptracers | --ptracers | -ptr | --ptr) ac_prev=PTRACERS_NUM ;; |
1015 |
|
-ptracers=* | --ptracers=* | -ptr=* | --ptr=*) PTRACERS_NUM=$ac_optarg ;; |
|
-command | --command | -c | --c) |
|
|
ac_prev=COMMAND ;; |
|
|
-command=* | --command=*) |
|
|
COMMAND=$ac_optarg ;; |
|
|
|
|
|
-make | --make | -m | --m) |
|
|
ac_prev=MAKE ;; |
|
|
-make=* | --make=*) |
|
|
MAKE=$ac_optarg ;; |
|
|
|
|
|
-odir | --odir) |
|
|
ac_prev=OUTDIR ;; |
|
|
-odir=* | --odir=*) |
|
|
OUTDIR=$ac_optarg ;; |
|
|
|
|
|
-ptracers | --ptracers | -ptr | --ptr) |
|
|
ac_prev=PTRACERS_NUM ;; |
|
|
-ptracers=* | --ptracers=* | -ptr=* | --ptr=*) |
|
|
PTRACERS_NUM=$ac_optarg ;; |
|
1016 |
|
|
1017 |
-match | --match ) ac_prev=MATCH_CRIT ;; |
-match | --match ) ac_prev=MATCH_CRIT ;; |
1018 |
-match=* | --match=* ) MATCH_CRIT=$ac_optarg ;; |
-match=* | --match=* ) MATCH_CRIT=$ac_optarg ;; |
1019 |
|
|
1020 |
-j) ac_prev=JOBS ;; |
-j | --j) ac_prev=JOBS ;; |
1021 |
-j=*) JOBS=$ac_optarg ;; |
-j=* | --j=*) JOBS=$ac_optarg ;; |
|
|
|
|
-clean | --clean) |
|
|
CLEANUP=t ; DELDIR=t ;; |
|
1022 |
|
|
1023 |
-quick | --quick | -q | --q) |
-clean | --clean) CLEANUP=t ; DELDIR=t ;; |
|
QUICK=t ;; |
|
|
-nogenmake | --nogenmake | -ng | --ng) |
|
|
NOGENMAKE=t ;; |
|
|
-noclean | --noclean | -nc | --nc) |
|
|
NOCLEAN=t ;; |
|
|
-nodepend | --nodepend | -nd | --nd) |
|
|
NODEPEND=t ;; |
|
1024 |
|
|
1025 |
-postclean | --postclean | -pc | --pc) |
-norun | --norun | -nr | --nr) NORUN=t ;; |
1026 |
POSTCLEAN=t ;; |
-runonly | --runonly | -ro | --ro) QUICK=t ; NOMAKE=t ;; |
1027 |
|
-quick | --quick | -q | --q) QUICK=t ;; |
1028 |
|
-nogenmake | --nogenmake | -ng | --ng) NOGENMAKE=t ;; |
1029 |
|
-noclean | --noclean | -nc | --nc) NOCLEAN=t ;; |
1030 |
|
-nodepend | --nodepend | -nd | --nd) NODEPEND=t ;; |
1031 |
|
|
1032 |
|
-postclean | --postclean | -pc | --pc) POSTCLEAN=2 ;; |
1033 |
|
-deloutp | --deloutp | -do | --do) POSTCLEAN=1 ;; |
1034 |
|
|
1035 |
|
-mpi | --mpi) MPI=2 ;; |
1036 |
|
-MPI | --MPI) ac_prev=MPI ;; |
1037 |
|
-MPI=* | --MPI=*) MPI=$ac_optarg ;; |
1038 |
|
|
1039 |
-mpi) MPI=t ;; |
-mfile | --mfile | -mf | --mf) ac_prev=MPI_MFILE ;; |
1040 |
|
-mfile=* | --mfile=* | -mf=* | --mf=*) MPI_MFILE=$ac_optarg ;; |
1041 |
|
|
1042 |
-mth) MULTI_THREAD=t ;; |
-mth) MULTI_THREAD=t ;; |
1043 |
|
|
1044 |
-adm | -ad) ADM=t ;; |
-adm | -ad) ADM=t ;; |
1045 |
|
-oad) OADM=t; NODEPEND=t ;; |
1046 |
|
|
1047 |
-ieee) IEEE=true ;; |
-ieee) IEEE=true ;; |
1048 |
-noieee) IEEE= ;; |
-noieee) IEEE= ;; |
1049 |
-gsl) GSL=t ;; |
-gsl) GSL=t ;; |
1050 |
|
|
1051 |
-verbose) verbose=2 ;; |
-verbose) verbose=2 ;; |
1052 |
-debug) debug=1 ;; |
-debug) debug=1 ;; |
1054 |
|
|
1055 |
-deldir | -dd) DELDIR=t ;; |
-deldir | -dd) DELDIR=t ;; |
1056 |
|
|
1057 |
-ts) TS=t;; |
-use_r4|-ur4) USE_R4=t ;; |
1058 |
|
|
1059 |
|
-ts) TS=t;; |
1060 |
-papis) PAPIS=t;; |
-papis) PAPIS=t;; |
|
|
|
1061 |
-pcls) PCL=t;; |
-pcls) PCL=t;; |
1062 |
|
|
1063 |
-*) |
-*) echo "Error: unrecognized option: "$ac_option |
1064 |
echo "Error: unrecognized option: "$ac_option |
usage ;; |
1065 |
usage |
*) echo "Error: unrecognized argument: "$ac_option |
1066 |
;; |
usage ;; |
1067 |
|
|
|
*) |
|
|
echo "Error: unrecognized argument: "$ac_option |
|
|
usage |
|
|
;; |
|
|
|
|
1068 |
esac |
esac |
1069 |
|
|
1070 |
done |
done |
1071 |
|
|
1072 |
if test "x$QUICK" = xt ; then |
if test "x$QUICK" = xt ; then |
1075 |
NODEPEND=t |
NODEPEND=t |
1076 |
fi |
fi |
1077 |
|
|
1078 |
|
#- check length of MPI machine file: |
1079 |
|
if test "x$MPI" != x0 -a "x$MPI_MFILE" != x ; then |
1080 |
|
if test -r $MPI_MFILE ; then |
1081 |
|
nl=`wc -l $MPI_MFILE | awk '{print $1}'` |
1082 |
|
if [ $nl -lt $MPI ] ; then |
1083 |
|
echo "Error: need at least $MPI nodes (currently only $nl) in MPI_MFILE=$MPI_FILE" |
1084 |
|
usage |
1085 |
|
fi |
1086 |
|
if [ $verbose -gt 1 ]; then |
1087 |
|
echo " MPI_MFILE=$MPI_MFILE : $nl procs for MPI=$MPI run" |
1088 |
|
fi |
1089 |
|
else |
1090 |
|
echo "Error: cannot access MPI_MFILE=$MPI_FILE" |
1091 |
|
usage |
1092 |
|
fi |
1093 |
|
fi |
1094 |
|
|
1095 |
#- setting for forward or ADM testing |
#- setting for forward or ADM testing |
1096 |
if test "x$ADM" = xt ; then |
if test "x$ADM" = xt ; then |
1097 |
code_dir=code_ad |
code_dir=code_ad |
1098 |
inputdir=input_ad |
inputdir=input_ad |
1099 |
ref_outp="output_adm.txt" |
ref_outp="output_adm.txt" |
1100 |
EXECUTABLE="mitgcmuv_ad" |
EXECUTABLE="mitgcmuv_ad" |
1101 |
|
elif test "x$OADM" = xt ; then |
1102 |
|
code_dir=code_oad |
1103 |
|
inputdir=input_oad |
1104 |
|
ref_outp="output_oadm.txt" |
1105 |
|
EXECUTABLE="mitgcmuv_ad" |
1106 |
else |
else |
1107 |
code_dir=code |
code_dir=code |
1108 |
inputdir=input |
inputdir=input |
1110 |
EXECUTABLE="mitgcmuv" |
EXECUTABLE="mitgcmuv" |
1111 |
fi |
fi |
1112 |
|
|
1113 |
|
xx=`echo $TESTDIRS | awk '{print $1}'` |
1114 |
if test "x$TESTDIRS" = x ; then |
if test "x$TESTDIRS" = x ; then |
1115 |
LIST=`scandirs results/$ref_outp` |
LIST=`scandirs results/$ref_outp` |
1116 |
|
elif test $xx = 'start_from' ; then |
1117 |
|
xx=`echo $TESTDIRS | awk '{print $2}'` |
1118 |
|
LIST=`scandirs results/$ref_outp | sed -n "/$xx/,$ p"` |
1119 |
else |
else |
1120 |
#- expand group of experiments: |
#- expand group of experiments: |
1121 |
LIST=" " |
LIST=" " |
1130 |
LIST=${LIST}" "`ls | grep 'tutorial_'` ;; |
LIST=${LIST}" "`ls | grep 'tutorial_'` ;; |
1131 |
*) LIST=${LIST}" "$xx ;; |
*) LIST=${LIST}" "$xx ;; |
1132 |
esac |
esac |
1133 |
done |
done |
1134 |
fi |
fi |
1135 |
#echo 'LIST='${LIST}'<' |
#echo 'LIST='${LIST}'<' |
1136 |
#- skip dirs, remove duplicate and non-directory: |
#- skip dirs, remove duplicate and non-directory: |
1151 |
else count=1 ; echo "" ; echo -n " skip: \"$xx\"" |
else count=1 ; echo "" ; echo -n " skip: \"$xx\"" |
1152 |
fi |
fi |
1153 |
fi |
fi |
1154 |
done |
done |
1155 |
if test $count = 1 ; then echo "" ; echo -n " ... " ; fi |
if test $count = 1 ; then echo "" ; echo -n " ... " ; fi |
1156 |
#echo 'TESTDIRS='${TESTDIRS}'<' |
#echo 'TESTDIRS='${TESTDIRS}'<' |
1157 |
|
|
1159 |
OPTFILE=$MITGCM_OF |
OPTFILE=$MITGCM_OF |
1160 |
fi |
fi |
1161 |
|
|
1162 |
RUNLOG="run.log" |
LOC_MFILE='tr_mpi_mfile' |
1163 |
|
RUNLOG="run.tr_log" |
1164 |
OUTPUTFILE=$ref_outp |
OUTPUTFILE=$ref_outp |
1165 |
if test "x$COMMAND" = x ; then |
if test "x$COMMAND" = x ; then |
1166 |
COMMAND="./$EXECUTABLE > $OUTPUTFILE" |
COMMAND="./$EXECUTABLE > $OUTPUTFILE" |
1167 |
fi |
fi |
1168 |
if test "x$MPI" = xt ; then |
if test "x$MPI" != x0 ; then |
1169 |
OUTPUTFILE="STDOUT.0000" |
OUTPUTFILE="STDOUT.0000" |
1170 |
fi |
fi |
1171 |
|
|
1175 |
# (use default or load experiment-specific list from file "tr_checklist") |
# (use default or load experiment-specific list from file "tr_checklist") |
1176 |
# content : 1rst = main variable used to decide if it pass or FAIL |
# content : 1rst = main variable used to decide if it pass or FAIL |
1177 |
# others = number of matching digits to be printed in summary.txt |
# others = number of matching digits to be printed in summary.txt |
1178 |
if test "x$ADM" = x ; then |
if test "x$ADM" = x -a "x$OADM" = x; then |
1179 |
DEF_CHECK_LIST='PS PS T+ S+ U+ V+ pt1+ pt2+ pt3+ pt4+ pt5+' |
DEF_CHECK_LIST='PS PS T+ S+ U+ V+ pt1+ pt2+ pt3+ pt4+ pt5+' |
1180 |
EMPTY_RESULTS='.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..' |
EMPTY_RESULTS='.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..' |
1181 |
LEN_CHECK_LIST=`echo $DEF_CHECK_LIST | sed 's/ [a-zA-Z0-9]*+/&mn &mx &av &sd/g' | awk '{print NF-1}'` |
LEN_CHECK_LIST=`echo $DEF_CHECK_LIST | sed 's/ [a-zA-Z0-9]*+/&mn &mx &av &sd/g' | awk '{print NF-1}'` |
1188 |
fi |
fi |
1189 |
|
|
1190 |
# create the FORTRAN comparison code |
# create the FORTRAN comparison code |
1191 |
createcodelet |
if test -x tr_cmpnum ; then |
1192 |
|
echo "skipping comparison code build" |
1193 |
|
else |
1194 |
|
createcodelet |
1195 |
|
fi |
1196 |
|
|
1197 |
# build the mpack utility (if ADDRESSES = NONE, do it to test the build) |
# build the mpack utility (if ADDRESSES = NONE, do it to test the build) |
1198 |
if test "x$ADDRESSES" = x ; then |
if test "x$ADDRESSES" = x ; then |
1214 |
BASE="tr_"$MACH"_"$DATE"_" |
BASE="tr_"$MACH"_"$DATE"_" |
1215 |
if test "x$OUTDIR" != x ; then |
if test "x$OUTDIR" != x ; then |
1216 |
BASE="tr_"$OUTDIR"_"$DATE"_" |
BASE="tr_"$OUTDIR"_"$DATE"_" |
1217 |
|
else |
1218 |
|
short_name=`hostname | sed 's/\..*$//'` |
1219 |
|
BASE="tr_"$short_name"_"$DATE"_" |
1220 |
fi |
fi |
1221 |
DNUM=0 |
DNUM=0 |
1222 |
DRESULTS="$BASE$DNUM" |
DRESULTS="$BASE$DNUM" |
1258 |
fi |
fi |
1259 |
else |
else |
1260 |
echo >> $SUMMARY |
echo >> $SUMMARY |
1261 |
echo "No \"OPTFILE\" was explicitly specified by testreport," >> $SUMMARY |
echo "No \"OPTFILE\" was specified ; genmake2 found and uses:" >> $SUMMARY |
1262 |
echo " so the genmake default will be used." >> $SUMMARY |
#-note: to be filled later after 1rst run |
1263 |
fi |
fi |
1264 |
echo |
echo |
1265 |
echo >> $SUMMARY |
echo >> $SUMMARY |
1266 |
if test "x$ADM" = x ; then |
if test "x$ADM" = x -a "x$OADM" = x; then |
1267 |
if [ $MATCH_CRIT -lt 10 ] ; |
if [ $MATCH_CRIT -lt 10 ] ; |
1268 |
then line_0="default "$MATCH_CRIT ; |
then line_0="default "$MATCH_CRIT ; |
1269 |
else line_0="default "$MATCH_CRIT ; fi |
else line_0="default "$MATCH_CRIT ; fi |
1270 |
line_0="$line_0 ----T----- ----S----- ----U----- ----V-----" |
line_0="$line_0 ----T----- ----S----- ----U----- ----V-----" |
|
# line_0=" ----T----- ----S----- ----U----- ----V-----" |
|
1271 |
line_1="G D M c m s m s m s m s" |
line_1="G D M c m s m s m s m s" |
1272 |
line_2="E p a R g m m e . m m e . m m e . m m e ." |
line_2="E p a R g m m e . m m e . m m e . m m e ." |
1273 |
line_3="N n k u 2 i a a d i a a d i a a d i a a d" |
line_3="N n k u 2 i a a d i a a d i a a d i a a d" |
1288 |
else |
else |
1289 |
echo "ADJOINT=true" >> $SUMMARY |
echo "ADJOINT=true" >> $SUMMARY |
1290 |
echo >> $SUMMARY |
echo >> $SUMMARY |
1291 |
if [ $MATCH_CRIT -lt 10 ] ; |
if [ $MATCH_CRIT -lt 10 ] ; |
1292 |
then line_0="default "$MATCH_CRIT ; |
then line_0="default "$MATCH_CRIT ; |
1293 |
else line_0="default "$MATCH_CRIT ; fi |
else line_0="default "$MATCH_CRIT ; fi |
1294 |
echo "$line_0" | tee -a $SUMMARY |
echo "$line_0" | tee -a $SUMMARY |
1295 |
cat << EOF | tee -a $SUMMARY |
cat << EOF | tee -a $SUMMARY |
1300 |
|
|
1301 |
EOF |
EOF |
1302 |
fi |
fi |
1303 |
|
echo "-------------------------------------------------------------------------------" |
1304 |
|
|
1305 |
# ...and each test directory... |
# ...and each test directory... |
1306 |
for dir in $TESTDIRS ; do |
for dir in $TESTDIRS ; do |
1307 |
|
|
1308 |
# set builddir & rundir: |
# set builddir & rundir: |
1309 |
builddir="build" |
builddir="build" |
1310 |
if test ! -d $dir/$builddir ; then mkdir $dir/$builddir ; fi |
if test ! -d $dir/$builddir ; then mkdir $dir/$builddir ; fi |
1311 |
rundir="run" |
rundir="run" |
1312 |
|
pfxdir="tr_$rundir" |
1313 |
if test ! -d $dir/$rundir ; then |
if test ! -d $dir/$rundir ; then |
1314 |
rundir=$builddir |
rundir=$builddir |
1315 |
fi |
fi |
1318 |
|
|
1319 |
# Cleanup only! |
# Cleanup only! |
1320 |
if test "x$CLEANUP" = xt ; then |
if test "x$CLEANUP" = xt ; then |
1321 |
if test -r $BUILD_DIR/Makefile ; then |
echo -n ' --- dir:' $BUILD_DIR ': ' |
1322 |
echo ' ------ clean dir:' $dir/$builddir |
makeclean $BUILD_DIR |
1323 |
( cd $BUILD_DIR ; make CLEAN ) |
( cd $BUILD_DIR |
1324 |
fi |
rm -f $EXECUTABLE *.bak |
1325 |
|
rm -f genmake_state genmake_*optfile genmake.log |
1326 |
|
rm -f SIZE.h.mpi genmake.tr_log make.tr_log |
1327 |
|
) |
1328 |
if test -d $dir/$rundir/CVS ; then |
if test -d $dir/$rundir/CVS ; then |
1329 |
echo ' ------ clean dir:' $dir/$rundir |
echo -n ' --- dir:' $dir/$rundir ': ' |
1330 |
run_clean $dir/$rundir |
run_clean $dir/$rundir |
1331 |
fi |
fi |
1332 |
( |
trdir=`( cd $dir ; find . -type d -name "$pfxdir.*" -print | sed 's/^.\///')` |
1333 |
cd $dir |
ttd=`echo $trdir | wc -w` |
1334 |
rm -rf tr_run.* |
if test $ttd != 0 ; then |
1335 |
) |
echo ' --- rm dir:' $trdir |
1336 |
|
( cd $dir ; rm -rf $trdir ) |
1337 |
|
fi |
1338 |
continue |
continue |
1339 |
fi |
fi |
1340 |
|
|
1341 |
# Verify that the testdir exists and contains previous |
# Verify that the testdir exists and contains previous |
1342 |
# results in the correct location--or skip this directory! |
# results in the correct location--or skip this directory! |
1343 |
fout=$dir"/results/"$ref_outp |
fout=$dir"/results/"$ref_outp |
1344 |
if test ! -r $fout ; then |
if test ! -r $fout ; then |
1348 |
|
|
1349 |
# Check for specific files for particular type of run |
# Check for specific files for particular type of run |
1350 |
|
|
1351 |
if test ! -r $CODE_DIR"/SIZE.h_mpi" -a "x$MPI" = "xt" ; then |
if test ! -r $CODE_DIR"/SIZE.h_mpi" -a "x$MPI" != "x0" ; then |
1352 |
echo "can't find \"$CODE_DIR/SIZE.h_mpi\" -- skipping $dir" |
echo "can't find \"$CODE_DIR/SIZE.h_mpi\" -- skipping $dir" |
1353 |
continue |
continue |
1354 |
fi |
fi |
1357 |
continue |
continue |
1358 |
fi |
fi |
1359 |
|
|
1360 |
|
if test "x$MPI" != "x0" ; then |
1361 |
|
prefer_X=0 |
1362 |
|
if test "x$MULTI_THREAD" = "xt" ; then |
1363 |
|
retv=`check_eedata $dir"/input/eedata.mth"` |
1364 |
|
if test $retv = 1 ; then prefer_X=1 ; fi |
1365 |
|
fi |
1366 |
|
#- create new SIZE.h with no more than '$MPI' Procs |
1367 |
|
mk_mpi_size $CODE_DIR"/SIZE.h_mpi" $BUILD_DIR"/tr_size.mpi" $MPI $prefer_X |
1368 |
|
LOC_NPROC=$? |
1369 |
|
( cd $BUILD_DIR |
1370 |
|
if test -r SIZE.h.mpi ; then |
1371 |
|
cmp tr_size.mpi SIZE.h.mpi > /dev/null 2>&1 ; RETVAL=$? |
1372 |
|
else RETVAL=1 |
1373 |
|
fi |
1374 |
|
if test "x$RETVAL" = x0 ; then |
1375 |
|
rm -f tr_size.mpi |
1376 |
|
else |
1377 |
|
rm -f SIZE.h.mpi ; mv tr_size.mpi SIZE.h.mpi |
1378 |
|
fi |
1379 |
|
) |
1380 |
|
if test "x$MPI_MFILE" != x ; then |
1381 |
|
#- create new MPI machine-file with the right number of Procs |
1382 |
|
rm -f $LOC_MFILE |
1383 |
|
cat $MPI_MFILE | sort | uniq | head -$LOC_NPROC > $LOC_MFILE |
1384 |
|
nl=`wc -l $LOC_MFILE | awk '{print $1}'` |
1385 |
|
if [ $nl -lt $LOC_NPROC ] ; then |
1386 |
|
rm -f $LOC_MFILE |
1387 |
|
cat $MPI_MFILE | head -$LOC_NPROC > $LOC_MFILE |
1388 |
|
#sed -n "1,$LOC_NPROC p" $MPI_MFILE > $LOC_MFILE |
1389 |
|
fi |
1390 |
|
if [ $verbose -gt 1 ]; then |
1391 |
|
nl=`wc -l $LOC_MFILE | awk '{print $1}'` |
1392 |
|
echo " new LOC_MFILE=$LOC_MFILE : $nl procs for LOC_NPROC=$LOC_NPROC" |
1393 |
|
fi |
1394 |
|
fi |
1395 |
|
if test "x$MULTI_THREAD" = "xt" ; then |
1396 |
|
retv=`check_eedata $dir"/input/eedata.mth" $BUILD_DIR"/SIZE.h.mpi"` |
1397 |
|
if test $retv != 0 ; then |
1398 |
|
echo "input/eedata.mth tiling misfit -- skipping $dir" |
1399 |
|
continue |
1400 |
|
fi |
1401 |
|
fi |
1402 |
|
fi |
1403 |
|
|
1404 |
# Check whether there are "extra runs" for this testdir |
# Check whether there are "extra runs" for this testdir |
1405 |
extra_runs= |
extra_runs= |
1406 |
ex_run_dirs=`( cd $dir ; echo $inputdir.* )` |
if test "x$NORUN" = xf ; then |
1407 |
|
ex_run_dirs=`( cd $dir ; echo $inputdir.* )` |
1408 |
|
fi |
1409 |
#echo "ex_run_dirs='$ex_run_dirs'" |
#echo "ex_run_dirs='$ex_run_dirs'" |
1410 |
for exd in $ex_run_dirs ; do |
for exd in $ex_run_dirs ; do |
1411 |
name=`echo $exd | sed -e "s/$inputdir\.//"` |
name=`echo $exd | sed -e "s/$inputdir\.//"` |
1412 |
refExOut=`echo $ref_outp | sed "s/\./.${name}./"` |
refExOut=`echo $ref_outp | sed "s/\./.${name}./"` |
1413 |
outf="$dir/results/$refExOut" |
outf="$dir/results/$refExOut" |
1414 |
if test -f $outf -a -r $outf ; then |
if test -f $outf -a -r $outf ; then |
1415 |
if test "x$MULTI_THREAD" = "xt" ; then |
if test "x$MULTI_THREAD" = "xt" ; then |
1416 |
if test -r $dir"/"$exd"/eedata.mth" ; then |
if test -r $dir"/"$exd"/eedata.mth" ; then |
1417 |
|
if test "x$MPI" = "x0" ; then |
1418 |
|
extra_runs="$extra_runs $name" |
1419 |
|
else |
1420 |
|
retv=`check_eedata $dir"/"$exd"/eedata.mth" $BUILD_DIR"/SIZE.h.mpi"` |
1421 |
|
if test $retv = 0 ; then |
1422 |
extra_runs="$extra_runs $name" |
extra_runs="$extra_runs $name" |
1423 |
#else echo $dir"/"$exd"/eedata.mth: not found" |
else |
1424 |
|
echo $exd"/eedata.mth tiling misfit -- skipping $dir" |
1425 |
fi |
fi |
1426 |
else |
fi |
1427 |
extra_runs="$extra_runs $name" |
#else echo $dir"/"$exd"/eedata.mth: not found" |
1428 |
fi |
fi |
1429 |
|
else |
1430 |
|
extra_runs="$extra_runs $name" |
1431 |
|
fi |
1432 |
fi |
fi |
1433 |
done |
done |
1434 |
|
|
|
echo "-------------------------------------------------------------------------------" |
|
1435 |
echo |
echo |
1436 |
if test "x$extra_runs" = "x" ; then |
if test "x$extra_runs" = "x" ; then |
1437 |
echo "Experiment: $dir" |
echo "Experiment: $dir" |
1438 |
else |
else |
1439 |
echo "Experiment: $dir ; extra_runs=$extra_runs" |
echo "Experiment: $dir ; extra_runs=$extra_runs" |
1442 |
unset genmake makedepend make run |
unset genmake makedepend make run |
1443 |
results=$EMPTY_RESULTS |
results=$EMPTY_RESULTS |
1444 |
|
|
1445 |
# Create an output dir for each OPTFILE/tdir combination |
# Create an output dir & summary.txt file for each tested experiment (tdir) |
1446 |
rel_CDIR=$DRESULTS"/"$dir |
locDIR=$DRESULTS"/"$dir |
1447 |
mkdir $rel_CDIR |
mkdir $locDIR |
1448 |
CDIR=`pwd`"/$rel_CDIR" |
#- report to this experiment local summary file --- |
1449 |
|
echo "DATE='$DATE' ; tdir='$dir'" > $locDIR"/summary.txt" |
1450 |
if test "x$CLEANUP" = xt ; then |
echo "MACH='$MACH'" >> $locDIR"/summary.txt" |
1451 |
echo '====>>> this is to check that we never go through this part <<< ===' |
echo "UNAMEA='$UNAMEA'" >> $locDIR"/summary.txt" |
1452 |
makeclean $dir/$builddir \ |
CDIR=`pwd`"/$locDIR" |
1453 |
&& run_clean $dir/$rundir |
|
1454 |
|
if test "x$NORUN" = xt ; then |
1455 |
|
run=N |
1456 |
|
genmakemodel $dir/$builddir && genmake=Y \ |
1457 |
|
&& makeclean $dir/$builddir \ |
1458 |
|
&& symlink_mpifiles $dir $code_dir $builddir \ |
1459 |
|
&& makedependmodel $dir/$builddir && makedepend=Y \ |
1460 |
|
&& makemodel $dir/$builddir && make=Y |
1461 |
else |
else |
1462 |
genmakemodel $dir/$builddir && genmake=Y \ |
genmakemodel $dir/$builddir && genmake=Y \ |
1463 |
&& makeclean $dir/$builddir \ |
&& makeclean $dir/$builddir \ |
|
&& run_clean $dir/$rundir \ |
|
1464 |
&& symlink_mpifiles $dir $code_dir $builddir \ |
&& symlink_mpifiles $dir $code_dir $builddir \ |
1465 |
&& makedependmodel $dir/$builddir && makedepend=Y \ |
&& makedependmodel $dir/$builddir && makedepend=Y \ |
1466 |
&& makemodel $dir/$builddir && make=Y \ |
&& makemodel $dir/$builddir && make=Y \ |
1467 |
&& linkdata $dir/$rundir $inputdir input \ |
&& run_clean $dir/$rundir \ |
1468 |
|
&& linkdata $dir/$rundir $inputdir \ |
1469 |
&& runmodel $dir/$rundir && run=Y \ |
&& runmodel $dir/$rundir && run=Y \ |
1470 |
&& results=`testoutput_run $dir $rundir $ref_outp` |
&& results=`testoutput_run $dir $rundir $ref_outp` |
1471 |
fi |
fi |
1472 |
|
#echo "results='$results'" |
1473 |
echo |
|
1474 |
fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` |
fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` |
1475 |
echo |
echo 1>&2 |
1476 |
echo "$fres" | sed 's/ 99/ --/g' | sed 's/ > />/' | sed 's/ < /</' >> $SUMMARY |
echo "$fres" | sed 's/ 99/ --/g' | sed 's/ > />/' | sed 's/ < /</' >> $SUMMARY |
1477 |
touch $CDIR"/summary.txt" |
echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt" |
|
echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $CDIR"/summary.txt" |
|
|
echo "MACH='$MACH'" >> $CDIR"/summary.txt" |
|
|
echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt" |
|
|
echo "DATE='$DATE'" >> $CDIR"/summary.txt" |
|
|
echo "tdir='$dir'" >> $CDIR"/summary.txt" |
|
|
if test "x$ADM" = xt ; then |
|
|
head -1 $dir/$builddir/taf_ad.log >> $CDIR"/summary.txt" |
|
|
grep -A3 'Seconds in section "ALL' $dir/$rundir/$OUTPUTFILE \ |
|
|
>> $CDIR"/summary.txt" |
|
|
fi |
|
1478 |
|
|
1479 |
for ex in $extra_runs ; do |
for ex in $extra_runs ; do |
1480 |
unset run |
unset run |
1481 |
results=$EMPTY_RESULTS |
results=$EMPTY_RESULTS |
1482 |
# reference output file |
# reference output file |
1483 |
refExOut=`echo $ref_outp | sed "s/\./.${ex}./g"` |
refExOut=`echo $ref_outp | sed "s/\./.${ex}./g"` |
1484 |
# Create an output dir for each OPTFILE/tdir.ex combination |
# Create an output dir & summary.txt file for each extra run (tdir.ex) |
1485 |
rel_CDIR=$DRESULTS"/"$dir"."$ex |
locDIR=$DRESULTS"/"$dir"."$ex |
1486 |
mkdir $rel_CDIR |
mkdir $locDIR |
1487 |
CDIR=`pwd`"/$rel_CDIR" |
#- report to this experiment local summary file --- |
1488 |
test ! -e "$dir/tr_run.$ex" && mkdir "$dir/tr_run.$ex" |
echo "DATE='$DATE' ; tdir='$dir.$ex'" > $locDIR"/summary.txt" |
1489 |
run_clean $dir/tr_run.$ex |
#echo "MACH='$MACH'" >> $locDIR"/summary.txt" |
1490 |
linkdata $dir/tr_run.$ex $inputdir.$ex $inputdir input |
#echo "UNAMEA='$UNAMEA'" >> $locDIR"/summary.txt" |
1491 |
runmodel $dir/tr_run.$ex && run=Y \ |
CDIR=`pwd`"/$locDIR" |
1492 |
&& results=`testoutput_run $dir tr_run.$ex $refExOut` |
test ! -e "$dir/$pfxdir.$ex" && mkdir "$dir/$pfxdir.$ex" |
1493 |
|
run_clean $dir/$pfxdir.$ex |
1494 |
|
linkdata $dir/$pfxdir.$ex $inputdir.$ex $inputdir |
1495 |
|
runmodel $dir/$pfxdir.$ex && run=Y \ |
1496 |
|
&& results=`testoutput_run $dir $pfxdir.$ex $refExOut` |
1497 |
fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` |
fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` |
1498 |
fres="$fres.$ex" |
fres="$fres.$ex" |
1499 |
echo |
echo 1>&2 |
1500 |
echo "$fres" | sed 's/ 99/ --/g' | sed 's/ > />/' | sed 's/ < /</' >> $SUMMARY |
echo "$fres" | sed 's/ 99/ --/g' | sed 's/ > />/' | sed 's/ < /</' >> $SUMMARY |
1501 |
touch $CDIR"/summary.txt" |
echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt" |
1502 |
echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $CDIR"/summary.txt" |
if test "x$POSTCLEAN" = x2 ; then |
1503 |
echo "MACH='$MACH'" >> $CDIR"/summary.txt" |
run_clean $dir/$pfxdir.$ex |
|
echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt" |
|
|
echo "DATE='$DATE'" >> $CDIR"/summary.txt" |
|
|
echo "tdir='$dir.$ex'" >> $CDIR"/summary.txt" |
|
|
if test "x$ADM" = xt ; then |
|
|
head -1 $dir/$builddir/taf_ad.log >> $CDIR"/summary.txt" |
|
|
grep -A3 'Seconds in section "ALL' $dir/tr_run.$ex/$OUTPUTFILE \ |
|
|
>> $CDIR"/summary.txt" |
|
|
fi |
|
|
if test "x$POSTCLEAN" = xt ; then |
|
|
run_clean $dir/tr_run.$ex |
|
1504 |
fi |
fi |
1505 |
done |
done |
1506 |
|
|
1507 |
|
if test -f $DRESULTS"/"genmake_state ; then : ; else |
1508 |
|
if test -f $dir/$builddir/Makefile ; then |
1509 |
|
mkOpt=`grep '^# OPTFILE=' $dir/$builddir/Makefile 2>/dev/null | head -1 | sed 's/^# //'` |
1510 |
|
echo "from '$dir/$builddir/Makefile', extract:" > $DRESULTS/genmake_state |
1511 |
|
sed -n '/^# executed by:/,+1 p' $dir/$builddir/Makefile >> $DRESULTS/genmake_state |
1512 |
|
echo " $mkOpt" >> $DRESULTS/genmake_state |
1513 |
|
if test "x$OPTFILE" = xNONE ; then |
1514 |
|
eval $mkOpt |
1515 |
|
sed "/^No \"OPTFILE\" was specified ; genmake2/a\ OPTFILE=${OPTFILE}"\ |
1516 |
|
$SUMMARY > tr_0.tmp_log |
1517 |
|
RETVAL=$? |
1518 |
|
if test "x$RETVAL" = x0 ; then rm -f $SUMMARY |
1519 |
|
cp tr_0.tmp_log $SUMMARY |
1520 |
|
else rm -f tr_0.tmp_log |
1521 |
|
fi |
1522 |
|
fi |
1523 |
|
gmkLog=$dir/$builddir/genmake.log |
1524 |
|
grep '^Get compiler version using:' $gmkLog > /dev/null 2>&1 |
1525 |
|
RETVAL=$? |
1526 |
|
if test "x$RETVAL" = x0 ; then |
1527 |
|
echo "from '$gmkLog', extract compiler version:" >> $DRESULTS/genmake_state |
1528 |
|
sed -n '/Get compiler version/,/<-- compiler version/p' $gmkLog \ |
1529 |
|
| grep -v '^... compiler version ' > tr_1.tmp_log |
1530 |
|
sed -n '1,/^$/p' tr_1.tmp_log | sed '/^$/d' | sed 's/^./ &/' \ |
1531 |
|
>> $DRESULTS/genmake_state |
1532 |
|
rm -f tr_1.tmp_log |
1533 |
|
fi |
1534 |
|
fi |
1535 |
|
fi |
1536 |
#postclean $dir/$builddir |
#postclean $dir/$builddir |
1537 |
if test "x$POSTCLEAN" = xt ; then |
if test "x$POSTCLEAN" = x2 ; then |
1538 |
makeclean $dir/$builddir \ |
makeclean $dir/$builddir \ |
1539 |
&& run_clean $dir/$rundir |
&& run_clean $dir/$rundir |
1540 |
fi |
fi |
1541 |
|
if test "x$MPI" != x0 -a "x$MPI_MFILE" != x ; then rm -f $LOC_MFILE ; fi |
1542 |
|
|
1543 |
echo "-------------------------------------------------------------------------------" |
echo "-------------------------------------------------------------------------------" |
1544 |
|
|
1545 |
done |
done |
1546 |
|
|
1547 |
printf "Start time: " >> $SUMMARY |
printf "Start time: " >> $SUMMARY |
1570 |
echo "An email containing results was sent to the following addresses:" |
echo "An email containing results was sent to the following addresses:" |
1571 |
echo " \"$ADDRESSES\"" |
echo " \"$ADDRESSES\"" |
1572 |
echo |
echo |
1573 |
|
test -f $DRESULTS".tar" && rm -f $DRESULTS".tar" |
1574 |
|
test -f $DRESULTS".tar.gz" && rm -f $DRESULTS".tar.gz" |
1575 |
fi |
fi |
|
test -f $DRESULTS".tar" && rm -f $DRESULTS".tar" |
|
|
test -f $DRESULTS".tar.gz" && rm -f $DRESULTS".tar.gz" |
|
1576 |
fi |
fi |
1577 |
fi |
fi |
1578 |
|
|
1579 |
rm -f tr_cmpnum.c tr_cmpnum |
if test "x$QUICK" = xf -a "x$NORUN" = xf ; then |
1580 |
|
rm -f tr_cmpnum.c tr_cmpnum |
1581 |
|
fi |
1582 |
|
|
1583 |
if test "x$CLEANUP" != xt ; then |
if test "x$CLEANUP" != xt ; then |
1584 |
cat $SUMMARY | sed 's/ \. \. \. \. \. \. \. \. \. \. \. \. //' |
cat $SUMMARY | sed 's/ \. \. \. \. \. \. \. \. \. \. \. \. //' |