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

Johannes Singler singler@kit.edu
Wed Apr 21 09:40:00 GMT 2010


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.

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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: partition_fastest_4_5.patch
Type: text/x-patch
Size: 8962 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100421/835892b2/attachment.bin>


More information about the Gcc-patches mailing list