353 |
command="$command -pcls" |
command="$command -pcls" |
354 |
fi |
fi |
355 |
fi |
fi |
356 |
printf 'genmake ... ' 1>&2 |
printf 'genmake ... ' |
|
# $command > make.log 2>&1 |
|
357 |
eval $command > make.log 2>&1 |
eval $command > make.log 2>&1 |
358 |
RETVAL=$? |
RETVAL=$? |
359 |
# Reduce the size of the testing emails! |
# Reduce the size of the testing emails! |
360 |
head -100 Makefile > $CDIR/Makefile_head |
head -100 Makefile > $CDIR/Makefile_head |
361 |
if test "x$RETVAL" != x0 ; then |
if test "x$RETVAL" != x0 ; then |
362 |
tail make.log |
tail make.log |
363 |
echo "genmakemodel: genmake failed" 1>&2 |
echo "genmakemodel: genmake failed" |
364 |
cp genmake_* make.log $CDIR |
cp genmake_* make.log $CDIR |
365 |
return 1 |
return 1 |
366 |
else |
else |
367 |
echo "successful" 1>&2 |
echo "successful" |
368 |
fi |
fi |
369 |
) |
) |
370 |
fi |
fi |
380 |
cd $1; |
cd $1; |
381 |
#if test -e $OUTPUTFILE ; then rm -f $OUTPUTFILE ; fi |
#if test -e $OUTPUTFILE ; then rm -f $OUTPUTFILE ; fi |
382 |
if test -r Makefile ; then |
if test -r Makefile ; then |
383 |
printf 'clean build-dir: make Clean ... ' 2>&1 |
printf 'clean build-dir: make Clean ... ' |
384 |
$MAKE Clean >> make.log 2>&1 |
$MAKE Clean >> make.log 2>&1 |
385 |
RETVAL=$? |
RETVAL=$? |
386 |
if test "x$RETVAL" != x0 ; then |
if test "x$RETVAL" != x0 ; then |
387 |
tail make.log |
tail make.log |
388 |
echo "makeclean: \"make Clean\" failed" 1>&2 |
echo "makeclean: \"make Clean\" failed" |
389 |
cp make.log $CDIR"/make.log" |
cp make.log $CDIR"/make.log" |
390 |
return 1 |
return 1 |
391 |
fi |
fi |
392 |
echo successful 1>&2 |
echo successful |
393 |
else |
else |
394 |
echo '' |
echo '' |
395 |
fi |
fi |
406 |
else |
else |
407 |
( |
( |
408 |
cd $1; |
cd $1; |
409 |
printf 'clean run-dir ... ' 2>&1 |
printf 'clean run-dir ... ' |
410 |
# part of what is done after "make clean" when doing "make CLEAN" |
# part of what is done after "make clean" when doing "make CLEAN" |
411 |
find . -name "*.meta" -exec rm {} \; |
find . -name "*.meta" -exec rm {} \; |
412 |
find . -name "*.data" -exec rm {} \; |
find . -name "*.data" -exec rm {} \; |
415 |
rm -f $EXECUTABLE *.txt STD* *diagnostics.log datetime |
rm -f $EXECUTABLE *.txt STD* *diagnostics.log datetime |
416 |
rm -rf mnc_test_* |
rm -rf mnc_test_* |
417 |
rm -f *_MIT_CE_000.opt0000 costfunction*0000 |
rm -f *_MIT_CE_000.opt0000 costfunction*0000 |
418 |
echo successful 1>&2 |
echo successful |
419 |
exit 0 |
exit 0 |
420 |
) |
) |
421 |
fi |
fi |
429 |
else |
else |
430 |
( |
( |
431 |
cd $1; |
cd $1; |
432 |
printf 'make depend ... ' 1>&2 |
printf 'make depend ... ' |
433 |
$MAKE depend >> make.log 2>&1 |
$MAKE depend >> make.log 2>&1 |
434 |
RETVAL=$? |
RETVAL=$? |
435 |
if test "x$RETVAL" != x0 ; then |
if test "x$RETVAL" != x0 ; then |
436 |
tail make.log |
tail make.log |
437 |
echo "makedependmodel: make depend failed" 1>&2 |
echo "makedependmodel: make depend failed" |
438 |
cp make.log $CDIR"/make.log" |
cp make.log $CDIR"/make.log" |
439 |
return 1 |
return 1 |
440 |
else |
else |
441 |
echo successful 1>&2 |
echo successful |
442 |
fi |
fi |
443 |
) |
) |
444 |
fi |
fi |
459 |
else |
else |
460 |
cd $1; |
cd $1; |
461 |
if test -r Makefile ; then |
if test -r Makefile ; then |
462 |
printf 'make ... ' 1>&2 |
printf 'make ... ' |
463 |
if test "x$ADM" = xt ; then |
if test "x$ADM" = xt ; then |
464 |
$MAKE adall >> make.log 2>&1 |
$MAKE adall >> make.log 2>&1 |
465 |
elif test "x$OADM" = xt ; then |
elif test "x$OADM" = xt ; then |
474 |
RETVAL=$? |
RETVAL=$? |
475 |
if test "x$RETVAL" != x0 ; then |
if test "x$RETVAL" != x0 ; then |
476 |
tail make.log |
tail make.log |
477 |
echo failed 1>&2 |
echo failed |
478 |
cp make.log $CDIR"/make.log" |
cp make.log $CDIR"/make.log" |
479 |
rm -f $EXECUTABLE |
rm -f $EXECUTABLE |
480 |
return 1 |
return 1 |
481 |
else |
else |
482 |
echo successful 1>&2 |
echo successful |
483 |
fi |
fi |
484 |
fi |
fi |
485 |
fi |
fi |
542 |
if test -d $1 ; then |
if test -d $1 ; then |
543 |
( |
( |
544 |
cd $1 ; shift |
cd $1 ; shift |
545 |
|
echo 'linkdata from dirs:' $* |
546 |
inpMPI=`(cd ../$1 ; find . -name "*.mpi" -print | sed 's:^\./::')` |
inpMPI=`(cd ../$1 ; find . -name "*.mpi" -print | sed 's:^\./::')` |
547 |
for xx in $inpMPI ; do |
for xx in $inpMPI ; do |
548 |
if test -r "../"$1"/"$xx ; then |
if test -r "../"$1"/"$xx ; then |
553 |
if test -h $yy ; then rm -f $yy ; fi |
if test -h $yy ; then rm -f $yy ; fi |
554 |
if test ! -r $yy ; then |
if test ! -r $yy ; then |
555 |
ln -sf "../"$1"/"$xx $yy ; |
ln -sf "../"$1"/"$xx $yy ; |
556 |
printf "$xx " 1>&2 |
printf " $xx" 1>&2 |
557 |
fi |
fi |
558 |
else |
else |
559 |
# not mpi test: remove symbolic link |
# not mpi test: remove symbolic link |
568 |
if test -h eedata ; then rm -f eedata ; fi |
if test -h eedata ; then rm -f eedata ; fi |
569 |
if test ! -r eedata ; then |
if test ! -r eedata ; then |
570 |
ln -sf "../"$1"/eedata.mth" eedata ; |
ln -sf "../"$1"/eedata.mth" eedata ; |
571 |
printf 'eedata.mth ' 1>&2 |
printf ' eedata.mth' 1>&2 |
572 |
fi |
fi |
573 |
else |
else |
574 |
# not multi-threaded test: remove eedata symbolic link |
# not multi-threaded test: remove eedata symbolic link |
578 |
prevDir='NONE' |
prevDir='NONE' |
579 |
for ldir in $* ; do |
for ldir in $* ; do |
580 |
if test -d "../"$ldir -a $ldir != $prevDir ; then |
if test -d "../"$ldir -a $ldir != $prevDir ; then |
581 |
printf 'ldir='${ldir} 1>&2 |
printf " ldir=${ldir}:" 1>&2 |
582 |
files=`( cd "../"$ldir ; ls -1 | grep -v CVS )` |
files=`( cd "../"$ldir ; ls -1 | grep -v CVS )` |
583 |
for i in $files ; do |
for i in $files ; do |
584 |
if test ! -d "../"$ldir/$i ; then |
if test ! -d "../"$ldir/$i ; then |
588 |
fi |
fi |
589 |
fi |
fi |
590 |
done |
done |
591 |
|
printf ' ;' 1>&2 |
592 |
if test -x "../"$ldir"/"prepare_run ; then |
if test -x "../"$ldir"/"prepare_run ; then |
593 |
"../"$ldir"/"prepare_run |
"../"$ldir"/"prepare_run 1>&2 |
594 |
|
else |
595 |
|
echo '' 1>&2 |
596 |
fi |
fi |
|
printf ' ; ' 1>&2 |
|
597 |
fi |
fi |
598 |
prevDir=$ldir |
prevDir=$ldir |
599 |
done |
done |
609 |
# (where "$COMMAND" is relative to "directory") |
# (where "$COMMAND" is relative to "directory") |
610 |
( |
( |
611 |
cd $1 |
cd $1 |
612 |
printf 'runmodel in %s ...' $1 1>&2 |
printf 'runmodel in %s ... ' $1 |
|
# make output.txt |
|
|
echo |
|
613 |
if test -L $EXECUTABLE ; then |
if test -L $EXECUTABLE ; then |
614 |
if test -x "../"$builddir"/"$EXECUTABLE ; then |
if test -x "../"$builddir"/"$EXECUTABLE ; then |
615 |
diff -q $EXECUTABLE "../"$builddir"/"$EXECUTABLE > /dev/null 2>&1 |
diff -q $EXECUTABLE "../"$builddir"/"$EXECUTABLE > /dev/null 2>&1 |
650 |
fi |
fi |
651 |
rm -f run.log_tmp |
rm -f run.log_tmp |
652 |
if [ $RETVAL -eq 0 -a $ENDVAL -gt 0 ] ; then |
if [ $RETVAL -eq 0 -a $ENDVAL -gt 0 ] ; then |
653 |
tail $RUNLOG |
echo successful |
654 |
echo successful 1>&2 |
printf '=> output from running in %s :\n' $1 1>&2 |
655 |
|
tail $RUNLOG | sed 's/^.*/> &/g' 1>&2 |
656 |
# === Reduce the size of the testing emails! |
# === Reduce the size of the testing emails! |
657 |
#cp $OUTPUTFILE $CDIR"/"$OUTPUTFILE |
#cp $OUTPUTFILE $CDIR"/"$OUTPUTFILE |
658 |
if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi |
if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi |
659 |
return 0 |
return 0 |
660 |
elif [ $RETVAL -ne 0 -a $ENDVAL -gt 0 ] ; then |
elif [ $RETVAL -ne 0 -a $ENDVAL -gt 0 ] ; then |
661 |
#-- for some weird cases (run is finihed but with error code) |
#-- for some weird cases (run is finihed but with error code) |
662 |
tail $RUNLOG |
echo 'finished with error (run:' $RETVAL ' end:' $ENDVAL ')' |
663 |
echo finished with error '(run:' $RETVAL ' end:' $ENDVAL ')' 1>&2 |
printf '=> output from running in %s :\n' $1 1>&2 |
664 |
|
tail $RUNLOG | sed 's/^.*/> &/g' 1>&2 |
665 |
return 0 |
return 0 |
666 |
else |
else |
667 |
tail $RUNLOG |
echo 'failed (run:' $RETVAL ' end:' $ENDVAL ')' |
668 |
echo failed '(run:' $RETVAL ' end:' $ENDVAL ')' 1>&2 |
printf '=> output from running in %s :\n' $1 1>&2 |
669 |
|
tail $RUNLOG | sed 's/^.*/> &/g' 1>&2 |
670 |
cp $RUNLOG $CDIR"/"$RUNLOG |
cp $RUNLOG $CDIR"/"$RUNLOG |
671 |
if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi |
if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi |
672 |
return 1 |
return 1 |
1158 |
then line_0="default "$MATCH_CRIT ; |
then line_0="default "$MATCH_CRIT ; |
1159 |
else line_0="default "$MATCH_CRIT ; fi |
else line_0="default "$MATCH_CRIT ; fi |
1160 |
line_0="$line_0 ----T----- ----S----- ----U----- ----V-----" |
line_0="$line_0 ----T----- ----S----- ----U----- ----V-----" |
|
# line_0=" ----T----- ----S----- ----U----- ----V-----" |
|
1161 |
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" |
1162 |
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 ." |
1163 |
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" |
1190 |
|
|
1191 |
EOF |
EOF |
1192 |
fi |
fi |
1193 |
|
echo "-------------------------------------------------------------------------------" |
1194 |
|
|
1195 |
# ...and each test directory... |
# ...and each test directory... |
1196 |
for dir in $TESTDIRS ; do |
for dir in $TESTDIRS ; do |
1280 |
fi |
fi |
1281 |
done |
done |
1282 |
|
|
|
echo "-------------------------------------------------------------------------------" |
|
1283 |
echo |
echo |
1284 |
if test "x$extra_runs" = "x" ; then |
if test "x$extra_runs" = "x" ; then |
1285 |
echo "Experiment: $dir" |
echo "Experiment: $dir" |
1299 |
run=N |
run=N |
1300 |
genmakemodel $dir/$builddir && genmake=Y \ |
genmakemodel $dir/$builddir && genmake=Y \ |
1301 |
&& makeclean $dir/$builddir \ |
&& makeclean $dir/$builddir \ |
|
&& run_clean $dir/$rundir \ |
|
1302 |
&& symlink_mpifiles $dir $code_dir $builddir \ |
&& symlink_mpifiles $dir $code_dir $builddir \ |
1303 |
&& makedependmodel $dir/$builddir && makedepend=Y \ |
&& makedependmodel $dir/$builddir && makedepend=Y \ |
1304 |
&& makemodel $dir/$builddir && make=Y |
&& makemodel $dir/$builddir && make=Y |
1305 |
else |
else |
1306 |
genmakemodel $dir/$builddir && genmake=Y \ |
genmakemodel $dir/$builddir && genmake=Y \ |
1307 |
&& makeclean $dir/$builddir \ |
&& makeclean $dir/$builddir \ |
|
&& run_clean $dir/$rundir \ |
|
1308 |
&& symlink_mpifiles $dir $code_dir $builddir \ |
&& symlink_mpifiles $dir $code_dir $builddir \ |
1309 |
&& makedependmodel $dir/$builddir && makedepend=Y \ |
&& makedependmodel $dir/$builddir && makedepend=Y \ |
1310 |
&& makemodel $dir/$builddir && make=Y \ |
&& makemodel $dir/$builddir && make=Y \ |
1311 |
|
&& run_clean $dir/$rundir \ |
1312 |
&& linkdata $dir/$rundir $inputdir input \ |
&& linkdata $dir/$rundir $inputdir input \ |
1313 |
&& runmodel $dir/$rundir && run=Y \ |
&& runmodel $dir/$rundir && run=Y \ |
1314 |
&& results=`testoutput_run $dir $rundir $ref_outp` |
&& results=`testoutput_run $dir $rundir $ref_outp` |
1315 |
fi |
fi |
|
|
|
1316 |
#echo "results='$results'" |
#echo "results='$results'" |
1317 |
echo |
|
1318 |
fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` |
fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` |
1319 |
echo |
echo 1>&2 |
1320 |
echo "$fres" | sed 's/ 99/ --/g' | sed 's/ > />/' | sed 's/ < /</' >> $SUMMARY |
echo "$fres" | sed 's/ 99/ --/g' | sed 's/ > />/' | sed 's/ < /</' >> $SUMMARY |
1321 |
touch $locDIR"/summary.txt" |
touch $locDIR"/summary.txt" |
1322 |
echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt" |
echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt" |
1346 |
&& results=`testoutput_run $dir tr_run.$ex $refExOut` |
&& results=`testoutput_run $dir tr_run.$ex $refExOut` |
1347 |
fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` |
fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` |
1348 |
fres="$fres.$ex" |
fres="$fres.$ex" |
1349 |
echo |
echo 1>&2 |
1350 |
echo "$fres" | sed 's/ 99/ --/g' | sed 's/ > />/' | sed 's/ < /</' >> $SUMMARY |
echo "$fres" | sed 's/ 99/ --/g' | sed 's/ > />/' | sed 's/ < /</' >> $SUMMARY |
1351 |
touch $locDIR"/summary.txt" |
touch $locDIR"/summary.txt" |
1352 |
echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt" |
echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt" |
1364 |
fi |
fi |
1365 |
done |
done |
1366 |
|
|
1367 |
if test -f $DRESULTS"/"genmake_state ; then : ; else |
if test -f $DRESULTS"/"genmake_state ; then : ; else |
1368 |
if test -f $dir/$builddir/Makefile ; then |
if test -f $dir/$builddir/Makefile ; then |
1369 |
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/^# //'` |
1370 |
echo "from '$dir/$builddir/Makefile', extract:" > $DRESULTS/genmake_state |
echo "from '$dir/$builddir/Makefile', extract:" > $DRESULTS/genmake_state |