[gcc r16-8938] libstdc++: Reduce iterations in PSTL test for Debug Mode
Jonathan Wakely
redi@gcc.gnu.org
Tue May 19 21:35:17 GMT 2026
https://gcc.gnu.org/g:40e11138dbfbf1a155372f737bf41358b3cb7d70
commit r16-8938-g40e11138dbfbf1a155372f737bf41358b3cb7d70
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Sun May 17 19:27:11 2026 +0100
libstdc++: Reduce iterations in PSTL test for Debug Mode
This test often times out, especially on machines with a large number of
cores when the tests are run with a lot of parallel jobs. I suspect that
TBB creates a lot of threads due to std::hardware_concurrency() being a
large number, but because most cores are already busy running other
tests (due to `make -jN check` with large N) the system gets
oversubscribed. In Debug Mode, the testcase runs much slower, and often
times out.
It's probably fine to just test with fewer iterations when Debug Mode is
active.
libstdc++-v3/ChangeLog:
* testsuite/25_algorithms/pstl/alg_sorting/minmax_element.cc:
Reduce iterations for debug mode.
(cherry picked from commit 6df1f865272fc95f386f5448f3a74486451bb58c)
Diff:
---
.../testsuite/25_algorithms/pstl/alg_sorting/minmax_element.cc | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/minmax_element.cc b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/minmax_element.cc
index e4bd435d1926..51bdeaa96a13 100644
--- a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/minmax_element.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/minmax_element.cc
@@ -189,7 +189,11 @@ int
main()
{
using TestUtils::float64_t;
+#ifndef _GLIBCXX_DEBUG
const std::size_t N = 100000;
+#else
+ const std::size_t N = 10000;
+#endif
for (std::size_t n = 0; n < N; n = n < 16 ? n + 1 : size_t(3.14159 * n))
{
More information about the Libstdc++-cvs
mailing list