public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
To: Thomas Schwinge <thomas@codesourcery.com>
Cc: rep.dot.nop@gmail.com, Jakub Jelinek <jakub@redhat.com>,
	Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>,
	<gcc-patches@gcc.gnu.org>,
	Tobias Burnus <tobias@codesourcery.com>,
	Mike Stump <mikestump@comcast.net>, Jan Hubicka <hubicka@ucw.cz>,
	Segher Boessenkool <segher@kernel.crashing.org>
Subject: Re: Support parallel testing in libgomp, part I [PR66005]
Date: Sat, 6 May 2023 16:15:45 +0200	[thread overview]
Message-ID: <20230506161545.2be3ffa6@nbbrfq> (raw)
In-Reply-To: <87h6srb1iq.fsf@euler.schwinge.homeip.net>

On Fri, 5 May 2023 10:55:41 +0200
Thomas Schwinge <thomas@codesourcery.com> wrote:

> So I recently had re-created this patch independently, before remembering
> that Rainer had -- just eight years ago... ;-) -- already submitted this.

thanks to you both :)

> etc. (where "normal" is a libstdc++ detail), and regarding:
> 
> >> > 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.  
> 
> ... in 'libgomp/testsuite/lib/libgomp.exp', I've changed:
> 
>     -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
> 
> ... into the more explicit:
> 
>     -load_file libgomp-test-support.exp
>     +# Search in '..' vs. '.' to support parallel vs. sequential testing.
>     +if [info exists ::env(GCC_RUNTEST_PARALLELIZE_DIR)] {
>     +    load_file ../libgomp-test-support.exp
>     +} else {
>     +    load_file libgomp-test-support.exp
>     +}

Do we have to re-read those? Otherwise this would be load_lib:

We have libdirs in the minimum deja we require.

Speaking of which. IIRC i additionally deleted all load_gcc_lib:
https://gcc.gnu.org/legacy-ml/fortran/2012-03/msg00094.html
in lib{atomic,ffi,go,gomp,itm,phobos,stdc++-v3,vtv}

> And, for now, I hard-code the number of parallel slots to one.  This
> means that libgomp for 'make -j' now does use the parallel testing code
> paths, but is restricted to just one slot.  That is, no actual change in
> behavior, other than that 'libgomp.sum' then is filtered through
> 'contrib/dg-extract-results.sh'.
> 
> OK to push the attached
> "Support parallel testing in libgomp, part I [PR66005]"?

Some cosmetic nits.
See Jakubs one_to_9999.

+	@test ! -f $*/site.exp || mv $*/site.exp $*/site.bak
that's twisted

+	  rm -rf libgomp-parallel || true; \

just || :; \
I count 4 times.

There seems to be a mixture of ${PWD_COMMAND} and am__cd && pwd:
+	@objdir=`${PWD_COMMAND}`/$*; \
+	srcdir=`$(am__cd) $(srcdir) && pwd`; export srcdir; \

+	runtest=$(_RUNTEST); \
+	if [ -z "$$runtest" ]; then runtest=runtest; fi; \
I think I have plain $${RUNTEST-runtest}
off the default wildcard $(top_srcdir)/../dejagnu/runtest

> >> It is far from trivial though.
> >> The point is that most of the OpenMP tests are parallelized with the
> >> default OMP_NUM_THREADS, so running the tests in parallel oversubscribes the
> >> machine a lot, the higher number of hw threads the more.  
> >
> > Do you agree that we have two classes of test cases in libgomp: 1) test
> > cases that don't place a considerably higher load on the machine compared
> > to "normal" (single-threaded) execution tests, because they're just
> > testing some functionality that is not expected to actively depend
> > on/interfere with parallelism.  If needed, and/or if not already done,
> > such test cases can be parameterized (OMP_NUM_THREADS, OpenACC num_gangs,
> > num_workers, vector_length clauses, and so on) for low parallelism
> > levels.  And, 2) test cases that place a considerably higher load on the
> > machine compared to "normal" (single-threaded) execution tests, because
> > they're testing some functionality that actively depends on/interferes
> > with some kind of parallelism.  What about marking such tests specially,
> > such that DejaGnu will only ever schedule one of them for execution at
> > the same time?  For example, a new dg-* directive to run them wrapped
> > through »flock [libgomp/testsuite/serial.lock] [a.out]« or some such?

I think we all agree one that, yes.

> >  
> >> If we go forward with some parallelization of the tests, we at least should
> >> try to export something like OMP_WAIT_POLICY=passive so that the
> >> oversubscribed machine would at least not spend too much time in spinning.  
> >
> > (Will again have the problem that DejaGnu doesn't provide infrastructure
> > to communicate environment variables to boards in remote testing.)

Are you sure? I'm pretty confident that this worked fine at least at
one point in the past for certain targets.

The rest of these 2 patches LGTM. Let's see what others have to say.
thanks,

  parent reply	other threads:[~2023-05-06 19:30 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-07 11:27 [libgomp, testsuite] Support parallel testing in libgomp (PR libgomp/66005) Rainer Orth
2015-05-07 11:39 ` Jakub Jelinek
2015-05-07 18:07   ` Mike Stump
2015-05-08  8:40   ` Thomas Schwinge
2018-08-14  8:37     ` Martin Liška
2023-05-05  8:55     ` Support parallel testing in libgomp, part I [PR66005] Thomas Schwinge
2023-05-05  8:59       ` Support parallel testing in libgomp, part II [PR66005] Thomas Schwinge
2023-05-09 17:27         ` Bernhard Reutner-Fischer
2023-05-16 14:32         ` Support parallel testing in libgomp: fallback Perl 'flock' [PR66005] Thomas Schwinge
2023-05-06 14:15       ` Bernhard Reutner-Fischer [this message]
2023-05-08 10:42         ` Support parallel testing in libgomp, part I [PR66005] Thomas Schwinge
2023-05-08 17:52           ` Bernhard Reutner-Fischer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230506161545.2be3ffa6@nbbrfq \
    --to=rep.dot.nop@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hubicka@ucw.cz \
    --cc=jakub@redhat.com \
    --cc=mikestump@comcast.net \
    --cc=ro@CeBiTec.Uni-Bielefeld.DE \
    --cc=segher@kernel.crashing.org \
    --cc=thomas@codesourcery.com \
    --cc=tobias@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).