From patchwork Thu May 7 11:26:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 469601 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 75BC6140281 for ; Thu, 7 May 2015 21:27:15 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=ScV2q2iW; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:mime-version:content-type; q=dns; s=default; b=O7kBAENmQPY1voLQJPXFP7M+4FzY5Ak38+rH4qarl/BN7+v0Fd PEuDnIxmVU0nRGT/+2hij6/sQ5XGlFghRLBvGpi6fxBVeYH10dFCSanRC00rH/Sx RznPk81/mH/qTNU2hcO/+64uwNP/LJtBtZ3wZh85SXuthpA0dXGmwp7yE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:mime-version:content-type; s= default; bh=nZjIppuPHxAg2KL574t3Az6HTrg=; b=ScV2q2iWcnoLqOQzjDGm 2T3r/8MmfSd4519KycylTFexuy2o9cOwt91Us9vYE27RqXkuf8mAKew5btoRchtm ILivlTllW12aSdgjx9UXiAHJwWpVtKLWK5eTlF2aXa/7bjw4CsKPg79ipxZacpet /DN2WRCuJkJdCRjTsqOtIMU= Received: (qmail 128134 invoked by alias); 7 May 2015 11:27:07 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 128125 invoked by uid 89); 7 May 2015 11:27:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.2 required=5.0 tests=AWL, BAYES_50, KAM_LAZY_DOMAIN_SECURITY, T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: smtp-relay.CeBiTec.Uni-Bielefeld.DE Received: from snape.CeBiTec.Uni-Bielefeld.DE (HELO smtp-relay.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 07 May 2015 11:27:04 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 5636DE23; Thu, 7 May 2015 13:27:02 +0200 (CEST) Received: from smtp-relay.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id seAG+t-bdHd0; Thu, 7 May 2015 13:26:58 +0200 (CEST) Received: from lokon.CeBiTec.Uni-Bielefeld.DE (lokon.CeBiTec.Uni-Bielefeld.DE [129.70.161.110]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id 429AFE22; Thu, 7 May 2015 13:26:58 +0200 (CEST) Received: (from ro@localhost) by lokon.CeBiTec.Uni-Bielefeld.DE (8.15.1+Sun/8.15.1/Submit) id t47BQv2R011412; Thu, 7 May 2015 13:26:57 +0200 (CEST) From: Rainer Orth To: gcc-patches@gcc.gnu.org Cc: Jakub Jelinek Subject: [libgomp, testsuite] Support parallel testing in libgomp (PR libgomp/66005) Date: Thu, 07 May 2015 13:26:57 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (usg-unix-v) MIME-Version: 1.0 X-IsSubscribed: yes As reported in the PR, with the addition of all those OpenACC tests, libgomp make check times have skyrocketed since the testsuite is still run sequentially. Even on a reasonably fast x86 machine (4 x 2.0 Ghz Xeon E7450) the run takes 4286 seconds. On slower sparc boxes (1.2 GHz UltraSPARC-T2) we're at 29406 seconds, compared to 7825 seconds on the 4.9 branch. Thus, the libgomp tests massively slow down the whole testsuite run, being the last part to finish. Fixing this proved trivial: I managed to almost literally copy the solution from libstdc++-v3/testsuite/Makefile.am, with a minimal change to libgomp.exp so the generated libgomp-test-support.exp file is found in both the sequential and parallel cases. This isn't an issue in libstdc++ since all necessary variables are stored in a single site.exp. Tested with make (1:13:53.80) and make -j128 (4:58.78) on i386-pc-solaris2.11 (4 x 2.0 Ghz Xeon E7-4850), no differences in results according to contrib/dg-cmp-results.sh. Ok for mainline and gcc-5 branch after some soak time? Rainer 2015-05-06 Rainer Orth PR libgomp/66005 * testsuite/Makefile.am (PWD_COMMAND): New variable. (%/site.exp): New target. (check_p_numbers0, check_p_numbers1, check_p_numbers2) (check_p_numbers3, check_p_numbers4, check_p_numbers5) (check_p_numbers6, check_p_numbers, check_p_subdirs) (check_DEJAGNU_normal_targets): New variables. ($(check_DEJAGNU_normal_targets)): New target. ($(check_DEJAGNU_normal_targets)): New dependency. (check-DEJAGNU $(check_DEJAGNU_normal_targets)): New targets. * testsuite/Makefile.in: Regenerate. * testsuite/lib/libgomp.exp: Also search in .. for libgomp-test-support.exp. # HG changeset patch # Parent 56a827256364c7b567b751287defdb0c9eabc666 Support parallel testing in libgomp (PR libgomp/66005) diff --git a/libgomp/testsuite/Makefile.am b/libgomp/testsuite/Makefile.am --- a/libgomp/testsuite/Makefile.am +++ b/libgomp/testsuite/Makefile.am @@ -12,6 +12,71 @@ EXPECT = $(shell if test -f $(top_buildd echo $(top_srcdir)/../dejagnu/runtest; else echo runtest; fi) RUNTEST = "$(_RUNTEST) $(AM_RUNTESTFLAGS)" +PWD_COMMAND = $${PWDCMD-pwd} + +%/site.exp: site.exp + -@test -d $* || mkdir $* + @srcdir=`cd $(srcdir); ${PWD_COMMAND}`; + @objdir=`${PWD_COMMAND}`/$*; \ + sed -e "s|^set srcdir .*$$|set srcdir $$srcdir|" \ + -e "s|^set objdir .*$$|set objdir $$objdir|" \ + site.exp > $*/site.exp.tmp + @-rm -f $*/site.bak + @test ! -f $*/site.exp || mv $*/site.exp $*/site.bak + @mv $*/site.exp.tmp $*/site.exp + +check_p_numbers0:=1 2 3 4 5 6 7 8 9 +check_p_numbers1:=0 $(check_p_numbers0) +check_p_numbers2:=$(foreach i,$(check_p_numbers0),$(addprefix $(i),$(check_p_numbers1))) +check_p_numbers3:=$(addprefix 0,$(check_p_numbers1)) $(check_p_numbers2) +check_p_numbers4:=$(foreach i,$(check_p_numbers0),$(addprefix $(i),$(check_p_numbers3))) +check_p_numbers5:=$(addprefix 0,$(check_p_numbers3)) $(check_p_numbers4) +check_p_numbers6:=$(foreach i,$(check_p_numbers0),$(addprefix $(i),$(check_p_numbers5))) +check_p_numbers:=$(check_p_numbers0) $(check_p_numbers2) $(check_p_numbers4) $(check_p_numbers6) +check_p_subdirs=$(wordlist 1,$(if $(GCC_TEST_PARALLEL_SLOTS),$(GCC_TEST_PARALLEL_SLOTS),128),$(check_p_numbers)) +check_DEJAGNU_normal_targets = $(addprefix check-DEJAGNUnormal,$(check_p_subdirs)) +$(check_DEJAGNU_normal_targets): check-DEJAGNUnormal%: normal%/site.exp + +check-DEJAGNU $(check_DEJAGNU_normal_targets): check-DEJAGNU%: site.exp + $(if $*,@)AR="$(AR)"; export AR; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + if [ -z "$*" ] && [ "$(filter -j, $(MFLAGS))" = "-j" ]; then \ + rm -rf normal-parallel || true; \ + mkdir normal-parallel; \ + $(MAKE) $(AM_MAKEFLAGS) $(check_DEJAGNU_normal_targets); \ + rm -rf normal-parallel || true; \ + for idx in $(check_p_subdirs); do \ + if [ -d normal$$idx ]; then \ + mv -f normal$$idx/libgomp.sum normal$$idx/libgomp.sum.sep; \ + mv -f normal$$idx/libgomp.log normal$$idx/libgomp.log.sep; \ + fi; \ + done; \ + $(SHELL) $(srcdir)/../../contrib/dg-extract-results.sh \ + normal[0-9]*/libgomp.sum.sep > libgomp.sum; \ + $(SHELL) $(srcdir)/../../contrib/dg-extract-results.sh -L \ + normal[0-9]*/libgomp.log.sep > libgomp.log; \ + exit 0; \ + fi; \ + srcdir=`$(am__cd) $(srcdir) && pwd`; export srcdir; \ + EXPECT=$(EXPECT); export EXPECT; \ + runtest=$(RUNTEST); \ + if [ -z "$$runtest" ]; then runtest=runtest; fi; \ + tool=libgomp; \ + if [ -n "$*" ]; then \ + if [ -f normal-parallel/finished ]; then rm -rf "$*"; exit 0; fi; \ + GCC_RUNTEST_PARALLELIZE_DIR=`${PWD_COMMAND}`/normal-parallel; \ + export GCC_RUNTEST_PARALLELIZE_DIR; \ + cd "$*"; \ + fi; \ + if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \ + $$runtest $(AM_RUNTESTFLAGS) $(RUNTESTDEFAULTFLAGS) \ + $(RUNTESTFLAGS); \ + if [ -n "$*" ]; then \ + touch $$GCC_RUNTEST_PARALLELIZE_DIR/finished; \ + fi; \ + else \ + echo "WARNING: could not find \`runtest'" 1>&2; :;\ + fi # Instead of directly in ../testsuite/libgomp-test-support.exp.in, the # following variables have to be "routed through" this Makefile, for expansion diff --git a/libgomp/testsuite/lib/libgomp.exp b/libgomp/testsuite/lib/libgomp.exp --- a/libgomp/testsuite/lib/libgomp.exp +++ b/libgomp/testsuite/lib/libgomp.exp @@ -33,7 +33,8 @@ load_gcc_lib torture-options.exp load_gcc_lib fortran-modules.exp # Try to load a test support file, built during libgomp configuration. -load_file libgomp-test-support.exp +# Search in both .. and . to support parallel and sequential testing. +load_file -1 ../libgomp-test-support.exp libgomp-test-support.exp # Populate offload_targets_s (offloading targets separated by a space), and # offload_targets_s_openacc (the same, but with OpenACC names; OpenACC spells