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" |
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=\"$MATCH_CRIT\")" |
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'" > $locDIR"/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=$? ;; |
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 |
383 |
fi |
fi |
384 |
fi |
fi |
385 |
printf 'genmake ... ' |
printf 'genmake ... ' |
386 |
eval $command > make.log 2>&1 |
eval $command > genmake.tr_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" |
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" |
echo "successful" |
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 |
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 ... ' |
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" |
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 |
echo successful |
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* w2_tile_topology.????.log *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 |
echo successful |
461 |
( |
( |
462 |
cd $1; |
cd $1; |
463 |
printf 'make depend ... ' |
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" |
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 |
echo successful |
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 ... ' |
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 |
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 |
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 threads_Nb_X threads_Nb_Y |
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 |
|
# ensure that enough tiles per proc (nSx,nSy) remain for the given |
534 |
|
# number of threads (nTx,nTy) ; |
535 |
|
# return the effective number of processors. |
536 |
|
|
537 |
|
inp=$1 |
538 |
|
out=$2 |
539 |
|
np=$3 |
540 |
|
tx=$4 |
541 |
|
ty=$5 |
542 |
|
tmp=TTT.$$ |
543 |
|
|
544 |
|
# dirX : select with direction to favor in MPI process repartition |
545 |
|
# dirX=1 : prefer to put more proc in X direction |
546 |
|
# dirX=0 : prefer to put more proc in Y direction |
547 |
|
dirX=0 |
548 |
|
|
549 |
|
px=`grep "^ & *nPx *=" $inp | sed "s/^ & *nPx *= *//" | sed 's/, *$//'` |
550 |
|
py=`grep "^ & *nPy *=" $inp | sed "s/^ & *nPy *= *//" | sed 's/, *$//'` |
551 |
|
sx=`grep "^ & *nSx *=" $inp | sed "s/^ & *nSx *= *//" | sed 's/, *$//'` |
552 |
|
sy=`grep "^ & *nSy *=" $inp | sed "s/^ & *nSy *= *//" | sed 's/, *$//'` |
553 |
|
|
554 |
|
#- for each direction, assume # of threads is a multiple of total number of tiles |
555 |
|
nx=$px |
556 |
|
if [ `expr $sx % $tx` -ne 0 -a `expr $sx \* $px % $tx` -eq 0 ] ; then |
557 |
|
nx=`expr $sx \* $px / $tx` |
558 |
|
if [ $verbose -gt 1 ]; then |
559 |
|
echo " change px from $px to $nx to accommodate $tx threads" |
560 |
|
fi |
561 |
|
fi |
562 |
|
ny=$py |
563 |
|
if [ `expr $sy % $ty` -ne 0 -a `expr $sy \* $py % $ty` -eq 0 ] ; then |
564 |
|
ny=`expr $sy \* $py / $ty` |
565 |
|
if [ $verbose -gt 1 ]; then |
566 |
|
echo " change py from $py to $ny to accommodate $ty threads" |
567 |
|
fi |
568 |
|
fi |
569 |
|
#- find the largest divisor of input_file proc Nb, but not larger than $np |
570 |
|
pp=0 |
571 |
|
i=1 |
572 |
|
while [ $i -le $nx ] ; do |
573 |
|
if [ `expr $nx % $i` -eq 0 ] ; then |
574 |
|
j=1 |
575 |
|
while [ $j -le $ny ] ; do |
576 |
|
if [ `expr $ny % $j` -eq 0 ] ; then |
577 |
|
ij=`expr $i \* $j` |
578 |
|
if [ $ij -gt $pp ] ; then |
579 |
|
flag=1 |
580 |
|
elif [ $ij -eq $pp ] ; then |
581 |
|
flag=$dirX |
582 |
|
else |
583 |
|
flag=0 |
584 |
|
fi |
585 |
|
if test $flag = 1 ; then |
586 |
|
if [ $ij -le $np ] ; then |
587 |
|
ix=$i ; jy=$j ; pp=$ij |
588 |
|
#echo " ix,jy= $ix,$jy" |
589 |
|
fi |
590 |
|
fi |
591 |
|
fi |
592 |
|
j=`expr $j + 1` |
593 |
|
done |
594 |
|
fi |
595 |
|
i=`expr $i + 1` |
596 |
|
done |
597 |
|
|
598 |
|
#- create new SIZE.h type file: |
599 |
|
sx=`expr $sx \* $px / $ix` |
600 |
|
sy=`expr $sy \* $py / $jy` |
601 |
|
if [ $verbose -gt 1 ]; then |
602 |
|
echo " px,py,np= $px,$py,$np : New MPI size: px,py= $ix,$jy : sx,sy= $sx,$sy" |
603 |
|
fi |
604 |
|
sed "/^ \& *nPx *=/s/[0-9]*,/$ix,/" $inp > $tmp |
605 |
|
sed "/^ \& *nPy *=/s/[0-9]*,/$jy,/" $tmp > $out |
606 |
|
sed "/^ \& *nSx *=/s/[0-9]*,/$sx,/" $out > $tmp |
607 |
|
sed "/^ \& *nSy *=/s/[0-9]*,/$sy,/" $tmp > $out |
608 |
|
rm -f $tmp |
609 |
|
return $pp |
610 |
|
} |
611 |
|
|
612 |
symlink_mpifiles() |
symlink_mpifiles() |
613 |
{ |
{ |
614 |
# Put special links so that MPI specific files are used |
# Put special links so that MPI specific files are used |
617 |
|
|
618 |
dir=$1 |
dir=$1 |
619 |
code_dir=$2 |
code_dir=$2 |
620 |
BUILD_DIR=$dir/$3 |
build_dir=$dir/$3 |
|
CODE_DIR=$dir/$code_dir |
|
621 |
|
|
622 |
# These are files that should replace their counter-part when using -mpi |
# These are files that should replace their counter-part when using -mpi |
623 |
MPI_FILES=`(cd $CODE_DIR; find . -name "*_mpi" -print)` |
MPI_FILES=`(cd $dir/$code_dir; find . -name "*_mpi" -print)` |
624 |
|
|
625 |
# Is this an MPI run? |
for ii in $MPI_FILES ; do |
626 |
if test "x$MPI" = xt ; then |
i=`echo $ii | sed 's:^\./::'` |
627 |
# YES: We symbolically link these files to the build |
name=`echo $i | sed 's:_mpi::'` |
628 |
# dir so long as there is no real file in place |
file="../$code_dir/$i" |
629 |
for ii in $MPI_FILES ; do |
if test $name = 'SIZE.h' ; then file="SIZE.h.mpi" ; fi |
630 |
i=`echo $ii | sed 's:^\./::'` |
|
631 |
name=`echo $i | sed 's:_mpi::' ` |
# Is this an MPI run? |
632 |
cmp $CODE_DIR/$i $BUILD_DIR/$name > /dev/null 2>&1 |
if test "x$MPI" = x0 ; then |
633 |
RETVAL=$? |
# NO: We undo any _mpi symbolically linked files |
634 |
if test "x$RETVAL" != x0 ; then |
if test -L $build_dir/$name ; then |
635 |
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 |
|
636 |
RETVAL=$? |
RETVAL=$? |
637 |
if test "x$RETVAL" = x0 ; then |
if test "x$RETVAL" = x0 ; then |
638 |
#echo Un-linking $name from $linktarg |
if [ $verbose -gt 1 ]; then |
639 |
rm -f $BUILD_DIR/$name |
echo " Un-linking $name from ../$code_dir" ; fi |
640 |
|
rm -f $build_dir/$name |
641 |
fi |
fi |
642 |
fi |
fi |
643 |
done |
else |
644 |
fi |
# YES: We symbolically link these files to the build |
645 |
|
# dir so long as there is no real file in place |
646 |
|
( cd $build_dir ; cmp $name $file > /dev/null 2>&1 ) |
647 |
|
RETVAL=$? |
648 |
|
if [ $verbose -gt 1 ]; then echo " cmp $name $file returns: $RETVAL" ; fi |
649 |
|
if test "x$RETVAL" != x0 ; then |
650 |
|
if test -h $build_dir/$name ; then rm -f $build_dir/$name ; fi |
651 |
|
if test ! -r $build_dir/$name ; then |
652 |
|
if [ $verbose -gt 1 ]; then echo " Linking $name to $file" ; fi |
653 |
|
(cd $build_dir; ln -sf $file $name) |
654 |
|
fi |
655 |
|
fi |
656 |
|
fi |
657 |
|
done |
658 |
} |
} |
659 |
|
|
660 |
linkdata() |
linkdata() |
671 |
if test -r "../"$1"/"$xx ; then |
if test -r "../"$1"/"$xx ; then |
672 |
# 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 |
673 |
yy=`echo $xx | sed 's:\.mpi$::'` |
yy=`echo $xx | sed 's:\.mpi$::'` |
674 |
if test "x$MPI" = "xt" ; then |
if test "x$MPI" = "x0" ; then |
675 |
# mpi test: remove symbolic link & link _mpi sfx file |
# not mpi test: remove symbolic link |
676 |
|
if test -h $yy ; then rm -f $yy ; fi |
677 |
|
else |
678 |
|
# mpi test: remove symbolic link & link .mpi sfx file |
679 |
if test -h $yy ; then rm -f $yy ; fi |
if test -h $yy ; then rm -f $yy ; fi |
680 |
if test ! -r $yy ; then |
if test ! -r $yy ; then |
681 |
ln -sf "../"$1"/"$xx $yy ; |
ln -sf "../"$1"/"$xx $yy ; |
682 |
printf " $xx" 1>&2 |
printf " $xx" 1>&2 |
683 |
fi |
fi |
|
else |
|
|
# not mpi test: remove symbolic link |
|
|
if test -h $yy ; then rm -f $yy ; fi |
|
684 |
fi |
fi |
685 |
fi |
fi |
686 |
done |
done |
728 |
{ |
{ |
729 |
# runmodel directory |
# runmodel directory |
730 |
# |
# |
731 |
# runs "$COMMAND in "directory" |
# runs $COMMAND in "directory" |
732 |
# (where "$COMMAND" is relative to "directory") |
# (where "$COMMAND" is relative to "directory") |
733 |
( |
( |
734 |
cd $1 |
cd $1 |
735 |
printf 'runmodel in %s ... ' $1 |
printf 'runmodel in %s ... ' $1 |
736 |
|
if test "x$MPI" != x0 ; then |
737 |
|
#- adjust the MPI run command with the right number of Procs |
738 |
|
#echo '' ; echo " COMMAND='$COMMAND'" |
739 |
|
COMMAND=`echo $COMMAND | sed "s/ TR_NPROC / $LOC_NPROC /"` |
740 |
|
if test "x$MPI_MFILE" != x ; then |
741 |
|
COMMAND=`echo $COMMAND | sed "s/ TR_MFILE / ..\/..\/$LOC_MFILE /"` |
742 |
|
fi |
743 |
|
#echo " COMMAND='$COMMAND'" |
744 |
|
fi |
745 |
if test -L $EXECUTABLE ; then |
if test -L $EXECUTABLE ; then |
746 |
if test -x "../"$builddir"/"$EXECUTABLE ; then |
if test -x "../"$builddir"/"$EXECUTABLE ; then |
747 |
diff -q $EXECUTABLE "../"$builddir"/"$EXECUTABLE > /dev/null 2>&1 |
cmp $EXECUTABLE "../"$builddir"/"$EXECUTABLE > /dev/null 2>&1 |
748 |
outD=$? ; if test $outD != 0 ; then rm -f $EXECUTABLE ; fi |
outD=$? ; if test "x$outD" != x0 ; then rm -f $EXECUTABLE ; fi |
749 |
else rm -f $EXECUTABLE |
else rm -f $EXECUTABLE |
750 |
fi |
fi |
751 |
fi |
fi |
754 |
ln -sf "../"$builddir"/"$EXECUTABLE . |
ln -sf "../"$builddir"/"$EXECUTABLE . |
755 |
fi |
fi |
756 |
if test ! -x $EXECUTABLE ; then |
if test ! -x $EXECUTABLE ; then |
757 |
rm -f $RUNLOG ; touch $RUNLOG |
rm -f $RUNLOG ; touch $RUNLOG |
758 |
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 |
759 |
echo " no executable:" $EXECUTABLE >> $RUNLOG |
echo " no executable:" $EXECUTABLE >> $RUNLOG |
760 |
RETVAL=8 |
RETVAL=8 |
761 |
ENDVAL=-1 |
ENDVAL=-1 |
762 |
else |
else |
763 |
if test ! -f $OUTPUTFILE -o $OUTPUTFILE -ot $EXECUTABLE ; then |
if test ! -f $OUTPUTFILE -o $OUTPUTFILE -ot $EXECUTABLE ; then |
764 |
# output do not exist or is older than executable: |
# output do not exist or is older than executable: |
765 |
rm -f $RUNLOG ; touch $RUNLOG |
rm -f $OUTPUTFILE $RUNLOG ; touch $RUNLOG |
766 |
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 |
767 |
( eval $COMMAND ) >> $RUNLOG 2>&1 |
( eval $COMMAND ) >> $RUNLOG 2>&1 |
768 |
RETVAL=$? |
RETVAL=$? |
769 |
else |
ENDVAL=`tail $OUTPUTFILE | grep -c 'PROGRAM MAIN: Execution ended Normally'` |
770 |
RETVAL=0 |
if [ $POSTCLEAN -eq 1 -a $ENDVAL -gt 0 ] ; then |
771 |
if test -f $RUNLOG ; then |
find . -name "*.meta" -exec rm {} \; |
772 |
if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi |
find . -name "*.data" -exec rm {} \; |
773 |
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 |
|
774 |
fi |
fi |
775 |
ENDVAL=`cat $RUNLOG | grep -v 'ABNORMAL END' | grep -c 'NORMAL END'` |
else |
776 |
|
RETVAL=0 |
777 |
|
ENDVAL=`tail $OUTPUTFILE | grep -c 'PROGRAM MAIN: Execution ended Normally'` |
778 |
|
touch $RUNLOG |
779 |
|
if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi |
780 |
|
echo "---------->> $OUTPUTFILE is up to date " >> $RUNLOG 2>&1 |
781 |
|
fi |
782 |
fi |
fi |
783 |
rm -f run.log_tmp |
rm -f run.log_tmp |
784 |
|
#- in all cases where OutputFile exists, report SIZE (and AD time) |
785 |
|
if test -f $OUTPUTFILE ; then |
786 |
|
grep '(PID\.TID 0000\.0001) n.. =' $OUTPUTFILE \ |
787 |
|
| sed 's/(PID.TID 0000.0001) //' >> $CDIR"/summary.txt" |
788 |
|
if test "x$ADM" = xt ; then |
789 |
|
grep -A3 'Seconds in section "ALL' $OUTPUTFILE >> $CDIR"/summary.txt" |
790 |
|
fi |
791 |
|
fi |
792 |
|
if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi |
793 |
if [ $RETVAL -eq 0 -a $ENDVAL -gt 0 ] ; then |
if [ $RETVAL -eq 0 -a $ENDVAL -gt 0 ] ; then |
794 |
echo successful |
echo successful |
795 |
printf '=> output from running in %s :\n' $1 1>&2 |
printf '=> output from running in %s :\n' $1 1>&2 |
796 |
tail $RUNLOG | sed 's/^.*/> &/g' 1>&2 |
tail $RUNLOG | sed 's/^.*/> &/g' 1>&2 |
|
# === Reduce the size of the testing emails! |
|
|
#cp $OUTPUTFILE $CDIR"/"$OUTPUTFILE |
|
|
if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi |
|
797 |
return 0 |
return 0 |
798 |
elif [ $RETVAL -ne 0 -a $ENDVAL -gt 0 ] ; then |
elif [ $RETVAL -ne 0 -a $ENDVAL -gt 0 ] ; then |
799 |
#-- for some weird cases (run is finihed but with error code) |
#-- for some weird cases (run is finihed but with error code) |
806 |
printf '=> output from running in %s :\n' $1 1>&2 |
printf '=> output from running in %s :\n' $1 1>&2 |
807 |
tail $RUNLOG | sed 's/^.*/> &/g' 1>&2 |
tail $RUNLOG | sed 's/^.*/> &/g' 1>&2 |
808 |
cp $RUNLOG $CDIR"/"$RUNLOG |
cp $RUNLOG $CDIR"/"$RUNLOG |
|
if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi |
|
809 |
return 1 |
return 1 |
810 |
fi |
fi |
811 |
) |
) |
907 |
|
|
908 |
check_eedata() |
check_eedata() |
909 |
{ |
{ |
910 |
# check_eedata size.h eedata |
# check_eedata eedata size.h |
911 |
if [ $# -eq 2 ] ; then |
if [ $# -eq 2 ] ; then |
912 |
if test -f $1 -a -f $2 ; then |
if test -f $1 -a -f $2 ; then |
913 |
sx=`grep "^ & *nSx *=" $1 | sed "s/^ & *nSx *=//" | sed 's/, *$//'` |
nx=`grep "^ *nTx *=" $1 | tail -1 | sed 's/^ *nTx *= *//' | sed "s/, *$//"` |
914 |
nx=`grep "^ *nTx *=" $2 | tail -1 | sed 's/^ *nTx *= *//' | sed "s/, *$//"` |
sx=`grep "^ & *nSx *=" $2 | sed "s/^ & *nSx *=//" | sed 's/, *$//'` |
915 |
if test "x$nx" = x ; then |
if test "x$nx" = x ; then |
916 |
rx=10 |
rx=10 |
917 |
else |
else |
918 |
rx=`expr $sx % $nx` |
rx=`expr $sx % $nx` |
919 |
fi |
fi |
920 |
sy=`grep "^ & *nSy *=" $1 | sed "s/^ & *nSy *=//" | sed 's/, *$//'` |
ny=`grep "^ *nTy *=" $1 | tail -1 | sed 's/^ *nTy *= *//' | sed "s/, *$//"` |
921 |
ny=`grep "^ *nTy *=" $2 | tail -1 | sed 's/^ *nTy *= *//' | sed "s/, *$//"` |
sy=`grep "^ & *nSy *=" $2 | sed "s/^ & *nSy *=//" | sed 's/, *$//'` |
922 |
if test "x$ny" = x ; then |
if test "x$ny" = x ; then |
923 |
ry=20 |
ry=20 |
924 |
else |
else |
925 |
ry=`expr $sy % $ny` |
ry=`expr $sy % $ny` |
926 |
fi |
fi |
927 |
echo `expr $rx + $ry` |
echo `expr $rx + $ry` |
928 |
else |
else |
929 |
echo '-1' |
echo '-1' |
930 |
fi |
fi |
931 |
|
elif [ $# -eq 1 ] ; then |
932 |
|
if test -f $1 ; then |
933 |
|
nx=`grep "^ *nTx *=" $1 | tail -1 | sed 's/^ *nTx *= *//' | sed "s/, *$//"` |
934 |
|
if test "x$nx" = x ; then nx=1 ; fi |
935 |
|
ny=`grep "^ *nTy *=" $1 | tail -1 | sed 's/^ *nTy *= *//' | sed "s/, *$//"` |
936 |
|
if test "x$ny" = x ; then ny=1 ; fi |
937 |
|
#echo $nx $ny |
938 |
|
echo $nx |
939 |
|
else |
940 |
|
echo '-1' |
941 |
|
fi |
942 |
else |
else |
943 |
echo '-2' |
echo '-2' |
944 |
fi |
fi |
951 |
# Default properties |
# Default properties |
952 |
debug=0 |
debug=0 |
953 |
verbose=1 |
verbose=1 |
954 |
clean=0 |
NBLINES_MKLOG=16000 |
955 |
|
|
956 |
IEEE=true |
OptLev=1 |
|
if test "x$MITGCM_IEEE" != x ; then |
|
|
IEEE=$MITGCM_IEEE |
|
|
fi |
|
957 |
GSL=f |
GSL=f |
958 |
|
|
959 |
CLEANUP=f |
CLEANUP=f |
963 |
NOGENMAKE=f |
NOGENMAKE=f |
964 |
NOCLEAN=f |
NOCLEAN=f |
965 |
NODEPEND=f |
NODEPEND=f |
966 |
POSTCLEAN=f |
POSTCLEAN=0 |
967 |
|
|
968 |
BASH= |
BASH= |
969 |
OPTFILE=NONE |
OPTFILE=NONE |
978 |
if test "x$MAKE" = x ; then |
if test "x$MAKE" = x ; then |
979 |
MAKE=make |
MAKE=make |
980 |
fi |
fi |
981 |
|
REPLMAKE= |
982 |
if test "x$CC" = x ; then |
if test "x$CC" = x ; then |
983 |
CC=cc |
CC=cc |
984 |
fi |
fi |
985 |
JOBS= |
JOBS= |
986 |
MPI=f |
TARG= |
987 |
|
MPI=0 |
988 |
|
MPI_MFILE= |
989 |
MULTI_THREAD=f |
MULTI_THREAD=f |
990 |
OUTDIR= |
OUTDIR= |
991 |
DELDIR= |
DELDIR= |
992 |
USE_R4= |
USE_R4= |
993 |
|
EXTRFLG= |
994 |
|
|
995 |
ADM= |
ADM= |
996 |
OADM= |
OADM= |
998 |
# list of pTracers to check for monitor output |
# list of pTracers to check for monitor output |
999 |
PTRACERS_NUM="1 2 3 4 5" |
PTRACERS_NUM="1 2 3 4 5" |
1000 |
|
|
1001 |
MATCH_CRIT=13 |
MATCH_CRIT=10 |
1002 |
|
|
1003 |
printf "parsing options... " |
printf "parsing options... " |
1004 |
|
|
1016 |
|
|
1017 |
case $ac_option in |
case $ac_option in |
1018 |
|
|
1019 |
-help | --help | -h | --h) |
-help | --help | -h | --h) usage ;; |
1020 |
usage ;; |
|
1021 |
|
-optfile | --optfile | -of | --of) ac_prev=OPTFILE ;; |
1022 |
-optfile | --optfile | -of | --of) |
-optfile=* | --optfile=* | -of=* | --of=*) OPTFILE=$ac_optarg ;; |
1023 |
ac_prev=OPTFILE ;; |
|
1024 |
-optfile=* | --optfile=* | -of=* | --of=*) |
-addr | --addr | -a | --a) ac_prev=ADDRESSES ;; |
1025 |
OPTFILE=$ac_optarg ;; |
-addr=* | --addr=* | -a=* | --a=*) ADDRESSES=$ac_optarg ;; |
1026 |
|
-mpackdir | --mpackdir | -mpd | --mpd) ac_prev=MPACKDIR ;; |
1027 |
-addr | --addr | -a | --a) |
-mpackdir=* | --mpackdir=* | -mpd=* | --mpd=*) MPACKDIR=$ac_optarg ;; |
1028 |
ac_prev=ADDRESSES ;; |
|
1029 |
-addr=* | --addr=* | -a=* | --a=*) |
-tdir | --tdir | -t | --t) ac_prev=TESTDIRS ;; |
1030 |
ADDRESSES=$ac_optarg ;; |
-tdir=* | --tdir=* | -t=* | --t=*) TESTDIRS=$ac_optarg ;; |
1031 |
-mpackdir | --mpackdir | -mpd | --mpd) |
-skipdir | --skipdir | -skd | --skd) ac_prev=SKIPDIRS ;; |
1032 |
ac_prev=MPACKDIR ;; |
-skipdir=* | --skipdir=* | -skd=* | --skd=*) SKIPDIRS=$ac_optarg ;; |
1033 |
-mpackdir=* | --mpackdir=* | -mpd=* | --mpd=*) |
|
1034 |
MPACKDIR=$ac_optarg ;; |
-bash | --bash | -b | --b) ac_prev=BASH ;; |
1035 |
|
-bash=* | --bash=* | -b=* | --b=*) BASH=$ac_optarg ;; |
1036 |
-tdir | --tdir | -t | --t) |
|
1037 |
ac_prev=TESTDIRS ;; |
-command | --command | -c | --c) ac_prev=COMMAND ;; |
1038 |
-tdir=* | --tdir=* | -t=* | --t=*) |
-command=* | --command=* | -c=* | --c=*) COMMAND=$ac_optarg ;; |
1039 |
TESTDIRS=$ac_optarg ;; |
|
1040 |
|
-makedepend | --makedepend | -md | --md) ac_prev=MKDEPEND ;; |
1041 |
-skipdir | --skipdir | -skd | --skd) |
-makedepend=* | --makedepend=* | -md=* | --md=*) MKDEPEND=$ac_optarg ;; |
1042 |
ac_prev=SKIPDIRS ;; |
|
1043 |
-skipdir=* | --skipdir=* | -skd=* | --skd=*) |
-make | --make | -m | --m) ac_prev=MAKE ;; |
1044 |
SKIPDIRS=$ac_optarg ;; |
-make=* | --make=* | -m=* | --m=*) MAKE=$ac_optarg ;; |
1045 |
|
|
1046 |
-bash | --bash | -b | --b) |
-repl_mk | --repl_mk ) ac_prev=REPLMAKE ;; |
1047 |
ac_prev=BASH ;; |
-repl_mk=* | --repl_mk=*) REPLMAKE=$ac_optarg ;; |
1048 |
-bash=* | --bash=* | -b=* | --b=*) |
|
1049 |
BASH=$ac_optarg ;; |
-odir | --odir) ac_prev=OUTDIR ;; |
1050 |
|
-odir=* | --odir=*) OUTDIR=$ac_optarg ;; |
1051 |
-command | --command | -c | --c) |
|
1052 |
ac_prev=COMMAND ;; |
-ptracers | --ptracers | -ptr | --ptr) ac_prev=PTRACERS_NUM ;; |
1053 |
-command=* | --command=* | -c=* | --c=*) |
-ptracers=* | --ptracers=* | -ptr=* | --ptr=*) PTRACERS_NUM=$ac_optarg ;; |
|
COMMAND=$ac_optarg ;; |
|
|
|
|
|
-makedepend | --makedepend | -md | --md) |
|
|
ac_prev=MKDEPEND ;; |
|
|
-makedepend=* | --makedepend=* | -md=* | --md=*) |
|
|
MKDEPEND=$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 ;; |
|
1054 |
|
|
1055 |
-match | --match ) ac_prev=MATCH_CRIT ;; |
-match | --match ) ac_prev=MATCH_CRIT ;; |
1056 |
-match=* | --match=* ) MATCH_CRIT=$ac_optarg ;; |
-match=* | --match=* ) MATCH_CRIT=$ac_optarg ;; |
1058 |
-j | --j) ac_prev=JOBS ;; |
-j | --j) ac_prev=JOBS ;; |
1059 |
-j=* | --j=*) JOBS=$ac_optarg ;; |
-j=* | --j=*) JOBS=$ac_optarg ;; |
1060 |
|
|
1061 |
-clean | --clean) |
-ef | --ef) ac_prev=EXTRFLG ;; |
1062 |
CLEANUP=t ; DELDIR=t ;; |
-ef=* | --ef=*) EXTRFLG=$ac_optarg ;; |
1063 |
|
|
1064 |
-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 ;; |
|
1065 |
|
|
1066 |
-postclean | --postclean | -pc | --pc) |
-norun | --norun | -nr | --nr) NORUN=t ;; |
1067 |
POSTCLEAN=t ;; |
-obj | --obj ) TARG='obj' ; NORUN=t ;; |
1068 |
|
-runonly | --runonly | -ro | --ro) QUICK=t ; NOMAKE=t ;; |
1069 |
|
-quick | --quick | -q | --q) QUICK=t ;; |
1070 |
|
-nogenmake | --nogenmake | -ng | --ng) NOGENMAKE=t ;; |
1071 |
|
-noclean | --noclean | -nc | --nc) NOCLEAN=t ;; |
1072 |
|
-nodepend | --nodepend | -nd | --nd) NODEPEND=t ;; |
1073 |
|
|
1074 |
|
-postclean | --postclean | -pc | --pc) POSTCLEAN=2 ;; |
1075 |
|
-deloutp | --deloutp | -do | --do) POSTCLEAN=1 ;; |
1076 |
|
|
1077 |
|
-mpi | --mpi) MPI=2 ;; |
1078 |
|
-MPI | --MPI) ac_prev=MPI ;; |
1079 |
|
-MPI=* | --MPI=*) MPI=$ac_optarg ;; |
1080 |
|
|
1081 |
-mpi) MPI=t ;; |
-mfile | --mfile | -mf | --mf) ac_prev=MPI_MFILE ;; |
1082 |
|
-mfile=* | --mfile=* | -mf=* | --mf=*) MPI_MFILE=$ac_optarg ;; |
1083 |
|
|
1084 |
-mth) MULTI_THREAD=t ;; |
-mth) MULTI_THREAD=t ;; |
1085 |
|
|
1086 |
-adm | -ad) ADM=t ;; |
-adm | -ad) ADM=t ;; |
|
|
|
1087 |
-oad) OADM=t; NODEPEND=t ;; |
-oad) OADM=t; NODEPEND=t ;; |
1088 |
|
|
1089 |
-ieee) IEEE=true ;; |
-ieee) echo "Warning: ignore option '-ieee' (already the default)" |
1090 |
-noieee) IEEE= ;; |
printf " ... " ;; |
1091 |
-gsl) GSL=t ;; |
-noieee) echo "Warning: will use option '-fast' instead of '-noieee' (obsolete)" |
1092 |
|
printf " ... " ; OptLev=`expr $OptLev \* 2` ;; |
1093 |
|
-fast) OptLev=`expr $OptLev \* 2` ;; |
1094 |
|
-devel) OptLev=0 ;; |
1095 |
|
-gsl) GSL=t ;; |
1096 |
|
|
1097 |
-verbose) verbose=2 ;; |
-verbose) verbose=2 ;; |
1098 |
-debug) debug=1 ;; |
-debug) debug=1 ;; |
1106 |
-papis) PAPIS=t;; |
-papis) PAPIS=t;; |
1107 |
-pcls) PCL=t;; |
-pcls) PCL=t;; |
1108 |
|
|
1109 |
-*) |
-*) echo "Error: unrecognized option: "$ac_option |
1110 |
echo "Error: unrecognized option: "$ac_option |
usage ;; |
1111 |
usage |
*) echo "Error: unrecognized argument: "$ac_option |
1112 |
;; |
usage ;; |
|
|
|
|
*) |
|
|
echo "Error: unrecognized argument: "$ac_option |
|
|
usage |
|
|
;; |
|
1113 |
|
|
1114 |
esac |
esac |
1115 |
|
|
1121 |
NODEPEND=t |
NODEPEND=t |
1122 |
fi |
fi |
1123 |
|
|
1124 |
|
#- check length of MPI machine file: |
1125 |
|
if test "x$MPI" != x0 -a "x$MPI_MFILE" != x ; then |
1126 |
|
if test -r $MPI_MFILE ; then |
1127 |
|
nl=`wc -l $MPI_MFILE | awk '{print $1}'` |
1128 |
|
if [ $nl -lt $MPI ] ; then |
1129 |
|
echo "Error: need at least $MPI nodes (currently only $nl) in MPI_MFILE=$MPI_FILE" |
1130 |
|
usage |
1131 |
|
fi |
1132 |
|
if [ $verbose -gt 1 ]; then |
1133 |
|
echo " MPI_MFILE=$MPI_MFILE : $nl procs for MPI=$MPI run" |
1134 |
|
fi |
1135 |
|
else |
1136 |
|
echo "Error: cannot access MPI_MFILE=$MPI_FILE" |
1137 |
|
usage |
1138 |
|
fi |
1139 |
|
fi |
1140 |
|
|
1141 |
#- setting for forward or ADM testing |
#- setting for forward or ADM testing |
1142 |
if test "x$ADM" = xt ; then |
if test "x$ADM" = xt ; then |
1143 |
|
if test "x$TARG" = xobj ; then TARG=adobj ; else TARG=adall ; fi |
1144 |
code_dir=code_ad |
code_dir=code_ad |
1145 |
inputdir=input_ad |
inputdir=input_ad |
1146 |
ref_outp="output_adm.txt" |
ref_outp="output_adm.txt" |
1147 |
EXECUTABLE="mitgcmuv_ad" |
EXECUTABLE="mitgcmuv_ad" |
1148 |
elif test "x$OADM" = xt ; then |
elif test "x$OADM" = xt ; then |
1149 |
|
TARG=adAll |
1150 |
code_dir=code_oad |
code_dir=code_oad |
1151 |
inputdir=input_oad |
inputdir=input_oad |
1152 |
ref_outp="output_oadm.txt" |
ref_outp="output_oadm.txt" |
1153 |
EXECUTABLE="mitgcmuv_ad" |
EXECUTABLE="mitgcmuv_ad" |
1154 |
else |
else |
1155 |
|
if test "x$JOBS" != x ; then TARG="-j $JOBS $TARG" ; fi |
1156 |
code_dir=code |
code_dir=code |
1157 |
inputdir=input |
inputdir=input |
1158 |
ref_outp="output.txt" |
ref_outp="output.txt" |
1159 |
EXECUTABLE="mitgcmuv" |
EXECUTABLE="mitgcmuv" |
1160 |
fi |
fi |
1161 |
|
|
1162 |
|
xx=`echo $TESTDIRS | awk '{print $1}'` |
1163 |
if test "x$TESTDIRS" = x ; then |
if test "x$TESTDIRS" = x ; then |
1164 |
LIST=`scandirs results/$ref_outp` |
LIST=`scandirs results/$ref_outp` |
1165 |
|
elif test $xx = 'start_from' ; then |
1166 |
|
xx=`echo $TESTDIRS | awk '{print $2}'` |
1167 |
|
LIST=`scandirs results/$ref_outp | sed -n "/$xx/,$ p"` |
1168 |
else |
else |
1169 |
#- expand group of experiments: |
#- expand group of experiments: |
1170 |
LIST=" " |
LIST=" " |
1208 |
OPTFILE=$MITGCM_OF |
OPTFILE=$MITGCM_OF |
1209 |
fi |
fi |
1210 |
|
|
1211 |
RUNLOG="run.log" |
LOC_MFILE='tr_mpi_mfile' |
1212 |
|
RUNLOG="run.tr_log" |
1213 |
OUTPUTFILE=$ref_outp |
OUTPUTFILE=$ref_outp |
1214 |
if test "x$COMMAND" = x ; then |
if test "x$COMMAND" = x ; then |
1215 |
COMMAND="./$EXECUTABLE > $OUTPUTFILE" |
COMMAND="./$EXECUTABLE > $OUTPUTFILE" |
1216 |
fi |
fi |
1217 |
if test "x$MPI" = xt ; then |
if test "x$MPI" != x0 ; then |
1218 |
OUTPUTFILE="STDOUT.0000" |
OUTPUTFILE="STDOUT.0000" |
1219 |
fi |
fi |
1220 |
|
|
1231 |
ii=`echo $EMPTY_RESULTS | awk '{print NF}'` |
ii=`echo $EMPTY_RESULTS | awk '{print NF}'` |
1232 |
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 " ."}}'` |
1233 |
else |
else |
1234 |
DEF_CHECK_LIST='Grad Cost Grad' |
DEF_CHECK_LIST='AdGrd Cost AdGrd FDGrd' |
1235 |
EMPTY_RESULTS='.. ..' |
EMPTY_RESULTS='.. .. ..' |
1236 |
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}'` |
1237 |
fi |
fi |
1238 |
|
|
1307 |
fi |
fi |
1308 |
else |
else |
1309 |
echo >> $SUMMARY |
echo >> $SUMMARY |
1310 |
echo "No \"OPTFILE\" was explicitly specified by testreport," >> $SUMMARY |
echo "No \"OPTFILE\" was specified ; genmake2 found and uses:" >> $SUMMARY |
1311 |
echo " so the genmake default will be used." >> $SUMMARY |
#-note: to be filled later after 1rst run |
1312 |
fi |
fi |
1313 |
echo |
echo |
1314 |
echo >> $SUMMARY |
echo >> $SUMMARY |
1318 |
else line_0="default "$MATCH_CRIT ; fi |
else line_0="default "$MATCH_CRIT ; fi |
1319 |
line_0="$line_0 ----T----- ----S----- ----U----- ----V-----" |
line_0="$line_0 ----T----- ----S----- ----U----- ----V-----" |
1320 |
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" |
1321 |
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 ." |
1322 |
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" |
1323 |
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 ." |
1324 |
for ii in $PTRACERS_NUM ; do |
for ii in $PTRACERS_NUM ; do |
1325 |
line_0="$line_0 --PTR 0"$ii"--" |
line_0="$line_0 --PTR 0"$ii"--" |
1342 |
else line_0="default "$MATCH_CRIT ; fi |
else line_0="default "$MATCH_CRIT ; fi |
1343 |
echo "$line_0" | tee -a $SUMMARY |
echo "$line_0" | tee -a $SUMMARY |
1344 |
cat << EOF | tee -a $SUMMARY |
cat << EOF | tee -a $SUMMARY |
1345 |
G D M C G |
G D M C A F |
1346 |
E p a R o r |
e p a R o d D |
1347 |
N n k u s a |
n n k u s G G |
1348 |
2 d e n t d |
2 d e n t r r |
1349 |
|
|
1350 |
EOF |
EOF |
1351 |
fi |
fi |
1358 |
builddir="build" |
builddir="build" |
1359 |
if test ! -d $dir/$builddir ; then mkdir $dir/$builddir ; fi |
if test ! -d $dir/$builddir ; then mkdir $dir/$builddir ; fi |
1360 |
rundir="run" |
rundir="run" |
1361 |
|
pfxdir="tr_$rundir" |
1362 |
if test ! -d $dir/$rundir ; then |
if test ! -d $dir/$rundir ; then |
1363 |
rundir=$builddir |
rundir=$builddir |
1364 |
fi |
fi |
1369 |
if test "x$CLEANUP" = xt ; then |
if test "x$CLEANUP" = xt ; then |
1370 |
echo -n ' --- dir:' $BUILD_DIR ': ' |
echo -n ' --- dir:' $BUILD_DIR ': ' |
1371 |
makeclean $BUILD_DIR |
makeclean $BUILD_DIR |
1372 |
rm -f $BUILD_DIR/$EXECUTABLE |
( cd $BUILD_DIR |
1373 |
|
rm -f $EXECUTABLE *.bak |
1374 |
|
rm -f genmake_state genmake_*optfile genmake.log |
1375 |
|
rm -f SIZE.h.mpi genmake.tr_log make.tr_log |
1376 |
|
) |
1377 |
if test -d $dir/$rundir/CVS ; then |
if test -d $dir/$rundir/CVS ; then |
1378 |
echo -n ' --- dir:' $dir/$rundir ': ' |
echo -n ' --- dir:' $dir/$rundir ': ' |
1379 |
run_clean $dir/$rundir |
run_clean $dir/$rundir |
1380 |
fi |
fi |
1381 |
trdir=`( cd $dir ; find . -type d -name "tr_run.*" -print | sed 's/^.\///')` |
trdir=`( cd $dir ; find . -type d -name "$pfxdir.*" -print | sed 's/^.\///')` |
1382 |
ttd=`echo $trdir | wc -w` |
ttd=`echo $trdir | wc -w` |
1383 |
if test $ttd != 0 ; then |
if test $ttd != 0 ; then |
1384 |
echo ' --- rm dir:' $trdir |
echo ' --- rm dir:' $trdir |
1397 |
|
|
1398 |
# Check for specific files for particular type of run |
# Check for specific files for particular type of run |
1399 |
|
|
1400 |
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 |
1401 |
echo "can't find \"$CODE_DIR/SIZE.h_mpi\" -- skipping $dir" |
echo "can't find \"$CODE_DIR/SIZE.h_mpi\" -- skipping $dir" |
1402 |
continue |
continue |
1403 |
fi |
fi |
1405 |
echo "can't find \"$dir/input/eedata.mth\" -- skipping $dir" |
echo "can't find \"$dir/input/eedata.mth\" -- skipping $dir" |
1406 |
continue |
continue |
1407 |
fi |
fi |
1408 |
if test "x$MPI" = "xt" -a "x$MULTI_THREAD" = "xt" ; then |
|
1409 |
retv=`check_eedata $CODE_DIR"/SIZE.h_mpi" $dir"/input/eedata.mth"` |
if test "x$MPI" != "x0" ; then |
1410 |
if test $retv != 0 ; then |
ntx=1 ; nty=1 |
1411 |
echo "input/eedata.mth tiling misfit -- skipping $dir" |
if test "x$MULTI_THREAD" = "xt" ; then |
1412 |
continue |
ff=$dir"/input/eedata.mth" |
1413 |
fi |
ntx=`grep "^ *nTx *=" $ff | tail -1 | sed 's/^ *nTx *= *//' | sed "s/, *$//"` |
1414 |
|
nty=`grep "^ *nTy *=" $ff | tail -1 | sed 's/^ *nTy *= *//' | sed "s/, *$//"` |
1415 |
|
fi |
1416 |
|
#- create new SIZE.h with no more than '$MPI' Procs |
1417 |
|
mk_mpi_size $CODE_DIR"/SIZE.h_mpi" $BUILD_DIR"/tr_size.mpi" $MPI $ntx $nty |
1418 |
|
LOC_NPROC=$? |
1419 |
|
( cd $BUILD_DIR |
1420 |
|
if test -r SIZE.h.mpi ; then |
1421 |
|
cmp tr_size.mpi SIZE.h.mpi > /dev/null 2>&1 ; RETVAL=$? |
1422 |
|
else RETVAL=1 |
1423 |
|
fi |
1424 |
|
if test "x$RETVAL" = x0 ; then |
1425 |
|
rm -f tr_size.mpi |
1426 |
|
else |
1427 |
|
rm -f SIZE.h.mpi ; mv tr_size.mpi SIZE.h.mpi |
1428 |
|
fi |
1429 |
|
) |
1430 |
|
if test "x$MPI_MFILE" != x ; then |
1431 |
|
#- create new MPI machine-file with the right number of Procs |
1432 |
|
rm -f $LOC_MFILE |
1433 |
|
cat $MPI_MFILE | sort | uniq | head -$LOC_NPROC > $LOC_MFILE |
1434 |
|
nl=`wc -l $LOC_MFILE | awk '{print $1}'` |
1435 |
|
if [ $nl -lt $LOC_NPROC ] ; then |
1436 |
|
rm -f $LOC_MFILE |
1437 |
|
cat $MPI_MFILE | head -$LOC_NPROC > $LOC_MFILE |
1438 |
|
#sed -n "1,$LOC_NPROC p" $MPI_MFILE > $LOC_MFILE |
1439 |
|
fi |
1440 |
|
if [ $verbose -gt 1 ]; then |
1441 |
|
nl=`wc -l $LOC_MFILE | awk '{print $1}'` |
1442 |
|
echo " new LOC_MFILE=$LOC_MFILE : $nl procs for LOC_NPROC=$LOC_NPROC" |
1443 |
|
fi |
1444 |
|
fi |
1445 |
|
if test "x$MULTI_THREAD" = "xt" ; then |
1446 |
|
retv=`check_eedata $dir"/input/eedata.mth" $BUILD_DIR"/SIZE.h.mpi"` |
1447 |
|
if test $retv != 0 ; then |
1448 |
|
echo "input/eedata.mth tiling misfit -- skipping $dir" |
1449 |
|
continue |
1450 |
|
fi |
1451 |
|
fi |
1452 |
fi |
fi |
1453 |
|
|
1454 |
# Check whether there are "extra runs" for this testdir |
# Check whether there are "extra runs" for this testdir |
1464 |
if test -f $outf -a -r $outf ; then |
if test -f $outf -a -r $outf ; then |
1465 |
if test "x$MULTI_THREAD" = "xt" ; then |
if test "x$MULTI_THREAD" = "xt" ; then |
1466 |
if test -r $dir"/"$exd"/eedata.mth" ; then |
if test -r $dir"/"$exd"/eedata.mth" ; then |
1467 |
if test "x$MPI" = "xt" ; then |
if test "x$MPI" = "x0" ; then |
1468 |
retv=`check_eedata $CODE_DIR"/SIZE.h_mpi" $dir"/"$exd"/eedata.mth"` |
extra_runs="$extra_runs $name" |
1469 |
|
else |
1470 |
|
retv=`check_eedata $dir"/"$exd"/eedata.mth" $BUILD_DIR"/SIZE.h.mpi"` |
1471 |
if test $retv = 0 ; then |
if test $retv = 0 ; then |
1472 |
extra_runs="$extra_runs $name" |
extra_runs="$extra_runs $name" |
1473 |
else |
else |
1474 |
echo $exd"/eedata.mth tiling misfit -- skipping $dir" |
echo $exd"/eedata.mth tiling misfit -- skipping $dir" |
1475 |
fi |
fi |
|
else |
|
|
extra_runs="$extra_runs $name" |
|
1476 |
fi |
fi |
1477 |
#else echo $dir"/"$exd"/eedata.mth: not found" |
#else echo $dir"/"$exd"/eedata.mth: not found" |
1478 |
fi |
fi |
1492 |
unset genmake makedepend make run |
unset genmake makedepend make run |
1493 |
results=$EMPTY_RESULTS |
results=$EMPTY_RESULTS |
1494 |
|
|
1495 |
# Create an output dir for each OPTFILE/tdir combination |
# Create an output dir & summary.txt file for each tested experiment (tdir) |
1496 |
locDIR=$DRESULTS"/"$dir |
locDIR=$DRESULTS"/"$dir |
1497 |
mkdir $locDIR |
mkdir $locDIR |
1498 |
|
#- report to this experiment local summary file --- |
1499 |
|
echo "DATE='$DATE' ; tdir='$dir'" > $locDIR"/summary.txt" |
1500 |
|
echo "MACH='$MACH'" >> $locDIR"/summary.txt" |
1501 |
|
echo "UNAMEA='$UNAMEA'" >> $locDIR"/summary.txt" |
1502 |
CDIR=`pwd`"/$locDIR" |
CDIR=`pwd`"/$locDIR" |
1503 |
|
|
1504 |
if test "x$NORUN" = xt ; then |
if test "x$NORUN" = xt ; then |
1524 |
fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` |
fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` |
1525 |
echo 1>&2 |
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 |
|
touch $locDIR"/summary.txt" |
|
1527 |
echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt" |
echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt" |
|
echo "MACH='$MACH'" >> $locDIR"/summary.txt" |
|
|
echo "UNAMEA='$UNAMEA'" >> $locDIR"/summary.txt" |
|
|
echo "DATE='$DATE'" >> $locDIR"/summary.txt" |
|
|
echo "tdir='$dir'" >> $locDIR"/summary.txt" |
|
|
if test "x$ADM" = xt ; then |
|
|
head -1 $dir/$builddir/taf_ad.log >> $locDIR"/summary.txt" |
|
|
grep -A3 'Seconds in section "ALL' $dir/$rundir/$OUTPUTFILE \ |
|
|
>> $locDIR"/summary.txt" |
|
|
fi |
|
1528 |
|
|
1529 |
for ex in $extra_runs ; do |
for ex in $extra_runs ; do |
1530 |
unset run |
unset run |
1531 |
results=$EMPTY_RESULTS |
results=$EMPTY_RESULTS |
1532 |
# reference output file |
# reference output file |
1533 |
refExOut=`echo $ref_outp | sed "s/\./.${ex}./g"` |
refExOut=`echo $ref_outp | sed "s/\./.${ex}./g"` |
1534 |
# Create an output dir for each OPTFILE/tdir.ex combination |
# Create an output dir & summary.txt file for each extra run (tdir.ex) |
1535 |
locDIR=$DRESULTS"/"$dir"."$ex |
locDIR=$DRESULTS"/"$dir"."$ex |
1536 |
mkdir $locDIR |
mkdir $locDIR |
1537 |
|
#- report to this experiment local summary file --- |
1538 |
|
echo "DATE='$DATE' ; tdir='$dir.$ex'" > $locDIR"/summary.txt" |
1539 |
|
#echo "MACH='$MACH'" >> $locDIR"/summary.txt" |
1540 |
|
#echo "UNAMEA='$UNAMEA'" >> $locDIR"/summary.txt" |
1541 |
CDIR=`pwd`"/$locDIR" |
CDIR=`pwd`"/$locDIR" |
1542 |
test ! -e "$dir/tr_run.$ex" && mkdir "$dir/tr_run.$ex" |
test ! -e "$dir/$pfxdir.$ex" && mkdir "$dir/$pfxdir.$ex" |
1543 |
run_clean $dir/tr_run.$ex |
run_clean $dir/$pfxdir.$ex |
1544 |
linkdata $dir/tr_run.$ex $inputdir.$ex $inputdir |
linkdata $dir/$pfxdir.$ex $inputdir.$ex $inputdir |
1545 |
runmodel $dir/tr_run.$ex && run=Y \ |
runmodel $dir/$pfxdir.$ex && run=Y \ |
1546 |
&& results=`testoutput_run $dir tr_run.$ex $refExOut` |
&& results=`testoutput_run $dir $pfxdir.$ex $refExOut` |
1547 |
fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` |
fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` |
1548 |
fres="$fres.$ex" |
fres="$fres.$ex" |
1549 |
echo 1>&2 |
echo 1>&2 |
1550 |
echo "$fres" | sed 's/ 99/ --/g' | sed 's/ > />/' | sed 's/ < /</' >> $SUMMARY |
echo "$fres" | sed 's/ 99/ --/g' | sed 's/ > />/' | sed 's/ < /</' >> $SUMMARY |
|
touch $locDIR"/summary.txt" |
|
1551 |
echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt" |
echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt" |
1552 |
echo "MACH='$MACH'" >> $locDIR"/summary.txt" |
if test "x$POSTCLEAN" = x2 ; then |
1553 |
echo "UNAMEA='$UNAMEA'" >> $locDIR"/summary.txt" |
run_clean $dir/$pfxdir.$ex |
|
echo "DATE='$DATE'" >> $locDIR"/summary.txt" |
|
|
echo "tdir='$dir.$ex'" >> $locDIR"/summary.txt" |
|
|
if test "x$ADM" = xt ; then |
|
|
head -1 $dir/$builddir/taf_ad.log >> $locDIR"/summary.txt" |
|
|
grep -A3 'Seconds in section "ALL' $dir/tr_run.$ex/$OUTPUTFILE \ |
|
|
>> $locDIR"/summary.txt" |
|
|
fi |
|
|
if test "x$POSTCLEAN" = xt ; then |
|
|
run_clean $dir/tr_run.$ex |
|
1554 |
fi |
fi |
1555 |
done |
done |
1556 |
|
|
1559 |
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/^# //'` |
1560 |
echo "from '$dir/$builddir/Makefile', extract:" > $DRESULTS/genmake_state |
echo "from '$dir/$builddir/Makefile', extract:" > $DRESULTS/genmake_state |
1561 |
sed -n '/^# executed by:/,+1 p' $dir/$builddir/Makefile >> $DRESULTS/genmake_state |
sed -n '/^# executed by:/,+1 p' $dir/$builddir/Makefile >> $DRESULTS/genmake_state |
1562 |
echo $mkOpt >> $DRESULTS/genmake_state |
echo " $mkOpt" >> $DRESULTS/genmake_state |
1563 |
|
if test "x$OPTFILE" = xNONE ; then |
1564 |
|
eval $mkOpt |
1565 |
|
sed "/^No \"OPTFILE\" was specified ; genmake2/a\ OPTFILE=${OPTFILE}"\ |
1566 |
|
$SUMMARY > tr_0.tmp_log |
1567 |
|
RETVAL=$? |
1568 |
|
if test "x$RETVAL" = x0 ; then rm -f $SUMMARY |
1569 |
|
cp tr_0.tmp_log $SUMMARY |
1570 |
|
else rm -f tr_0.tmp_log |
1571 |
|
fi |
1572 |
|
fi |
1573 |
|
gmkLog=$dir/$builddir/genmake.log |
1574 |
|
grep '^Get compiler version using:' $gmkLog > /dev/null 2>&1 |
1575 |
|
RETVAL=$? |
1576 |
|
if test "x$RETVAL" = x0 ; then |
1577 |
|
echo "from '$gmkLog', extract compiler version:" >> $DRESULTS/genmake_state |
1578 |
|
sed -n '/Get compiler version/,/<-- compiler version/p' $gmkLog \ |
1579 |
|
| grep -v '^... compiler version ' > tr_1.tmp_log |
1580 |
|
sed -n '1p' tr_1.tmp_log >> $DRESULTS/genmake_state |
1581 |
|
sed -n '2,/^$/p' tr_1.tmp_log | sed '/^$/d' | sed 's/^./ &/' \ |
1582 |
|
>> $DRESULTS/genmake_state |
1583 |
|
rm -f tr_1.tmp_log |
1584 |
|
fi |
1585 |
fi |
fi |
1586 |
fi |
fi |
1587 |
#postclean $dir/$builddir |
#postclean $dir/$builddir |
1588 |
if test "x$POSTCLEAN" = xt ; then |
if test "x$POSTCLEAN" = x2 ; then |
1589 |
makeclean $dir/$builddir \ |
makeclean $dir/$builddir \ |
1590 |
&& run_clean $dir/$rundir |
&& run_clean $dir/$rundir |
1591 |
fi |
fi |
1592 |
|
if test "x$MPI" != x0 -a "x$MPI_MFILE" != x ; then rm -f $LOC_MFILE ; fi |
1593 |
|
|
1594 |
echo "-------------------------------------------------------------------------------" |
echo "-------------------------------------------------------------------------------" |
1595 |
|
|