Does running a parallel "make -jN check" work safely?

Daniel Jacobowitz drow@false.org
Tue Feb 24 22:45:00 GMT 2004


On Tue, Feb 24, 2004 at 04:52:33PM -0500, Kaveh R. Ghazi wrote:
>  > From: Jim Wilson <wilson@specifixinc.com>
>  > 
>  > Kaveh R. Ghazi wrote:
>  > > I'm wondering whether running "make -jN check" is safe.  I'm
>  > 
>  > I have problems with the java testsuite when I use make -jN.  Some of 
>  > the java tests are self-timing.  They time a loop, use that timing info 
>  > to set a timer, and then do something that might hang.  See for instance 
>  > libjava/testsuite/libjava.lang/Thread_Interrupt.java.  These tests work 
>  > fine normally, but are unreliable with make -jN.  I suspect that the 
>  > changing load average disrupts the timing of them.  I avoid parallel 
>  > make checks because of this problem.  I am talking about using N > 
>  > number of processors here.  Maybe they work OK if N <= number of processors.
>  > 
>  > If your target is a simulator, and you have a broken simulator that 
>  > requires the dejagnu testglue.o file, then running tests in parallel may 
>  > fail because of conflicts with the testglue.o file.  This one might have 
>  > been fixed though; I am not sure.
> 
> Thanks for the info.  I get random libjava Thread_* failures
> regardless. :-/ I don't use a sim so can't say much about that.
> 
> The thing I was worried about was if I run multilib passes (e.g. -m32
> vs -m64 on sparc-solaris) whether it would run those in parallel too
> and clobber the identically named executable for testcase.c with -m32
> and testcase.c with -m64.
> 
> When Brad said he used parallel check regularly, I decided to give it
> a try comparing serial vs -j10 (on a 32-cpu box).  It seems to work
> fine when the results were diff'ed.  Turns out that multiple passes in
> $RUNTESTFLAGS are executed serially.  So that wasn't an issue.
> 
> Therefore, the maximum parallelization you'll get for "make -jN check"
> is one thread for each of the gcc, g++, g77, objc, libstdc++-v3,
> libjava and libffi testsuites.  (More if you bootstrap with Ada and/or
> treelang, but I generally don't.)  So in my case, you'll achieve
> maximum benefit at -j7.  That's a vast improvement, BTW and allows me
> to run with extra passes more often.  I've made -jN a standard part of
> my scripts that test GCC now.

Take a look at this in gcc/Makefile.in:

# The idea is to parallelize testing of multilibs, for example:
#   make -j3 check-gcc//sh-hms-sim/{-m1,-m2,-m3,-m3e,-m4}/{,-nofpu}
# will run 3 concurrent sessions of check-gcc, eventually testing
# all 10 combinations.  GNU make is required, as is a shell that expands
# alternations within braces.

There's no easy equivalent for the library testsuites but that will
handle the compiler.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer



More information about the Gcc mailing list