You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Shawn Heisey <ap...@elyograg.org> on 2015/02/11 19:34:54 UTC

'ant test' -- calculation for tests.jvms

If the computer has four CPU cores, running tests via the build system
will set tests.jvms to 3, but if it has three CPU cores, it will set
tests.jvms to 1.

IMHO, this calculation should be adjusted so that a 3-core system gets a
value of 2.  I've been trying to find the code that calculates it, but
I've come up empty so far.

Does anyone like or hate this idea?

Thanks,
Shawn


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: 'ant test' -- calculation for tests.jvms

Posted by Dawid Weiss <da...@cs.put.poznan.pl>.
> The easiest to work around this is to put a lucene.build.properties into
> your home directory and specify tests.jvms there.

Exactly. If you only look for tweaking the defaults on your machine
then this is the best solution -- create lucene.build.properties in
your home folder and specify:

tests.jvms=3

in there. Voila.

Answering your other question this has nothing to do with JUnit. JUnit
(by default) uses a single-threaded runner (and for good reasons).
Tests in Lucene fork separate isolated JVMs, each running a single
threaded runner (although not JUnit's one).

Dawid

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: 'ant test' -- calculation for tests.jvms

Posted by Uwe Schindler <uw...@thetaphi.de>.
The easiest to work around this is to put a lucene.build.properties into your home directory and specify tests.jvms there.

I have this next to other settings like disabling slow tests. The Jenkins machines are set up the same way.

Am 12. Februar 2015 00:05:25 MEZ, schrieb Shawn Heisey <ap...@elyograg.org>:
>On 2/11/2015 12:42 PM, Dawid Weiss wrote:
>>> IMHO, this calculation should be adjusted so that a 3-core system
>gets a value of 2.
>> A 3-core system? What happened to one of its, ahem, gems? :)
>
>This is the processor I have:
>
>http://www.newegg.com/Product/Product.aspx?Item=N82E16819103683
>
>The X3 chip line consists of 4-core chips that have had one of the
>cores
>disabled.  Initially AMD did this because sometimes one of the cores
>would be bad and fail tests, but later they also used it as a way to
>sell perfectly good 4-core chips at a lower price point, by disabling
>one of the cores.  There's no way to know (aside from testing) why any
>specific chip is an X3 instead of an X4, but apparently most of the X3
>chips on the market have 4 perfectly good cores.
>
>The motherboard I'm using will enable the disabled core, but when I
>enabled the relevant BIOS setting (which also overclocked the chip a
>little bit), I had stability problems with the machine, so I disabled
>it
>and now I'm back down to three cores at the labelled speed.  Eventually
>I will get around to figuring out whether the disabled core is bad or
>the stability problems were due to overclocking.
>
>Is this JVM calculation only done in the carrotsearch randomized
>testing, or is it also found in JUnit itself?
>
>Thanks,
>Shawn
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
>For additional commands, e-mail: dev-help@lucene.apache.org

--
Uwe Schindler
H.-H.-Meier-Allee 63, 28213 Bremen
http://www.thetaphi.de

Re: 'ant test' -- calculation for tests.jvms

Posted by Shawn Heisey <ap...@elyograg.org>.
On 2/11/2015 12:42 PM, Dawid Weiss wrote:
>> IMHO, this calculation should be adjusted so that a 3-core system gets a value of 2.
> A 3-core system? What happened to one of its, ahem, gems? :)

This is the processor I have:

http://www.newegg.com/Product/Product.aspx?Item=N82E16819103683

The X3 chip line consists of 4-core chips that have had one of the cores
disabled.  Initially AMD did this because sometimes one of the cores
would be bad and fail tests, but later they also used it as a way to
sell perfectly good 4-core chips at a lower price point, by disabling
one of the cores.  There's no way to know (aside from testing) why any
specific chip is an X3 instead of an X4, but apparently most of the X3
chips on the market have 4 perfectly good cores.

The motherboard I'm using will enable the disabled core, but when I
enabled the relevant BIOS setting (which also overclocked the chip a
little bit), I had stability problems with the machine, so I disabled it
and now I'm back down to three cores at the labelled speed.  Eventually
I will get around to figuring out whether the disabled core is bad or
the stability problems were due to overclocking.

Is this JVM calculation only done in the carrotsearch randomized
testing, or is it also found in JUnit itself?

Thanks,
Shawn


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: 'ant test' -- calculation for tests.jvms

Posted by Dawid Weiss <da...@cs.put.poznan.pl>.
> IMHO, this calculation should be adjusted so that a 3-core system gets a value of 2.

A 3-core system? What happened to one of its, ahem, gems? :)

> I've been trying to find the code that calculates it, but I've come up empty so far.

The code to adjust it automatically is in the runner itself, here:

https://github.com/carrotsearch/randomizedtesting/blob/master/junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/JUnit4.java#L1288

Feel free to provide a patch, although I think a 3-core system is an
not something many people have. The rationale for decreasing the
number of threads on 4-cores and on is to leave some slack for GC, ANT
itself, etc. Otherwise you can brick the machine.

Dawid

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org