[PATCH][libstdc++-v3 parallel mode] Better scalability for parallel partition

Richard Guenther richard.guenther@gmail.com
Wed Apr 21 09:40:00 GMT 2010


On Wed, Apr 21, 2010 at 11:30 AM, Johannes Singler <singler@kit.edu> wrote:
> This patch improves scalability for the parallel partitioning algorithm.
>  Although the acceleration is only about 25%, this means that speedup
> goes up from 4 to 5 on eight cores.
> I consider the code also more elegant now.
>
> before:
> ## partition int
> #                    seq           1           2           3           4
>          5           6           7           8
> 10000000    0.051112    0.053733    0.030644    0.020897    0.016176
> 0.013590    0.012479    0.012280    0.012888
>
> after:
> 10000000    0.051556    0.052810    0.029154    0.020030    0.015668
> 0.012935    0.011506    0.011265    0.010248
>
> Tested x86_64-unknown-linux-gnu, gcc-4_5-branch: No regressions except
> that profile mode and parallel mode do not cooperate.
>
> Please approve for mainline and gcc-4_5-branch.

If this is does not fix a regression then I don't think this kind of patches are
appropriate for the branch.

Thanks,
Richard.

> 2010-04-21  Johannes Singler  <singler@kit.edu>
>
>        * include/parallel/partition.h (__parallel_partition):
>        Improve performance by:
>        -introducing new variables __leftold, __rightold, __dist, thus
>        -getting rid of omp lock by using atomic operations
>        -getting rid of two omp barriers
>
> Johannes
>
>
>



More information about the Libstdc++ mailing list