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 " (DEF=\"-ieee\")" |
echo " (-mfile|-mf) STRING MPI: file with list of possible machines to run on" |
18 |
|
echo " (-fast) use optfile default for compiler flags (no '-ieee')" |
19 |
|
echo " DEF=off => use IEEE numerics option (if available)" |
20 |
|
echo " (-devel) use optfile developement flags (if available)" |
21 |
echo " (-gsl) compile with \"-gsl\" flag" |
echo " (-gsl) compile with \"-gsl\" flag" |
22 |
echo " (-use_r4|-ur4) if allowed, use real*4 type for '_RS' variable" |
echo " (-use_r4|-ur4) if allowed, use real*4 type for '_RS' variable" |
23 |
echo " (-optfile|-of) STRING list of optfiles to use" |
echo " (-optfile|-of) STRING list of optfiles to use" |
28 |
echo " (-tdir|-t) STRING list of group and/or exp. dirs to test" |
echo " (-tdir|-t) STRING list of group and/or exp. dirs to test" |
29 |
echo " (recognized groups: basic, tutorials)" |
echo " (recognized groups: basic, tutorials)" |
30 |
echo " (DEF=\"\" which test all)" |
echo " (DEF=\"\" which test all)" |
31 |
|
echo " (if list= 'start_from THIS_EXP' then" |
32 |
|
echo " test THIS_EXP + all the following)" |
33 |
echo " (-skipdir|-skd) STRING list of exp. dirs to skip" |
echo " (-skipdir|-skd) STRING list of exp. dirs to skip" |
34 |
echo " (DEF=\"\" which test all)" |
echo " (DEF=\"\" which test all)" |
35 |
echo " (-bash|-b) STRING preferred location of a \"bash\" or" |
echo " (-bash|-b) STRING preferred location of a \"bash\" or" |
38 |
echo " (-adm|-ad) perform an adjoint run" |
echo " (-adm|-ad) perform an adjoint run" |
39 |
echo " (-oad) perform an OpenAD adjoint run" |
echo " (-oad) perform an OpenAD adjoint run" |
40 |
echo " (-command|-c) STRING command to run" |
echo " (-command|-c) STRING command to run" |
41 |
|
echo " (-makedepend|-md) STRING command to use for \"makedepend\"" |
42 |
echo " (-make|-m) STRING command to use for \"make\"" |
echo " (-make|-m) STRING command to use for \"make\"" |
43 |
echo " (DEF=\"make\")" |
echo " (DEF=\"make\")" |
44 |
echo " (-odir) STRING used to build output directory name" |
echo " (-odir) STRING used to build output directory name" |
45 |
echo " (DEF=\"hostname\")" |
echo " (DEF=\"hostname\")" |
46 |
echo " (-ptracers|-ptr) STRING specify which ptracers to test" |
# echo " (-ptracers|-ptr) STRING specify which ptracers to test" |
47 |
echo " (DEF=\"1 2 3 4 5\")" |
# echo " (DEF=\"1 2 3 4 5\")" |
48 |
echo " (-match) NUMBER Matching Criteria (number of digits)" |
echo " (-match) NUMBER Matching Criteria (number of digits)" |
49 |
echo " (DEF=\"12\")" |
echo " (DEF=\"$MATCH_CRIT\")" |
50 |
echo " (-j) JOBS use \"make -j JOBS\" for parallel builds" |
echo " (-j) JOBS use \"make -j JOBS\" for parallel builds" |
51 |
echo " (-clean) *ONLY* run \"make CLEAN\"" |
echo " (-ef) STRING used as genmake2 \"-extra_flag\" argument" |
52 |
|
echo " (-clean) *ONLY* run \"make CLEAN\" & clean run-dir" |
53 |
echo " (-norun|-nr) skip the \"runmodel\" stage (stop after make)" |
echo " (-norun|-nr) skip the \"runmodel\" stage (stop after make)" |
54 |
|
echo " (-obj) only produces objects (=norun & no executable)" |
55 |
echo " (-runonly|-ro) *ONLY* run stage (=\"-quick\" without make)" |
echo " (-runonly|-ro) *ONLY* run stage (=\"-quick\" without make)" |
56 |
echo " (-quick|-q) same as \"-nogenmake -noclean -nodepend\"" |
echo " (-quick|-q) same as \"-nogenmake -noclean -nodepend\"" |
57 |
echo " (-nogenmake|-ng) skip the genmake stage" |
echo " (-nogenmake|-ng) skip the genmake stage" |
58 |
echo " (-noclean|-nc) skip the \"make clean\" stage" |
echo " (-noclean|-nc) skip the \"make clean\" stage" |
59 |
echo " (-nodepend|-nd) skip the \"make depend\" stage" |
echo " (-nodepend|-nd) skip the \"make depend\" stage" |
60 |
|
echo " (-postclean|-pc) after each exp. test, clean build-dir & run-dir" |
61 |
|
echo " (-deloutp|-do) delete output files after successful run" |
62 |
echo " (-deldir|-dd) on success, delete the output directory" |
echo " (-deldir|-dd) on success, delete the output directory" |
63 |
echo " (-ts) provide timing information per timestep" |
echo " (-ts) provide timing information per timestep" |
64 |
echo " (-papis) provide MFlop/s per timestep using PAPI" |
echo " (-papis) provide MFlop/s per timestep using PAPI" |
241 |
listVar=" $sVar "`echo "$listVar " | sed "s/ $sVar / /g"` |
listVar=" $sVar "`echo "$listVar " | sed "s/ $sVar / /g"` |
242 |
fi |
fi |
243 |
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 |
244 |
echo "listVar='$listVar'" > $CDIR"/summary.txt" |
echo "listVar='$listVar'" >> $locDIR"/summary.txt" |
245 |
|
#--- |
246 |
allargs="" |
allargs="" |
247 |
for xx in $listVar |
for xx in $listVar |
248 |
do |
do |
251 |
then echo testoutput_run: testoutput_var $1 cg2d_init_res 1>&2 ; fi |
then echo testoutput_run: testoutput_var $1 cg2d_init_res 1>&2 ; fi |
252 |
testoutput_var $1 "cg2d_init_res" "Press. Solver (cg2d)" $2 $3; yy=$? |
testoutput_var $1 "cg2d_init_res" "Press. Solver (cg2d)" $2 $3; yy=$? |
253 |
if [ $debug -gt 0 ] ; then echo testoutput_run: cg2dres=$yy 1>&2 ; fi ;; |
if [ $debug -gt 0 ] ; then echo testoutput_run: cg2dres=$yy 1>&2 ; fi ;; |
254 |
'Cost') testoutput_var $1 "ADM precision_derivative_cost" "ADM Cost" $2 $3; yy=$? ;; |
'Cost') testoutput_var $1 "ADM ref_cost_function" "ADM CostFct" $2 $3; yy=$? ;; |
255 |
'Grad') testoutput_var $1 "ADM precision_derivative_grad" "ADM Grad" $2 $3; yy=$? ;; |
'AdGrd') testoutput_var $1 "ADM adjoint_gradient" "ADM Ad Grad" $2 $3; yy=$? ;; |
256 |
|
'FDGrd') testoutput_var $1 "ADM finite-diff_grad" "ADM FD Grad" $2 $3; yy=$? ;; |
257 |
'Tmn') testoutput_var $1 "dynstat_theta_min" "Theta minimum" $2 $3; yy=$? ;; |
'Tmn') testoutput_var $1 "dynstat_theta_min" "Theta minimum" $2 $3; yy=$? ;; |
258 |
'Tmx') testoutput_var $1 "dynstat_theta_max" "Theta maximum" $2 $3; yy=$? ;; |
'Tmx') testoutput_var $1 "dynstat_theta_max" "Theta maximum" $2 $3; yy=$? ;; |
259 |
'Tav') testoutput_var $1 "dynstat_theta_mean" "Theta mean" $2 $3; yy=$? ;; |
'Tav') testoutput_var $1 "dynstat_theta_mean" "Theta mean" $2 $3; yy=$? ;; |
290 |
'hSImx') testoutput_var $1 "seaice_heff_max" "SIce Heff max" $2 $3; yy=$? ;; |
'hSImx') testoutput_var $1 "seaice_heff_max" "SIce Heff max" $2 $3; yy=$? ;; |
291 |
'hSIav') testoutput_var $1 "seaice_heff_mean" "SIce Heff mean" $2 $3; yy=$? ;; |
'hSIav') testoutput_var $1 "seaice_heff_mean" "SIce Heff mean" $2 $3; yy=$? ;; |
292 |
'hSIsd') testoutput_var $1 "seaice_heff_sd" "SIce Heff StDv" $2 $3; yy=$? ;; |
'hSIsd') testoutput_var $1 "seaice_heff_sd" "SIce Heff StDv" $2 $3; yy=$? ;; |
293 |
|
'uSImn') testoutput_var $1 "seaice_uice_min" "SIce Uice min" $2 $3; yy=$? ;; |
294 |
|
'uSImx') testoutput_var $1 "seaice_uice_max" "SIce Uice max" $2 $3; yy=$? ;; |
295 |
|
'uSIav') testoutput_var $1 "seaice_uice_mean" "SIce Uice mean" $2 $3; yy=$? ;; |
296 |
|
'uSIsd') testoutput_var $1 "seaice_uice_sd" "SIce Uice StDv" $2 $3; yy=$? ;; |
297 |
|
'vSImn') testoutput_var $1 "seaice_vice_min" "SIce Vice min" $2 $3; yy=$? ;; |
298 |
|
'vSImx') testoutput_var $1 "seaice_vice_max" "SIce Vice max" $2 $3; yy=$? ;; |
299 |
|
'vSIav') testoutput_var $1 "seaice_vice_mean" "SIce Vice mean" $2 $3; yy=$? ;; |
300 |
|
'vSIsd') testoutput_var $1 "seaice_vice_sd" "SIce Vice StDv" $2 $3; yy=$? ;; |
301 |
'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=$? ;; |
302 |
'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=$? ;; |
303 |
'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=$? ;; |
337 |
( |
( |
338 |
cd $1; |
cd $1; |
339 |
command="$GENMAKE2 -ds -m $MAKE" |
command="$GENMAKE2 -ds -m $MAKE" |
340 |
|
if test "x$MKDEPEND" != x ; then |
341 |
|
command="$command -makedepend=$MKDEPEND" |
342 |
|
fi |
343 |
if test "x$ADM" = xt ; then |
if test "x$ADM" = xt ; then |
344 |
command="$command --mods=../code_ad" |
command="$command --mods=../code_ad" |
345 |
elif test "x$OADM" = xt ; then |
elif test "x$OADM" = xt ; then |
350 |
if test "x$OPTFILE" != xNONE ; then |
if test "x$OPTFILE" != xNONE ; then |
351 |
command="$command -optfile=$OPTFILE" |
command="$command -optfile=$OPTFILE" |
352 |
fi |
fi |
353 |
if test "x$IEEE" != x ; then |
if test $OptLev = 1 ; then |
354 |
command="$command -ieee" |
command="$command -ieee" |
355 |
|
fi |
356 |
|
if test $OptLev = 0 ; then |
357 |
|
command="$command -devel" |
358 |
fi |
fi |
359 |
if test "x$GSL" = xt ; then |
if test "x$GSL" = xt ; then |
360 |
command="$command -gsl" |
command="$command -gsl" |
361 |
fi |
fi |
362 |
if test "x$MPI" = xt ; then |
if test "x$MPI" != x0 ; then |
363 |
command="$command -mpi" |
command="$command -mpi" |
364 |
fi |
fi |
365 |
if test "x$MULTI_THREAD" = xt ; then |
if test "x$MULTI_THREAD" = xt ; then |
369 |
if test "x$USE_R4" = xt ; then |
if test "x$USE_R4" = xt ; then |
370 |
command="$command -use_r4" |
command="$command -use_r4" |
371 |
fi |
fi |
372 |
|
if test "x$EXTRFLG" != x ; then |
373 |
|
command="$command -extra_flag $EXTRFLG" |
374 |
|
fi |
375 |
if test "x$TS" = xt ; then |
if test "x$TS" = xt ; then |
376 |
command="$command -ts" |
command="$command -ts" |
377 |
fi |
fi |
382 |
command="$command -pcls" |
command="$command -pcls" |
383 |
fi |
fi |
384 |
fi |
fi |
385 |
printf 'genmake ... ' 1>&2 |
printf 'genmake ... ' |
386 |
# $command > make.log 2>&1 |
eval $command > genmake.tr_log 2>&1 |
|
eval $command > make.log 2>&1 |
|
387 |
RETVAL=$? |
RETVAL=$? |
388 |
# Reduce the size of the testing emails! |
# Reduce the size of the testing emails! |
389 |
head -100 Makefile > $CDIR/Makefile_head |
head -100 Makefile > $CDIR/Makefile_head |
390 |
if test "x$RETVAL" != x0 ; then |
if test "x$RETVAL" != x0 ; then |
391 |
tail make.log |
tail genmake.tr_log |
392 |
echo "genmakemodel: genmake failed" 1>&2 |
echo "genmakemodel: genmake failed" |
393 |
cp genmake_* make.log $CDIR |
cp genmake.log genmake_* genmake.tr_log $CDIR |
394 |
return 1 |
return 1 |
395 |
else |
else |
396 |
echo "successful" 1>&2 |
echo "successful" |
397 |
fi |
fi |
398 |
) |
) |
399 |
fi |
fi |
402 |
makeclean() |
makeclean() |
403 |
{ |
{ |
404 |
# makeclean directory |
# makeclean directory |
405 |
|
if test "x$NODEPEND" = xf ; then rm -f $1/make.tr_log ; fi |
406 |
if test "x$NOCLEAN" = xt ; then |
if test "x$NOCLEAN" = xt ; then |
407 |
echo "make Clean skipped!" |
echo "make Clean skipped!" |
408 |
else |
else |
410 |
cd $1; |
cd $1; |
411 |
#if test -e $OUTPUTFILE ; then rm -f $OUTPUTFILE ; fi |
#if test -e $OUTPUTFILE ; then rm -f $OUTPUTFILE ; fi |
412 |
if test -r Makefile ; then |
if test -r Makefile ; then |
413 |
printf 'clean build-dir: make Clean ... ' 2>&1 |
printf 'clean build-dir: make Clean ... ' |
414 |
$MAKE Clean >> make.log 2>&1 |
$MAKE Clean >> make.tr_log 2>&1 |
415 |
RETVAL=$? |
RETVAL=$? |
416 |
if test "x$RETVAL" != x0 ; then |
if test "x$RETVAL" != x0 ; then |
417 |
tail make.log |
tail make.tr_log |
418 |
echo "makeclean: \"make Clean\" failed" 1>&2 |
echo "makeclean: \"make Clean\" failed" |
419 |
cp make.log $CDIR"/make.log" |
cp make.tr_log genmake.log genmake.tr_log $CDIR |
420 |
return 1 |
return 1 |
421 |
fi |
fi |
422 |
echo successful 1>&2 |
echo successful |
423 |
else |
else |
424 |
echo '' |
echo '' |
425 |
fi |
fi |
436 |
else |
else |
437 |
( |
( |
438 |
cd $1; |
cd $1; |
439 |
printf 'clean run-dir ... ' 2>&1 |
printf 'clean run-dir ... ' |
440 |
# part of what is done after "make clean" when doing "make CLEAN" |
# part of what is done after "make clean" when doing "make CLEAN" |
441 |
find . -name "*.meta" -exec rm {} \; |
find . -name "*.meta" -exec rm {} \; |
442 |
find . -name "*.data" -exec rm {} \; |
find . -name "*.data" -exec rm {} \; |
443 |
find . -name "fort.*" -exec rm {} \; |
find . -name "fort.*" -exec rm {} \; |
444 |
find . -type l -exec rm {} \; |
find . -type l -exec rm {} \; |
445 |
rm -f $EXECUTABLE *.txt STD* *diagnostics.log datetime |
#- should remove executable only if sym-link (alredy done above) |
446 |
|
rm -f $RUNLOG *.txt STD* *diagnostics.log datetime |
447 |
rm -rf mnc_test_* |
rm -rf mnc_test_* |
448 |
rm -f *_MIT_CE_000.opt0000 costfunction*0000 |
rm -f *_MIT_CE_000.opt0000 costfunction*0000 |
449 |
echo successful 1>&2 |
echo successful |
450 |
exit 0 |
exit 0 |
451 |
) |
) |
452 |
fi |
fi |
460 |
else |
else |
461 |
( |
( |
462 |
cd $1; |
cd $1; |
463 |
printf 'make depend ... ' 1>&2 |
printf 'make depend ... ' |
464 |
$MAKE depend >> make.log 2>&1 |
$MAKE depend >> make.tr_log 2>&1 |
465 |
RETVAL=$? |
RETVAL=$? |
466 |
if test "x$RETVAL" != x0 ; then |
if test "x$RETVAL" != x0 ; then |
467 |
tail make.log |
tail make.tr_log |
468 |
echo "makedependmodel: make depend failed" 1>&2 |
echo "makedependmodel: make depend failed" |
469 |
cp make.log $CDIR"/make.log" |
cp make.tr_log genmake.log genmake.tr_log $CDIR |
470 |
return 1 |
return 1 |
471 |
else |
else |
472 |
echo successful 1>&2 |
echo successful |
473 |
fi |
fi |
474 |
) |
) |
475 |
fi |
fi |
479 |
{ |
{ |
480 |
# makemodel directory |
# makemodel directory |
481 |
( |
( |
482 |
|
mk_fail=0 |
483 |
if test "x$NOMAKE" = xt ; then |
if test "x$NOMAKE" = xt ; then |
484 |
cd $1; |
cd $1; |
485 |
if test -x $EXECUTABLE ; then |
if test -x $EXECUTABLE ; then |
486 |
echo "make skipped!" |
echo "make skipped!" |
487 |
else |
else |
488 |
echo "no executable!" |
echo "no executable!" |
489 |
return 2 |
mk_fail=3 |
490 |
fi |
fi |
491 |
else |
else |
492 |
cd $1; |
cd $1; |
493 |
if test -r Makefile ; then |
if test -r Makefile ; then |
494 |
printf 'make ... ' 1>&2 |
printf 'make ... ' |
495 |
if test "x$ADM" = xt ; then |
if test "x$REPLMAKE" = x ; then |
496 |
$MAKE adall >> make.log 2>&1 |
$MAKE $TARG >> make.tr_log 2>&1 |
497 |
elif test "x$OADM" = xt ; then |
else |
498 |
$MAKE adAll >> make.log 2>&1 |
$REPLMAKE $TARG >> make.tr_log 2>&1 |
|
else |
|
|
if test "x$JOBS" = x ; then |
|
|
$MAKE >> make.log 2>&1 |
|
|
else |
|
|
$MAKE -j $JOBS >> make.log 2>&1 |
|
|
fi |
|
499 |
fi |
fi |
500 |
RETVAL=$? |
RETVAL=$? |
501 |
if test "x$RETVAL" != x0 ; then |
if test "x$RETVAL" != x0 ; then |
502 |
tail make.log |
tail make.tr_log |
503 |
echo failed 1>&2 |
echo failed |
504 |
cp make.log $CDIR"/make.log" |
cp genmake.log genmake.tr_log $CDIR |
505 |
|
tail -$NBLINES_MKLOG make.tr_log > $CDIR"/make.tr_log_tail" |
506 |
rm -f $EXECUTABLE |
rm -f $EXECUTABLE |
507 |
return 1 |
mk_fail=1 |
508 |
else |
else |
509 |
echo successful 1>&2 |
echo successful |
510 |
fi |
fi |
511 |
|
else |
512 |
|
echo "no Makefile !" |
513 |
|
mk_fail=2 |
514 |
fi |
fi |
515 |
fi |
fi |
516 |
|
if test "x$ADM" = xt -a -f taf_ad.log ; then |
517 |
|
head -1 taf_ad.log >> $CDIR"/summary.txt" |
518 |
|
nerr=`grep -c 'TAF *.* ERROR ' taf_ad.log` |
519 |
|
nwar=`grep -c 'TAF RECOMPUTATION *.* WARNING ' taf_ad.log` |
520 |
|
echo " TAF reports $nerr Errors and $nwar Recomputation Warnings" \ |
521 |
|
>> $CDIR"/summary.txt" |
522 |
|
fi |
523 |
|
if test $mk_fail != 0 ; then return $mk_fail ; fi |
524 |
) |
) |
525 |
} |
} |
526 |
|
|
527 |
|
mk_mpi_size() |
528 |
|
{ |
529 |
|
# mk_mpi_size input_file output_file proc_Nb prefer_to_split_X |
530 |
|
# |
531 |
|
# make new SIZE.h (=output_file) from SIZE.h_mpi (=input_file) |
532 |
|
# for an MPI build with no more than proc_Nb processors ; |
533 |
|
# return the effective number of processors. |
534 |
|
|
535 |
|
inp=$1 |
536 |
|
out=$2 |
537 |
|
np=$3 |
538 |
|
dirX=$4 |
539 |
|
tmp=TTT.$$ |
540 |
|
|
541 |
|
px=`grep "^ & *nPx *=" $inp | sed "s/^ & *nPx *= *//" | sed 's/, *$//'` |
542 |
|
py=`grep "^ & *nPy *=" $inp | sed "s/^ & *nPy *= *//" | sed 's/, *$//'` |
543 |
|
sx=`grep "^ & *nSx *=" $inp | sed "s/^ & *nSx *= *//" | sed 's/, *$//'` |
544 |
|
sy=`grep "^ & *nSy *=" $inp | sed "s/^ & *nSy *= *//" | sed 's/, *$//'` |
545 |
|
|
546 |
|
#- find the largest divisor of input_file proc Nb, but not larger than $np |
547 |
|
pp=0 |
548 |
|
i=1 |
549 |
|
while [ $i -le $px ] ; do |
550 |
|
if [ `expr $px % $i` -eq 0 ] ; then |
551 |
|
j=1 |
552 |
|
while [ $j -le $py ] ; do |
553 |
|
if [ `expr $py % $j` -eq 0 ] ; then |
554 |
|
ij=`expr $i \* $j` |
555 |
|
if [ $ij -gt $pp ] ; then |
556 |
|
flag=1 |
557 |
|
elif [ $ij -eq $pp ] ; then |
558 |
|
flag=$dirX |
559 |
|
else |
560 |
|
flag=0 |
561 |
|
fi |
562 |
|
if test $flag = 1 ; then |
563 |
|
if [ $ij -le $np ] ; then |
564 |
|
ix=$i ; jy=$j ; pp=$ij |
565 |
|
#echo " ix,jy= $ix,$jy" |
566 |
|
fi |
567 |
|
fi |
568 |
|
fi |
569 |
|
j=`expr $j + 1` |
570 |
|
done |
571 |
|
fi |
572 |
|
i=`expr $i + 1` |
573 |
|
done |
574 |
|
|
575 |
|
#- create new SIZE.h type file: |
576 |
|
sx=`expr $sx \* $px / $ix` |
577 |
|
sy=`expr $sy \* $py / $jy` |
578 |
|
if [ $verbose -gt 1 ]; then |
579 |
|
echo " px,py,np= $px,$py,$np : New MPI size: px,py= $ix,$jy : sx,sy= $sx,$sy" |
580 |
|
fi |
581 |
|
sed "/^ \& *nPx *=/s/[0-9]*,/$ix,/" $inp > $tmp |
582 |
|
sed "/^ \& *nPy *=/s/[0-9]*,/$jy,/" $tmp > $out |
583 |
|
sed "/^ \& *nSx *=/s/[0-9]*,/$sx,/" $out > $tmp |
584 |
|
sed "/^ \& *nSy *=/s/[0-9]*,/$sy,/" $tmp > $out |
585 |
|
rm -f $tmp |
586 |
|
return $pp |
587 |
|
} |
588 |
|
|
589 |
symlink_mpifiles() |
symlink_mpifiles() |
590 |
{ |
{ |
591 |
# Put special links so that MPI specific files are used |
# Put special links so that MPI specific files are used |
594 |
|
|
595 |
dir=$1 |
dir=$1 |
596 |
code_dir=$2 |
code_dir=$2 |
597 |
BUILD_DIR=$dir/$3 |
build_dir=$dir/$3 |
|
CODE_DIR=$dir/$code_dir |
|
598 |
|
|
599 |
# These are files that should replace their counter-part when using -mpi |
# These are files that should replace their counter-part when using -mpi |
600 |
MPI_FILES=`(cd $CODE_DIR; find . -name "*_mpi" -print)` |
MPI_FILES=`(cd $dir/$code_dir; find . -name "*_mpi" -print)` |
601 |
|
|
602 |
# Is this an MPI run? |
for ii in $MPI_FILES ; do |
603 |
if test "x$MPI" = xt ; then |
i=`echo $ii | sed 's:^\./::'` |
604 |
# YES: We symbolically link these files to the build |
name=`echo $i | sed 's:_mpi::'` |
605 |
# dir so long as there is no real file in place |
file="../$code_dir/$i" |
606 |
for ii in $MPI_FILES ; do |
if test $name = 'SIZE.h' ; then file="SIZE.h.mpi" ; fi |
607 |
i=`echo $ii | sed 's:^\./::'` |
|
608 |
name=`echo $i | sed 's:_mpi::' ` |
# Is this an MPI run? |
609 |
cmp $CODE_DIR/$i $BUILD_DIR/$name > /dev/null 2>&1 |
if test "x$MPI" = x0 ; then |
610 |
RETVAL=$? |
# NO: We undo any _mpi symbolically linked files |
611 |
if test "x$RETVAL" != x0 ; then |
if test -L $build_dir/$name ; then |
612 |
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 |
|
613 |
RETVAL=$? |
RETVAL=$? |
614 |
if test "x$RETVAL" = x0 ; then |
if test "x$RETVAL" = x0 ; then |
615 |
#echo Un-linking $name from $linktarg |
if [ $verbose -gt 1 ]; then |
616 |
rm -f $BUILD_DIR/$name |
echo " Un-linking $name from ../$code_dir" ; fi |
617 |
|
rm -f $build_dir/$name |
618 |
fi |
fi |
619 |
fi |
fi |
620 |
done |
else |
621 |
fi |
# YES: We symbolically link these files to the build |
622 |
|
# dir so long as there is no real file in place |
623 |
|
( cd $build_dir ; cmp $name $file > /dev/null 2>&1 ) |
624 |
|
RETVAL=$? |
625 |
|
if [ $verbose -gt 1 ]; then echo " cmp $name $file returns: $RETVAL" ; fi |
626 |
|
if test "x$RETVAL" != x0 ; then |
627 |
|
if test -h $build_dir/$name ; then rm -f $build_dir/$name ; fi |
628 |
|
if test ! -r $build_dir/$name ; then |
629 |
|
if [ $verbose -gt 1 ]; then echo " Linking $name to $file" ; fi |
630 |
|
(cd $build_dir; ln -sf $file $name) |
631 |
|
fi |
632 |
|
fi |
633 |
|
fi |
634 |
|
done |
635 |
} |
} |
636 |
|
|
637 |
linkdata() |
linkdata() |
642 |
if test -d $1 ; then |
if test -d $1 ; then |
643 |
( |
( |
644 |
cd $1 ; shift |
cd $1 ; shift |
645 |
|
echo 'linkdata from dirs:' $* |
646 |
inpMPI=`(cd ../$1 ; find . -name "*.mpi" -print | sed 's:^\./::')` |
inpMPI=`(cd ../$1 ; find . -name "*.mpi" -print | sed 's:^\./::')` |
647 |
for xx in $inpMPI ; do |
for xx in $inpMPI ; do |
648 |
if test -r "../"$1"/"$xx ; then |
if test -r "../"$1"/"$xx ; then |
649 |
# found 1 _mpi sfx file in 1rst input dir and it is readable |
# found 1 _mpi sfx file in 1rst input dir and it is readable |
650 |
yy=`echo $xx | sed 's:\.mpi$::'` |
yy=`echo $xx | sed 's:\.mpi$::'` |
651 |
if test "x$MPI" = "xt" ; then |
if test "x$MPI" = "x0" ; then |
652 |
# mpi test: remove symbolic link & link _mpi sfx file |
# not mpi test: remove symbolic link |
653 |
|
if test -h $yy ; then rm -f $yy ; fi |
654 |
|
else |
655 |
|
# mpi test: remove symbolic link & link .mpi sfx file |
656 |
if test -h $yy ; then rm -f $yy ; fi |
if test -h $yy ; then rm -f $yy ; fi |
657 |
if test ! -r $yy ; then |
if test ! -r $yy ; then |
658 |
ln -sf "../"$1"/"$xx $yy ; |
ln -sf "../"$1"/"$xx $yy ; |
659 |
printf "$xx " 1>&2 |
printf " $xx" 1>&2 |
660 |
fi |
fi |
|
else |
|
|
# not mpi test: remove symbolic link |
|
|
if test -h $yy ; then rm -f $yy ; fi |
|
661 |
fi |
fi |
662 |
fi |
fi |
663 |
done |
done |
668 |
if test -h eedata ; then rm -f eedata ; fi |
if test -h eedata ; then rm -f eedata ; fi |
669 |
if test ! -r eedata ; then |
if test ! -r eedata ; then |
670 |
ln -sf "../"$1"/eedata.mth" eedata ; |
ln -sf "../"$1"/eedata.mth" eedata ; |
671 |
printf 'eedata.mth ' 1>&2 |
printf ' eedata.mth' 1>&2 |
672 |
fi |
fi |
673 |
else |
else |
674 |
# not multi-threaded test: remove eedata symbolic link |
# not multi-threaded test: remove eedata symbolic link |
678 |
prevDir='NONE' |
prevDir='NONE' |
679 |
for ldir in $* ; do |
for ldir in $* ; do |
680 |
if test -d "../"$ldir -a $ldir != $prevDir ; then |
if test -d "../"$ldir -a $ldir != $prevDir ; then |
681 |
printf 'ldir='${ldir} 1>&2 |
printf " ldir=${ldir}:" 1>&2 |
682 |
files=`( cd "../"$ldir ; ls -1 | grep -v CVS )` |
files=`( cd "../"$ldir ; ls -1 | grep -v CVS )` |
683 |
for i in $files ; do |
for i in $files ; do |
684 |
if test ! -d "../"$ldir/$i ; then |
if test ! -d "../"$ldir/$i ; then |
688 |
fi |
fi |
689 |
fi |
fi |
690 |
done |
done |
691 |
|
printf ' ;' 1>&2 |
692 |
if test -x "../"$ldir"/"prepare_run ; then |
if test -x "../"$ldir"/"prepare_run ; then |
693 |
"../"$ldir"/"prepare_run |
"../"$ldir"/"prepare_run 1>&2 |
694 |
|
else |
695 |
|
echo '' 1>&2 |
696 |
fi |
fi |
|
printf ' ; ' 1>&2 |
|
697 |
fi |
fi |
698 |
prevDir=$ldir |
prevDir=$ldir |
699 |
done |
done |
705 |
{ |
{ |
706 |
# runmodel directory |
# runmodel directory |
707 |
# |
# |
708 |
# runs "$COMMAND in "directory" |
# runs $COMMAND in "directory" |
709 |
# (where "$COMMAND" is relative to "directory") |
# (where "$COMMAND" is relative to "directory") |
710 |
( |
( |
711 |
cd $1 |
cd $1 |
712 |
printf 'runmodel in %s ...' $1 1>&2 |
printf 'runmodel in %s ... ' $1 |
713 |
# make output.txt |
if test "x$MPI" != x0 ; then |
714 |
echo |
#- adjust the MPI run command with the right number of Procs |
715 |
|
#echo '' ; echo " COMMAND='$COMMAND'" |
716 |
|
COMMAND=`echo $COMMAND | sed "s/ TR_NPROC / $LOC_NPROC /"` |
717 |
|
if test "x$MPI_MFILE" != x ; then |
718 |
|
COMMAND=`echo $COMMAND | sed "s/ TR_MFILE / ..\/..\/$LOC_MFILE /"` |
719 |
|
fi |
720 |
|
#echo " COMMAND='$COMMAND'" |
721 |
|
fi |
722 |
if test -L $EXECUTABLE ; then |
if test -L $EXECUTABLE ; then |
723 |
if test -x "../"$builddir"/"$EXECUTABLE ; then |
if test -x "../"$builddir"/"$EXECUTABLE ; then |
724 |
diff -q $EXECUTABLE "../"$builddir"/"$EXECUTABLE > /dev/null 2>&1 |
cmp $EXECUTABLE "../"$builddir"/"$EXECUTABLE > /dev/null 2>&1 |
725 |
outD=$? ; if test $outD != 0 ; then rm -f $EXECUTABLE ; fi |
outD=$? ; if test "x$outD" != x0 ; then rm -f $EXECUTABLE ; fi |
726 |
else rm -f $EXECUTABLE |
else rm -f $EXECUTABLE |
727 |
fi |
fi |
728 |
fi |
fi |
731 |
ln -sf "../"$builddir"/"$EXECUTABLE . |
ln -sf "../"$builddir"/"$EXECUTABLE . |
732 |
fi |
fi |
733 |
if test ! -x $EXECUTABLE ; then |
if test ! -x $EXECUTABLE ; then |
734 |
rm -f $RUNLOG ; touch $RUNLOG |
rm -f $RUNLOG ; touch $RUNLOG |
735 |
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 |
736 |
echo " no executable:" $EXECUTABLE >> $RUNLOG |
echo " no executable:" $EXECUTABLE >> $RUNLOG |
737 |
RETVAL=8 |
RETVAL=8 |
738 |
ENDVAL=-1 |
ENDVAL=-1 |
739 |
else |
else |
740 |
if test ! -f $OUTPUTFILE -o $OUTPUTFILE -ot $EXECUTABLE ; then |
if test ! -f $OUTPUTFILE -o $OUTPUTFILE -ot $EXECUTABLE ; then |
741 |
# output do not exist or is older than executable: |
# output do not exist or is older than executable: |
742 |
rm -f $RUNLOG ; touch $RUNLOG |
rm -f $OUTPUTFILE $RUNLOG ; touch $RUNLOG |
743 |
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 |
744 |
( eval $COMMAND ) >> $RUNLOG 2>&1 |
( eval $COMMAND ) >> $RUNLOG 2>&1 |
745 |
RETVAL=$? |
RETVAL=$? |
746 |
else |
ENDVAL=`tail $OUTPUTFILE | grep -c 'PROGRAM MAIN: Execution ended Normally'` |
747 |
RETVAL=0 |
if [ $POSTCLEAN -eq 1 -a $ENDVAL -gt 0 ] ; then |
748 |
if test -f $RUNLOG ; then |
find . -name "*.meta" -exec rm {} \; |
749 |
if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi |
find . -name "*.data" -exec rm {} \; |
750 |
echo "---------->> $OUTPUTFILE is up to date " >> $RUNLOG 2>&1 |
rm -rf mnc_test_* |
|
else |
|
|
touch $RUNLOG |
|
|
if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi |
|
|
echo "---------->> $OUTPUTFILE is up to date " >> $RUNLOG 2>&1 |
|
|
echo " no previous $RUNLOG: assume NORMAL END" >> $RUNLOG 2>&1 |
|
|
fi |
|
751 |
fi |
fi |
752 |
ENDVAL=`cat $RUNLOG | grep -v 'ABNORMAL END' | grep -c 'NORMAL END'` |
else |
753 |
|
RETVAL=0 |
754 |
|
ENDVAL=`tail $OUTPUTFILE | grep -c 'PROGRAM MAIN: Execution ended Normally'` |
755 |
|
touch $RUNLOG |
756 |
|
if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi |
757 |
|
echo "---------->> $OUTPUTFILE is up to date " >> $RUNLOG 2>&1 |
758 |
|
fi |
759 |
fi |
fi |
760 |
rm -f run.log_tmp |
rm -f run.log_tmp |
761 |
|
#- in all cases where OutputFile exists, report SIZE (and AD time) |
762 |
|
if test -f $OUTPUTFILE ; then |
763 |
|
grep '(PID\.TID 0000\.0001) n.. =' $OUTPUTFILE \ |
764 |
|
| sed 's/(PID.TID 0000.0001) //' >> $CDIR"/summary.txt" |
765 |
|
if test "x$ADM" = xt ; then |
766 |
|
grep -A3 'Seconds in section "ALL' $OUTPUTFILE >> $CDIR"/summary.txt" |
767 |
|
fi |
768 |
|
fi |
769 |
|
if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi |
770 |
if [ $RETVAL -eq 0 -a $ENDVAL -gt 0 ] ; then |
if [ $RETVAL -eq 0 -a $ENDVAL -gt 0 ] ; then |
771 |
tail $RUNLOG |
echo successful |
772 |
echo successful 1>&2 |
printf '=> output from running in %s :\n' $1 1>&2 |
773 |
# === Reduce the size of the testing emails! |
tail $RUNLOG | sed 's/^.*/> &/g' 1>&2 |
|
#cp $OUTPUTFILE $CDIR"/"$OUTPUTFILE |
|
|
if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi |
|
774 |
return 0 |
return 0 |
775 |
elif [ $RETVAL -ne 0 -a $ENDVAL -gt 0 ] ; then |
elif [ $RETVAL -ne 0 -a $ENDVAL -gt 0 ] ; then |
776 |
#-- for some weird cases (run is finihed but with error code) |
#-- for some weird cases (run is finihed but with error code) |
777 |
tail $RUNLOG |
echo 'finished with error (run:' $RETVAL ' end:' $ENDVAL ')' |
778 |
echo finished with error '(run:' $RETVAL ' end:' $ENDVAL ')' 1>&2 |
printf '=> output from running in %s :\n' $1 1>&2 |
779 |
|
tail $RUNLOG | sed 's/^.*/> &/g' 1>&2 |
780 |
return 0 |
return 0 |
781 |
else |
else |
782 |
tail $RUNLOG |
echo 'failed (run:' $RETVAL ' end:' $ENDVAL ')' |
783 |
echo failed '(run:' $RETVAL ' end:' $ENDVAL ')' 1>&2 |
printf '=> output from running in %s :\n' $1 1>&2 |
784 |
|
tail $RUNLOG | sed 's/^.*/> &/g' 1>&2 |
785 |
cp $RUNLOG $CDIR"/"$RUNLOG |
cp $RUNLOG $CDIR"/"$RUNLOG |
|
if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi |
|
786 |
return 1 |
return 1 |
787 |
fi |
fi |
788 |
) |
) |
884 |
|
|
885 |
check_eedata() |
check_eedata() |
886 |
{ |
{ |
887 |
# check_eedata size.h eedata |
# check_eedata eedata size.h |
888 |
if [ $# -eq 2 ] ; then |
if [ $# -eq 2 ] ; then |
889 |
if test -f $1 -a -f $2 ; then |
if test -f $1 -a -f $2 ; then |
890 |
sx=`grep "^ & *nSx *=" $1 | sed "s/^ & *nSx *=//" | sed 's/, *$//'` |
nx=`grep "^ *nTx *=" $1 | tail -1 | sed 's/^ *nTx *= *//' | sed "s/, *$//"` |
891 |
nx=`grep "^ *nTx *=" $2 | tail -1 | sed 's/^ *nTx *= *//' | sed "s/, *$//"` |
sx=`grep "^ & *nSx *=" $2 | sed "s/^ & *nSx *=//" | sed 's/, *$//'` |
892 |
if test "x$nx" = x ; then |
if test "x$nx" = x ; then |
893 |
rx=10 |
rx=10 |
894 |
else |
else |
895 |
rx=`expr $sx % $nx` |
rx=`expr $sx % $nx` |
896 |
fi |
fi |
897 |
sy=`grep "^ & *nSy *=" $1 | sed "s/^ & *nSy *=//" | sed 's/, *$//'` |
ny=`grep "^ *nTy *=" $1 | tail -1 | sed 's/^ *nTy *= *//' | sed "s/, *$//"` |
898 |
ny=`grep "^ *nTy *=" $2 | tail -1 | sed 's/^ *nTy *= *//' | sed "s/, *$//"` |
sy=`grep "^ & *nSy *=" $2 | sed "s/^ & *nSy *=//" | sed 's/, *$//'` |
899 |
if test "x$ny" = x ; then |
if test "x$ny" = x ; then |
900 |
ry=20 |
ry=20 |
901 |
else |
else |
902 |
ry=`expr $sy % $ny` |
ry=`expr $sy % $ny` |
903 |
fi |
fi |
904 |
echo `expr $rx + $ry` |
echo `expr $rx + $ry` |
905 |
else |
else |
906 |
echo '-1' |
echo '-1' |
907 |
fi |
fi |
908 |
|
elif [ $# -eq 1 ] ; then |
909 |
|
if test -f $1 ; then |
910 |
|
nx=`grep "^ *nTx *=" $1 | tail -1 | sed 's/^ *nTx *= *//' | sed "s/, *$//"` |
911 |
|
if test "x$nx" = x ; then nx=1 ; fi |
912 |
|
ny=`grep "^ *nTy *=" $1 | tail -1 | sed 's/^ *nTy *= *//' | sed "s/, *$//"` |
913 |
|
if test "x$ny" = x ; then ny=1 ; fi |
914 |
|
#echo $nx $ny |
915 |
|
echo $nx |
916 |
|
else |
917 |
|
echo '-1' |
918 |
|
fi |
919 |
else |
else |
920 |
echo '-2' |
echo '-2' |
921 |
fi |
fi |
928 |
# Default properties |
# Default properties |
929 |
debug=0 |
debug=0 |
930 |
verbose=1 |
verbose=1 |
931 |
clean=0 |
NBLINES_MKLOG=16000 |
932 |
|
|
933 |
IEEE=true |
OptLev=1 |
|
if test "x$MITGCM_IEEE" != x ; then |
|
|
IEEE=$MITGCM_IEEE |
|
|
fi |
|
934 |
GSL=f |
GSL=f |
935 |
|
|
936 |
CLEANUP=f |
CLEANUP=f |
940 |
NOGENMAKE=f |
NOGENMAKE=f |
941 |
NOCLEAN=f |
NOCLEAN=f |
942 |
NODEPEND=f |
NODEPEND=f |
943 |
POSTCLEAN=f |
POSTCLEAN=0 |
944 |
|
|
945 |
BASH= |
BASH= |
946 |
OPTFILE=NONE |
OPTFILE=NONE |
951 |
HAVE_MPACK= |
HAVE_MPACK= |
952 |
MPACK= |
MPACK= |
953 |
COMMAND= |
COMMAND= |
954 |
|
MKDEPEND= |
955 |
if test "x$MAKE" = x ; then |
if test "x$MAKE" = x ; then |
956 |
MAKE=make |
MAKE=make |
957 |
fi |
fi |
958 |
|
REPLMAKE= |
959 |
if test "x$CC" = x ; then |
if test "x$CC" = x ; then |
960 |
CC=cc |
CC=cc |
961 |
fi |
fi |
962 |
JOBS= |
JOBS= |
963 |
MPI=f |
TARG= |
964 |
|
MPI=0 |
965 |
|
MPI_MFILE= |
966 |
MULTI_THREAD=f |
MULTI_THREAD=f |
967 |
OUTDIR= |
OUTDIR= |
968 |
DELDIR= |
DELDIR= |
969 |
USE_R4= |
USE_R4= |
970 |
|
EXTRFLG= |
971 |
|
|
972 |
ADM= |
ADM= |
973 |
OADM= |
OADM= |
975 |
# list of pTracers to check for monitor output |
# list of pTracers to check for monitor output |
976 |
PTRACERS_NUM="1 2 3 4 5" |
PTRACERS_NUM="1 2 3 4 5" |
977 |
|
|
978 |
MATCH_CRIT=13 |
MATCH_CRIT=10 |
979 |
|
|
980 |
printf "parsing options... " |
printf "parsing options... " |
981 |
|
|
993 |
|
|
994 |
case $ac_option in |
case $ac_option in |
995 |
|
|
996 |
-help | --help | -h | --h) |
-help | --help | -h | --h) usage ;; |
997 |
usage ;; |
|
998 |
|
-optfile | --optfile | -of | --of) ac_prev=OPTFILE ;; |
999 |
-optfile | --optfile | -of | --of) |
-optfile=* | --optfile=* | -of=* | --of=*) OPTFILE=$ac_optarg ;; |
1000 |
ac_prev=OPTFILE ;; |
|
1001 |
-optfile=* | --optfile=* | -of=* | --of=*) |
-addr | --addr | -a | --a) ac_prev=ADDRESSES ;; |
1002 |
OPTFILE=$ac_optarg ;; |
-addr=* | --addr=* | -a=* | --a=*) ADDRESSES=$ac_optarg ;; |
1003 |
|
-mpackdir | --mpackdir | -mpd | --mpd) ac_prev=MPACKDIR ;; |
1004 |
-addr | --addr | -a | --a) |
-mpackdir=* | --mpackdir=* | -mpd=* | --mpd=*) MPACKDIR=$ac_optarg ;; |
1005 |
ac_prev=ADDRESSES ;; |
|
1006 |
-addr=* | --addr=* | -a=* | --a=*) |
-tdir | --tdir | -t | --t) ac_prev=TESTDIRS ;; |
1007 |
ADDRESSES=$ac_optarg ;; |
-tdir=* | --tdir=* | -t=* | --t=*) TESTDIRS=$ac_optarg ;; |
1008 |
-mpackdir | --mpackdir | -mpd | --mpd) |
-skipdir | --skipdir | -skd | --skd) ac_prev=SKIPDIRS ;; |
1009 |
ac_prev=MPACKDIR ;; |
-skipdir=* | --skipdir=* | -skd=* | --skd=*) SKIPDIRS=$ac_optarg ;; |
1010 |
-mpackdir=* | --mpackdir=* | -mpd=* | --mpd=*) |
|
1011 |
MPACKDIR=$ac_optarg ;; |
-bash | --bash | -b | --b) ac_prev=BASH ;; |
1012 |
|
-bash=* | --bash=* | -b=* | --b=*) BASH=$ac_optarg ;; |
1013 |
-tdir | --tdir | -t | --t) |
|
1014 |
ac_prev=TESTDIRS ;; |
-command | --command | -c | --c) ac_prev=COMMAND ;; |
1015 |
-tdir=* | --tdir=* | -t=* | --t=*) |
-command=* | --command=* | -c=* | --c=*) COMMAND=$ac_optarg ;; |
1016 |
TESTDIRS=$ac_optarg ;; |
|
1017 |
|
-makedepend | --makedepend | -md | --md) ac_prev=MKDEPEND ;; |
1018 |
-skipdir | --skipdir | -skd | --skd) |
-makedepend=* | --makedepend=* | -md=* | --md=*) MKDEPEND=$ac_optarg ;; |
1019 |
ac_prev=SKIPDIRS ;; |
|
1020 |
-skipdir=* | --skipdir=* | -skd=* | --skd=*) |
-make | --make | -m | --m) ac_prev=MAKE ;; |
1021 |
SKIPDIRS=$ac_optarg ;; |
-make=* | --make=* | -m=* | --m=*) MAKE=$ac_optarg ;; |
1022 |
|
|
1023 |
-bash | --bash | -b | --b) |
-repl_mk | --repl_mk ) ac_prev=REPLMAKE ;; |
1024 |
ac_prev=BASH ;; |
-repl_mk=* | --repl_mk=*) REPLMAKE=$ac_optarg ;; |
1025 |
-bash=* | --bash=* | -b=* | --b=*) |
|
1026 |
BASH=$ac_optarg ;; |
-odir | --odir) ac_prev=OUTDIR ;; |
1027 |
|
-odir=* | --odir=*) OUTDIR=$ac_optarg ;; |
1028 |
-command | --command | -c | --c) |
|
1029 |
ac_prev=COMMAND ;; |
-ptracers | --ptracers | -ptr | --ptr) ac_prev=PTRACERS_NUM ;; |
1030 |
-command=* | --command=* | -c=* | --c=*) |
-ptracers=* | --ptracers=* | -ptr=* | --ptr=*) PTRACERS_NUM=$ac_optarg ;; |
|
COMMAND=$ac_optarg ;; |
|
|
|
|
|
-make | --make | -m | --m) |
|
|
ac_prev=MAKE ;; |
|
|
-make=* | --make=* | -m=* | --m=*) |
|
|
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 ;; |
|
1031 |
|
|
1032 |
-match | --match ) ac_prev=MATCH_CRIT ;; |
-match | --match ) ac_prev=MATCH_CRIT ;; |
1033 |
-match=* | --match=* ) MATCH_CRIT=$ac_optarg ;; |
-match=* | --match=* ) MATCH_CRIT=$ac_optarg ;; |
1035 |
-j | --j) ac_prev=JOBS ;; |
-j | --j) ac_prev=JOBS ;; |
1036 |
-j=* | --j=*) JOBS=$ac_optarg ;; |
-j=* | --j=*) JOBS=$ac_optarg ;; |
1037 |
|
|
1038 |
-clean | --clean) |
-ef | --ef) ac_prev=EXTRFLG ;; |
1039 |
CLEANUP=t ; DELDIR=t ;; |
-ef=* | --ef=*) EXTRFLG=$ac_optarg ;; |
1040 |
|
|
1041 |
-norun | --norun | -nr | --nr) |
-clean | --clean) CLEANUP=t ; DELDIR=t ;; |
|
NORUN=t ;; |
|
|
-runonly | --runonly | -ro | --ro) |
|
|
QUICK=t ; NOMAKE=t ;; |
|
|
-quick | --quick | -q | --q) |
|
|
QUICK=t ;; |
|
|
-nogenmake | --nogenmake | -ng | --ng) |
|
|
NOGENMAKE=t ;; |
|
|
-noclean | --noclean | -nc | --nc) |
|
|
NOCLEAN=t ;; |
|
|
-nodepend | --nodepend | -nd | --nd) |
|
|
NODEPEND=t ;; |
|
1042 |
|
|
1043 |
-postclean | --postclean | -pc | --pc) |
-norun | --norun | -nr | --nr) NORUN=t ;; |
1044 |
POSTCLEAN=t ;; |
-obj | --obj ) TARG='obj' ; NORUN=t ;; |
1045 |
|
-runonly | --runonly | -ro | --ro) QUICK=t ; NOMAKE=t ;; |
1046 |
|
-quick | --quick | -q | --q) QUICK=t ;; |
1047 |
|
-nogenmake | --nogenmake | -ng | --ng) NOGENMAKE=t ;; |
1048 |
|
-noclean | --noclean | -nc | --nc) NOCLEAN=t ;; |
1049 |
|
-nodepend | --nodepend | -nd | --nd) NODEPEND=t ;; |
1050 |
|
|
1051 |
|
-postclean | --postclean | -pc | --pc) POSTCLEAN=2 ;; |
1052 |
|
-deloutp | --deloutp | -do | --do) POSTCLEAN=1 ;; |
1053 |
|
|
1054 |
|
-mpi | --mpi) MPI=2 ;; |
1055 |
|
-MPI | --MPI) ac_prev=MPI ;; |
1056 |
|
-MPI=* | --MPI=*) MPI=$ac_optarg ;; |
1057 |
|
|
1058 |
-mpi) MPI=t ;; |
-mfile | --mfile | -mf | --mf) ac_prev=MPI_MFILE ;; |
1059 |
|
-mfile=* | --mfile=* | -mf=* | --mf=*) MPI_MFILE=$ac_optarg ;; |
1060 |
|
|
1061 |
-mth) MULTI_THREAD=t ;; |
-mth) MULTI_THREAD=t ;; |
1062 |
|
|
1063 |
-adm | -ad) ADM=t ;; |
-adm | -ad) ADM=t ;; |
|
|
|
1064 |
-oad) OADM=t; NODEPEND=t ;; |
-oad) OADM=t; NODEPEND=t ;; |
1065 |
|
|
1066 |
-ieee) IEEE=true ;; |
-ieee) echo "Warning: ignore option '-ieee' (already the default)" |
1067 |
-noieee) IEEE= ;; |
printf " ... " ;; |
1068 |
-gsl) GSL=t ;; |
-noieee) echo "Warning: will use option '-fast' instead of '-noieee' (obsolete)" |
1069 |
|
printf " ... " ; OptLev=`expr $OptLev \* 2` ;; |
1070 |
|
-fast) OptLev=`expr $OptLev \* 2` ;; |
1071 |
|
-devel) OptLev=0 ;; |
1072 |
|
-gsl) GSL=t ;; |
1073 |
|
|
1074 |
-verbose) verbose=2 ;; |
-verbose) verbose=2 ;; |
1075 |
-debug) debug=1 ;; |
-debug) debug=1 ;; |
1083 |
-papis) PAPIS=t;; |
-papis) PAPIS=t;; |
1084 |
-pcls) PCL=t;; |
-pcls) PCL=t;; |
1085 |
|
|
1086 |
-*) |
-*) echo "Error: unrecognized option: "$ac_option |
1087 |
echo "Error: unrecognized option: "$ac_option |
usage ;; |
1088 |
usage |
*) echo "Error: unrecognized argument: "$ac_option |
1089 |
;; |
usage ;; |
|
|
|
|
*) |
|
|
echo "Error: unrecognized argument: "$ac_option |
|
|
usage |
|
|
;; |
|
1090 |
|
|
1091 |
esac |
esac |
1092 |
|
|
1098 |
NODEPEND=t |
NODEPEND=t |
1099 |
fi |
fi |
1100 |
|
|
1101 |
|
#- check length of MPI machine file: |
1102 |
|
if test "x$MPI" != x0 -a "x$MPI_MFILE" != x ; then |
1103 |
|
if test -r $MPI_MFILE ; then |
1104 |
|
nl=`wc -l $MPI_MFILE | awk '{print $1}'` |
1105 |
|
if [ $nl -lt $MPI ] ; then |
1106 |
|
echo "Error: need at least $MPI nodes (currently only $nl) in MPI_MFILE=$MPI_FILE" |
1107 |
|
usage |
1108 |
|
fi |
1109 |
|
if [ $verbose -gt 1 ]; then |
1110 |
|
echo " MPI_MFILE=$MPI_MFILE : $nl procs for MPI=$MPI run" |
1111 |
|
fi |
1112 |
|
else |
1113 |
|
echo "Error: cannot access MPI_MFILE=$MPI_FILE" |
1114 |
|
usage |
1115 |
|
fi |
1116 |
|
fi |
1117 |
|
|
1118 |
#- setting for forward or ADM testing |
#- setting for forward or ADM testing |
1119 |
if test "x$ADM" = xt ; then |
if test "x$ADM" = xt ; then |
1120 |
|
if test "x$TARG" = xobj ; then TARG=adobj ; else TARG=adall ; fi |
1121 |
code_dir=code_ad |
code_dir=code_ad |
1122 |
inputdir=input_ad |
inputdir=input_ad |
1123 |
ref_outp="output_adm.txt" |
ref_outp="output_adm.txt" |
1124 |
EXECUTABLE="mitgcmuv_ad" |
EXECUTABLE="mitgcmuv_ad" |
1125 |
elif test "x$OADM" = xt ; then |
elif test "x$OADM" = xt ; then |
1126 |
|
TARG=adAll |
1127 |
code_dir=code_oad |
code_dir=code_oad |
1128 |
inputdir=input_oad |
inputdir=input_oad |
1129 |
ref_outp="output_oadm.txt" |
ref_outp="output_oadm.txt" |
1130 |
EXECUTABLE="mitgcmuv_ad" |
EXECUTABLE="mitgcmuv_ad" |
1131 |
else |
else |
1132 |
|
if test "x$JOBS" != x ; then TARG="-j $JOBS $TARG" ; fi |
1133 |
code_dir=code |
code_dir=code |
1134 |
inputdir=input |
inputdir=input |
1135 |
ref_outp="output.txt" |
ref_outp="output.txt" |
1136 |
EXECUTABLE="mitgcmuv" |
EXECUTABLE="mitgcmuv" |
1137 |
fi |
fi |
1138 |
|
|
1139 |
|
xx=`echo $TESTDIRS | awk '{print $1}'` |
1140 |
if test "x$TESTDIRS" = x ; then |
if test "x$TESTDIRS" = x ; then |
1141 |
LIST=`scandirs results/$ref_outp` |
LIST=`scandirs results/$ref_outp` |
1142 |
|
elif test $xx = 'start_from' ; then |
1143 |
|
xx=`echo $TESTDIRS | awk '{print $2}'` |
1144 |
|
LIST=`scandirs results/$ref_outp | sed -n "/$xx/,$ p"` |
1145 |
else |
else |
1146 |
#- expand group of experiments: |
#- expand group of experiments: |
1147 |
LIST=" " |
LIST=" " |
1185 |
OPTFILE=$MITGCM_OF |
OPTFILE=$MITGCM_OF |
1186 |
fi |
fi |
1187 |
|
|
1188 |
RUNLOG="run.log" |
LOC_MFILE='tr_mpi_mfile' |
1189 |
|
RUNLOG="run.tr_log" |
1190 |
OUTPUTFILE=$ref_outp |
OUTPUTFILE=$ref_outp |
1191 |
if test "x$COMMAND" = x ; then |
if test "x$COMMAND" = x ; then |
1192 |
COMMAND="./$EXECUTABLE > $OUTPUTFILE" |
COMMAND="./$EXECUTABLE > $OUTPUTFILE" |
1193 |
fi |
fi |
1194 |
if test "x$MPI" = xt ; then |
if test "x$MPI" != x0 ; then |
1195 |
OUTPUTFILE="STDOUT.0000" |
OUTPUTFILE="STDOUT.0000" |
1196 |
fi |
fi |
1197 |
|
|
1208 |
ii=`echo $EMPTY_RESULTS | awk '{print NF}'` |
ii=`echo $EMPTY_RESULTS | awk '{print NF}'` |
1209 |
EMPTY_RESULTS=$EMPTY_RESULTS`expr $LEN_CHECK_LIST - $ii | awk 'BEGIN{FS=":"}{for(i=1;i<=$1;i++){printf " ."}}'` |
EMPTY_RESULTS=$EMPTY_RESULTS`expr $LEN_CHECK_LIST - $ii | awk 'BEGIN{FS=":"}{for(i=1;i<=$1;i++){printf " ."}}'` |
1210 |
else |
else |
1211 |
DEF_CHECK_LIST='Grad Cost Grad' |
DEF_CHECK_LIST='AdGrd Cost AdGrd FDGrd' |
1212 |
EMPTY_RESULTS='.. ..' |
EMPTY_RESULTS='.. .. ..' |
1213 |
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}'` |
1214 |
fi |
fi |
1215 |
|
|
1284 |
fi |
fi |
1285 |
else |
else |
1286 |
echo >> $SUMMARY |
echo >> $SUMMARY |
1287 |
echo "No \"OPTFILE\" was explicitly specified by testreport," >> $SUMMARY |
echo "No \"OPTFILE\" was specified ; genmake2 found and uses:" >> $SUMMARY |
1288 |
echo " so the genmake default will be used." >> $SUMMARY |
#-note: to be filled later after 1rst run |
1289 |
fi |
fi |
1290 |
echo |
echo |
1291 |
echo >> $SUMMARY |
echo >> $SUMMARY |
1294 |
then line_0="default "$MATCH_CRIT ; |
then line_0="default "$MATCH_CRIT ; |
1295 |
else line_0="default "$MATCH_CRIT ; fi |
else line_0="default "$MATCH_CRIT ; fi |
1296 |
line_0="$line_0 ----T----- ----S----- ----U----- ----V-----" |
line_0="$line_0 ----T----- ----S----- ----U----- ----V-----" |
|
# line_0=" ----T----- ----S----- ----U----- ----V-----" |
|
1297 |
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" |
1298 |
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 ." |
1299 |
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" |
1300 |
line_4="2 d e n d n x n . n x n . n x n . n x n ." |
line_4="2 d e n d n x n . n x n . n x n . n x n ." |
1301 |
for ii in $PTRACERS_NUM ; do |
for ii in $PTRACERS_NUM ; do |
1302 |
line_0="$line_0 --PTR 0"$ii"--" |
line_0="$line_0 --PTR 0"$ii"--" |
1319 |
else line_0="default "$MATCH_CRIT ; fi |
else line_0="default "$MATCH_CRIT ; fi |
1320 |
echo "$line_0" | tee -a $SUMMARY |
echo "$line_0" | tee -a $SUMMARY |
1321 |
cat << EOF | tee -a $SUMMARY |
cat << EOF | tee -a $SUMMARY |
1322 |
G D M C G |
G D M C A F |
1323 |
E p a R o r |
e p a R o d D |
1324 |
N n k u s a |
n n k u s G G |
1325 |
2 d e n t d |
2 d e n t r r |
1326 |
|
|
1327 |
EOF |
EOF |
1328 |
fi |
fi |
1329 |
|
echo "-------------------------------------------------------------------------------" |
1330 |
|
|
1331 |
# ...and each test directory... |
# ...and each test directory... |
1332 |
for dir in $TESTDIRS ; do |
for dir in $TESTDIRS ; do |
1335 |
builddir="build" |
builddir="build" |
1336 |
if test ! -d $dir/$builddir ; then mkdir $dir/$builddir ; fi |
if test ! -d $dir/$builddir ; then mkdir $dir/$builddir ; fi |
1337 |
rundir="run" |
rundir="run" |
1338 |
|
pfxdir="tr_$rundir" |
1339 |
if test ! -d $dir/$rundir ; then |
if test ! -d $dir/$rundir ; then |
1340 |
rundir=$builddir |
rundir=$builddir |
1341 |
fi |
fi |
1346 |
if test "x$CLEANUP" = xt ; then |
if test "x$CLEANUP" = xt ; then |
1347 |
echo -n ' --- dir:' $BUILD_DIR ': ' |
echo -n ' --- dir:' $BUILD_DIR ': ' |
1348 |
makeclean $BUILD_DIR |
makeclean $BUILD_DIR |
1349 |
rm -f $BUILD_DIR/$EXECUTABLE |
( cd $BUILD_DIR |
1350 |
|
rm -f $EXECUTABLE *.bak |
1351 |
|
rm -f genmake_state genmake_*optfile genmake.log |
1352 |
|
rm -f SIZE.h.mpi genmake.tr_log make.tr_log |
1353 |
|
) |
1354 |
if test -d $dir/$rundir/CVS ; then |
if test -d $dir/$rundir/CVS ; then |
1355 |
echo -n ' --- dir:' $dir/$rundir ': ' |
echo -n ' --- dir:' $dir/$rundir ': ' |
1356 |
run_clean $dir/$rundir |
run_clean $dir/$rundir |
1357 |
fi |
fi |
1358 |
trdir=`( cd $dir ; find . -type d -name "tr_run.*" -print | sed 's/^.\///')` |
trdir=`( cd $dir ; find . -type d -name "$pfxdir.*" -print | sed 's/^.\///')` |
1359 |
ttd=`echo $trdir | wc -w` |
ttd=`echo $trdir | wc -w` |
1360 |
if test $ttd != 0 ; then |
if test $ttd != 0 ; then |
1361 |
echo ' --- rm dir:' $trdir |
echo ' --- rm dir:' $trdir |
1374 |
|
|
1375 |
# Check for specific files for particular type of run |
# Check for specific files for particular type of run |
1376 |
|
|
1377 |
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 |
1378 |
echo "can't find \"$CODE_DIR/SIZE.h_mpi\" -- skipping $dir" |
echo "can't find \"$CODE_DIR/SIZE.h_mpi\" -- skipping $dir" |
1379 |
continue |
continue |
1380 |
fi |
fi |
1382 |
echo "can't find \"$dir/input/eedata.mth\" -- skipping $dir" |
echo "can't find \"$dir/input/eedata.mth\" -- skipping $dir" |
1383 |
continue |
continue |
1384 |
fi |
fi |
1385 |
if test "x$MPI" = "xt" -a "x$MULTI_THREAD" = "xt" ; then |
|
1386 |
retv=`check_eedata $CODE_DIR"/SIZE.h_mpi" $dir"/input/eedata.mth"` |
if test "x$MPI" != "x0" ; then |
1387 |
if test $retv != 0 ; then |
prefer_X=0 |
1388 |
echo "input/eedata.mth tiling misfit -- skipping $dir" |
if test "x$MULTI_THREAD" = "xt" ; then |
1389 |
continue |
retv=`check_eedata $dir"/input/eedata.mth"` |
1390 |
fi |
if test $retv = 1 ; then prefer_X=1 ; fi |
1391 |
|
fi |
1392 |
|
#- create new SIZE.h with no more than '$MPI' Procs |
1393 |
|
mk_mpi_size $CODE_DIR"/SIZE.h_mpi" $BUILD_DIR"/tr_size.mpi" $MPI $prefer_X |
1394 |
|
LOC_NPROC=$? |
1395 |
|
( cd $BUILD_DIR |
1396 |
|
if test -r SIZE.h.mpi ; then |
1397 |
|
cmp tr_size.mpi SIZE.h.mpi > /dev/null 2>&1 ; RETVAL=$? |
1398 |
|
else RETVAL=1 |
1399 |
|
fi |
1400 |
|
if test "x$RETVAL" = x0 ; then |
1401 |
|
rm -f tr_size.mpi |
1402 |
|
else |
1403 |
|
rm -f SIZE.h.mpi ; mv tr_size.mpi SIZE.h.mpi |
1404 |
|
fi |
1405 |
|
) |
1406 |
|
if test "x$MPI_MFILE" != x ; then |
1407 |
|
#- create new MPI machine-file with the right number of Procs |
1408 |
|
rm -f $LOC_MFILE |
1409 |
|
cat $MPI_MFILE | sort | uniq | head -$LOC_NPROC > $LOC_MFILE |
1410 |
|
nl=`wc -l $LOC_MFILE | awk '{print $1}'` |
1411 |
|
if [ $nl -lt $LOC_NPROC ] ; then |
1412 |
|
rm -f $LOC_MFILE |
1413 |
|
cat $MPI_MFILE | head -$LOC_NPROC > $LOC_MFILE |
1414 |
|
#sed -n "1,$LOC_NPROC p" $MPI_MFILE > $LOC_MFILE |
1415 |
|
fi |
1416 |
|
if [ $verbose -gt 1 ]; then |
1417 |
|
nl=`wc -l $LOC_MFILE | awk '{print $1}'` |
1418 |
|
echo " new LOC_MFILE=$LOC_MFILE : $nl procs for LOC_NPROC=$LOC_NPROC" |
1419 |
|
fi |
1420 |
|
fi |
1421 |
|
if test "x$MULTI_THREAD" = "xt" ; then |
1422 |
|
retv=`check_eedata $dir"/input/eedata.mth" $BUILD_DIR"/SIZE.h.mpi"` |
1423 |
|
if test $retv != 0 ; then |
1424 |
|
echo "input/eedata.mth tiling misfit -- skipping $dir" |
1425 |
|
continue |
1426 |
|
fi |
1427 |
|
fi |
1428 |
fi |
fi |
1429 |
|
|
1430 |
# Check whether there are "extra runs" for this testdir |
# Check whether there are "extra runs" for this testdir |
1440 |
if test -f $outf -a -r $outf ; then |
if test -f $outf -a -r $outf ; then |
1441 |
if test "x$MULTI_THREAD" = "xt" ; then |
if test "x$MULTI_THREAD" = "xt" ; then |
1442 |
if test -r $dir"/"$exd"/eedata.mth" ; then |
if test -r $dir"/"$exd"/eedata.mth" ; then |
1443 |
if test "x$MPI" = "xt" ; then |
if test "x$MPI" = "x0" ; then |
1444 |
retv=`check_eedata $CODE_DIR"/SIZE.h_mpi" $dir"/"$exd"/eedata.mth"` |
extra_runs="$extra_runs $name" |
1445 |
|
else |
1446 |
|
retv=`check_eedata $dir"/"$exd"/eedata.mth" $BUILD_DIR"/SIZE.h.mpi"` |
1447 |
if test $retv = 0 ; then |
if test $retv = 0 ; then |
1448 |
extra_runs="$extra_runs $name" |
extra_runs="$extra_runs $name" |
1449 |
else |
else |
1450 |
echo $exd"/eedata.mth tiling misfit -- skipping $dir" |
echo $exd"/eedata.mth tiling misfit -- skipping $dir" |
1451 |
fi |
fi |
|
else |
|
|
extra_runs="$extra_runs $name" |
|
1452 |
fi |
fi |
1453 |
#else echo $dir"/"$exd"/eedata.mth: not found" |
#else echo $dir"/"$exd"/eedata.mth: not found" |
1454 |
fi |
fi |
1458 |
fi |
fi |
1459 |
done |
done |
1460 |
|
|
|
echo "-------------------------------------------------------------------------------" |
|
1461 |
echo |
echo |
1462 |
if test "x$extra_runs" = "x" ; then |
if test "x$extra_runs" = "x" ; then |
1463 |
echo "Experiment: $dir" |
echo "Experiment: $dir" |
1468 |
unset genmake makedepend make run |
unset genmake makedepend make run |
1469 |
results=$EMPTY_RESULTS |
results=$EMPTY_RESULTS |
1470 |
|
|
1471 |
# Create an output dir for each OPTFILE/tdir combination |
# Create an output dir & summary.txt file for each tested experiment (tdir) |
1472 |
CDIR=$DRESULTS"/"$dir |
locDIR=$DRESULTS"/"$dir |
1473 |
mkdir $CDIR |
mkdir $locDIR |
1474 |
|
#- report to this experiment local summary file --- |
1475 |
|
echo "DATE='$DATE' ; tdir='$dir'" > $locDIR"/summary.txt" |
1476 |
|
echo "MACH='$MACH'" >> $locDIR"/summary.txt" |
1477 |
|
echo "UNAMEA='$UNAMEA'" >> $locDIR"/summary.txt" |
1478 |
|
CDIR=`pwd`"/$locDIR" |
1479 |
|
|
1480 |
if test "x$NORUN" = xt ; then |
if test "x$NORUN" = xt ; then |
1481 |
run=N |
run=N |
1482 |
genmakemodel $dir/$builddir && genmake=Y \ |
genmakemodel $dir/$builddir && genmake=Y \ |
1483 |
&& makeclean $dir/$builddir \ |
&& makeclean $dir/$builddir \ |
|
&& run_clean $dir/$rundir \ |
|
1484 |
&& symlink_mpifiles $dir $code_dir $builddir \ |
&& symlink_mpifiles $dir $code_dir $builddir \ |
1485 |
&& makedependmodel $dir/$builddir && makedepend=Y \ |
&& makedependmodel $dir/$builddir && makedepend=Y \ |
1486 |
&& makemodel $dir/$builddir && make=Y |
&& makemodel $dir/$builddir && make=Y |
1487 |
else |
else |
1488 |
genmakemodel $dir/$builddir && genmake=Y \ |
genmakemodel $dir/$builddir && genmake=Y \ |
1489 |
&& makeclean $dir/$builddir \ |
&& makeclean $dir/$builddir \ |
|
&& run_clean $dir/$rundir \ |
|
1490 |
&& symlink_mpifiles $dir $code_dir $builddir \ |
&& symlink_mpifiles $dir $code_dir $builddir \ |
1491 |
&& makedependmodel $dir/$builddir && makedepend=Y \ |
&& makedependmodel $dir/$builddir && makedepend=Y \ |
1492 |
&& makemodel $dir/$builddir && make=Y \ |
&& makemodel $dir/$builddir && make=Y \ |
1493 |
&& linkdata $dir/$rundir $inputdir input \ |
&& run_clean $dir/$rundir \ |
1494 |
|
&& linkdata $dir/$rundir $inputdir \ |
1495 |
&& runmodel $dir/$rundir && run=Y \ |
&& runmodel $dir/$rundir && run=Y \ |
1496 |
&& results=`testoutput_run $dir $rundir $ref_outp` |
&& results=`testoutput_run $dir $rundir $ref_outp` |
1497 |
fi |
fi |
|
|
|
1498 |
#echo "results='$results'" |
#echo "results='$results'" |
1499 |
echo |
|
1500 |
fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` |
fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` |
1501 |
echo |
echo 1>&2 |
1502 |
echo "$fres" | sed 's/ 99/ --/g' | sed 's/ > />/' | sed 's/ < /</' >> $SUMMARY |
echo "$fres" | sed 's/ 99/ --/g' | sed 's/ > />/' | sed 's/ < /</' >> $SUMMARY |
1503 |
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 |
|
1504 |
|
|
1505 |
for ex in $extra_runs ; do |
for ex in $extra_runs ; do |
1506 |
unset run |
unset run |
1507 |
results=$EMPTY_RESULTS |
results=$EMPTY_RESULTS |
1508 |
# reference output file |
# reference output file |
1509 |
refExOut=`echo $ref_outp | sed "s/\./.${ex}./g"` |
refExOut=`echo $ref_outp | sed "s/\./.${ex}./g"` |
1510 |
# Create an output dir for each OPTFILE/tdir.ex combination |
# Create an output dir & summary.txt file for each extra run (tdir.ex) |
1511 |
CDIR=$DRESULTS"/"$dir"."$ex |
locDIR=$DRESULTS"/"$dir"."$ex |
1512 |
mkdir $CDIR |
mkdir $locDIR |
1513 |
test ! -e "$dir/tr_run.$ex" && mkdir "$dir/tr_run.$ex" |
#- report to this experiment local summary file --- |
1514 |
run_clean $dir/tr_run.$ex |
echo "DATE='$DATE' ; tdir='$dir.$ex'" > $locDIR"/summary.txt" |
1515 |
linkdata $dir/tr_run.$ex $inputdir.$ex $inputdir input |
#echo "MACH='$MACH'" >> $locDIR"/summary.txt" |
1516 |
runmodel $dir/tr_run.$ex && run=Y \ |
#echo "UNAMEA='$UNAMEA'" >> $locDIR"/summary.txt" |
1517 |
&& results=`testoutput_run $dir tr_run.$ex $refExOut` |
CDIR=`pwd`"/$locDIR" |
1518 |
|
test ! -e "$dir/$pfxdir.$ex" && mkdir "$dir/$pfxdir.$ex" |
1519 |
|
run_clean $dir/$pfxdir.$ex |
1520 |
|
linkdata $dir/$pfxdir.$ex $inputdir.$ex $inputdir |
1521 |
|
runmodel $dir/$pfxdir.$ex && run=Y \ |
1522 |
|
&& results=`testoutput_run $dir $pfxdir.$ex $refExOut` |
1523 |
fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` |
fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` |
1524 |
fres="$fres.$ex" |
fres="$fres.$ex" |
1525 |
echo |
echo 1>&2 |
1526 |
echo "$fres" | sed 's/ 99/ --/g' | sed 's/ > />/' | sed 's/ < /</' >> $SUMMARY |
echo "$fres" | sed 's/ 99/ --/g' | sed 's/ > />/' | sed 's/ < /</' >> $SUMMARY |
1527 |
touch $CDIR"/summary.txt" |
echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt" |
1528 |
echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $CDIR"/summary.txt" |
if test "x$POSTCLEAN" = x2 ; then |
1529 |
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 |
|
1530 |
fi |
fi |
1531 |
done |
done |
1532 |
|
|
1533 |
if test -f $DRESULTS"/"genmake_state ; then : ; else |
if test -f $DRESULTS"/"genmake_state ; then : ; else |
1534 |
if test -f $dir/$builddir/Makefile ; then |
if test -f $dir/$builddir/Makefile ; then |
1535 |
mkOpt=`grep '^# OPTFILE=' $dir/$builddir/Makefile 2>/dev/null | head -1 | sed 's/^# //'` |
mkOpt=`grep '^# OPTFILE=' $dir/$builddir/Makefile 2>/dev/null | head -1 | sed 's/^# //'` |
1536 |
echo "from '$dir/$builddir/Makefile', extract:" > $DRESULTS/genmake_state |
echo "from '$dir/$builddir/Makefile', extract:" > $DRESULTS/genmake_state |
1537 |
sed -n '/^# executed by:/,+1 p' $dir/$builddir/Makefile >> $DRESULTS/genmake_state |
sed -n '/^# executed by:/,+1 p' $dir/$builddir/Makefile >> $DRESULTS/genmake_state |
1538 |
echo $mkOpt >> $DRESULTS/genmake_state |
echo " $mkOpt" >> $DRESULTS/genmake_state |
1539 |
|
if test "x$OPTFILE" = xNONE ; then |
1540 |
|
eval $mkOpt |
1541 |
|
sed "/^No \"OPTFILE\" was specified ; genmake2/a\ OPTFILE=${OPTFILE}"\ |
1542 |
|
$SUMMARY > tr_0.tmp_log |
1543 |
|
RETVAL=$? |
1544 |
|
if test "x$RETVAL" = x0 ; then rm -f $SUMMARY |
1545 |
|
cp tr_0.tmp_log $SUMMARY |
1546 |
|
else rm -f tr_0.tmp_log |
1547 |
|
fi |
1548 |
|
fi |
1549 |
|
gmkLog=$dir/$builddir/genmake.log |
1550 |
|
grep '^Get compiler version using:' $gmkLog > /dev/null 2>&1 |
1551 |
|
RETVAL=$? |
1552 |
|
if test "x$RETVAL" = x0 ; then |
1553 |
|
echo "from '$gmkLog', extract compiler version:" >> $DRESULTS/genmake_state |
1554 |
|
sed -n '/Get compiler version/,/<-- compiler version/p' $gmkLog \ |
1555 |
|
| grep -v '^... compiler version ' > tr_1.tmp_log |
1556 |
|
sed -n '1p' tr_1.tmp_log >> $DRESULTS/genmake_state |
1557 |
|
sed -n '2,/^$/p' tr_1.tmp_log | sed '/^$/d' | sed 's/^./ &/' \ |
1558 |
|
>> $DRESULTS/genmake_state |
1559 |
|
rm -f tr_1.tmp_log |
1560 |
|
fi |
1561 |
fi |
fi |
1562 |
fi |
fi |
1563 |
#postclean $dir/$builddir |
#postclean $dir/$builddir |
1564 |
if test "x$POSTCLEAN" = xt ; then |
if test "x$POSTCLEAN" = x2 ; then |
1565 |
makeclean $dir/$builddir \ |
makeclean $dir/$builddir \ |
1566 |
&& run_clean $dir/$rundir |
&& run_clean $dir/$rundir |
1567 |
fi |
fi |
1568 |
|
if test "x$MPI" != x0 -a "x$MPI_MFILE" != x ; then rm -f $LOC_MFILE ; fi |
1569 |
|
|
1570 |
echo "-------------------------------------------------------------------------------" |
echo "-------------------------------------------------------------------------------" |
1571 |
|
|