16

the GNU implementation of the C++ Library supports a parallel mode, explained here.

  • Any experiences in using it? Good ones? Bad ones? Especially regarding correctness, but also performance.
  • Are there some "more or less serious" projects using it?
  • Do you use it with the global turn-on-parallel switch -D_GLIBCXX_PARALLEL or do you use it carefully with manually turn-on specific parallelization functions like: __gnu_parallel::sort(v.begin(), v.end());?
  • Are there any similar open source projects? Meaning: more easy parallelization than using openMP.

Thanks for your experiences.

Sascha

Björn Pollex
  • 75,346
  • 28
  • 201
  • 283
sascha
  • 32,238
  • 6
  • 68
  • 110

3 Answers3

4

Too late answer, but:

I would seriously consider Intel TBB. One thing that I noted missing from C++ standard parallel mode is parallel containers. TBB containers do not follow the interface of C++ standard containers, but they provide justifications for this. Besides, TBB has a number of examples and design patterns.

amit kumar
  • 20,438
  • 23
  • 90
  • 126
  • TBB and gnu parallel mode are too different things. While you get (almost) >100 STL functions written in parallel for free, you will not get it in TBB but need code it yourself (only obvious functions like std::sort). If you know how to use STL functions this is really a good thing for parallelization. On the other hand you get some parallel containers in TBB. – eci Nov 21 '13 at 14:09
3

I've used it for some small projects, with a nice speedup for large stl operations. I never encountered any problems (I used the global switch). However I didn't really do much benchmarking, you might want to refer to studies like http://algo2.iti.kit.edu/singler/mcstl/parallelmode_se.pdf and http://ls11-www.cs.uni-dortmund.de/people/gutweng/AD08/VO11_parallel_mode_overview.pdf.

lucas clemente
  • 6,255
  • 8
  • 41
  • 61
1

This seems similar though I haven't looked very deeply into it. http://thrust.github.com/

dhruvbird
  • 6,061
  • 6
  • 34
  • 39