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) 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 " (-skipdir|-skd) STRING list of exp. dirs to skip" |
29 |
echo " (DEF=\"\" which test all)" |
echo " (DEF=\"\" which test all)" |
30 |
echo " (-b|-bash) STRING preferred location of a \"bash\" or" |
echo " (-bash|-b) STRING preferred location of a \"bash\" or" |
31 |
echo " Bourne-compatible \"sh\" shell" |
echo " Bourne-compatible \"sh\" shell" |
32 |
echo " (DEF=\"\" for \"bash\")" |
echo " (DEF=\"\" for \"bash\")" |
33 |
echo " (-adm|-ad) perform an adjoint run" |
echo " (-adm|-ad) perform an adjoint run" |
34 |
echo " (-oad) perform an OpenAD adjoint run" |
echo " (-oad) perform an OpenAD adjoint run" |
35 |
echo " (-command) STRING command to run" |
echo " (-command|-c) STRING command to run" |
36 |
echo " (DEF=\"make output.txt\")" |
echo " (-makedepend|-md) STRING command to use for \"makedepend\"" |
37 |
echo " (-m|-make) STRING command to use for \"make\"" |
echo " (-make|-m) STRING command to use for \"make\"" |
38 |
echo " (DEF=\"make\")" |
echo " (DEF=\"make\")" |
39 |
echo " (-odir) STRING used to build output directory name" |
echo " (-odir) STRING used to build output directory name" |
40 |
echo " (DEF=\"hostname\")" |
echo " (DEF=\"hostname\")" |
41 |
echo " (-ptr|-ptracers) STRING specify which ptracers to test" |
echo " (-ptracers|-ptr) STRING specify which ptracers to test" |
42 |
echo " (DEF=\"1 2 3 4 5\")" |
echo " (DEF=\"1 2 3 4 5\")" |
43 |
echo " (-match) NUMBER Matching Criteria (number of digits)" |
echo " (-match) NUMBER Matching Criteria (number of digits)" |
44 |
echo " (DEF=\"12\")" |
echo " (DEF=\"$MATCH_CRIT\")" |
45 |
echo " (-j) JOBS use \"make -j JOBS\" for parallel builds" |
echo " (-j) JOBS use \"make -j JOBS\" for parallel builds" |
46 |
echo " (-clean) *ONLY* run \"make CLEAN\"" |
echo " (-clean) *ONLY* run \"make CLEAN\"" |
47 |
|
echo " (-norun|-nr) skip the \"runmodel\" stage (stop after make)" |
48 |
|
echo " (-runonly|-ro) *ONLY* run stage (=\"-quick\" without make)" |
49 |
echo " (-quick|-q) same as \"-nogenmake -noclean -nodepend\"" |
echo " (-quick|-q) same as \"-nogenmake -noclean -nodepend\"" |
50 |
echo " (-nogenmake|-ng) skip the genmake stage" |
echo " (-nogenmake|-ng) skip the genmake stage" |
51 |
echo " (-noclean|-nc) skip the \"make clean\" stage" |
echo " (-noclean|-nc) skip the \"make clean\" stage" |
107 |
{ |
{ |
108 |
# testoutput_var dir s1 label subdir reference_output |
# testoutput_var dir s1 label subdir reference_output |
109 |
# |
# |
110 |
# compares 1 variable output selected from file $dir/$subdir/$OUTPUTFILE |
# compares 1 variable output selected from file $dir/$subdir/$OUTPUTFILE |
111 |
# with same output from reference file $dir/results/$reference_output |
# with same output from reference file $dir/results/$reference_output |
112 |
# using search strings s1 and text label |
# using search strings s1 and text label |
113 |
|
|
179 |
fi |
fi |
180 |
fi |
fi |
181 |
rm -f tmp1.txt tmp2.txt tmp3.txt tmp4.txt |
rm -f tmp1.txt tmp2.txt tmp3.txt tmp4.txt |
182 |
|
|
183 |
return $digits_of_similarity |
return $digits_of_similarity |
184 |
} |
} |
185 |
|
|
232 |
listVar=" $sVar "`echo "$listVar " | sed "s/ $sVar / /g"` |
listVar=" $sVar "`echo "$listVar " | sed "s/ $sVar / /g"` |
233 |
fi |
fi |
234 |
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 |
235 |
echo "listVar='$listVar'" > $CDIR"/summary.txt" |
echo "listVar='$listVar'" > $locDIR"/summary.txt" |
236 |
allargs="" |
allargs="" |
237 |
for xx in $listVar |
for xx in $listVar |
238 |
do |
do |
267 |
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=$? ;; |
268 |
'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/..$//'` |
269 |
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=$? ;; |
270 |
'Qntmn') testoutput_var $1 "extforcing_qnet_min" "Qnet minimum" $2 $3; yy=$? ;; |
'Qntmn') testoutput_var $1 "forcing_qnet_min" "Qnet minimum" $2 $3; yy=$? ;; |
271 |
'Qntmx') testoutput_var $1 "extforcing_qnet_max" "Qnet maximum" $2 $3; yy=$? ;; |
'Qntmx') testoutput_var $1 "forcing_qnet_max" "Qnet maximum" $2 $3; yy=$? ;; |
272 |
'Qntav') testoutput_var $1 "extforcing_qnet_mean" "Qnet mean" $2 $3; yy=$? ;; |
'Qntav') testoutput_var $1 "forcing_qnet_mean" "Qnet mean" $2 $3; yy=$? ;; |
273 |
'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=$? ;; |
274 |
'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=$? ;; |
275 |
'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=$? ;; |
276 |
'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=$? ;; |
277 |
'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=$? ;; |
278 |
'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=$? ;; |
279 |
'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=$? ;; |
280 |
'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=$? ;; |
281 |
'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=$? ;; |
282 |
'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=$? ;; |
283 |
'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=$? ;; |
284 |
'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=$? ;; |
294 |
done |
done |
295 |
|
|
296 |
nbVar=`echo $listVar | awk '{print NF}'` |
nbVar=`echo $listVar | awk '{print NF}'` |
297 |
if [ $nbVar -lt $LEN_CHECK_LIST ] ; then |
if [ $nbVar -lt $LEN_CHECK_LIST ] ; then |
298 |
#-- fill line (up to standard length) with dot: |
#-- fill line (up to standard length) with dot: |
299 |
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 "."}}'` |
300 |
echo $allargs $adNul |
echo $allargs $adNul |
301 |
else |
else |
302 |
echo $allargs |
echo $allargs |
303 |
fi |
fi |
304 |
# <-- same processing for adjoint & forward test |
# <-- same processing for adjoint & forward test |
305 |
} |
} |
306 |
|
|
318 |
( |
( |
319 |
cd $1; |
cd $1; |
320 |
command="$GENMAKE2 -ds -m $MAKE" |
command="$GENMAKE2 -ds -m $MAKE" |
321 |
|
if test "x$MKDEPEND" != x ; then |
322 |
|
command="$command -makedepend=$MKDEPEND" |
323 |
|
fi |
324 |
if test "x$ADM" = xt ; then |
if test "x$ADM" = xt ; then |
325 |
command="$command --mods=../code_ad" |
command="$command --mods=../code_ad" |
326 |
elif test "x$OADM" = xt ; then |
elif test "x$OADM" = xt ; then |
327 |
command="$command -adof ../../../tools/adjoint_options/adjoint_oad -mods '../code_oad ../../OpenAD/code_oad_all'" |
command="$command -adof ../../../tools/adjoint_options/adjoint_oad -mods '../code_oad ../../OpenAD/code_oad_all'" |
328 |
else |
else |
329 |
command="$command --mods=../code" |
command="$command -mods=../code" |
330 |
fi |
fi |
331 |
if test "x$OPTFILE" != xNONE ; then |
if test "x$OPTFILE" != xNONE ; then |
332 |
command="$command --optfile=$OPTFILE" |
command="$command -optfile=$OPTFILE" |
333 |
fi |
fi |
334 |
if test "x$IEEE" != x ; then |
if test "x$IEEE" != x ; then |
335 |
command="$command -ieee" |
command="$command -ieee" |
340 |
if test "x$MPI" = xt ; then |
if test "x$MPI" = xt ; then |
341 |
command="$command -mpi" |
command="$command -mpi" |
342 |
fi |
fi |
343 |
|
if test "x$MULTI_THREAD" = xt ; then |
344 |
|
#- run multi-threaded using OpenMP: |
345 |
|
command="$command -omp" |
346 |
|
fi |
347 |
|
if test "x$USE_R4" = xt ; then |
348 |
|
command="$command -use_r4" |
349 |
|
fi |
350 |
if test "x$TS" = xt ; then |
if test "x$TS" = xt ; then |
351 |
command="$command -ts" |
command="$command -ts" |
352 |
fi |
fi |
353 |
if test "x$PAPIS" = xt ; then |
if test "x$PAPIS" = xt ; then |
354 |
command="$command -papis" |
command="$command -papis" |
355 |
else |
else |
356 |
if test "x$PCLS" = xt ; then |
if test "x$PCLS" = xt ; then |
357 |
command="$command -pcls" |
command="$command -pcls" |
358 |
fi |
fi |
359 |
fi |
fi |
360 |
printf 'genmake ... ' 1>&2 |
printf 'genmake ... ' |
|
# $command > make.log 2>&1 |
|
361 |
eval $command > make.log 2>&1 |
eval $command > make.log 2>&1 |
362 |
RETVAL=$? |
RETVAL=$? |
363 |
# Reduce the size of the testing emails! |
# Reduce the size of the testing emails! |
364 |
head -100 Makefile > $CDIR/Makefile_head |
head -100 Makefile > $CDIR/Makefile_head |
365 |
if test "x$RETVAL" != x0 ; then |
if test "x$RETVAL" != x0 ; then |
366 |
tail make.log |
tail make.log |
367 |
echo "genmakemodel: genmake failed" 1>&2 |
echo "genmakemodel: genmake failed" |
368 |
cp genmake_* make.log $CDIR |
cp genmake_* make.log $CDIR |
369 |
return 1 |
return 1 |
370 |
else |
else |
371 |
echo "successful" 1>&2 |
echo "successful" |
372 |
fi |
fi |
373 |
) |
) |
374 |
fi |
fi |
384 |
cd $1; |
cd $1; |
385 |
#if test -e $OUTPUTFILE ; then rm -f $OUTPUTFILE ; fi |
#if test -e $OUTPUTFILE ; then rm -f $OUTPUTFILE ; fi |
386 |
if test -r Makefile ; then |
if test -r Makefile ; then |
387 |
printf 'clean build-dir: make Clean ... ' 2>&1 |
printf 'clean build-dir: make Clean ... ' |
388 |
$MAKE Clean >> make.log 2>&1 |
$MAKE Clean >> make.log 2>&1 |
389 |
RETVAL=$? |
RETVAL=$? |
390 |
if test "x$RETVAL" != x0 ; then |
if test "x$RETVAL" != x0 ; then |
391 |
tail make.log |
tail make.log |
392 |
echo "makeclean: \"make Clean\" failed" 1>&2 |
echo "makeclean: \"make Clean\" failed" |
393 |
cp make.log $CDIR"/make.log" |
cp make.log $CDIR"/make.log" |
394 |
return 1 |
return 1 |
395 |
fi |
fi |
396 |
|
echo successful |
397 |
|
else |
398 |
|
echo '' |
399 |
fi |
fi |
|
echo successful 1>&2 |
|
400 |
exit 0 |
exit 0 |
401 |
) |
) |
402 |
fi |
fi |
410 |
else |
else |
411 |
( |
( |
412 |
cd $1; |
cd $1; |
413 |
printf 'clean run-dir ... ' 2>&1 |
printf 'clean run-dir ... ' |
414 |
# part of what is done after "make clean" when doing "make CLEAN" |
# part of what is done after "make clean" when doing "make CLEAN" |
415 |
find . -name "*.meta" -exec rm {} \; |
find . -name "*.meta" -exec rm {} \; |
416 |
find . -name "*.data" -exec rm {} \; |
find . -name "*.data" -exec rm {} \; |
419 |
rm -f $EXECUTABLE *.txt STD* *diagnostics.log datetime |
rm -f $EXECUTABLE *.txt STD* *diagnostics.log datetime |
420 |
rm -rf mnc_test_* |
rm -rf mnc_test_* |
421 |
rm -f *_MIT_CE_000.opt0000 costfunction*0000 |
rm -f *_MIT_CE_000.opt0000 costfunction*0000 |
422 |
echo successful 1>&2 |
echo successful |
423 |
exit 0 |
exit 0 |
424 |
) |
) |
425 |
fi |
fi |
433 |
else |
else |
434 |
( |
( |
435 |
cd $1; |
cd $1; |
436 |
printf 'make depend ... ' 1>&2 |
printf 'make depend ... ' |
437 |
$MAKE depend >> make.log 2>&1 |
$MAKE depend >> make.log 2>&1 |
438 |
RETVAL=$? |
RETVAL=$? |
439 |
if test "x$RETVAL" != x0 ; then |
if test "x$RETVAL" != x0 ; then |
440 |
tail make.log |
tail make.log |
441 |
echo "makedependmodel: make depend failed" 1>&2 |
echo "makedependmodel: make depend failed" |
442 |
cp make.log $CDIR"/make.log" |
cp make.log $CDIR"/make.log" |
443 |
return 1 |
return 1 |
444 |
else |
else |
445 |
echo successful 1>&2 |
echo successful |
446 |
fi |
fi |
447 |
) |
) |
448 |
fi |
fi |
452 |
{ |
{ |
453 |
# makemodel directory |
# makemodel directory |
454 |
( |
( |
455 |
|
if test "x$NOMAKE" = xt ; then |
456 |
|
cd $1; |
457 |
|
if test -x $EXECUTABLE ; then |
458 |
|
echo "make skipped!" |
459 |
|
else |
460 |
|
echo "no executable!" |
461 |
|
return 2 |
462 |
|
fi |
463 |
|
else |
464 |
cd $1; |
cd $1; |
465 |
if test -r Makefile ; then |
if test -r Makefile ; then |
466 |
printf 'make ... ' 1>&2 |
printf 'make ... ' |
467 |
if test "x$ADM" = xt ; then |
if test "x$ADM" = xt ; then |
468 |
$MAKE adall >> make.log 2>&1 |
$MAKE adall >> make.log 2>&1 |
469 |
elif test "x$OADM" = xt ; then |
elif test "x$OADM" = xt ; then |
478 |
RETVAL=$? |
RETVAL=$? |
479 |
if test "x$RETVAL" != x0 ; then |
if test "x$RETVAL" != x0 ; then |
480 |
tail make.log |
tail make.log |
481 |
echo failed 1>&2 |
echo failed |
482 |
cp make.log $CDIR"/make.log" |
cp make.log $CDIR"/make.log" |
483 |
|
rm -f $EXECUTABLE |
484 |
return 1 |
return 1 |
485 |
else |
else |
486 |
echo successful 1>&2 |
echo successful |
487 |
fi |
fi |
488 |
fi |
fi |
489 |
|
fi |
490 |
) |
) |
491 |
} |
} |
492 |
|
|
500 |
code_dir=$2 |
code_dir=$2 |
501 |
BUILD_DIR=$dir/$3 |
BUILD_DIR=$dir/$3 |
502 |
CODE_DIR=$dir/$code_dir |
CODE_DIR=$dir/$code_dir |
503 |
|
|
504 |
# These are files that should replace their counter-part when using -mpi |
# These are files that should replace their counter-part when using -mpi |
505 |
MPI_FILES=`(cd $CODE_DIR; find . -name "*_mpi" -print)` |
MPI_FILES=`(cd $CODE_DIR; find . -name "*_mpi" -print)` |
506 |
|
|
535 |
fi |
fi |
536 |
done |
done |
537 |
fi |
fi |
538 |
|
|
539 |
} |
} |
540 |
|
|
541 |
linkdata() |
linkdata() |
546 |
if test -d $1 ; then |
if test -d $1 ; then |
547 |
( |
( |
548 |
cd $1 ; shift |
cd $1 ; shift |
549 |
|
echo 'linkdata from dirs:' $* |
550 |
|
inpMPI=`(cd ../$1 ; find . -name "*.mpi" -print | sed 's:^\./::')` |
551 |
|
for xx in $inpMPI ; do |
552 |
|
if test -r "../"$1"/"$xx ; then |
553 |
|
# found 1 _mpi sfx file in 1rst input dir and it is readable |
554 |
|
yy=`echo $xx | sed 's:\.mpi$::'` |
555 |
|
if test "x$MPI" = "xt" ; then |
556 |
|
# mpi test: remove symbolic link & link _mpi sfx file |
557 |
|
if test -h $yy ; then rm -f $yy ; fi |
558 |
|
if test ! -r $yy ; then |
559 |
|
ln -sf "../"$1"/"$xx $yy ; |
560 |
|
printf " $xx" 1>&2 |
561 |
|
fi |
562 |
|
else |
563 |
|
# not mpi test: remove symbolic link |
564 |
|
if test -h $yy ; then rm -f $yy ; fi |
565 |
|
fi |
566 |
|
fi |
567 |
|
done |
568 |
if test -r "../"$1"/eedata.mth" ; then |
if test -r "../"$1"/eedata.mth" ; then |
569 |
# found eedata.mth in 1rst input dir and it is readable |
# found eedata.mth in 1rst input dir and it is readable |
570 |
if test "x$MULTI_THREAD" = "xt" ; then |
if test "x$MULTI_THREAD" = "xt" ; then |
571 |
# multi-threaded test: remove symbolic link & link eedata.mth |
# multi-threaded test: remove symbolic link & link eedata.mth |
572 |
if test -h eedata ; then rm -f eedata ; fi |
if test -h eedata ; then rm -f eedata ; fi |
573 |
if test ! -r eedata ; then |
if test ! -r eedata ; then |
574 |
ln -sf "../"$1"/eedata.mth" eedata ; |
ln -sf "../"$1"/eedata.mth" eedata ; |
575 |
printf 'eedata.mth ' 1>&2 |
printf ' eedata.mth' 1>&2 |
576 |
fi |
fi |
577 |
else |
else |
578 |
# not multi-threaded test: remove eedata symbolic link |
# not multi-threaded test: remove eedata symbolic link |
582 |
prevDir='NONE' |
prevDir='NONE' |
583 |
for ldir in $* ; do |
for ldir in $* ; do |
584 |
if test -d "../"$ldir -a $ldir != $prevDir ; then |
if test -d "../"$ldir -a $ldir != $prevDir ; then |
585 |
printf 'ldir='${ldir} 1>&2 |
printf " ldir=${ldir}:" 1>&2 |
586 |
files=`( cd "../"$ldir ; ls -1 | grep -v CVS )` |
files=`( cd "../"$ldir ; ls -1 | grep -v CVS )` |
587 |
for i in $files ; do |
for i in $files ; do |
588 |
if test ! -d "../"$ldir/$i ; then |
if test ! -d "../"$ldir/$i ; then |
592 |
fi |
fi |
593 |
fi |
fi |
594 |
done |
done |
595 |
|
printf ' ;' 1>&2 |
596 |
if test -x "../"$ldir"/"prepare_run ; then |
if test -x "../"$ldir"/"prepare_run ; then |
597 |
"../"$ldir"/"prepare_run |
"../"$ldir"/"prepare_run 1>&2 |
598 |
|
else |
599 |
|
echo '' 1>&2 |
600 |
fi |
fi |
|
printf ' ; ' 1>&2 |
|
601 |
fi |
fi |
602 |
prevDir=$ldir |
prevDir=$ldir |
603 |
done |
done |
609 |
{ |
{ |
610 |
# runmodel directory |
# runmodel directory |
611 |
# |
# |
612 |
# runs "$COMMAND in "directory" |
# runs "$COMMAND in "directory" |
613 |
# (where "$COMMAND" is relative to "directory") |
# (where "$COMMAND" is relative to "directory") |
614 |
( |
( |
615 |
cd $1 |
cd $1 |
616 |
printf 'runmodel in %s ...' $1 1>&2 |
printf 'runmodel in %s ... ' $1 |
617 |
# make output.txt |
if test -L $EXECUTABLE ; then |
618 |
echo |
if test -x "../"$builddir"/"$EXECUTABLE ; then |
|
if test -L $EXECUTABLE -a -x "../"$builddir"/"$EXECUTABLE ; then |
|
619 |
diff -q $EXECUTABLE "../"$builddir"/"$EXECUTABLE > /dev/null 2>&1 |
diff -q $EXECUTABLE "../"$builddir"/"$EXECUTABLE > /dev/null 2>&1 |
620 |
outD=$? ; if test $outD != 0 ; then rm -f $EXECUTABLE ; fi |
outD=$? ; if test $outD != 0 ; then rm -f $EXECUTABLE ; fi |
621 |
|
else rm -f $EXECUTABLE |
622 |
|
fi |
623 |
fi |
fi |
624 |
if test ! -x $EXECUTABLE -a -x "../"$builddir"/"$EXECUTABLE ; then |
if test ! -x $EXECUTABLE -a -x "../"$builddir"/"$EXECUTABLE ; then |
625 |
echo " link" $EXECUTABLE "from dir ../"$builddir > run.log_tmp |
echo " link" $EXECUTABLE "from dir ../"$builddir > run.log_tmp |
643 |
if test -f $RUNLOG ; then |
if test -f $RUNLOG ; then |
644 |
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 |
645 |
echo "---------->> $OUTPUTFILE is up to date " >> $RUNLOG 2>&1 |
echo "---------->> $OUTPUTFILE is up to date " >> $RUNLOG 2>&1 |
646 |
else |
else |
647 |
touch $RUNLOG |
touch $RUNLOG |
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 |
653 |
ENDVAL=`cat $RUNLOG | grep -v 'ABNORMAL END' | grep -c 'NORMAL END'` |
ENDVAL=`cat $RUNLOG | grep -v 'ABNORMAL END' | grep -c 'NORMAL END'` |
654 |
fi |
fi |
655 |
rm -f run.log_tmp |
rm -f run.log_tmp |
|
#if test "x$RETVAL" = x0 ; then |
|
656 |
if [ $RETVAL -eq 0 -a $ENDVAL -gt 0 ] ; then |
if [ $RETVAL -eq 0 -a $ENDVAL -gt 0 ] ; then |
657 |
tail $RUNLOG |
echo successful |
658 |
echo successful 1>&2 |
printf '=> output from running in %s :\n' $1 1>&2 |
659 |
|
tail $RUNLOG | sed 's/^.*/> &/g' 1>&2 |
660 |
# === Reduce the size of the testing emails! |
# === Reduce the size of the testing emails! |
661 |
#cp $OUTPUTFILE $CDIR"/"$OUTPUTFILE |
#cp $OUTPUTFILE $CDIR"/"$OUTPUTFILE |
662 |
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 |
663 |
return 0 |
return 0 |
664 |
|
elif [ $RETVAL -ne 0 -a $ENDVAL -gt 0 ] ; then |
665 |
|
#-- for some weird cases (run is finihed but with error code) |
666 |
|
echo 'finished with error (run:' $RETVAL ' end:' $ENDVAL ')' |
667 |
|
printf '=> output from running in %s :\n' $1 1>&2 |
668 |
|
tail $RUNLOG | sed 's/^.*/> &/g' 1>&2 |
669 |
|
return 0 |
670 |
else |
else |
671 |
tail $RUNLOG |
echo 'failed (run:' $RETVAL ' end:' $ENDVAL ')' |
672 |
echo failed '(run:' $RETVAL ' end:' $ENDVAL ')' 1>&2 |
printf '=> output from running in %s :\n' $1 1>&2 |
673 |
|
tail $RUNLOG | sed 's/^.*/> &/g' 1>&2 |
674 |
cp $RUNLOG $CDIR"/"$RUNLOG |
cp $RUNLOG $CDIR"/"$RUNLOG |
675 |
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 |
676 |
return 1 |
return 1 |
722 |
return 0 |
return 0 |
723 |
else |
else |
724 |
echo |
echo |
725 |
echo "ERROR: failed to compile comparison code -- please specify" |
echo "ERROR: failed to compile comparison code -- please specify" |
726 |
echo " a C compiler using the CC environment variable." |
echo " a C compiler using the CC environment variable." |
727 |
exit 1 |
exit 1 |
728 |
fi |
fi |
741 |
printf '%3s' $listPrt |
printf '%3s' $listPrt |
742 |
# 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 |
743 |
# printf '%3s' $listPrt | sed 's/ 99/ --/g' | sed 's/ > />/' | sed 's/ < /</' |
# printf '%3s' $listPrt | sed 's/ 99/ --/g' | sed 's/ > />/' | sed 's/ < /</' |
744 |
|
|
745 |
if [ $xx = '..' ]; then |
if [ $xx = '..' ]; then |
746 |
printf ' N/O ' |
printf ' N/O ' |
747 |
elif [ $xx = '--' ]; then |
elif [ $xx = '--' ]; then |
757 |
fi |
fi |
758 |
printf ' %s' $nm |
printf ' %s' $nm |
759 |
printf '\n' |
printf '\n' |
760 |
|
|
761 |
} |
} |
762 |
|
|
763 |
scandirs() |
scandirs() |
772 |
} |
} |
773 |
|
|
774 |
|
|
775 |
|
check_eedata() |
776 |
|
{ |
777 |
|
# check_eedata size.h eedata |
778 |
|
if [ $# -eq 2 ] ; then |
779 |
|
if test -f $1 -a -f $2 ; then |
780 |
|
sx=`grep "^ & *nSx *=" $1 | sed "s/^ & *nSx *=//" | sed 's/, *$//'` |
781 |
|
nx=`grep "^ *nTx *=" $2 | tail -1 | sed 's/^ *nTx *= *//' | sed "s/, *$//"` |
782 |
|
if test "x$nx" = x ; then |
783 |
|
rx=10 |
784 |
|
else |
785 |
|
rx=`expr $sx % $nx` |
786 |
|
fi |
787 |
|
sy=`grep "^ & *nSy *=" $1 | sed "s/^ & *nSy *=//" | sed 's/, *$//'` |
788 |
|
ny=`grep "^ *nTy *=" $2 | tail -1 | sed 's/^ *nTy *= *//' | sed "s/, *$//"` |
789 |
|
if test "x$ny" = x ; then |
790 |
|
ry=20 |
791 |
|
else |
792 |
|
ry=`expr $sy % $ny` |
793 |
|
fi |
794 |
|
echo `expr $rx + $ry` |
795 |
|
else |
796 |
|
echo '-1' |
797 |
|
fi |
798 |
|
else |
799 |
|
echo '-2' |
800 |
|
fi |
801 |
|
|
802 |
|
} |
803 |
|
|
804 |
############################################################################### |
############################################################################### |
805 |
|
|
806 |
|
|
816 |
GSL=f |
GSL=f |
817 |
|
|
818 |
CLEANUP=f |
CLEANUP=f |
819 |
|
NORUN=f |
820 |
QUICK=f |
QUICK=f |
821 |
|
NOMAKE=f |
822 |
NOGENMAKE=f |
NOGENMAKE=f |
823 |
NOCLEAN=f |
NOCLEAN=f |
824 |
NODEPEND=f |
NODEPEND=f |
833 |
HAVE_MPACK= |
HAVE_MPACK= |
834 |
MPACK= |
MPACK= |
835 |
COMMAND= |
COMMAND= |
836 |
|
MKDEPEND= |
837 |
if test "x$MAKE" = x ; then |
if test "x$MAKE" = x ; then |
838 |
MAKE=make |
MAKE=make |
839 |
fi |
fi |
845 |
MULTI_THREAD=f |
MULTI_THREAD=f |
846 |
OUTDIR= |
OUTDIR= |
847 |
DELDIR= |
DELDIR= |
848 |
|
USE_R4= |
849 |
|
|
850 |
ADM= |
ADM= |
851 |
OADM= |
OADM= |
868 |
fi |
fi |
869 |
|
|
870 |
ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` |
ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` |
871 |
|
|
872 |
case $ac_option in |
case $ac_option in |
873 |
|
|
874 |
-help | --help | -h | --h) |
-help | --help | -h | --h) |
881 |
|
|
882 |
-addr | --addr | -a | --a) |
-addr | --addr | -a | --a) |
883 |
ac_prev=ADDRESSES ;; |
ac_prev=ADDRESSES ;; |
884 |
-addr=* | --addr=*) |
-addr=* | --addr=* | -a=* | --a=*) |
885 |
ADDRESSES=$ac_optarg ;; |
ADDRESSES=$ac_optarg ;; |
886 |
-mpackdir | --mpackdir | -mpd | --mpd) |
-mpackdir | --mpackdir | -mpd | --mpd) |
887 |
ac_prev=MPACKDIR ;; |
ac_prev=MPACKDIR ;; |
890 |
|
|
891 |
-tdir | --tdir | -t | --t) |
-tdir | --tdir | -t | --t) |
892 |
ac_prev=TESTDIRS ;; |
ac_prev=TESTDIRS ;; |
893 |
-tdir=* | --tdir=*) |
-tdir=* | --tdir=* | -t=* | --t=*) |
894 |
TESTDIRS=$ac_optarg ;; |
TESTDIRS=$ac_optarg ;; |
895 |
|
|
896 |
-skipdir | --skipdir | -skd | --skd) |
-skipdir | --skipdir | -skd | --skd) |
897 |
ac_prev=SKIPDIRS ;; |
ac_prev=SKIPDIRS ;; |
898 |
-skipdir=* | --skipdir=*) |
-skipdir=* | --skipdir=* | -skd=* | --skd=*) |
899 |
SKIPDIRS=$ac_optarg ;; |
SKIPDIRS=$ac_optarg ;; |
900 |
|
|
901 |
-bash | --bash | -b | --b) |
-bash | --bash | -b | --b) |
902 |
ac_prev=BASH ;; |
ac_prev=BASH ;; |
903 |
-bash=* | --bash=*) |
-bash=* | --bash=* | -b=* | --b=*) |
904 |
BASH=$ac_optarg ;; |
BASH=$ac_optarg ;; |
905 |
|
|
906 |
-command | --command | -c | --c) |
-command | --command | -c | --c) |
907 |
ac_prev=COMMAND ;; |
ac_prev=COMMAND ;; |
908 |
-command=* | --command=*) |
-command=* | --command=* | -c=* | --c=*) |
909 |
COMMAND=$ac_optarg ;; |
COMMAND=$ac_optarg ;; |
910 |
|
|
911 |
|
-makedepend | --makedepend | -md | --md) |
912 |
|
ac_prev=MKDEPEND ;; |
913 |
|
-makedepend=* | --makedepend=* | -md=* | --md=*) |
914 |
|
MKDEPEND=$ac_optarg ;; |
915 |
|
|
916 |
-make | --make | -m | --m) |
-make | --make | -m | --m) |
917 |
ac_prev=MAKE ;; |
ac_prev=MAKE ;; |
918 |
-make=* | --make=*) |
-make=* | --make=* | -m=* | --m=*) |
919 |
MAKE=$ac_optarg ;; |
MAKE=$ac_optarg ;; |
920 |
|
|
921 |
-odir | --odir) |
-odir | --odir) |
931 |
-match | --match ) ac_prev=MATCH_CRIT ;; |
-match | --match ) ac_prev=MATCH_CRIT ;; |
932 |
-match=* | --match=* ) MATCH_CRIT=$ac_optarg ;; |
-match=* | --match=* ) MATCH_CRIT=$ac_optarg ;; |
933 |
|
|
934 |
-j) ac_prev=JOBS ;; |
-j | --j) ac_prev=JOBS ;; |
935 |
-j=*) JOBS=$ac_optarg ;; |
-j=* | --j=*) JOBS=$ac_optarg ;; |
936 |
|
|
937 |
-clean | --clean) |
-clean | --clean) |
938 |
CLEANUP=t ; DELDIR=t ;; |
CLEANUP=t ; DELDIR=t ;; |
939 |
|
|
940 |
|
-norun | --norun | -nr | --nr) |
941 |
|
NORUN=t ;; |
942 |
|
-runonly | --runonly | -ro | --ro) |
943 |
|
QUICK=t ; NOMAKE=t ;; |
944 |
-quick | --quick | -q | --q) |
-quick | --quick | -q | --q) |
945 |
QUICK=t ;; |
QUICK=t ;; |
946 |
-nogenmake | --nogenmake | -ng | --ng) |
-nogenmake | --nogenmake | -ng | --ng) |
971 |
|
|
972 |
-deldir | -dd) DELDIR=t ;; |
-deldir | -dd) DELDIR=t ;; |
973 |
|
|
974 |
-ts) TS=t;; |
-use_r4|-ur4) USE_R4=t ;; |
975 |
|
|
976 |
|
-ts) TS=t;; |
977 |
-papis) PAPIS=t;; |
-papis) PAPIS=t;; |
|
|
|
978 |
-pcls) PCL=t;; |
-pcls) PCL=t;; |
979 |
|
|
980 |
-*) |
-*) |
981 |
echo "Error: unrecognized option: "$ac_option |
echo "Error: unrecognized option: "$ac_option |
982 |
usage |
usage |
983 |
;; |
;; |
984 |
|
|
985 |
*) |
*) |
986 |
echo "Error: unrecognized argument: "$ac_option |
echo "Error: unrecognized argument: "$ac_option |
987 |
usage |
usage |
988 |
;; |
;; |
989 |
|
|
990 |
esac |
esac |
991 |
|
|
992 |
done |
done |
993 |
|
|
994 |
if test "x$QUICK" = xt ; then |
if test "x$QUICK" = xt ; then |
1015 |
EXECUTABLE="mitgcmuv" |
EXECUTABLE="mitgcmuv" |
1016 |
fi |
fi |
1017 |
|
|
1018 |
|
xx=`echo $TESTDIRS | awk '{print $1}'` |
1019 |
if test "x$TESTDIRS" = x ; then |
if test "x$TESTDIRS" = x ; then |
1020 |
LIST=`scandirs results/$ref_outp` |
LIST=`scandirs results/$ref_outp` |
1021 |
|
elif test $xx = 'start_from' ; then |
1022 |
|
xx=`echo $TESTDIRS | awk '{print $2}'` |
1023 |
|
LIST=`scandirs results/$ref_outp | sed -n "/$xx/,$ p"` |
1024 |
else |
else |
1025 |
#- expand group of experiments: |
#- expand group of experiments: |
1026 |
LIST=" " |
LIST=" " |
1035 |
LIST=${LIST}" "`ls | grep 'tutorial_'` ;; |
LIST=${LIST}" "`ls | grep 'tutorial_'` ;; |
1036 |
*) LIST=${LIST}" "$xx ;; |
*) LIST=${LIST}" "$xx ;; |
1037 |
esac |
esac |
1038 |
done |
done |
1039 |
fi |
fi |
1040 |
#echo 'LIST='${LIST}'<' |
#echo 'LIST='${LIST}'<' |
1041 |
#- skip dirs, remove duplicate and non-directory: |
#- skip dirs, remove duplicate and non-directory: |
1056 |
else count=1 ; echo "" ; echo -n " skip: \"$xx\"" |
else count=1 ; echo "" ; echo -n " skip: \"$xx\"" |
1057 |
fi |
fi |
1058 |
fi |
fi |
1059 |
done |
done |
1060 |
if test $count = 1 ; then echo "" ; echo -n " ... " ; fi |
if test $count = 1 ; then echo "" ; echo -n " ... " ; fi |
1061 |
#echo 'TESTDIRS='${TESTDIRS}'<' |
#echo 'TESTDIRS='${TESTDIRS}'<' |
1062 |
|
|
1092 |
fi |
fi |
1093 |
|
|
1094 |
# create the FORTRAN comparison code |
# create the FORTRAN comparison code |
1095 |
createcodelet |
if test -x tr_cmpnum ; then |
1096 |
|
echo "skipping comparison code build" |
1097 |
|
else |
1098 |
|
createcodelet |
1099 |
|
fi |
1100 |
|
|
1101 |
# 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) |
1102 |
if test "x$ADDRESSES" = x ; then |
if test "x$ADDRESSES" = x ; then |
1168 |
echo |
echo |
1169 |
echo >> $SUMMARY |
echo >> $SUMMARY |
1170 |
if test "x$ADM" = x -a "x$OADM" = x; then |
if test "x$ADM" = x -a "x$OADM" = x; then |
1171 |
if [ $MATCH_CRIT -lt 10 ] ; |
if [ $MATCH_CRIT -lt 10 ] ; |
1172 |
then line_0="default "$MATCH_CRIT ; |
then line_0="default "$MATCH_CRIT ; |
1173 |
else line_0="default "$MATCH_CRIT ; fi |
else line_0="default "$MATCH_CRIT ; fi |
1174 |
line_0="$line_0 ----T----- ----S----- ----U----- ----V-----" |
line_0="$line_0 ----T----- ----S----- ----U----- ----V-----" |
|
# line_0=" ----T----- ----S----- ----U----- ----V-----" |
|
1175 |
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" |
1176 |
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 ." |
1177 |
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" |
1192 |
else |
else |
1193 |
echo "ADJOINT=true" >> $SUMMARY |
echo "ADJOINT=true" >> $SUMMARY |
1194 |
echo >> $SUMMARY |
echo >> $SUMMARY |
1195 |
if [ $MATCH_CRIT -lt 10 ] ; |
if [ $MATCH_CRIT -lt 10 ] ; |
1196 |
then line_0="default "$MATCH_CRIT ; |
then line_0="default "$MATCH_CRIT ; |
1197 |
else line_0="default "$MATCH_CRIT ; fi |
else line_0="default "$MATCH_CRIT ; fi |
1198 |
echo "$line_0" | tee -a $SUMMARY |
echo "$line_0" | tee -a $SUMMARY |
1199 |
cat << EOF | tee -a $SUMMARY |
cat << EOF | tee -a $SUMMARY |
1204 |
|
|
1205 |
EOF |
EOF |
1206 |
fi |
fi |
1207 |
|
echo "-------------------------------------------------------------------------------" |
1208 |
|
|
1209 |
# ...and each test directory... |
# ...and each test directory... |
1210 |
for dir in $TESTDIRS ; do |
for dir in $TESTDIRS ; do |
1211 |
|
|
1212 |
# set builddir & rundir: |
# set builddir & rundir: |
1213 |
builddir="build" |
builddir="build" |
1214 |
if test ! -d $dir/$builddir ; then mkdir $dir/$builddir ; fi |
if test ! -d $dir/$builddir ; then mkdir $dir/$builddir ; fi |
1215 |
rundir="run" |
rundir="run" |
1216 |
|
pfxdir="tr_$rundir" |
1217 |
if test ! -d $dir/$rundir ; then |
if test ! -d $dir/$rundir ; then |
1218 |
rundir=$builddir |
rundir=$builddir |
1219 |
fi |
fi |
1222 |
|
|
1223 |
# Cleanup only! |
# Cleanup only! |
1224 |
if test "x$CLEANUP" = xt ; then |
if test "x$CLEANUP" = xt ; then |
1225 |
if test -r $BUILD_DIR/Makefile ; then |
echo -n ' --- dir:' $BUILD_DIR ': ' |
1226 |
echo ' ------ clean dir:' $dir/$builddir |
makeclean $BUILD_DIR |
1227 |
( cd $BUILD_DIR ; make CLEAN ) |
rm -f $BUILD_DIR/$EXECUTABLE |
1228 |
fi |
rm -f $BUILD_DIR/genmake_state $BUILD_DIR/genmake_*optfile |
1229 |
|
rm -f $BUILD_DIR/genmake_warnings $BUILD_DIR/genmake_errors |
1230 |
if test -d $dir/$rundir/CVS ; then |
if test -d $dir/$rundir/CVS ; then |
1231 |
echo ' ------ clean dir:' $dir/$rundir |
echo -n ' --- dir:' $dir/$rundir ': ' |
1232 |
run_clean $dir/$rundir |
run_clean $dir/$rundir |
1233 |
fi |
fi |
1234 |
( |
trdir=`( cd $dir ; find . -type d -name "$pfxdir.*" -print | sed 's/^.\///')` |
1235 |
cd $dir |
ttd=`echo $trdir | wc -w` |
1236 |
rm -rf tr_run.* |
if test $ttd != 0 ; then |
1237 |
) |
echo ' --- rm dir:' $trdir |
1238 |
|
( cd $dir ; rm -rf $trdir ) |
1239 |
|
fi |
1240 |
continue |
continue |
1241 |
fi |
fi |
1242 |
|
|
1243 |
# Verify that the testdir exists and contains previous |
# Verify that the testdir exists and contains previous |
1244 |
# results in the correct location--or skip this directory! |
# results in the correct location--or skip this directory! |
1245 |
fout=$dir"/results/"$ref_outp |
fout=$dir"/results/"$ref_outp |
1246 |
if test ! -r $fout ; then |
if test ! -r $fout ; then |
1258 |
echo "can't find \"$dir/input/eedata.mth\" -- skipping $dir" |
echo "can't find \"$dir/input/eedata.mth\" -- skipping $dir" |
1259 |
continue |
continue |
1260 |
fi |
fi |
1261 |
|
if test "x$MPI" = "xt" -a "x$MULTI_THREAD" = "xt" ; then |
1262 |
|
retv=`check_eedata $CODE_DIR"/SIZE.h_mpi" $dir"/input/eedata.mth"` |
1263 |
|
if test $retv != 0 ; then |
1264 |
|
echo "input/eedata.mth tiling misfit -- skipping $dir" |
1265 |
|
continue |
1266 |
|
fi |
1267 |
|
fi |
1268 |
|
|
1269 |
# Check whether there are "extra runs" for this testdir |
# Check whether there are "extra runs" for this testdir |
1270 |
extra_runs= |
extra_runs= |
1271 |
ex_run_dirs=`( cd $dir ; echo $inputdir.* )` |
if test "x$NORUN" = xf ; then |
1272 |
|
ex_run_dirs=`( cd $dir ; echo $inputdir.* )` |
1273 |
|
fi |
1274 |
#echo "ex_run_dirs='$ex_run_dirs'" |
#echo "ex_run_dirs='$ex_run_dirs'" |
1275 |
for exd in $ex_run_dirs ; do |
for exd in $ex_run_dirs ; do |
1276 |
name=`echo $exd | sed -e "s/$inputdir\.//"` |
name=`echo $exd | sed -e "s/$inputdir\.//"` |
1277 |
refExOut=`echo $ref_outp | sed "s/\./.${name}./"` |
refExOut=`echo $ref_outp | sed "s/\./.${name}./"` |
1278 |
outf="$dir/results/$refExOut" |
outf="$dir/results/$refExOut" |
1279 |
if test -f $outf -a -r $outf ; then |
if test -f $outf -a -r $outf ; then |
1280 |
if test "x$MULTI_THREAD" = "xt" ; then |
if test "x$MULTI_THREAD" = "xt" ; then |
1281 |
if test -r $dir"/"$exd"/eedata.mth" ; then |
if test -r $dir"/"$exd"/eedata.mth" ; then |
1282 |
|
if test "x$MPI" = "xt" ; then |
1283 |
|
retv=`check_eedata $CODE_DIR"/SIZE.h_mpi" $dir"/"$exd"/eedata.mth"` |
1284 |
|
if test $retv = 0 ; then |
1285 |
extra_runs="$extra_runs $name" |
extra_runs="$extra_runs $name" |
1286 |
#else echo $dir"/"$exd"/eedata.mth: not found" |
else |
1287 |
|
echo $exd"/eedata.mth tiling misfit -- skipping $dir" |
1288 |
fi |
fi |
1289 |
else |
else |
1290 |
extra_runs="$extra_runs $name" |
extra_runs="$extra_runs $name" |
1291 |
|
fi |
1292 |
|
#else echo $dir"/"$exd"/eedata.mth: not found" |
1293 |
fi |
fi |
1294 |
|
else |
1295 |
|
extra_runs="$extra_runs $name" |
1296 |
|
fi |
1297 |
fi |
fi |
1298 |
done |
done |
1299 |
|
|
|
echo "-------------------------------------------------------------------------------" |
|
1300 |
echo |
echo |
1301 |
if test "x$extra_runs" = "x" ; then |
if test "x$extra_runs" = "x" ; then |
1302 |
echo "Experiment: $dir" |
echo "Experiment: $dir" |
1303 |
else |
else |
1304 |
echo "Experiment: $dir ; extra_runs=$extra_runs" |
echo "Experiment: $dir ; extra_runs=$extra_runs" |
1308 |
results=$EMPTY_RESULTS |
results=$EMPTY_RESULTS |
1309 |
|
|
1310 |
# Create an output dir for each OPTFILE/tdir combination |
# Create an output dir for each OPTFILE/tdir combination |
1311 |
rel_CDIR=$DRESULTS"/"$dir |
locDIR=$DRESULTS"/"$dir |
1312 |
mkdir $rel_CDIR |
mkdir $locDIR |
1313 |
CDIR=`pwd`"/$rel_CDIR" |
CDIR=`pwd`"/$locDIR" |
1314 |
|
|
1315 |
if test "x$CLEANUP" = xt ; then |
if test "x$NORUN" = xt ; then |
1316 |
echo '====>>> this is to check that we never go through this part <<< ===' |
run=N |
1317 |
makeclean $dir/$builddir \ |
genmakemodel $dir/$builddir && genmake=Y \ |
1318 |
&& run_clean $dir/$rundir |
&& makeclean $dir/$builddir \ |
1319 |
|
&& symlink_mpifiles $dir $code_dir $builddir \ |
1320 |
|
&& makedependmodel $dir/$builddir && makedepend=Y \ |
1321 |
|
&& makemodel $dir/$builddir && make=Y |
1322 |
else |
else |
1323 |
genmakemodel $dir/$builddir && genmake=Y \ |
genmakemodel $dir/$builddir && genmake=Y \ |
1324 |
&& makeclean $dir/$builddir \ |
&& makeclean $dir/$builddir \ |
|
&& run_clean $dir/$rundir \ |
|
1325 |
&& symlink_mpifiles $dir $code_dir $builddir \ |
&& symlink_mpifiles $dir $code_dir $builddir \ |
1326 |
&& makedependmodel $dir/$builddir && makedepend=Y \ |
&& makedependmodel $dir/$builddir && makedepend=Y \ |
1327 |
&& makemodel $dir/$builddir && make=Y \ |
&& makemodel $dir/$builddir && make=Y \ |
1328 |
&& linkdata $dir/$rundir $inputdir input \ |
&& run_clean $dir/$rundir \ |
1329 |
|
&& linkdata $dir/$rundir $inputdir \ |
1330 |
&& runmodel $dir/$rundir && run=Y \ |
&& runmodel $dir/$rundir && run=Y \ |
1331 |
&& results=`testoutput_run $dir $rundir $ref_outp` |
&& results=`testoutput_run $dir $rundir $ref_outp` |
1332 |
fi |
fi |
1333 |
|
#echo "results='$results'" |
1334 |
echo |
|
1335 |
fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` |
fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` |
1336 |
echo |
echo 1>&2 |
1337 |
echo "$fres" | sed 's/ 99/ --/g' | sed 's/ > />/' | sed 's/ < /</' >> $SUMMARY |
echo "$fres" | sed 's/ 99/ --/g' | sed 's/ > />/' | sed 's/ < /</' >> $SUMMARY |
1338 |
touch $CDIR"/summary.txt" |
touch $locDIR"/summary.txt" |
1339 |
echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $CDIR"/summary.txt" |
echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt" |
1340 |
echo "MACH='$MACH'" >> $CDIR"/summary.txt" |
echo "MACH='$MACH'" >> $locDIR"/summary.txt" |
1341 |
echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt" |
echo "UNAMEA='$UNAMEA'" >> $locDIR"/summary.txt" |
1342 |
echo "DATE='$DATE'" >> $CDIR"/summary.txt" |
echo "DATE='$DATE'" >> $locDIR"/summary.txt" |
1343 |
echo "tdir='$dir'" >> $CDIR"/summary.txt" |
echo "tdir='$dir'" >> $locDIR"/summary.txt" |
1344 |
if test "x$ADM" = xt ; then |
if test "x$ADM" = xt ; then |
1345 |
head -1 $dir/$builddir/taf_ad.log >> $CDIR"/summary.txt" |
head -1 $dir/$builddir/taf_ad.log >> $locDIR"/summary.txt" |
1346 |
grep -A3 'Seconds in section "ALL' $dir/$rundir/$OUTPUTFILE \ |
grep -A3 'Seconds in section "ALL' $dir/$rundir/$OUTPUTFILE \ |
1347 |
>> $CDIR"/summary.txt" |
>> $locDIR"/summary.txt" |
1348 |
fi |
fi |
1349 |
|
|
1350 |
for ex in $extra_runs ; do |
for ex in $extra_runs ; do |
1353 |
# reference output file |
# reference output file |
1354 |
refExOut=`echo $ref_outp | sed "s/\./.${ex}./g"` |
refExOut=`echo $ref_outp | sed "s/\./.${ex}./g"` |
1355 |
# Create an output dir for each OPTFILE/tdir.ex combination |
# Create an output dir for each OPTFILE/tdir.ex combination |
1356 |
rel_CDIR=$DRESULTS"/"$dir"."$ex |
locDIR=$DRESULTS"/"$dir"."$ex |
1357 |
mkdir $rel_CDIR |
mkdir $locDIR |
1358 |
CDIR=`pwd`"/$rel_CDIR" |
CDIR=`pwd`"/$locDIR" |
1359 |
test ! -e "$dir/tr_run.$ex" && mkdir "$dir/tr_run.$ex" |
test ! -e "$dir/$pfxdir.$ex" && mkdir "$dir/$pfxdir.$ex" |
1360 |
run_clean $dir/tr_run.$ex |
run_clean $dir/$pfxdir.$ex |
1361 |
linkdata $dir/tr_run.$ex $inputdir.$ex $inputdir input |
linkdata $dir/$pfxdir.$ex $inputdir.$ex $inputdir |
1362 |
runmodel $dir/tr_run.$ex && run=Y \ |
runmodel $dir/$pfxdir.$ex && run=Y \ |
1363 |
&& results=`testoutput_run $dir tr_run.$ex $refExOut` |
&& results=`testoutput_run $dir $pfxdir.$ex $refExOut` |
1364 |
fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` |
fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` |
1365 |
fres="$fres.$ex" |
fres="$fres.$ex" |
1366 |
echo |
echo 1>&2 |
1367 |
echo "$fres" | sed 's/ 99/ --/g' | sed 's/ > />/' | sed 's/ < /</' >> $SUMMARY |
echo "$fres" | sed 's/ 99/ --/g' | sed 's/ > />/' | sed 's/ < /</' >> $SUMMARY |
1368 |
touch $CDIR"/summary.txt" |
touch $locDIR"/summary.txt" |
1369 |
echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $CDIR"/summary.txt" |
echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt" |
1370 |
echo "MACH='$MACH'" >> $CDIR"/summary.txt" |
echo "MACH='$MACH'" >> $locDIR"/summary.txt" |
1371 |
echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt" |
echo "UNAMEA='$UNAMEA'" >> $locDIR"/summary.txt" |
1372 |
echo "DATE='$DATE'" >> $CDIR"/summary.txt" |
echo "DATE='$DATE'" >> $locDIR"/summary.txt" |
1373 |
echo "tdir='$dir.$ex'" >> $CDIR"/summary.txt" |
echo "tdir='$dir.$ex'" >> $locDIR"/summary.txt" |
1374 |
if test "x$ADM" = xt ; then |
if test "x$ADM" = xt ; then |
1375 |
head -1 $dir/$builddir/taf_ad.log >> $CDIR"/summary.txt" |
head -1 $dir/$builddir/taf_ad.log >> $locDIR"/summary.txt" |
1376 |
grep -A3 'Seconds in section "ALL' $dir/tr_run.$ex/$OUTPUTFILE \ |
grep -A3 'Seconds in section "ALL' $dir/$pfxdir.$ex/$OUTPUTFILE \ |
1377 |
>> $CDIR"/summary.txt" |
>> $locDIR"/summary.txt" |
1378 |
fi |
fi |
1379 |
if test "x$POSTCLEAN" = xt ; then |
if test "x$POSTCLEAN" = xt ; then |
1380 |
run_clean $dir/tr_run.$ex |
run_clean $dir/$pfxdir.$ex |
1381 |
fi |
fi |
1382 |
done |
done |
1383 |
|
|
1384 |
|
if test -f $DRESULTS"/"genmake_state ; then : ; else |
1385 |
|
if test -f $dir/$builddir/Makefile ; then |
1386 |
|
mkOpt=`grep '^# OPTFILE=' $dir/$builddir/Makefile 2>/dev/null | head -1 | sed 's/^# //'` |
1387 |
|
echo "from '$dir/$builddir/Makefile', extract:" > $DRESULTS/genmake_state |
1388 |
|
sed -n '/^# executed by:/,+1 p' $dir/$builddir/Makefile >> $DRESULTS/genmake_state |
1389 |
|
echo $mkOpt >> $DRESULTS/genmake_state |
1390 |
|
fi |
1391 |
|
fi |
1392 |
#postclean $dir/$builddir |
#postclean $dir/$builddir |
1393 |
if test "x$POSTCLEAN" = xt ; then |
if test "x$POSTCLEAN" = xt ; then |
1394 |
makeclean $dir/$builddir \ |
makeclean $dir/$builddir \ |
1395 |
&& run_clean $dir/$rundir |
&& run_clean $dir/$rundir |
1396 |
fi |
fi |
1397 |
|
|
1398 |
echo "-------------------------------------------------------------------------------" |
echo "-------------------------------------------------------------------------------" |
1399 |
|
|
1400 |
done |
done |
1401 |
|
|
1402 |
printf "Start time: " >> $SUMMARY |
printf "Start time: " >> $SUMMARY |
1425 |
echo "An email containing results was sent to the following addresses:" |
echo "An email containing results was sent to the following addresses:" |
1426 |
echo " \"$ADDRESSES\"" |
echo " \"$ADDRESSES\"" |
1427 |
echo |
echo |
1428 |
|
test -f $DRESULTS".tar" && rm -f $DRESULTS".tar" |
1429 |
|
test -f $DRESULTS".tar.gz" && rm -f $DRESULTS".tar.gz" |
1430 |
fi |
fi |
|
test -f $DRESULTS".tar" && rm -f $DRESULTS".tar" |
|
|
test -f $DRESULTS".tar.gz" && rm -f $DRESULTS".tar.gz" |
|
1431 |
fi |
fi |
1432 |
fi |
fi |
1433 |
|
|
1434 |
rm -f tr_cmpnum.c tr_cmpnum |
if test "x$QUICK" = xf -a "x$NORUN" = xf ; then |
1435 |
|
rm -f tr_cmpnum.c tr_cmpnum |
1436 |
|
fi |
1437 |
|
|
1438 |
if test "x$CLEANUP" != xt ; then |
if test "x$CLEANUP" != xt ; then |
1439 |
cat $SUMMARY | sed 's/ \. \. \. \. \. \. \. \. \. \. \. \. //' |
cat $SUMMARY | sed 's/ \. \. \. \. \. \. \. \. \. \. \. \. //' |