This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/40852] [parallel-mode] parallel sort run time increases ~10 fold when vector size gets over ~4*10^9



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]