[libmath-prime-util-perl] 07/18: Lighten threads testing for normal case (helps some slower machines), add more for release testing

Partha P. Mukherjee ppm-guest at moszumanska.debian.org
Thu May 21 18:46:39 UTC 2015


This is an automated email from the git hooks/post-receive script.

ppm-guest pushed a commit to annotated tag v0.17
in repository libmath-prime-util-perl.

commit c5533dc4078ca89f6aaa1d80f4f082938c954f7d
Author: Dana Jacobsen <dana at acm.org>
Date:   Mon Dec 17 01:56:40 2012 -0800

    Lighten threads testing for normal case (helps some slower machines), add more for release testing
---
 examples/parallel_fibprime.pl |  3 ++-
 t/31-threading.t              | 14 ++++++++++----
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/examples/parallel_fibprime.pl b/examples/parallel_fibprime.pl
index 50df2a5..22a51d6 100755
--- a/examples/parallel_fibprime.pl
+++ b/examples/parallel_fibprime.pl
@@ -14,7 +14,8 @@ $| = 1;
 #
 # This will fully utilize however many cores you choose (using the $nthreads
 # variable).  It spreads the numbers across threads, where each one runs a
-# BPSW test.  A separate thread handles the in-order display.
+# BPSW test.  A separate thread handles the in-order display.  I have tested
+# it on machines with 2, 4, 8, 12, 24, and 64 cores.
 #
 # On my 12-core computer:
 #    24    5387              0.65488
diff --git a/t/31-threading.t b/t/31-threading.t
index 100af72..b9a952f 100644
--- a/t/31-threading.t
+++ b/t/31-threading.t
@@ -28,9 +28,12 @@ BEGIN {
 use Test::More 'tests' => 9;
 use Math::Prime::Util ":all";
 
+my $extra = defined $ENV{RELEASE_TESTING} && $ENV{RELEASE_TESTING};
+my $is_win32 = ($Config{osname} eq 'MSWin32')  ?  1  :  0;
+
 # threads are memory hogs, so we want few of them.  But for testing purposes,
 # we want a lot of them.  4-8 perhaps.
-my $numthreads = 8;
+my $numthreads = 4;
 
 # Random numbers, pregenerated
 my @randn = (
@@ -40,7 +43,11 @@ my @randn = (
     39165  8147 62890 63565 39279 47830 43617 40299 65372 37479   884 27007
     24978 55716 38115 71502 30134 40903 71231 40095  9054 54133 13876 55660
     44544  1880 39217 36609 38711 49576 55029 21831 75022 69128  2311 16321
-     1400  9659  6010  8206 78113 76539 17430 69393 26519 50162 49317 20231
+     1400  9659  6010  8206 78113 76539 17430 69393 26519 50162 49317 20231/);
+
+if ($extra) {
+  $numthreads *= 2;
+  push @randn, (qw/
     11019 28515 73527 50147 33512 28347 19122 66580 14286 81842 38344 10886
     52253 57834 37446 49360 24401 45815 54811  1703 38180 22473 17946 58833
     29700 55366 35155 31902 28299 34139 51961 75210  9126 30331 54658 50208
@@ -60,8 +67,7 @@ my @randn = (
     23284 41448 37349 59268 36894 79674 31694 73975 71738 18344 26328  5264
     79976 26714 27187 65237 18881 74975 28505 16271 51390 22598 65689 65512
     20357 68743 72422 69481 26714  6824 30012/);
-
-my $is_win32 = ($Config{osname} eq 'MSWin32')  ?  1  :  0;
+}
 
 
 thread_test(

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libmath-prime-util-perl.git



More information about the Pkg-perl-cvs-commits mailing list