From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31256 invoked by alias); 15 Oct 2008 18:30:48 -0000 Received: (qmail 31246 invoked by uid 22791); 15 Oct 2008 18:30:47 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 15 Oct 2008 18:29:56 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m9FITsQg023220; Wed, 15 Oct 2008 14:29:54 -0400 Received: from tyan-ft48-01.lab.bos.redhat.com (tyan-ft48-01.lab.bos.redhat.com [10.16.42.4]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m9FITsbu011732; Wed, 15 Oct 2008 14:29:54 -0400 Received: (from jakub@localhost) by tyan-ft48-01.lab.bos.redhat.com (8.14.2/8.14.2/Submit) id m9FIUGBW017116; Wed, 15 Oct 2008 20:30:16 +0200 Date: Wed, 15 Oct 2008 22:10:00 -0000 From: Jakub Jelinek To: Janis Johnson Cc: gcc-patches@gcc.gnu.org Subject: Re: [contrib] dg-extract-test-results.sh, to combine or extract .sum files Message-ID: <20081015183016.GA30239@tyan-ft48-01.lab.bos.redhat.com> Reply-To: Jakub Jelinek References: <1224093373.6379.5.camel@janis-laptop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1224093373.6379.5.camel@janis-laptop> User-Agent: Mutt/1.5.18 (2008-05-17) X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2008-10/txt/msg00659.txt.bz2 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