This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [contrib] dg-extract-test-results.sh, to combine or extract .sum files
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Janis Johnson <janis187 at us dot ibm dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 15 Oct 2008 20:30:16 +0200
- Subject: Re: [contrib] dg-extract-test-results.sh, to combine or extract .sum files
- References: <1224093373.6379.5.camel@janis-laptop>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Oct 15, 2008 at 10:56:13AM -0700, Janis Johnson wrote:
> I've been using this quite a bit with results from my attempts to
> paralellize the compiler tests on GNU/Linux. I've tried to make it
> portable but it's quite possible that it isn't. I'd appreicate having
> other people try it out, perhaps just by running a .sum file through it
> to make sure the result is the same as the original file.
Here is a WIP what I've been playing with today. Some tuning
is needed in check_gcc_parallelize (guess tree-ssa.exp and maybe
dg-torture.exp and/or vect.exp could be kicked out and replaced by some *.exp
that takes a long time, measuring times right now (likely i386.exp
(or generally $(target).exp?), unsorted.exp and stackalign.exp),
but even with this I got make -j8 -k check-gcc finished in 19 minutes
instead of the usual 60 minutes. The merging is something I've left
out for the time being, so your merge script could be very handy.
If you use make -j4 check-gcc RUNTESTFLAGS=dg.exp etc., it doesn't
parallelize and similarly if make check-gcc, parallelization is only done
if RUNTESTFLAGS is empty or contains only --target_board and -j was used.
I believe check-gcc is the longest one, check-target-libstdc++-v3 the
second and check-gfortran the third. check-g++ and check-gfortran speedup
is harder if we don't want to restructure the exp files, most of
check-g++ time is in dg.exp and most of check-gfortran time is in dg.exp
too. Perhaps something like running dg.exp=[a-h]* in one case and
dg.exp=[^a-h]* in check-gfortran and something similar for check-g++
could help.
--- gcc/Makefile.in.jj 2008-10-14 13:58:50.000000000 +0200
+++ gcc/Makefile.in 2008-10-15 20:02:21.000000000 +0200
@@ -442,6 +442,10 @@ GTHREAD_FLAGS=@gthread_flags@
extra_modes_file=@extra_modes_file@
extra_opt_files=@extra_opt_files@
host_hook_obj=@out_host_hook_obj@
+# This lists a couple of test files that take most time during check-gcc.
+# When doing parallelized check-gcc, these can run in parallel with the
+# remaining tests.
+check_gcc_parallelize=compile.exp execute.exp dg.exp dg-torture.exp tree-ssa.exp vect.exp
# ------------------------
# Installation directories
@@ -4498,7 +4502,7 @@ $(TESTSUITEDIR)/site.exp: site.exp
-rm -f $@
sed '/set tmpdir/ s|testsuite|$(TESTSUITEDIR)|' < site.exp > $@
-$(lang_checks): check-% : site.exp
+$(filter-out check-gcc,$(lang_checks)): check-% : site.exp
-test -d $(TESTSUITEDIR) || mkdir $(TESTSUITEDIR)
test -d $(TESTSUITEDIR)/$* || mkdir $(TESTSUITEDIR)/$*
-(rootme=`${PWD_COMMAND}`; export rootme; \
@@ -4515,6 +4519,47 @@ $(lang_checks): check-% : site.exp
GCC_EXEC_PREFIX="$(libdir)/gcc/" ; export GCC_EXEC_PREFIX ; \
$(RUNTEST) --tool $* $(RUNTESTFLAGS))
+$(filter check-gcc, $(lang_checks)): check-% : site.exp
+ @if [ -z "$(filter-out --target_board=%, $(RUNTESTFLAGS))" ] \
+ && [ "$(filter -j, $(MFLAGS))" = "-j" ]; then \
+ $(MAKE) RUNTESTFLAGS=$(RUNTESTFLAGS) \
+ check-parallel-$* $(patsubst %,check-parallel-$*_%,$(check_$*_parallelize)); \
+ echo "Merge it now"; \
+ else \
+ $(MAKE) RUNTESTFLAGS=$(RUNTESTFLAGS) check_$*_parallelize= check-parallel-$*; \
+ fi
+
+check-parallel-% : site.exp
+ -test -d $(TESTSUITEDIR) || mkdir $(TESTSUITEDIR)
+ test -d $(TESTSUITEDIR)/$* || mkdir $(TESTSUITEDIR)/$*
+ -(rootme=`${PWD_COMMAND}`; export rootme; \
+ srcdir=`cd ${srcdir}; ${PWD_COMMAND}` ; export srcdir ; \
+ cd $(TESTSUITEDIR)/$*; \
+ rm -f tmp-site.exp; \
+ sed '/set tmpdir/ s|testsuite|$(TESTSUITEDIR)/$*|' \
+ < ../../site.exp > tmp-site.exp; \
+ $(SHELL) $${srcdir}/../move-if-change tmp-site.exp site.exp; \
+ EXPECT=${EXPECT} ; export EXPECT ; \
+ if [ -f $${rootme}/../expect/expect ] ; then \
+ TCL_LIBRARY=`cd .. ; cd $${srcdir}/../tcl/library ; ${PWD_COMMAND}` ; \
+ export TCL_LIBRARY ; fi ; \
+ GCC_EXEC_PREFIX="$(libdir)/gcc/" ; export GCC_EXEC_PREFIX ; \
+ tool=`echo "$*" | sed 's/_.*$$//'` ; \
+ part=`echo "$*" | sed -n 's/^[^_]*_//p'` ; \
+ runtestflags= ; \
+ if [ -n "$$part" ] ; then \
+ runtestflags="$$part" ; \
+ elif [ -n "$(check_$*_parallelize)" ] ; then \
+ for part in `find $$srcdir/testsuite/$$tool* -name \*.exp` ; do \
+ part=`basename $$part` ; \
+ case " $(strip $(check_$*_parallelize)) $$runtestflags " in \
+ *" $$part "*) ;; \
+ *) runtestflags="$$runtestflags $$part" ;; \
+ esac ; \
+ done ; \
+ fi ; \
+ $(RUNTEST) --tool $$tool $(RUNTESTFLAGS) $$runtestflags)
+
check-consistency: testsuite/site.exp
-rootme=`${PWD_COMMAND}`; export rootme; \
srcdir=`cd ${srcdir}; ${PWD_COMMAND}` ; export srcdir ; \
@@ -4552,7 +4597,7 @@ QMTEST_DIR=qmtestsuite
${QMTEST_DIR} stamp-qmtest:
${QMTEST} -D ${QMTEST_DIR} create-tdb \
-c gcc_database.GCCDatabase \
- -a srcdir=`cd ${srcdir}/testsuite && ${PWD_COMMAND}` && \
+ -a srcdir=`cd ${srcdir}/testsuite && ${PWD_COMMAND}` && \
$(STAMP) stamp-qmtest
# Create the QMTest context file.
Jakub