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) compile and run using MPI" |
16 |
echo " (-ieee|-noieee) if possible, use IEEE compiler flags" |
echo " (-ieee/-noieee) if possible, use IEEE compiler flags" |
17 |
echo " (DEF=\"-ieee\")" |
echo " (DEF=\"-ieee\")" |
18 |
echo " (-gsl) compile with \"-gsl\" flag" |
echo " (-gsl) compile with \"-gsl\" flag" |
19 |
echo " (-of=|-optfile=)STRING list of optfiles to use" |
echo " (-use_r4|-ur4) if allowed, use real*4 type for '_RS' variable" |
20 |
echo " (-a|-addr) STRING list of email recipients" |
echo " (-optfile|-of) STRING list of optfiles to use" |
21 |
|
echo " (-addr|-a) STRING list of email recipients" |
22 |
echo " (DEF=\"\" no email is sent)" |
echo " (DEF=\"\" no email is sent)" |
23 |
echo " (-mpd|-mpackdir) DIR location of the mpack utility" |
echo " (-mpackdir|-mpd) DIR location of the mpack utility" |
24 |
echo " (DEF=\"../tools/mpack-1.6\")" |
echo " (DEF=\"../tools/mpack-1.6\")" |
25 |
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" |
26 |
echo " (recognized groups: basic, tutorials)" |
echo " (recognized groups: basic, tutorials)" |
27 |
echo " (DEF=\"\" which test all)" |
echo " (DEF=\"\" which test all)" |
28 |
echo " (-skd|-skipdir) STRING list of exp. dirs to skip" |
echo " (if list= 'start_from THIS_EXP' then" |
29 |
|
echo " test THIS_EXP + all the following)" |
30 |
|
echo " (-skipdir|-skd) STRING list of exp. dirs to skip" |
31 |
echo " (DEF=\"\" which test all)" |
echo " (DEF=\"\" which test all)" |
32 |
echo " (-b|-bash) STRING preferred location of a \"bash\" or" |
echo " (-bash|-b) STRING preferred location of a \"bash\" or" |
33 |
echo " Bourne-compatible \"sh\" shell" |
echo " Bourne-compatible \"sh\" shell" |
34 |
echo " (DEF=\"\" for \"bash\")" |
echo " (DEF=\"\" for \"bash\")" |
35 |
echo " (-adm|-ad) perform an adjoint run" |
echo " (-adm|-ad) perform an adjoint run" |
36 |
echo " (-oad) perform an OpenAD adjoint run" |
echo " (-oad) perform an OpenAD adjoint run" |
37 |
echo " (-command) STRING command to run" |
echo " (-command|-c) STRING command to run" |
38 |
echo " (DEF=\"make output.txt\")" |
echo " (-makedepend|-md) STRING command to use for \"makedepend\"" |
39 |
echo " (-m|-make) STRING command to use for \"make\"" |
echo " (-make|-m) STRING command to use for \"make\"" |
40 |
echo " (DEF=\"make\")" |
echo " (DEF=\"make\")" |
41 |
echo " (-odir) STRING used to build output directory name" |
echo " (-odir) STRING used to build output directory name" |
42 |
echo " (DEF=\"hostname\")" |
echo " (DEF=\"hostname\")" |
43 |
echo " (-ptr|-ptracers) STRING specify which ptracers to test" |
echo " (-ptracers|-ptr) STRING specify which ptracers to test" |
44 |
echo " (DEF=\"1 2 3 4 5\")" |
echo " (DEF=\"1 2 3 4 5\")" |
45 |
echo " (-match) NUMBER Matching Criteria (number of digits)" |
echo " (-match) NUMBER Matching Criteria (number of digits)" |
46 |
echo " (DEF=\"12\")" |
echo " (DEF=\"$MATCH_CRIT\")" |
47 |
echo " (-j) JOBS use \"make -j JOBS\" for parallel builds" |
echo " (-j) JOBS use \"make -j JOBS\" for parallel builds" |
48 |
echo " (-clean) *ONLY* run \"make CLEAN\"" |
echo " (-clean) *ONLY* run \"make CLEAN\"" |
49 |
|
echo " (-norun|-nr) skip the \"runmodel\" stage (stop after make)" |
50 |
|
echo " (-runonly|-ro) *ONLY* run stage (=\"-quick\" without make)" |
51 |
echo " (-quick|-q) same as \"-nogenmake -noclean -nodepend\"" |
echo " (-quick|-q) same as \"-nogenmake -noclean -nodepend\"" |
52 |
echo " (-nogenmake|-ng) skip the genmake stage" |
echo " (-nogenmake|-ng) skip the genmake stage" |
53 |
echo " (-noclean|-nc) skip the \"make clean\" stage" |
echo " (-noclean|-nc) skip the \"make clean\" stage" |
109 |
{ |
{ |
110 |
# testoutput_var dir s1 label subdir reference_output |
# testoutput_var dir s1 label subdir reference_output |
111 |
# |
# |
112 |
# compares 1 variable output selected from file $dir/$subdir/$OUTPUTFILE |
# compares 1 variable output selected from file $dir/$subdir/$OUTPUTFILE |
113 |
# with same output from reference file $dir/results/$reference_output |
# with same output from reference file $dir/results/$reference_output |
114 |
# using search strings s1 and text label |
# using search strings s1 and text label |
115 |
|
|
181 |
fi |
fi |
182 |
fi |
fi |
183 |
rm -f tmp1.txt tmp2.txt tmp3.txt tmp4.txt |
rm -f tmp1.txt tmp2.txt tmp3.txt tmp4.txt |
184 |
|
|
185 |
return $digits_of_similarity |
return $digits_of_similarity |
186 |
} |
} |
187 |
|
|
234 |
listVar=" $sVar "`echo "$listVar " | sed "s/ $sVar / /g"` |
listVar=" $sVar "`echo "$listVar " | sed "s/ $sVar / /g"` |
235 |
fi |
fi |
236 |
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 |
237 |
echo "listVar='$listVar'" > $CDIR"/summary.txt" |
echo "listVar='$listVar'" > $locDIR"/summary.txt" |
238 |
allargs="" |
allargs="" |
239 |
for xx in $listVar |
for xx in $listVar |
240 |
do |
do |
269 |
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=$? ;; |
270 |
'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/..$//'` |
271 |
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=$? ;; |
272 |
'Qntmn') testoutput_var $1 "extforcing_qnet_min" "Qnet minimum" $2 $3; yy=$? ;; |
'Qntmn') testoutput_var $1 "forcing_qnet_min" "Qnet minimum" $2 $3; yy=$? ;; |
273 |
'Qntmx') testoutput_var $1 "extforcing_qnet_max" "Qnet maximum" $2 $3; yy=$? ;; |
'Qntmx') testoutput_var $1 "forcing_qnet_max" "Qnet maximum" $2 $3; yy=$? ;; |
274 |
'Qntav') testoutput_var $1 "extforcing_qnet_mean" "Qnet mean" $2 $3; yy=$? ;; |
'Qntav') testoutput_var $1 "forcing_qnet_mean" "Qnet mean" $2 $3; yy=$? ;; |
275 |
'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=$? ;; |
276 |
'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=$? ;; |
277 |
'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=$? ;; |
278 |
'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=$? ;; |
279 |
'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=$? ;; |
280 |
'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=$? ;; |
281 |
'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=$? ;; |
282 |
'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=$? ;; |
283 |
'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=$? ;; |
284 |
'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=$? ;; |
285 |
'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=$? ;; |
286 |
'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=$? ;; |
296 |
done |
done |
297 |
|
|
298 |
nbVar=`echo $listVar | awk '{print NF}'` |
nbVar=`echo $listVar | awk '{print NF}'` |
299 |
if [ $nbVar -lt $LEN_CHECK_LIST ] ; then |
if [ $nbVar -lt $LEN_CHECK_LIST ] ; then |
300 |
#-- fill line (up to standard length) with dot: |
#-- fill line (up to standard length) with dot: |
301 |
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 "."}}'` |
302 |
echo $allargs $adNul |
echo $allargs $adNul |
303 |
else |
else |
304 |
echo $allargs |
echo $allargs |
305 |
fi |
fi |
306 |
# <-- same processing for adjoint & forward test |
# <-- same processing for adjoint & forward test |
307 |
} |
} |
308 |
|
|
320 |
( |
( |
321 |
cd $1; |
cd $1; |
322 |
command="$GENMAKE2 -ds -m $MAKE" |
command="$GENMAKE2 -ds -m $MAKE" |
323 |
|
if test "x$MKDEPEND" != x ; then |
324 |
|
command="$command -makedepend=$MKDEPEND" |
325 |
|
fi |
326 |
if test "x$ADM" = xt ; then |
if test "x$ADM" = xt ; then |
327 |
command="$command --mods=../code_ad" |
command="$command --mods=../code_ad" |
328 |
elif test "x$OADM" = xt ; then |
elif test "x$OADM" = xt ; then |
346 |
#- run multi-threaded using OpenMP: |
#- run multi-threaded using OpenMP: |
347 |
command="$command -omp" |
command="$command -omp" |
348 |
fi |
fi |
349 |
|
if test "x$USE_R4" = xt ; then |
350 |
|
command="$command -use_r4" |
351 |
|
fi |
352 |
if test "x$TS" = xt ; then |
if test "x$TS" = xt ; then |
353 |
command="$command -ts" |
command="$command -ts" |
354 |
fi |
fi |
355 |
if test "x$PAPIS" = xt ; then |
if test "x$PAPIS" = xt ; then |
356 |
command="$command -papis" |
command="$command -papis" |
357 |
else |
else |
358 |
if test "x$PCLS" = xt ; then |
if test "x$PCLS" = xt ; then |
359 |
command="$command -pcls" |
command="$command -pcls" |
360 |
fi |
fi |
361 |
fi |
fi |
362 |
printf 'genmake ... ' 1>&2 |
printf 'genmake ... ' |
363 |
# $command > make.log 2>&1 |
eval $command > genmake.tr_log 2>&1 |
|
eval $command > make.log 2>&1 |
|
364 |
RETVAL=$? |
RETVAL=$? |
365 |
# Reduce the size of the testing emails! |
# Reduce the size of the testing emails! |
366 |
head -100 Makefile > $CDIR/Makefile_head |
head -100 Makefile > $CDIR/Makefile_head |
367 |
if test "x$RETVAL" != x0 ; then |
if test "x$RETVAL" != x0 ; then |
368 |
tail make.log |
tail genmake.tr_log |
369 |
echo "genmakemodel: genmake failed" 1>&2 |
echo "genmakemodel: genmake failed" |
370 |
cp genmake_* make.log $CDIR |
cp genmake.log genmake_* genmake.tr_log $CDIR |
371 |
return 1 |
return 1 |
372 |
else |
else |
373 |
echo "successful" 1>&2 |
echo "successful" |
374 |
fi |
fi |
375 |
) |
) |
376 |
fi |
fi |
379 |
makeclean() |
makeclean() |
380 |
{ |
{ |
381 |
# makeclean directory |
# makeclean directory |
382 |
|
if test "x$NODEPEND" = xf ; then rm -f $1/make.tr_log ; fi |
383 |
if test "x$NOCLEAN" = xt ; then |
if test "x$NOCLEAN" = xt ; then |
384 |
echo "make Clean skipped!" |
echo "make Clean skipped!" |
385 |
else |
else |
387 |
cd $1; |
cd $1; |
388 |
#if test -e $OUTPUTFILE ; then rm -f $OUTPUTFILE ; fi |
#if test -e $OUTPUTFILE ; then rm -f $OUTPUTFILE ; fi |
389 |
if test -r Makefile ; then |
if test -r Makefile ; then |
390 |
printf 'clean build-dir: make Clean ... ' 2>&1 |
printf 'clean build-dir: make Clean ... ' |
391 |
$MAKE Clean >> make.log 2>&1 |
rm -f Makefile.old |
392 |
|
$MAKE Clean >> make.tr_log 2>&1 |
393 |
RETVAL=$? |
RETVAL=$? |
394 |
if test "x$RETVAL" != x0 ; then |
if test "x$RETVAL" != x0 ; then |
395 |
tail make.log |
tail make.tr_log |
396 |
echo "makeclean: \"make Clean\" failed" 1>&2 |
echo "makeclean: \"make Clean\" failed" |
397 |
cp make.log $CDIR"/make.log" |
cp make.tr_log genmake.log genmake.tr_log $CDIR |
398 |
return 1 |
return 1 |
399 |
fi |
fi |
400 |
|
echo successful |
401 |
|
else |
402 |
|
echo '' |
403 |
fi |
fi |
|
echo successful 1>&2 |
|
404 |
exit 0 |
exit 0 |
405 |
) |
) |
406 |
fi |
fi |
414 |
else |
else |
415 |
( |
( |
416 |
cd $1; |
cd $1; |
417 |
printf 'clean run-dir ... ' 2>&1 |
printf 'clean run-dir ... ' |
418 |
# part of what is done after "make clean" when doing "make CLEAN" |
# part of what is done after "make clean" when doing "make CLEAN" |
419 |
find . -name "*.meta" -exec rm {} \; |
find . -name "*.meta" -exec rm {} \; |
420 |
find . -name "*.data" -exec rm {} \; |
find . -name "*.data" -exec rm {} \; |
421 |
find . -name "fort.*" -exec rm {} \; |
find . -name "fort.*" -exec rm {} \; |
422 |
find . -type l -exec rm {} \; |
find . -type l -exec rm {} \; |
423 |
rm -f $EXECUTABLE *.txt STD* *diagnostics.log datetime |
rm -f $EXECUTABLE $RUNLOG *.txt STD* *diagnostics.log datetime |
424 |
rm -rf mnc_test_* |
rm -rf mnc_test_* |
425 |
rm -f *_MIT_CE_000.opt0000 costfunction*0000 |
rm -f *_MIT_CE_000.opt0000 costfunction*0000 |
426 |
echo successful 1>&2 |
echo successful |
427 |
exit 0 |
exit 0 |
428 |
) |
) |
429 |
fi |
fi |
437 |
else |
else |
438 |
( |
( |
439 |
cd $1; |
cd $1; |
440 |
printf 'make depend ... ' 1>&2 |
printf 'make depend ... ' |
441 |
$MAKE depend >> make.log 2>&1 |
$MAKE depend >> make.tr_log 2>&1 |
442 |
RETVAL=$? |
RETVAL=$? |
443 |
if test "x$RETVAL" != x0 ; then |
if test "x$RETVAL" != x0 ; then |
444 |
tail make.log |
tail make.tr_log |
445 |
echo "makedependmodel: make depend failed" 1>&2 |
echo "makedependmodel: make depend failed" |
446 |
cp make.log $CDIR"/make.log" |
cp make.tr_log genmake.log genmake.tr_log $CDIR |
447 |
return 1 |
return 1 |
448 |
else |
else |
449 |
echo successful 1>&2 |
echo successful |
450 |
fi |
fi |
451 |
) |
) |
452 |
fi |
fi |
456 |
{ |
{ |
457 |
# makemodel directory |
# makemodel directory |
458 |
( |
( |
459 |
|
if test "x$NOMAKE" = xt ; then |
460 |
|
cd $1; |
461 |
|
if test -x $EXECUTABLE ; then |
462 |
|
echo "make skipped!" |
463 |
|
else |
464 |
|
echo "no executable!" |
465 |
|
return 2 |
466 |
|
fi |
467 |
|
else |
468 |
cd $1; |
cd $1; |
469 |
if test -r Makefile ; then |
if test -r Makefile ; then |
470 |
printf 'make ... ' 1>&2 |
printf 'make ... ' |
471 |
if test "x$ADM" = xt ; then |
if test "x$ADM" = xt ; then |
472 |
$MAKE adall >> make.log 2>&1 |
$MAKE adall >> make.tr_log 2>&1 |
473 |
elif test "x$OADM" = xt ; then |
elif test "x$OADM" = xt ; then |
474 |
$MAKE adAll >> make.log 2>&1 |
$MAKE adAll >> make.tr_log 2>&1 |
475 |
else |
else |
476 |
if test "x$JOBS" = x ; then |
if test "x$JOBS" = x ; then |
477 |
$MAKE >> make.log 2>&1 |
$MAKE >> make.tr_log 2>&1 |
478 |
else |
else |
479 |
$MAKE -j $JOBS >> make.log 2>&1 |
$MAKE -j $JOBS >> make.tr_log 2>&1 |
480 |
fi |
fi |
481 |
fi |
fi |
482 |
RETVAL=$? |
RETVAL=$? |
483 |
if test "x$RETVAL" != x0 ; then |
if test "x$RETVAL" != x0 ; then |
484 |
tail make.log |
tail make.tr_log |
485 |
echo failed 1>&2 |
echo failed |
486 |
cp make.log $CDIR"/make.log" |
cp make.tr_log genmake.log genmake.tr_log $CDIR |
487 |
|
rm -f $EXECUTABLE |
488 |
return 1 |
return 1 |
489 |
else |
else |
490 |
echo successful 1>&2 |
echo successful |
491 |
fi |
fi |
492 |
fi |
fi |
493 |
|
fi |
494 |
) |
) |
495 |
} |
} |
496 |
|
|
504 |
code_dir=$2 |
code_dir=$2 |
505 |
BUILD_DIR=$dir/$3 |
BUILD_DIR=$dir/$3 |
506 |
CODE_DIR=$dir/$code_dir |
CODE_DIR=$dir/$code_dir |
507 |
|
|
508 |
# These are files that should replace their counter-part when using -mpi |
# These are files that should replace their counter-part when using -mpi |
509 |
MPI_FILES=`(cd $CODE_DIR; find . -name "*_mpi" -print)` |
MPI_FILES=`(cd $CODE_DIR; find . -name "*_mpi" -print)` |
510 |
|
|
539 |
fi |
fi |
540 |
done |
done |
541 |
fi |
fi |
542 |
|
|
543 |
} |
} |
544 |
|
|
545 |
linkdata() |
linkdata() |
550 |
if test -d $1 ; then |
if test -d $1 ; then |
551 |
( |
( |
552 |
cd $1 ; shift |
cd $1 ; shift |
553 |
|
echo 'linkdata from dirs:' $* |
554 |
inpMPI=`(cd ../$1 ; find . -name "*.mpi" -print | sed 's:^\./::')` |
inpMPI=`(cd ../$1 ; find . -name "*.mpi" -print | sed 's:^\./::')` |
555 |
for xx in $inpMPI ; do |
for xx in $inpMPI ; do |
556 |
if test -r "../"$1"/"$xx ; then |
if test -r "../"$1"/"$xx ; then |
559 |
if test "x$MPI" = "xt" ; then |
if test "x$MPI" = "xt" ; then |
560 |
# mpi test: remove symbolic link & link _mpi sfx file |
# mpi test: remove symbolic link & link _mpi sfx file |
561 |
if test -h $yy ; then rm -f $yy ; fi |
if test -h $yy ; then rm -f $yy ; fi |
562 |
if test ! -r $yy ; then |
if test ! -r $yy ; then |
563 |
ln -sf "../"$1"/"$xx $yy ; |
ln -sf "../"$1"/"$xx $yy ; |
564 |
printf "$xx " 1>&2 |
printf " $xx" 1>&2 |
565 |
fi |
fi |
566 |
else |
else |
567 |
# not mpi test: remove symbolic link |
# not mpi test: remove symbolic link |
574 |
if test "x$MULTI_THREAD" = "xt" ; then |
if test "x$MULTI_THREAD" = "xt" ; then |
575 |
# multi-threaded test: remove symbolic link & link eedata.mth |
# multi-threaded test: remove symbolic link & link eedata.mth |
576 |
if test -h eedata ; then rm -f eedata ; fi |
if test -h eedata ; then rm -f eedata ; fi |
577 |
if test ! -r eedata ; then |
if test ! -r eedata ; then |
578 |
ln -sf "../"$1"/eedata.mth" eedata ; |
ln -sf "../"$1"/eedata.mth" eedata ; |
579 |
printf 'eedata.mth ' 1>&2 |
printf ' eedata.mth' 1>&2 |
580 |
fi |
fi |
581 |
else |
else |
582 |
# not multi-threaded test: remove eedata symbolic link |
# not multi-threaded test: remove eedata symbolic link |
586 |
prevDir='NONE' |
prevDir='NONE' |
587 |
for ldir in $* ; do |
for ldir in $* ; do |
588 |
if test -d "../"$ldir -a $ldir != $prevDir ; then |
if test -d "../"$ldir -a $ldir != $prevDir ; then |
589 |
printf 'ldir='${ldir} 1>&2 |
printf " ldir=${ldir}:" 1>&2 |
590 |
files=`( cd "../"$ldir ; ls -1 | grep -v CVS )` |
files=`( cd "../"$ldir ; ls -1 | grep -v CVS )` |
591 |
for i in $files ; do |
for i in $files ; do |
592 |
if test ! -d "../"$ldir/$i ; then |
if test ! -d "../"$ldir/$i ; then |
596 |
fi |
fi |
597 |
fi |
fi |
598 |
done |
done |
599 |
|
printf ' ;' 1>&2 |
600 |
if test -x "../"$ldir"/"prepare_run ; then |
if test -x "../"$ldir"/"prepare_run ; then |
601 |
"../"$ldir"/"prepare_run |
"../"$ldir"/"prepare_run 1>&2 |
602 |
|
else |
603 |
|
echo '' 1>&2 |
604 |
fi |
fi |
|
printf ' ; ' 1>&2 |
|
605 |
fi |
fi |
606 |
prevDir=$ldir |
prevDir=$ldir |
607 |
done |
done |
613 |
{ |
{ |
614 |
# runmodel directory |
# runmodel directory |
615 |
# |
# |
616 |
# runs "$COMMAND in "directory" |
# runs "$COMMAND in "directory" |
617 |
# (where "$COMMAND" is relative to "directory") |
# (where "$COMMAND" is relative to "directory") |
618 |
( |
( |
619 |
cd $1 |
cd $1 |
620 |
printf 'runmodel in %s ...' $1 1>&2 |
printf 'runmodel in %s ... ' $1 |
621 |
# make output.txt |
if test -L $EXECUTABLE ; then |
622 |
echo |
if test -x "../"$builddir"/"$EXECUTABLE ; then |
|
if test -L $EXECUTABLE -a -x "../"$builddir"/"$EXECUTABLE ; then |
|
623 |
diff -q $EXECUTABLE "../"$builddir"/"$EXECUTABLE > /dev/null 2>&1 |
diff -q $EXECUTABLE "../"$builddir"/"$EXECUTABLE > /dev/null 2>&1 |
624 |
outD=$? ; if test $outD != 0 ; then rm -f $EXECUTABLE ; fi |
outD=$? ; if test $outD != 0 ; then rm -f $EXECUTABLE ; fi |
625 |
|
else rm -f $EXECUTABLE |
626 |
|
fi |
627 |
fi |
fi |
628 |
if test ! -x $EXECUTABLE -a -x "../"$builddir"/"$EXECUTABLE ; then |
if test ! -x $EXECUTABLE -a -x "../"$builddir"/"$EXECUTABLE ; then |
629 |
echo " link" $EXECUTABLE "from dir ../"$builddir > run.log_tmp |
echo " link" $EXECUTABLE "from dir ../"$builddir > run.log_tmp |
647 |
if test -f $RUNLOG ; then |
if test -f $RUNLOG ; then |
648 |
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 |
649 |
echo "---------->> $OUTPUTFILE is up to date " >> $RUNLOG 2>&1 |
echo "---------->> $OUTPUTFILE is up to date " >> $RUNLOG 2>&1 |
650 |
else |
else |
651 |
touch $RUNLOG |
touch $RUNLOG |
652 |
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 |
653 |
echo "---------->> $OUTPUTFILE is up to date " >> $RUNLOG 2>&1 |
echo "---------->> $OUTPUTFILE is up to date " >> $RUNLOG 2>&1 |
654 |
echo " no previous $RUNLOG: assume NORMAL END" >> $RUNLOG 2>&1 |
echo " no previous $RUNLOG: assume NORMAL END" >> $RUNLOG 2>&1 |
655 |
fi |
fi |
656 |
fi |
fi |
657 |
ENDVAL=`cat $RUNLOG | grep -v 'ABNORMAL END' | grep -c 'NORMAL END'` |
#ENDVAL=`cat $RUNLOG | grep -v 'ABNORMAL END' | grep -c 'NORMAL END'` |
658 |
|
ENDVAL=`tail $OUTPUTFILE | grep -c 'PROGRAM MAIN: Execution ended Normally'` |
659 |
fi |
fi |
660 |
rm -f run.log_tmp |
rm -f run.log_tmp |
|
#if test "x$RETVAL" = x0 ; then |
|
661 |
if [ $RETVAL -eq 0 -a $ENDVAL -gt 0 ] ; then |
if [ $RETVAL -eq 0 -a $ENDVAL -gt 0 ] ; then |
662 |
tail $RUNLOG |
echo successful |
663 |
echo successful 1>&2 |
printf '=> output from running in %s :\n' $1 1>&2 |
664 |
|
tail $RUNLOG | sed 's/^.*/> &/g' 1>&2 |
665 |
# === Reduce the size of the testing emails! |
# === Reduce the size of the testing emails! |
666 |
#cp $OUTPUTFILE $CDIR"/"$OUTPUTFILE |
#cp $OUTPUTFILE $CDIR"/"$OUTPUTFILE |
667 |
if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi |
if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi |
668 |
return 0 |
return 0 |
669 |
|
elif [ $RETVAL -ne 0 -a $ENDVAL -gt 0 ] ; then |
670 |
|
#-- for some weird cases (run is finihed but with error code) |
671 |
|
echo 'finished with error (run:' $RETVAL ' end:' $ENDVAL ')' |
672 |
|
printf '=> output from running in %s :\n' $1 1>&2 |
673 |
|
tail $RUNLOG | sed 's/^.*/> &/g' 1>&2 |
674 |
|
return 0 |
675 |
else |
else |
676 |
tail $RUNLOG |
echo 'failed (run:' $RETVAL ' end:' $ENDVAL ')' |
677 |
echo failed '(run:' $RETVAL ' end:' $ENDVAL ')' 1>&2 |
printf '=> output from running in %s :\n' $1 1>&2 |
678 |
|
tail $RUNLOG | sed 's/^.*/> &/g' 1>&2 |
679 |
cp $RUNLOG $CDIR"/"$RUNLOG |
cp $RUNLOG $CDIR"/"$RUNLOG |
680 |
if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi |
if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi |
681 |
return 1 |
return 1 |
727 |
return 0 |
return 0 |
728 |
else |
else |
729 |
echo |
echo |
730 |
echo "ERROR: failed to compile comparison code -- please specify" |
echo "ERROR: failed to compile comparison code -- please specify" |
731 |
echo " a C compiler using the CC environment variable." |
echo " a C compiler using the CC environment variable." |
732 |
exit 1 |
exit 1 |
733 |
fi |
fi |
746 |
printf '%3s' $listPrt |
printf '%3s' $listPrt |
747 |
# 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 |
748 |
# printf '%3s' $listPrt | sed 's/ 99/ --/g' | sed 's/ > />/' | sed 's/ < /</' |
# printf '%3s' $listPrt | sed 's/ 99/ --/g' | sed 's/ > />/' | sed 's/ < /</' |
749 |
|
|
750 |
if [ $xx = '..' ]; then |
if [ $xx = '..' ]; then |
751 |
printf ' N/O ' |
printf ' N/O ' |
752 |
elif [ $xx = '--' ]; then |
elif [ $xx = '--' ]; then |
762 |
fi |
fi |
763 |
printf ' %s' $nm |
printf ' %s' $nm |
764 |
printf '\n' |
printf '\n' |
765 |
|
|
766 |
} |
} |
767 |
|
|
768 |
scandirs() |
scandirs() |
821 |
GSL=f |
GSL=f |
822 |
|
|
823 |
CLEANUP=f |
CLEANUP=f |
824 |
|
NORUN=f |
825 |
QUICK=f |
QUICK=f |
826 |
|
NOMAKE=f |
827 |
NOGENMAKE=f |
NOGENMAKE=f |
828 |
NOCLEAN=f |
NOCLEAN=f |
829 |
NODEPEND=f |
NODEPEND=f |
838 |
HAVE_MPACK= |
HAVE_MPACK= |
839 |
MPACK= |
MPACK= |
840 |
COMMAND= |
COMMAND= |
841 |
|
MKDEPEND= |
842 |
if test "x$MAKE" = x ; then |
if test "x$MAKE" = x ; then |
843 |
MAKE=make |
MAKE=make |
844 |
fi |
fi |
850 |
MULTI_THREAD=f |
MULTI_THREAD=f |
851 |
OUTDIR= |
OUTDIR= |
852 |
DELDIR= |
DELDIR= |
853 |
|
USE_R4= |
854 |
|
|
855 |
ADM= |
ADM= |
856 |
OADM= |
OADM= |
858 |
# list of pTracers to check for monitor output |
# list of pTracers to check for monitor output |
859 |
PTRACERS_NUM="1 2 3 4 5" |
PTRACERS_NUM="1 2 3 4 5" |
860 |
|
|
861 |
MATCH_CRIT=13 |
MATCH_CRIT=10 |
862 |
|
|
863 |
printf "parsing options... " |
printf "parsing options... " |
864 |
|
|
873 |
fi |
fi |
874 |
|
|
875 |
ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` |
ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` |
876 |
|
|
877 |
case $ac_option in |
case $ac_option in |
878 |
|
|
879 |
-help | --help | -h | --h) |
-help | --help | -h | --h) |
886 |
|
|
887 |
-addr | --addr | -a | --a) |
-addr | --addr | -a | --a) |
888 |
ac_prev=ADDRESSES ;; |
ac_prev=ADDRESSES ;; |
889 |
-addr=* | --addr=*) |
-addr=* | --addr=* | -a=* | --a=*) |
890 |
ADDRESSES=$ac_optarg ;; |
ADDRESSES=$ac_optarg ;; |
891 |
-mpackdir | --mpackdir | -mpd | --mpd) |
-mpackdir | --mpackdir | -mpd | --mpd) |
892 |
ac_prev=MPACKDIR ;; |
ac_prev=MPACKDIR ;; |
895 |
|
|
896 |
-tdir | --tdir | -t | --t) |
-tdir | --tdir | -t | --t) |
897 |
ac_prev=TESTDIRS ;; |
ac_prev=TESTDIRS ;; |
898 |
-tdir=* | --tdir=*) |
-tdir=* | --tdir=* | -t=* | --t=*) |
899 |
TESTDIRS=$ac_optarg ;; |
TESTDIRS=$ac_optarg ;; |
900 |
|
|
901 |
-skipdir | --skipdir | -skd | --skd) |
-skipdir | --skipdir | -skd | --skd) |
902 |
ac_prev=SKIPDIRS ;; |
ac_prev=SKIPDIRS ;; |
903 |
-skipdir=* | --skipdir=*) |
-skipdir=* | --skipdir=* | -skd=* | --skd=*) |
904 |
SKIPDIRS=$ac_optarg ;; |
SKIPDIRS=$ac_optarg ;; |
905 |
|
|
906 |
-bash | --bash | -b | --b) |
-bash | --bash | -b | --b) |
907 |
ac_prev=BASH ;; |
ac_prev=BASH ;; |
908 |
-bash=* | --bash=*) |
-bash=* | --bash=* | -b=* | --b=*) |
909 |
BASH=$ac_optarg ;; |
BASH=$ac_optarg ;; |
910 |
|
|
911 |
-command | --command | -c | --c) |
-command | --command | -c | --c) |
912 |
ac_prev=COMMAND ;; |
ac_prev=COMMAND ;; |
913 |
-command=* | --command=*) |
-command=* | --command=* | -c=* | --c=*) |
914 |
COMMAND=$ac_optarg ;; |
COMMAND=$ac_optarg ;; |
915 |
|
|
916 |
|
-makedepend | --makedepend | -md | --md) |
917 |
|
ac_prev=MKDEPEND ;; |
918 |
|
-makedepend=* | --makedepend=* | -md=* | --md=*) |
919 |
|
MKDEPEND=$ac_optarg ;; |
920 |
|
|
921 |
-make | --make | -m | --m) |
-make | --make | -m | --m) |
922 |
ac_prev=MAKE ;; |
ac_prev=MAKE ;; |
923 |
-make=* | --make=*) |
-make=* | --make=* | -m=* | --m=*) |
924 |
MAKE=$ac_optarg ;; |
MAKE=$ac_optarg ;; |
925 |
|
|
926 |
-odir | --odir) |
-odir | --odir) |
936 |
-match | --match ) ac_prev=MATCH_CRIT ;; |
-match | --match ) ac_prev=MATCH_CRIT ;; |
937 |
-match=* | --match=* ) MATCH_CRIT=$ac_optarg ;; |
-match=* | --match=* ) MATCH_CRIT=$ac_optarg ;; |
938 |
|
|
939 |
-j) ac_prev=JOBS ;; |
-j | --j) ac_prev=JOBS ;; |
940 |
-j=*) JOBS=$ac_optarg ;; |
-j=* | --j=*) JOBS=$ac_optarg ;; |
941 |
|
|
942 |
-clean | --clean) |
-clean | --clean) |
943 |
CLEANUP=t ; DELDIR=t ;; |
CLEANUP=t ; DELDIR=t ;; |
944 |
|
|
945 |
|
-norun | --norun | -nr | --nr) |
946 |
|
NORUN=t ;; |
947 |
|
-runonly | --runonly | -ro | --ro) |
948 |
|
QUICK=t ; NOMAKE=t ;; |
949 |
-quick | --quick | -q | --q) |
-quick | --quick | -q | --q) |
950 |
QUICK=t ;; |
QUICK=t ;; |
951 |
-nogenmake | --nogenmake | -ng | --ng) |
-nogenmake | --nogenmake | -ng | --ng) |
976 |
|
|
977 |
-deldir | -dd) DELDIR=t ;; |
-deldir | -dd) DELDIR=t ;; |
978 |
|
|
979 |
-ts) TS=t;; |
-use_r4|-ur4) USE_R4=t ;; |
980 |
|
|
981 |
|
-ts) TS=t;; |
982 |
-papis) PAPIS=t;; |
-papis) PAPIS=t;; |
|
|
|
983 |
-pcls) PCL=t;; |
-pcls) PCL=t;; |
984 |
|
|
985 |
-*) |
-*) |
986 |
echo "Error: unrecognized option: "$ac_option |
echo "Error: unrecognized option: "$ac_option |
987 |
usage |
usage |
988 |
;; |
;; |
989 |
|
|
990 |
*) |
*) |
991 |
echo "Error: unrecognized argument: "$ac_option |
echo "Error: unrecognized argument: "$ac_option |
992 |
usage |
usage |
993 |
;; |
;; |
994 |
|
|
995 |
esac |
esac |
996 |
|
|
997 |
done |
done |
998 |
|
|
999 |
if test "x$QUICK" = xt ; then |
if test "x$QUICK" = xt ; then |
1020 |
EXECUTABLE="mitgcmuv" |
EXECUTABLE="mitgcmuv" |
1021 |
fi |
fi |
1022 |
|
|
1023 |
|
xx=`echo $TESTDIRS | awk '{print $1}'` |
1024 |
if test "x$TESTDIRS" = x ; then |
if test "x$TESTDIRS" = x ; then |
1025 |
LIST=`scandirs results/$ref_outp` |
LIST=`scandirs results/$ref_outp` |
1026 |
|
elif test $xx = 'start_from' ; then |
1027 |
|
xx=`echo $TESTDIRS | awk '{print $2}'` |
1028 |
|
LIST=`scandirs results/$ref_outp | sed -n "/$xx/,$ p"` |
1029 |
else |
else |
1030 |
#- expand group of experiments: |
#- expand group of experiments: |
1031 |
LIST=" " |
LIST=" " |
1040 |
LIST=${LIST}" "`ls | grep 'tutorial_'` ;; |
LIST=${LIST}" "`ls | grep 'tutorial_'` ;; |
1041 |
*) LIST=${LIST}" "$xx ;; |
*) LIST=${LIST}" "$xx ;; |
1042 |
esac |
esac |
1043 |
done |
done |
1044 |
fi |
fi |
1045 |
#echo 'LIST='${LIST}'<' |
#echo 'LIST='${LIST}'<' |
1046 |
#- skip dirs, remove duplicate and non-directory: |
#- skip dirs, remove duplicate and non-directory: |
1061 |
else count=1 ; echo "" ; echo -n " skip: \"$xx\"" |
else count=1 ; echo "" ; echo -n " skip: \"$xx\"" |
1062 |
fi |
fi |
1063 |
fi |
fi |
1064 |
done |
done |
1065 |
if test $count = 1 ; then echo "" ; echo -n " ... " ; fi |
if test $count = 1 ; then echo "" ; echo -n " ... " ; fi |
1066 |
#echo 'TESTDIRS='${TESTDIRS}'<' |
#echo 'TESTDIRS='${TESTDIRS}'<' |
1067 |
|
|
1069 |
OPTFILE=$MITGCM_OF |
OPTFILE=$MITGCM_OF |
1070 |
fi |
fi |
1071 |
|
|
1072 |
RUNLOG="run.log" |
RUNLOG="run.tr_log" |
1073 |
OUTPUTFILE=$ref_outp |
OUTPUTFILE=$ref_outp |
1074 |
if test "x$COMMAND" = x ; then |
if test "x$COMMAND" = x ; then |
1075 |
COMMAND="./$EXECUTABLE > $OUTPUTFILE" |
COMMAND="./$EXECUTABLE > $OUTPUTFILE" |
1097 |
fi |
fi |
1098 |
|
|
1099 |
# create the FORTRAN comparison code |
# create the FORTRAN comparison code |
1100 |
createcodelet |
if test -x tr_cmpnum ; then |
1101 |
|
echo "skipping comparison code build" |
1102 |
|
else |
1103 |
|
createcodelet |
1104 |
|
fi |
1105 |
|
|
1106 |
# 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) |
1107 |
if test "x$ADDRESSES" = x ; then |
if test "x$ADDRESSES" = x ; then |
1167 |
fi |
fi |
1168 |
else |
else |
1169 |
echo >> $SUMMARY |
echo >> $SUMMARY |
1170 |
echo "No \"OPTFILE\" was explicitly specified by testreport," >> $SUMMARY |
echo "No \"OPTFILE\" was specified ; genmake2 found and uses:" >> $SUMMARY |
1171 |
echo " so the genmake default will be used." >> $SUMMARY |
#-note: to be filled later after 1rst run |
1172 |
fi |
fi |
1173 |
echo |
echo |
1174 |
echo >> $SUMMARY |
echo >> $SUMMARY |
1175 |
if test "x$ADM" = x -a "x$OADM" = x; then |
if test "x$ADM" = x -a "x$OADM" = x; then |
1176 |
if [ $MATCH_CRIT -lt 10 ] ; |
if [ $MATCH_CRIT -lt 10 ] ; |
1177 |
then line_0="default "$MATCH_CRIT ; |
then line_0="default "$MATCH_CRIT ; |
1178 |
else line_0="default "$MATCH_CRIT ; fi |
else line_0="default "$MATCH_CRIT ; fi |
1179 |
line_0="$line_0 ----T----- ----S----- ----U----- ----V-----" |
line_0="$line_0 ----T----- ----S----- ----U----- ----V-----" |
|
# line_0=" ----T----- ----S----- ----U----- ----V-----" |
|
1180 |
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" |
1181 |
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 ." |
1182 |
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" |
1197 |
else |
else |
1198 |
echo "ADJOINT=true" >> $SUMMARY |
echo "ADJOINT=true" >> $SUMMARY |
1199 |
echo >> $SUMMARY |
echo >> $SUMMARY |
1200 |
if [ $MATCH_CRIT -lt 10 ] ; |
if [ $MATCH_CRIT -lt 10 ] ; |
1201 |
then line_0="default "$MATCH_CRIT ; |
then line_0="default "$MATCH_CRIT ; |
1202 |
else line_0="default "$MATCH_CRIT ; fi |
else line_0="default "$MATCH_CRIT ; fi |
1203 |
echo "$line_0" | tee -a $SUMMARY |
echo "$line_0" | tee -a $SUMMARY |
1204 |
cat << EOF | tee -a $SUMMARY |
cat << EOF | tee -a $SUMMARY |
1209 |
|
|
1210 |
EOF |
EOF |
1211 |
fi |
fi |
1212 |
|
echo "-------------------------------------------------------------------------------" |
1213 |
|
|
1214 |
# ...and each test directory... |
# ...and each test directory... |
1215 |
for dir in $TESTDIRS ; do |
for dir in $TESTDIRS ; do |
1216 |
|
|
1217 |
# set builddir & rundir: |
# set builddir & rundir: |
1218 |
builddir="build" |
builddir="build" |
1219 |
if test ! -d $dir/$builddir ; then mkdir $dir/$builddir ; fi |
if test ! -d $dir/$builddir ; then mkdir $dir/$builddir ; fi |
1220 |
rundir="run" |
rundir="run" |
1221 |
|
pfxdir="tr_$rundir" |
1222 |
if test ! -d $dir/$rundir ; then |
if test ! -d $dir/$rundir ; then |
1223 |
rundir=$builddir |
rundir=$builddir |
1224 |
fi |
fi |
1227 |
|
|
1228 |
# Cleanup only! |
# Cleanup only! |
1229 |
if test "x$CLEANUP" = xt ; then |
if test "x$CLEANUP" = xt ; then |
1230 |
if test -r $BUILD_DIR/Makefile ; then |
echo -n ' --- dir:' $BUILD_DIR ': ' |
1231 |
echo ' ------ clean dir:' $dir/$builddir |
makeclean $BUILD_DIR |
1232 |
( cd $BUILD_DIR ; make CLEAN ) |
( cd $BUILD_DIR |
1233 |
fi |
rm -f $EXECUTABLE *.bak |
1234 |
|
rm -f genmake_state genmake_*optfile genmake.log |
1235 |
|
rm -f genmake.tr_log make.tr_log |
1236 |
|
) |
1237 |
if test -d $dir/$rundir/CVS ; then |
if test -d $dir/$rundir/CVS ; then |
1238 |
echo ' ------ clean dir:' $dir/$rundir |
echo -n ' --- dir:' $dir/$rundir ': ' |
1239 |
run_clean $dir/$rundir |
run_clean $dir/$rundir |
1240 |
fi |
fi |
1241 |
( |
trdir=`( cd $dir ; find . -type d -name "$pfxdir.*" -print | sed 's/^.\///')` |
1242 |
cd $dir |
ttd=`echo $trdir | wc -w` |
1243 |
rm -rf tr_run.* |
if test $ttd != 0 ; then |
1244 |
) |
echo ' --- rm dir:' $trdir |
1245 |
|
( cd $dir ; rm -rf $trdir ) |
1246 |
|
fi |
1247 |
continue |
continue |
1248 |
fi |
fi |
1249 |
|
|
1250 |
# Verify that the testdir exists and contains previous |
# Verify that the testdir exists and contains previous |
1251 |
# results in the correct location--or skip this directory! |
# results in the correct location--or skip this directory! |
1252 |
fout=$dir"/results/"$ref_outp |
fout=$dir"/results/"$ref_outp |
1253 |
if test ! -r $fout ; then |
if test ! -r $fout ; then |
1275 |
|
|
1276 |
# Check whether there are "extra runs" for this testdir |
# Check whether there are "extra runs" for this testdir |
1277 |
extra_runs= |
extra_runs= |
1278 |
ex_run_dirs=`( cd $dir ; echo $inputdir.* )` |
if test "x$NORUN" = xf ; then |
1279 |
|
ex_run_dirs=`( cd $dir ; echo $inputdir.* )` |
1280 |
|
fi |
1281 |
#echo "ex_run_dirs='$ex_run_dirs'" |
#echo "ex_run_dirs='$ex_run_dirs'" |
1282 |
for exd in $ex_run_dirs ; do |
for exd in $ex_run_dirs ; do |
1283 |
name=`echo $exd | sed -e "s/$inputdir\.//"` |
name=`echo $exd | sed -e "s/$inputdir\.//"` |
1284 |
refExOut=`echo $ref_outp | sed "s/\./.${name}./"` |
refExOut=`echo $ref_outp | sed "s/\./.${name}./"` |
1285 |
outf="$dir/results/$refExOut" |
outf="$dir/results/$refExOut" |
1286 |
if test -f $outf -a -r $outf ; then |
if test -f $outf -a -r $outf ; then |
1287 |
if test "x$MULTI_THREAD" = "xt" ; then |
if test "x$MULTI_THREAD" = "xt" ; then |
1288 |
if test -r $dir"/"$exd"/eedata.mth" ; then |
if test -r $dir"/"$exd"/eedata.mth" ; then |
1289 |
if test "x$MPI" = "xt" ; then |
if test "x$MPI" = "xt" ; then |
1290 |
retv=`check_eedata $CODE_DIR"/SIZE.h_mpi" $dir"/"$exd"/eedata.mth"` |
retv=`check_eedata $CODE_DIR"/SIZE.h_mpi" $dir"/"$exd"/eedata.mth"` |
1304 |
fi |
fi |
1305 |
done |
done |
1306 |
|
|
|
echo "-------------------------------------------------------------------------------" |
|
1307 |
echo |
echo |
1308 |
if test "x$extra_runs" = "x" ; then |
if test "x$extra_runs" = "x" ; then |
1309 |
echo "Experiment: $dir" |
echo "Experiment: $dir" |
1310 |
else |
else |
1311 |
echo "Experiment: $dir ; extra_runs=$extra_runs" |
echo "Experiment: $dir ; extra_runs=$extra_runs" |
1315 |
results=$EMPTY_RESULTS |
results=$EMPTY_RESULTS |
1316 |
|
|
1317 |
# Create an output dir for each OPTFILE/tdir combination |
# Create an output dir for each OPTFILE/tdir combination |
1318 |
rel_CDIR=$DRESULTS"/"$dir |
locDIR=$DRESULTS"/"$dir |
1319 |
mkdir $rel_CDIR |
mkdir $locDIR |
1320 |
CDIR=`pwd`"/$rel_CDIR" |
CDIR=`pwd`"/$locDIR" |
1321 |
|
|
1322 |
if test "x$CLEANUP" = xt ; then |
if test "x$NORUN" = xt ; then |
1323 |
echo '====>>> this is to check that we never go through this part <<< ===' |
run=N |
1324 |
makeclean $dir/$builddir \ |
genmakemodel $dir/$builddir && genmake=Y \ |
1325 |
&& run_clean $dir/$rundir |
&& makeclean $dir/$builddir \ |
1326 |
|
&& symlink_mpifiles $dir $code_dir $builddir \ |
1327 |
|
&& makedependmodel $dir/$builddir && makedepend=Y \ |
1328 |
|
&& makemodel $dir/$builddir && make=Y |
1329 |
else |
else |
1330 |
genmakemodel $dir/$builddir && genmake=Y \ |
genmakemodel $dir/$builddir && genmake=Y \ |
1331 |
&& makeclean $dir/$builddir \ |
&& makeclean $dir/$builddir \ |
|
&& run_clean $dir/$rundir \ |
|
1332 |
&& symlink_mpifiles $dir $code_dir $builddir \ |
&& symlink_mpifiles $dir $code_dir $builddir \ |
1333 |
&& makedependmodel $dir/$builddir && makedepend=Y \ |
&& makedependmodel $dir/$builddir && makedepend=Y \ |
1334 |
&& makemodel $dir/$builddir && make=Y \ |
&& makemodel $dir/$builddir && make=Y \ |
1335 |
&& linkdata $dir/$rundir $inputdir input \ |
&& run_clean $dir/$rundir \ |
1336 |
|
&& linkdata $dir/$rundir $inputdir \ |
1337 |
&& runmodel $dir/$rundir && run=Y \ |
&& runmodel $dir/$rundir && run=Y \ |
1338 |
&& results=`testoutput_run $dir $rundir $ref_outp` |
&& results=`testoutput_run $dir $rundir $ref_outp` |
1339 |
fi |
fi |
1340 |
|
#echo "results='$results'" |
1341 |
echo |
|
1342 |
fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` |
fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` |
1343 |
echo |
echo 1>&2 |
1344 |
echo "$fres" | sed 's/ 99/ --/g' | sed 's/ > />/' | sed 's/ < /</' >> $SUMMARY |
echo "$fres" | sed 's/ 99/ --/g' | sed 's/ > />/' | sed 's/ < /</' >> $SUMMARY |
1345 |
touch $CDIR"/summary.txt" |
touch $locDIR"/summary.txt" |
1346 |
echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $CDIR"/summary.txt" |
echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt" |
1347 |
echo "MACH='$MACH'" >> $CDIR"/summary.txt" |
echo "MACH='$MACH'" >> $locDIR"/summary.txt" |
1348 |
echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt" |
echo "UNAMEA='$UNAMEA'" >> $locDIR"/summary.txt" |
1349 |
echo "DATE='$DATE'" >> $CDIR"/summary.txt" |
echo "DATE='$DATE'" >> $locDIR"/summary.txt" |
1350 |
echo "tdir='$dir'" >> $CDIR"/summary.txt" |
echo "tdir='$dir'" >> $locDIR"/summary.txt" |
1351 |
if test "x$ADM" = xt ; then |
if test "x$ADM" = xt ; then |
1352 |
head -1 $dir/$builddir/taf_ad.log >> $CDIR"/summary.txt" |
head -1 $dir/$builddir/taf_ad.log >> $locDIR"/summary.txt" |
1353 |
grep -A3 'Seconds in section "ALL' $dir/$rundir/$OUTPUTFILE \ |
grep -A3 'Seconds in section "ALL' $dir/$rundir/$OUTPUTFILE \ |
1354 |
>> $CDIR"/summary.txt" |
>> $locDIR"/summary.txt" |
1355 |
fi |
fi |
1356 |
|
|
1357 |
for ex in $extra_runs ; do |
for ex in $extra_runs ; do |
1360 |
# reference output file |
# reference output file |
1361 |
refExOut=`echo $ref_outp | sed "s/\./.${ex}./g"` |
refExOut=`echo $ref_outp | sed "s/\./.${ex}./g"` |
1362 |
# Create an output dir for each OPTFILE/tdir.ex combination |
# Create an output dir for each OPTFILE/tdir.ex combination |
1363 |
rel_CDIR=$DRESULTS"/"$dir"."$ex |
locDIR=$DRESULTS"/"$dir"."$ex |
1364 |
mkdir $rel_CDIR |
mkdir $locDIR |
1365 |
CDIR=`pwd`"/$rel_CDIR" |
CDIR=`pwd`"/$locDIR" |
1366 |
test ! -e "$dir/tr_run.$ex" && mkdir "$dir/tr_run.$ex" |
test ! -e "$dir/$pfxdir.$ex" && mkdir "$dir/$pfxdir.$ex" |
1367 |
run_clean $dir/tr_run.$ex |
run_clean $dir/$pfxdir.$ex |
1368 |
linkdata $dir/tr_run.$ex $inputdir.$ex $inputdir input |
linkdata $dir/$pfxdir.$ex $inputdir.$ex $inputdir |
1369 |
runmodel $dir/tr_run.$ex && run=Y \ |
runmodel $dir/$pfxdir.$ex && run=Y \ |
1370 |
&& results=`testoutput_run $dir tr_run.$ex $refExOut` |
&& results=`testoutput_run $dir $pfxdir.$ex $refExOut` |
1371 |
fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` |
fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` |
1372 |
fres="$fres.$ex" |
fres="$fres.$ex" |
1373 |
echo |
echo 1>&2 |
1374 |
echo "$fres" | sed 's/ 99/ --/g' | sed 's/ > />/' | sed 's/ < /</' >> $SUMMARY |
echo "$fres" | sed 's/ 99/ --/g' | sed 's/ > />/' | sed 's/ < /</' >> $SUMMARY |
1375 |
touch $CDIR"/summary.txt" |
touch $locDIR"/summary.txt" |
1376 |
echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $CDIR"/summary.txt" |
echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt" |
1377 |
echo "MACH='$MACH'" >> $CDIR"/summary.txt" |
echo "MACH='$MACH'" >> $locDIR"/summary.txt" |
1378 |
echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt" |
echo "UNAMEA='$UNAMEA'" >> $locDIR"/summary.txt" |
1379 |
echo "DATE='$DATE'" >> $CDIR"/summary.txt" |
echo "DATE='$DATE'" >> $locDIR"/summary.txt" |
1380 |
echo "tdir='$dir.$ex'" >> $CDIR"/summary.txt" |
echo "tdir='$dir.$ex'" >> $locDIR"/summary.txt" |
1381 |
if test "x$ADM" = xt ; then |
if test "x$ADM" = xt ; then |
1382 |
head -1 $dir/$builddir/taf_ad.log >> $CDIR"/summary.txt" |
head -1 $dir/$builddir/taf_ad.log >> $locDIR"/summary.txt" |
1383 |
grep -A3 'Seconds in section "ALL' $dir/tr_run.$ex/$OUTPUTFILE \ |
grep -A3 'Seconds in section "ALL' $dir/$pfxdir.$ex/$OUTPUTFILE \ |
1384 |
>> $CDIR"/summary.txt" |
>> $locDIR"/summary.txt" |
1385 |
fi |
fi |
1386 |
if test "x$POSTCLEAN" = xt ; then |
if test "x$POSTCLEAN" = xt ; then |
1387 |
run_clean $dir/tr_run.$ex |
run_clean $dir/$pfxdir.$ex |
1388 |
fi |
fi |
1389 |
done |
done |
1390 |
|
|
1391 |
|
if test -f $DRESULTS"/"genmake_state ; then : ; else |
1392 |
|
if test -f $dir/$builddir/Makefile ; then |
1393 |
|
mkOpt=`grep '^# OPTFILE=' $dir/$builddir/Makefile 2>/dev/null | head -1 | sed 's/^# //'` |
1394 |
|
echo "from '$dir/$builddir/Makefile', extract:" > $DRESULTS/genmake_state |
1395 |
|
sed -n '/^# executed by:/,+1 p' $dir/$builddir/Makefile >> $DRESULTS/genmake_state |
1396 |
|
echo " $mkOpt" >> $DRESULTS/genmake_state |
1397 |
|
if test "x$OPTFILE" = xNONE ; then |
1398 |
|
eval $mkOpt |
1399 |
|
sed "/^No \"OPTFILE\" was specified ; genmake2/a\ OPTFILE=${OPTFILE}"\ |
1400 |
|
$SUMMARY > tr_0.tmp_log |
1401 |
|
RETVAL=$? |
1402 |
|
if test "x$RETVAL" = x0 ; then rm -f $SUMMARY |
1403 |
|
cp tr_0.tmp_log $SUMMARY |
1404 |
|
else rm -f tr_0.tmp_log |
1405 |
|
fi |
1406 |
|
fi |
1407 |
|
gmkLog=$dir/$builddir/genmake.log |
1408 |
|
grep '^Get compiler version using:' $gmkLog > /dev/null 2>&1 |
1409 |
|
RETVAL=$? |
1410 |
|
if test "x$RETVAL" = x0 ; then |
1411 |
|
echo "from '$gmkLog', extract compiler version:" >> $DRESULTS/genmake_state |
1412 |
|
sed -n '/Get compiler version/,/<-- compiler version/p' $gmkLog \ |
1413 |
|
| grep -v '^... compiler version ' > tr_1.tmp_log |
1414 |
|
sed -n '1,/^$/p' tr_1.tmp_log | sed '/^$/d' | sed 's/^./ &/' \ |
1415 |
|
>> $DRESULTS/genmake_state |
1416 |
|
rm -f tr_1.tmp_log |
1417 |
|
fi |
1418 |
|
fi |
1419 |
|
fi |
1420 |
#postclean $dir/$builddir |
#postclean $dir/$builddir |
1421 |
if test "x$POSTCLEAN" = xt ; then |
if test "x$POSTCLEAN" = xt ; then |
1422 |
makeclean $dir/$builddir \ |
makeclean $dir/$builddir \ |
1423 |
&& run_clean $dir/$rundir |
&& run_clean $dir/$rundir |
1424 |
fi |
fi |
1425 |
|
|
1426 |
echo "-------------------------------------------------------------------------------" |
echo "-------------------------------------------------------------------------------" |
1427 |
|
|
1428 |
done |
done |
1429 |
|
|
1430 |
printf "Start time: " >> $SUMMARY |
printf "Start time: " >> $SUMMARY |
1453 |
echo "An email containing results was sent to the following addresses:" |
echo "An email containing results was sent to the following addresses:" |
1454 |
echo " \"$ADDRESSES\"" |
echo " \"$ADDRESSES\"" |
1455 |
echo |
echo |
1456 |
|
test -f $DRESULTS".tar" && rm -f $DRESULTS".tar" |
1457 |
|
test -f $DRESULTS".tar.gz" && rm -f $DRESULTS".tar.gz" |
1458 |
fi |
fi |
|
test -f $DRESULTS".tar" && rm -f $DRESULTS".tar" |
|
|
test -f $DRESULTS".tar.gz" && rm -f $DRESULTS".tar.gz" |
|
1459 |
fi |
fi |
1460 |
fi |
fi |
1461 |
|
|
1462 |
rm -f tr_cmpnum.c tr_cmpnum |
if test "x$QUICK" = xf -a "x$NORUN" = xf ; then |
1463 |
|
rm -f tr_cmpnum.c tr_cmpnum |
1464 |
|
fi |
1465 |
|
|
1466 |
if test "x$CLEANUP" != xt ; then |
if test "x$CLEANUP" != xt ; then |
1467 |
cat $SUMMARY | sed 's/ \. \. \. \. \. \. \. \. \. \. \. \. //' |
cat $SUMMARY | sed 's/ \. \. \. \. \. \. \. \. \. \. \. \. //' |