public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Fix simulator timeout for testsuite/26_numerics/random/poisson_distribution/operators/values.cc
@ 2019-05-23 13:14 Hans-Peter Nilsson
  2019-05-23 13:16 ` Jonathan Wakely
  0 siblings, 1 reply; 2+ messages in thread
From: Hans-Peter Nilsson @ 2019-05-23 13:14 UTC (permalink / raw)
  To: libstdc++, gcc-patches

This test regressed for cris-elf (testing in a simulator) with
the fixing of libstdc++/83237, as the part suggested to be
wrapped in #ifndef was *added* to the existing test and causes a
timeout.  Tsk tsk.  Please don't pile-on existing tests, instead
add a *separate* test-file.

From what I understand of the libstdc++/83237 thread at
<https://gcc.gnu.org/ml/gcc-patches/2017-12/msg00573.html>, the
high numbers are not arbitrary, so it seems wrong to try
lowering them, or we'd just waste cycles testing nothing, or
worse, ending up with a bogus error indication.  Better to just
plain disable this part of the test for simulator targets; I
assume the results should be the same on any IEEE-float target,
i.e. no target-specific things going on here that'd raise a need
to cover it everywhere.

With this part of the test disabled, I saw the test finishing in
(time) "124.74s user" where it was before "1120.26s user"
running the cris-elf-run simulator on a "i7-4770K CPU @ 3.50GHz"
host.  Most certainly that indidates that the remainder of the
test is still too much for *some* host+simulator combos, but I'm
happy with the runtime lowered to 1/5 of the timeout (10
minutes) on this particular combination, and I'd think this
fixes timeouts for many other simulator combos too.

This construct (disabling or lowering limits for simulators) is
used elsewhere in the libstdc++ test-suite and in particular the
SIMULATOR_TEST macro is used in the testsuite machinery (though
AFAICT not in testDiscreteDist).

Ok to commit?

(I didn't open a ticket for this problem.)
libstdc++-v3:
	* testsuite/26_numerics/random/poisson_distribution/operators/values.cc:
	Don't run the libstdc++/83237 part on simulator targets.

diff --git libstdc++-v3/testsuite/26_numerics/random/poisson_distribution/operators/values.cc libstdc++-v3/testsuite/26_numerics/random/poisson_distribution/operators/values.cc
index 0b03d94..2a45081 100644
--- libstdc++-v3/testsuite/26_numerics/random/poisson_distribution/operators/values.cc
+++ libstdc++-v3/testsuite/26_numerics/random/poisson_distribution/operators/values.cc
@@ -1,3 +1,4 @@
+// { dg-options "-DSIMULATOR_TEST" { target simulator } }
 // { dg-do run { target c++11 } }
 // { dg-require-cstdint "" }
 // { dg-require-cmath "" }
@@ -43,11 +44,14 @@ void test01()
   auto bpd3 = std::bind(pd3, eng);
   testDiscreteDist(bpd3, [](int n) { return poisson_pdf(n, 30.0); } );
 
+  // This can take extremely long on simulators, timing out the test.
+#ifndef SIMULATOR_TEST
   // libstdc++/83237
   std::poisson_distribution<> pd4(37.17);
   auto bpd4 = std::bind(pd4, eng);
   testDiscreteDist<100, 2000000>(bpd4, [](int n)
 				 { return poisson_pdf(n, 37.17); } );
+#endif
 }
 
 int main()

brgds, H-P

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Fix simulator timeout for testsuite/26_numerics/random/poisson_distribution/operators/values.cc
  2019-05-23 13:14 Fix simulator timeout for testsuite/26_numerics/random/poisson_distribution/operators/values.cc Hans-Peter Nilsson
@ 2019-05-23 13:16 ` Jonathan Wakely
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Wakely @ 2019-05-23 13:16 UTC (permalink / raw)
  To: Hans-Peter Nilsson; +Cc: libstdc++, gcc-patches

On 23/05/19 15:14 +0200, Hans-Peter Nilsson wrote:
>This test regressed for cris-elf (testing in a simulator) with
>the fixing of libstdc++/83237, as the part suggested to be
>wrapped in #ifndef was *added* to the existing test and causes a
>timeout.  Tsk tsk.  Please don't pile-on existing tests, instead
>add a *separate* test-file.
>
From what I understand of the libstdc++/83237 thread at
><https://gcc.gnu.org/ml/gcc-patches/2017-12/msg00573.html>, the
>high numbers are not arbitrary, so it seems wrong to try
>lowering them, or we'd just waste cycles testing nothing, or
>worse, ending up with a bogus error indication.  Better to just
>plain disable this part of the test for simulator targets; I
>assume the results should be the same on any IEEE-float target,
>i.e. no target-specific things going on here that'd raise a need
>to cover it everywhere.
>
>With this part of the test disabled, I saw the test finishing in
>(time) "124.74s user" where it was before "1120.26s user"
>running the cris-elf-run simulator on a "i7-4770K CPU @ 3.50GHz"
>host.  Most certainly that indidates that the remainder of the
>test is still too much for *some* host+simulator combos, but I'm
>happy with the runtime lowered to 1/5 of the timeout (10
>minutes) on this particular combination, and I'd think this
>fixes timeouts for many other simulator combos too.
>
>This construct (disabling or lowering limits for simulators) is
>used elsewhere in the libstdc++ test-suite and in particular the
>SIMULATOR_TEST macro is used in the testsuite machinery (though
>AFAICT not in testDiscreteDist).
>
>Ok to commit?

OK, thanks. OK to backport too if you want.


>(I didn't open a ticket for this problem.)
>libstdc++-v3:
>	* testsuite/26_numerics/random/poisson_distribution/operators/values.cc:
>	Don't run the libstdc++/83237 part on simulator targets.
>
>diff --git libstdc++-v3/testsuite/26_numerics/random/poisson_distribution/operators/values.cc libstdc++-v3/testsuite/26_numerics/random/poisson_distribution/operators/values.cc
>index 0b03d94..2a45081 100644
>--- libstdc++-v3/testsuite/26_numerics/random/poisson_distribution/operators/values.cc
>+++ libstdc++-v3/testsuite/26_numerics/random/poisson_distribution/operators/values.cc
>@@ -1,3 +1,4 @@
>+// { dg-options "-DSIMULATOR_TEST" { target simulator } }
> // { dg-do run { target c++11 } }
> // { dg-require-cstdint "" }
> // { dg-require-cmath "" }
>@@ -43,11 +44,14 @@ void test01()
>   auto bpd3 = std::bind(pd3, eng);
>   testDiscreteDist(bpd3, [](int n) { return poisson_pdf(n, 30.0); } );
>
>+  // This can take extremely long on simulators, timing out the test.
>+#ifndef SIMULATOR_TEST
>   // libstdc++/83237
>   std::poisson_distribution<> pd4(37.17);
>   auto bpd4 = std::bind(pd4, eng);
>   testDiscreteDist<100, 2000000>(bpd4, [](int n)
> 				 { return poisson_pdf(n, 37.17); } );
>+#endif
> }
>
> int main()
>
>brgds, H-P

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-05-23 13:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-23 13:14 Fix simulator timeout for testsuite/26_numerics/random/poisson_distribution/operators/values.cc Hans-Peter Nilsson
2019-05-23 13:16 ` Jonathan Wakely

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).