This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/40852] [parallel-mode] parallel sort run time increases ~10 fold when vector size gets over ~4*10^9
- From: "singler at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Oct 2009 10:00:18 -0000
- Subject: [Bug libstdc++/40852] [parallel-mode] parallel sort run time increases ~10 fold when vector size gets over ~4*10^9
- References: <bug-40852-8473@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #18 from singler at gcc dot gnu dot org 2009-10-23 10:00 -------
(In reply to comment #17)
> Is something known about the actual size of a, b, and c?
They can be as large as the input size.
> Also, I don't know which is the required precision for the result: must be
> exact if representable?
In the last iteration, __n == 0 => __total == __N, and then, the result must
absolutely be __rank, according to the specification.
Anyway, I think I have found a solution that is easier, faster, and avoids the
large intermediate altogether (see attached patch). It also fixes similar
problems in two other locations. However, this patch needs further thorough
testing.
Also, __n == 2 ^ __r - 1, so __n + 1 == 2 ^ __r, and the divisions could be
replaced by shifts.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40852