Commit Graph

50 Commits

Author SHA1 Message Date
Johannes Singler 22ec53ec66 algorithmfwd.h: Add parallelism default for many declarations.
2009-02-03  Johannes Singler  <singler@ira.uka.de>

        * include/parallel/algorithmfwd.h:
        Add parallelism default for many declarations.
        * include/parallel/numericfwd.h: Likewise.
        * include/parallel/iterator.h: Use iterator_traits as usual.
        * include/parallel/par_loop.h:
        Include equally_split.h.
        (for_each_template_random_access_ed):
        Avoid calling the Result default constructor.
        * include/parallel/numeric: Replace
        for_each_template_random_access by
        for_each_template_random_access_ed in numeric functions.

From-SVN: r143902
2009-02-03 17:49:36 +00:00
Benjamin Kosnik d4e1b0727a cstdatomic: Remove assert include.
2008-12-15  Benjamin Kosnik  <bkoz@redhat.com>

	* include/c_global/cstdatomic: Remove assert include.
	* include/debug/debug.h: Consolidate __replacement_assert...
	* include/parallel/base.h: Consolidate __replacement_assert...
	* include/bits/c++config: ...here.
	* include/bits/atomic_0.h: Use it.
	* include/bits/atomic_2.h: Same.
	* testsuite/29_atomics/atomic/cons/assign_neg.cc: Adjust line numbers.
	* testsuite/29_atomics/atomic/cons/copy_neg.cc: Same.

From-SVN: r142777
2008-12-16 01:28:46 +00:00
Johannes Singler c38b84d8f1 re PR libstdc++/37470 (parallel/base.h log2 conflicts with math.h)
2008-09-19  Johannes Singler  <singler@ira.uka.de>

        PR libstdc++/37470
        * include/parallel/base.h: Rename log2 to __log2.
          (__log2) Avoid infinite loop for n <= 0, return 0.
        * include/parallel/losertree.h: Rename log2 to __log2.
        * include/parallel/multiseq_selection.h: Likewise.
        * include/parallel/random_shuffle.h: Likewise.

From-SVN: r140490
2008-09-19 11:37:16 +00:00
Johannes Singler d0259b010b 2008-08-12 Johannes Singler <singler@ira.uka.de>
* include/paralle/losertree.h
        (LoserTreePointerBase<>::~LoserTreePointerBase):
        Replace delete by appropriate delete[].

From-SVN: r139026
2008-08-12 17:23:00 +00:00
Johannes Singler cbcd1e4520 find_selectors.h: Correct name for include guard #ifndef.
2008-07-15  Johannes Singler  <singler@ira.uka.de>

        * include/parallel/find_selectors.h:
        Correct name for include guard #ifndef.
        * include/parallel/balanced_quicksort.h: Likewise.
        * include/parallel/unique_copy.h: Likewise.
        * include/parallel/multiway_mergesort.h: Likewise.
        * include/parallel/checkers.h: Likewise.
        * include/parallel/[various files]:
        Add/correct comment for #endif of include guard (at end of file)

From-SVN: r137827
2008-07-15 10:06:58 +00:00
Johannes Singler 38a28aabc1 balanced_quicksort.h: (qsb_divide) Replace "*end" by "*(end - 1)" in assertion.
2008-07-10  Johannes Singler  <singler@ira.uka.de>

        * include/parallel/balanced_quicksort.h:
        (qsb_divide) Replace "*end" by "*(end - 1)" in assertion.

From-SVN: r137691
2008-07-10 08:19:26 +00:00
Johannes Singler 361eefe75d random_shuffle.h: (sequential_random_shuffle) Copy data back.
2008-07-09  Johannes Singler  <singler@ira.uka.de>

         * include/parallel/random_shuffle.h:
         (sequential_random_shuffle) Copy data back.
         * testsuite/25_algorithms/random_shuffle/1.cc:
         New. Generic random_shuffle functionality test.

From-SVN: r137658
2008-07-09 15:26:56 +00:00
Paolo Carlini 2dcc0099c8 base.h (plus, multiplies): Use __typeof__, not typeof.
2008-06-26  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/parallel/base.h (plus, multiplies): Use __typeof__,
	not typeof.

From-SVN: r137145
2008-06-26 10:45:31 +00:00
Johannes Singler 3611e1767d random_shuffle.h: (parallel_random_shuffle_drs) Get the actual number of threads after entering...
2008-06-05  Johannes Singler  <singler@ira.uka.de>

        * include/parallel/random_shuffle.h:
        (parallel_random_shuffle_drs) Get the actual number of
        threads after entering the parallel region. Indentation.
        * include/parallel/algo.h: (random_shuffle(begin, end))
        Add namespace qualification to avoid ambiguity.

From-SVN: r136406
2008-06-05 15:47:17 +00:00
Johannes Singler 36fc59580b parallel_mode.xml: Documented the new choices, factoring out common tags.
2008-05-16  Johannes Singler  <singler@ira.uka.de>

         * doc/xml/manual/parallel_mode.xml:
         Documented the new choices, factoring out common tags.
         * include/parallel/multiway_merge.h:
         Place comparison functor at the end, to comply with
         established convention.
         (parallel_multiway_merge) Pass number of threads explicitly.
         Introduce new compile-time variants, make exact splitting the
         default.
         * include/parallel/tags.h:
         Extend exact_tag, introduce sampling_tag.
         * include/parallel/merge.h:
         (parallel_merge_advance) Adapt to changed interface.
         * include/parallel/multiway_mergesort.h: Likewise.

From-SVN: r135411
2008-05-16 07:10:26 +00:00
Johannes Singler a273a42537 quicksort.h: (parallel_sort_qs_conquer) Explicitly request number of threads in the parallel...
2008-05-07  Johannes Singler  <singler@ira.uka.de>

       * include/parallel/quicksort.h:
       (parallel_sort_qs_conquer) Explicitly request number of threads
       in the parallel clause.
       (parallel_sort_qs) Remove setting the number of threads globally.

From-SVN: r135038
2008-05-07 11:14:05 +00:00
Johannes Singler 3234d6b0b0 2008-05-06 Johannes Singler <singler@ira.uka.de>
* include/parallel/multiway_merge.h:
          (multiway_merge_*_unguarded):
          Pass sentinel directly, to allow correct determination.
          (multiway_merge_loser_tree_unguarded):
          Remove over-cautious assertion.
          (calls to multiway_merge_*_splitting):
          Parametrize with type that is correct in all cases.
        * include/parallel/losertree.h:
          (delete_min_insert (in many classes)):
          Correct and standardize assertions.

From-SVN: r134977
2008-05-06 08:55:57 +00:00
Johannes Singler d7066497b0 quicksort.h: Reformat,
2008-04-23  Johannes Singler  <singler@ira.uka.de>

        * include/parallel/quicksort.h: Reformat,
        (parallel_sort_qs): Do not pass number of elements.
        * include/parallel/balanced_quicksort.h: Reformat,
        (parallel_sort_qsb): Do not pass number of elements.
        * include/parallel/tags.h:
        Introduce new tags for compile-time choice.
        * include/parallel/merge.h:
        (parallel_merge_advance):Beautified.
        * include/parallel/algo.h: Reformatting (spaces for tabs)
        New sort and stable_sort variants, corresponding to the tags.
        * include/parallel/sort.h:
        New sort and stable_sort variants, corresponding to the tags.
        Changed determining the desired number of threads.

From-SVN: r134582
2008-04-23 07:26:53 +00:00
Johannes Singler 214ece2920 2008-04-23 Johannes Singler <singler@ira.uka.de>
* include/parallel/multiway_merge.h
        (multiway_merge_loser_tree):
        Leave checks to callers, add precondition instead.
        (multiway_merge_loser_tree_unguarded): Likewise.
        (multiway_merge_loser_tree_sentinel): Likewise.
        (sequential_multiway_merge): Added checks for total length 0.
        (parallel_multiway_merge): Skip empty sequences.
        (multiway_merge, all variants):
        Remove temporary variable, return directly.
        (stable_multiway_merge, all variants): Likewise.
        (multiway_merge_sentinels, all variants):  Likewise.
        (stable_multiway_merge_sentinels, all variants): Likewise.
        * include/parallel/multiseq_selection.h
        (multiseq_partition): More detailed assertions.

From-SVN: r134580
2008-04-23 07:20:58 +00:00
Johannes Singler f9985df51b re PR libstdc++/35588 ([parallel mode] parallel std::sort and bind())
2008-04-07  Johannes Singler  <singler@ira.uka.de>

         * include/parallel/multiway_merge.h:
           Moved decisions to compiletime instead of runtime.
         * include/parallel/losertree.h:
           Removed obsolete variants, added variant that uses pointers
           in the loser tree.
         * include/parallel/types.h:
           Remove obsolete settings options from enum.
         * include/parallel/features.h:
           Remove obsolete compile-time switches.
         * include/parallel/compiletime_settings.h:
           Remove obsolete variant that copies back *after* sorting.
         * include/parallel/tags.h:
           Add one new tag for compile-time switch.
         * include/parallel/merge.h:
           Adapt to changes in multiway_merge.h.
         * include/parallel/multiway_mergesort.h:
           Adapt to changes in multiway_merge.h.
           Factor out splitting variants.
           Remove obsolete variant that copies back *after* sorting.
         * include/parallel/sort.h:
           Adapt to changes in multiway_mergesort.h.
         * testsuite/25_algorithms/sort/35588.cc:
           Added test case from / for PR 35588.

From-SVN: r133975
2008-04-07 08:27:34 +00:00
Benjamin Kosnik 939759fcc9 run_doxygen: Remove html_output_dir.
2008-03-25  Benjamin Kosnik  <bkoz@redhat.com>

	* scripts/run_doxygen: Remove html_output_dir. Downgrade to
	Doxygen 1.5.1.
	* doc/doxygen/style.css: Delete.
	* doc/doxygen/user.cfg.in: Regenerate with Doxygen 1.5.1.
	(INPUT): Update.
	(PREDEFINED): Update.
	(HTML_OUTPUT): Remove html_output_dir, use html.
	(HTML_STYLESHEET): Remove style.css.
	* doc/doxygen/tables.html: Remove style.css use.
	* doc/doxygen/mainpage.html: Nested lists for Namespaces and Classes.
	* doc/doxygen/doxygroups.cc: Namespace edits.
	* doc/doxygen/Intro.3: Correct typo.

	* doc/xml/api.xml: Add gcc-4.3 links.
	* doc/html/api.html: Regenerate.	
	
	* include/debug/debug.h: Document namepaces here.
	* include/parallel/base.h: Same.
	* include/ext/typelist.h: Same.
	* include/ext/pb_ds/tag_and_trait.hpp: Same.
	
	* include/tr1_impl/random: Adjust line break.
	* include/tr1_impl/unordered_map: Correct and or add markup.
	* include/tr1_impl/boost_shared_ptr.h: Correct and or add markup.
	* include/tr1_impl/functional_hash.h: Same.
	* include/tr1_impl/cmath: Same.
	* include/tr1_impl/functional: Same.
	* include/tr1_impl/unordered_set: Same.
	* include/tr1_impl/complex: Same.
	* include/tr1_impl/type_traits: Same.
	* include/tr1_impl/regex: Same.
	* include/tr1_impl/array: Same.
	* include/std/tuple: Same.
	* include/std/date_time: Same.
	* include/std/system_error: Same.
	* include/std/type_traits: Same.
	* include/ext/enc_filebuf.h: Same.
	* include/ext/throw_allocator.h: Same.
	* include/ext/pool_allocator.h: Same.
	* include/ext/bitmap_allocator.h: Same.
	* include/ext/concurrence.h: Same.
	* include/ext/codecvt_specializations.h: Same.
	* include/ext/stdio_sync_filebuf.h: Same.
	* include/ext/array_allocator.h: Same.
	* include/ext/mt_allocator.h: Same.
	* include/bits/locale_classes.h: Same.
	* include/bits/locale_facets.h: Same.
	* include/bits/codecvt.h: Same.
	* include/bits/char_traits.h: Same.
	* include/bits/allocator.h: Same.
	* include/bits/locale_facets_nonio.h: Same.
	* include/tr1/poly_laguerre.tcc: Same.
	* include/tr1/riemann_zeta.tcc: Same.
	* include/tr1/beta_function.tcc: Same.
	* include/tr1/tuple: Same.
	* include/tr1/exp_integral.tcc: Same.
	* include/tr1/gamma.tcc: Same.
	* include/tr1/hypergeometric.tcc: Same.
	* include/tr1/modified_bessel_func.tcc: Same.
	* include/tr1/legendre_function.tcc: Same.
	* include/tr1/type_traits: Same.
	* include/tr1/special_function_util.h: Same.
	* include/tr1/bessel_function.tcc: Same.
	* include/tr1/cmath: Same.
	* include/tr1/poly_hermite.tcc: Same.
	* include/tr1/ell_integral.tcc: Same.
	* config/abi/compatibility.h: Adjust file name.

	* testsuite/19_diagnostics/error_category/cons/copy_neg.cc: Adjust
	line numbers.	
	* testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same.
	* testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same.

From-SVN: r133544
2008-03-26 06:27:35 +00:00
Johannes Singler 8894d2ba38 set_operations.h: Removed superfluous set_intersection.
2008-03-20  Johannes Singler  <singler@ira.uka.de>

        * include/parallel/set_operations.h: Removed superfluous
        set_intersection.

From-SVN: r133391
2008-03-20 17:14:05 +00:00
Benjamin Kosnik ee1b5fc5e0 re PR libstdc++/34797 ([parallel mode] Settings are separated for each compilation unit)
2008-02-17  Benjamin Kosnik  <bkoz@redhat.com>

	PR libstdc++/34797
	* include/parallel/settings.h (_Settings): Reconstruct Settings class
	here, uglify, remove anonymous namespace and static
	members. Convert to datum.	
	* include/parallel/types.h: Move Settings:: enumerations here, uglify.
	* src/parallel_settings.cc: New, definition for _Settings member
	functions.	
	* include/parallel/multiway_merge.h: Same.
	* include/parallel/for_each.h: Same.
	* include/parallel/workstealing.h: Same.
	* include/parallel/base.h: Same.
	* include/parallel/numeric
	* include/parallel/features.h: Same.
	* include/parallel/quicksort.h: Same.
	* include/parallel/equally_split.h: Same.
	* include/parallel/algorithmfwd.h: Same.
	* include/parallel/omp_loop_static.h: Same.
	* include/parallel/random_shuffle.h: Same.
	* include/parallel/balanced_quicksort.h: Same.
	* include/parallel/tags.h: Same.
	* include/parallel/multiway_mergesort.h: Same.
	* include/parallel/numericfwd.h: Same.
	* include/parallel/partition.h: Same.
	* include/parallel/partial_sum.h: Same.
	* include/parallel/find.h: Same.
	* include/parallel/algo.h: Same.
	* include/parallel/omp_loop.h: Same.
	* include/parallel/sort.h: Same.

	* src/Makefile.am (parallel_sources): Add parallel_settings.cc.
	* src/Makefile.in: Regenerate.
	
	* config/abi/pre/gnu.ver: Export _Settings::get and _Settings::set.

From-SVN: r132383
2008-02-18 00:00:00 +00:00
Paolo Carlini 6df548d2d3 re PR libstdc++/35221 (libstdc++ broken)
2008-02-17  Paolo Carlini  <pcarlini@suse.de>

	PR libstdc++/35221
	* include/parallel/types.h: Reinstate integer types typedefs.
	* include/parallel/multiseq_selection.h: Adjust.
	* include/parallel/compatibility.h: Likewise.
	* include/parallel/random_shuffle.h: Likewise.
	* include/parallel/random_number.h: Likewise.
	* include/parallel/base.h: Likewise.

From-SVN: r132380
2008-02-17 15:46:30 +00:00
Benjamin Kosnik 459af5a02d random_number.h: Use TR1's mersenne_twister.
2008-02-16  Benjamin Kosnik  <bkoz@redhat.com>

	* include/parallel/random_number.h: Use TR1's mersenne_twister.
	(random_number::genrand_bits()): Remove.
	(random_number::set_seed): Remove.

From-SVN: r132371
2008-02-16 23:21:20 +00:00
Benjamin Kosnik 257a545bc0 types.h: Remove enum parallelism.
2008-02-15  Benjamin Kosnik  <bkoz@redhat.com>
        
        * include/parallel/types.h: Remove enum parallelism.

From-SVN: r132364
2008-02-16 06:15:39 +00:00
Benjamin Kosnik 847eb5516f types.h: Move enum parallelism here.
2008-02-15  Benjamin Kosnik  <bkoz@redhat.com>

	* include/parallel/types.h: Move enum parallelism here.  Use
	tr1/cstdint's int16_t, uint16_t, int32_t, uint32_t, int64_t,
	uint64_t. 
	* include/parallel/multiseq_selection.h: Adjust for cstdint.
	* include/parallel/compatibility.h: Same.
	* include/parallel/tags.h: Just compile-time tags.
	* include/parallel/base.h: Put namespace bits here.

	* src/Makefile.am (PARALLEL_FLAGS): Use it.
	* src/Makefile.in: Regenerate.

	* testsuite/25_algorithms/nth_element/1.cc: Add test variable.

From-SVN: r132354
2008-02-15 22:55:14 +00:00
Ralf Wildenhues 28dac70a08 auto_ptr.h: Fix comment typos.
2008-01-31  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
    
	* include/backward/auto_ptr.h: Fix comment typos.
	* include/bits/algorithmfwd.h: Likewise.
	* include/bits/basic_ios.h: Likewise.
	* include/bits/c++config: Likewise.
	* include/bits/char_traits.h: Likewise.
	* include/bits/codecvt.h: Likewise.
	* include/bits/gslice.h: Likewise.
	* include/bits/ios_base.h: Likewise.
	* include/bits/locale_facets.h: Likewise.
	* include/bits/locale_facets_nonio.tcc: Likewise.
	* include/bits/postypes.h: Likewise.
	* include/bits/sstream.tcc: Likewise.
	* include/bits/stl_algo.h: Likewise.
	* include/bits/stl_deque.h: Likewise.
	* include/bits/stl_iterator.h: Likewise.
	* include/bits/stl_iterator_base_types.h Likewise.
	* include/bits/stl_list.h: Likewise.
	* include/bits/stl_map.h: Likewise.
	* include/bits/stl_multimap.h: Likewise.
	* include/bits/stl_multiset.h: Likewise.
	* include/bits/stl_set.h: Likewise.
	* include/bits/stl_vector.h: Likewise.
	* include/bits/valarray_array.h: Likewise.
	* include/debug/safe_base.h: Likewise.
	* include/ext/bitmap_allocator.h: Likewise.
	* include/ext/codecvt_specializations.h Likewise.
	* include/ext/mt_allocator.h: Likewise.
	* include/ext/rc_string_base.h: Likewise.
	* include/ext/rope: Likewise.
	* include/parallel/checkers.h: Likewise.
	* include/parallel/find.h: Likewise.
	* include/parallel/multiseq_selection.h: Likewise.
	* include/parallel/partition.h: Likewise.
	* include/parallel/settings.h: Likewise.
	* include/std/bitset: Likewise.
	* include/std/complex: Likewise.
	* include/std/fstream: Likewise.
	* include/std/istream: Likewise.
	* include/std/limits: Likewise.
	* include/std/ostream: Likewise.
	* include/std/stdexcept: Likewise.
	* include/std/streambuf: Likewise.
	* include/tr1/bessel_function.tcc: Likewise.
	* include/tr1/cmath: Likewise.
	* include/tr1/ell_integral.tcc: Likewise.
	* include/tr1/hypergeometric.tcc: Likewise.
	* include/tr1/legendre_function.tcc: Likewise.
	* include/tr1_impl/random: Likewise.
	* include/tr1_impl/regex: Likewise.

From-SVN: r131982
2008-01-31 18:44:55 +00:00
Paolo Carlini a4797b349c list_partition.h: Formatting fixes, inline tweaks.
2008-01-14  Paolo Carlini  <pcarlini@suse.de>

	* include/parallel/list_partition.h: Formatting fixes, inline tweaks.
	* include/parallel/numeric: Likewise.
	* include/parallel/balanced_quicksort.h: Likewise.
	* include/parallel/unique_copy.h: Likewise.
	* include/parallel/algobase.h: Likewise.
	* include/parallel/algo.h: Likewise.

From-SVN: r131542
2008-01-15 02:06:31 +00:00
Paolo Carlini eeb77d993d tree.h: Remove.
2008-01-14  Paolo Carlini  <pcarlini@suse.de>

	* include/parallel/tree.h: Remove.
	* include/Makefile.am: Update.
	* include/Makefile.in: Rebuild.

	* src/Makefile.am: Remove spurious trailing backslash.
	* src/Makefile.in: Rebuild.
	* po/Makefile.in: Likewise.
	* libmath/Makefile.in: Likewise.
	* testsuite/Makefile.in: Likewise.
	* libsupc++/Makefile.in: Likewise.
	* aclocal.m4: Likewise.
	* Makefile.in: Likewise.
	* configure: Likewise.

From-SVN: r131529
2008-01-14 18:08:39 +00:00
Paolo Carlini 5817ff8e5f multiway_merge.h: Reformat to 80 columns; adjust some inline specifiers; other minor style fixes.
2008-01-09  Paolo Carlini  <pcarlini@suse.de>

	* include/parallel/multiway_merge.h: Reformat to 80 columns;
	adjust some inline specifiers; other minor style fixes.
	* include/parallel/losertree.h: Likewise.
	* include/parallel/list_partition.h: Likewise.
	* include/parallel/multiseq_selection.h: Likewise.
	* include/parallel/workstealing.h: Likewise.
	* include/parallel/base.h: Likewise.
	* include/parallel/par_loop.h: Likewise.
	* include/parallel/numeric: Likewise.
	* include/parallel/quicksort.h: Likewise.
	* include/parallel/algorithmfwd.h: Likewise.
	* include/parallel/for_each_selectors.h: Likewise.
	* include/parallel/omp_loop_static.h: Likewise.
	* include/parallel/random_shuffle.h: Likewise.
	* include/parallel/balanced_quicksort.h: Likewise.
	* include/parallel/set_operations.h: Likewise.
	* include/parallel/tree.h: Likewise.
	* include/parallel/merge.h: Likewise.
	* include/parallel/unique_copy.h: Likewise.
	* include/parallel/settings.h: Likewise.
	* include/parallel/multiway_mergesort.h: Likewise.
	* include/parallel/numericfwd.h: Likewise.
	* include/parallel/search.h: Likewise.
	* include/parallel/partition.h: Likewise.
	* include/parallel/compatibility.h: Likewise.
	* include/parallel/partial_sum.h: Likewise.
	* include/parallel/find.h: Likewise.
	* include/parallel/algo.h: Likewise.
	* include/parallel/queue.h: Likewise.
	* include/parallel/omp_loop.h: Likewise.
	* include/parallel/sort.h: Likewise.
	* include/parallel/random_number.h: Likewise.

From-SVN: r131440
2008-01-10 02:07:41 +00:00
Paolo Carlini 531898c3c2 iterator.h: Reformat to 80 columns; adjust some inline specifiers.
2008-01-09  Paolo Carlini  <pcarlini@suse.de>

	* include/parallel/iterator.h: Reformat to 80 columns; adjust some
	inline specifiers.
	* include/parallel/find_selectors.h: Likewise.
	* include/parallel/losertree.h: Likewise.
	* include/parallel/list_partition.h: Likewise.
	* include/parallel/for_each.h: Likewise.
	* include/parallel/multiseq_selection.h: Likewise.
	* include/parallel/algorithmfwd.h: Likewise.
	* include/parallel/for_each_selectors.h: Likewise.
	* include/parallel/balanced_quicksort.h: Likewise.
	* include/parallel/merge.h: Likewise.
	* include/parallel/algobase.h: Likewise.
	* include/parallel/find.h: Likewise.
	* include/parallel/algo.h: Likewise.
	* include/parallel/checkers.h: Likewise.

From-SVN: r131431
2008-01-09 18:27:27 +00:00
Paolo Carlini fac9044d26 re PR libstdc++/34095 (parallel mode: segfault in std::sort)
2008-01-01  Paolo Carlini  <pcarlini@suse.de>

	PR libstdc++/34095
	* include/parallel/multiway_merge.h (multiway_merge_bubble,
	parallel_multiway_merge): Together with ::operator new use
	::operator delete.
	* include/parallel/losertree.h (LoserTree<>::~LoserTree): Likewise.
	* include/parallel/quicksort.h (parallel_sort_qs_divide): Likewise.
	* include/parallel/random_shuffle.h (parallel_random_shuffle_drs_pu,
	sequential_random_shuffle): Likewise.
	* include/parallel/tree.h (_M_not_sorted_bulk_insertion_construction):
	Likewise.
	* include/parallel/multiway_mergesort.h (parallel_sort_mwms_pu,
	parallel_sort_mwms): Likewise.
	* include/parallel/partial_sum.h (parallel_partial_sum_linear):
	Likewise. 
	* testsuite/25_algorithms/sort/34095.cc: New.

From-SVN: r131247
2008-01-01 19:05:41 +00:00
Paolo Carlini c5be97a5f0 re PR libstdc++/34636 (Parallel sort fails)
2008-01-01  Paolo Carlini  <pcarlini@suse.de>

	PR libstdc++/34636
	* include/parallel/algobase.h (lexicographical_compare_switch(...,
	random_access_iterator_tag, random_access_iterator_tag)): Careful
	with undereferenceable iterators.
	* testsuite/25_algorithms/sort/34636.cc: New.

From-SVN: r131245
2008-01-01 16:42:34 +00:00
Benjamin Kosnik 58a6ef4b09 partial_sum.h: Include new.
2007-12-15  Benjamin Kosnik  <bkoz@redhat.com>
	    Paolo Carlini  <pcarlini@suse.de>
	
	* include/parallel/partial_sum.h: Include new. Fix for DR 402.	
	* include/parallel/multiway_merge.h:Fix for DR 402.
	* include/parallel/losertree.h: Same.
	* include/parallel/quicksort.h: Same.
	* include/parallel/random_shuffle.h: Same.
	* include/parallel/multiway_mergesort.h: Same.


Co-Authored-By: Paolo Carlini <pcarlini@suse.de>

From-SVN: r130956
2007-12-15 16:19:37 +00:00
Johannes Singler 1661473b7f multiway_merge.h: Destruct only elements that were have been constructed before.
2007-11-28  Johannes Singler  <singler@ira.uka.de>

        * include/parallel/multiway_merge.h: Destruct only elements that
        were have been constructed before. Code beautifying and formatting.
        * include/parallel/losertree.h: (Copy) construct all loser tree
        item keys, so they can be deconstructed all at once.
        * include/parallel/quicksort.h: Fix memory leak.
        * include/parallel/random_shuffle.h: Use copy constructor instead
        of assignment. Code beautifying and formatting.
        * include/parallel/unique_copy.h: Use assignment instead of copy
        constructor.
        * include/parallel/multiway_mergesort.h: Use copy constructor
        instead of assignment. Code beautifying and formatting.
        * include/parallel/random_shuffle.h: Use copy constructor instead
        of assignment. Code beautifying.

From-SVN: r130490
2007-11-28 17:38:49 +00:00
Johannes Singler e683ee2a20 re PR libstdc++/33893 ([parallel mode] Algorithms rely on omp_set_dynamic(false))
2007-11-22  Johannes Singler  <singler@ira.uka.de>

        PR libstdc++/33893
        * include/parallel/multiway_merge.h: made omp_dynamic-safe
        * include/parallel/workstealing.h: made omp_dynamic-safe
        * include/parallel/base.h: infrastructure, cleanup
        * include/parallel/par_loop.h: made omp_dynamic-safe
        * include/parallel/features.h: activate loser tree variant
        * include/parallel/quicksort.h: made omp_dynamic-safe
        * include/parallel/compiletime_settings.h: settings overridable
        * include/parallel/equally_split.h: made omp_dynamic-safe
        * include/parallel/omp_loop_static.h: made omp_dynamic-safe
        * include/parallel/random_shuffle.h: made omp_dynamic-safe
        * include/parallel/balanced_quicksort.h: made omp_dynamic-safe
        * include/parallel/set_operations.h: made omp_dynamic-safe
        * include/parallel/unique_copy.h: made omp_dynamic-safe
        * include/parallel/multiway_mergesort.h: made omp_dynamic-safe
        * include/parallel/search.h: made omp_dynamic-safe
        * include/parallel/partition.h: made omp_dynamic-safe
        * include/parallel/partial_sum.h: made omp_dynamic-safe
        * include/parallel/find.h: made omp_dynamic-safe
        * include/parallel/omp_loop.h: made omp_dynamic-safe
        * include/parallel/losertree.h: avoid default constructor

From-SVN: r130347
2007-11-22 10:13:08 +00:00
Paolo Carlini 4f39bf5c6b re PR libstdc++/34105 (Confusing error message with missing #include <algorithm>)
2007-11-15  Paolo Carlini  <pcarlini@suse.de>

	PR libstdc++/34105
	* include/bits/stl_algobase.h: Do not include <bits/algorithmfwd.h>.
	(lexicographical_compare(const unsigned char*, const unsigned char*,
	const unsigned char*, const unsigned char*),
	lexicographical_compare(const char*, const char*, const char*,
	const char*)): Move to namespace (std, _GLIBCXX_STD_P).
	* include/parallel/algobase.h: Do not include <bits/algorithmfwd.h>.
	(equal): Move after mismatch.
	* include/bits/stl_heap.h (is_heap, is_heap_until): Reorder.
	* include/bits/char_traits.h: Include <bits/stl_algobase.h> instead
	of <bits/algorithmfwd.h>.
	* include/bits/stl_algo.h: Include first <bits/algorithmfwd.h>.
	* include/bits/algorithmfwd.h (lexicographical_compare): Do not
	declare overloads.
	* include/parallel/partition.h: Include <parallel/random_number.h>.
	* testsuite/util/testsuite_abi.cc: Include <algorithm>.

From-SVN: r130207
2007-11-15 19:05:17 +00:00
Johannes Singler d76575caa5 multiway_merge.h: More robust finding of an arbitrary existing element inside the input sequences.
2007-11-14  Johannes Singler  <singler@ira.uka.de>

      * include/parallel/multiway_merge.h: More robust finding of an
        arbitrary existing element inside the input sequences.
      * include/bits/stl_algo.h: Fix typo to actually call appropriate
        sequential version.

From-SVN: r130183
2007-11-14 17:37:38 +00:00
Johannes Singler 59b567fbca re PR libstdc++/33892 ([libstdc++ v3 parallel mode] Parallel mode algorithms use critical sections with global scope)
2007-11-02  Johannes Singler  <singler@ira.uka.de>

      PR libstdc++/33892

      * include/parallel/workstealing.h: Replaced pragma by function
        call lock.
      * include/parallel/search.h: Same
      * include/parallel/partition.h: Same
      * include/parallel/find.h: Same

From-SVN: r129852
2007-11-02 15:34:24 +00:00
Johannes Singler 740936e08e multiway_merge.h: Removed Timing<inactive_tag>
2007-10-25  Johannes Singler  <singler@ira.uka.de>

      * include/parallel/multiway_merge.h: Removed Timing<inactive_tag>
      * include/parallel/random_shuffle.h: Same
      * include/parallel/set_operations.h: Same
      * include/parallel/tree.h: Same
      * include/parallel/multiway_mergesort.h: Same
      * include/parallel/timing.h: Removed completely

From-SVN: r129629
2007-10-25 17:07:56 +00:00
Danny Smith cccc4450ce re PR libstdc++/33578 (__gnu_parallel::yield means what?)
PR libstdc++/33578
	* include/parallel/compatibility.h.  Use POSIX sched_yield on
	__CYGWIN__ 
	(Sleep): Add prototype for __MINGW32__.

From-SVN: r129219
2007-10-10 23:39:30 +00:00
Benjamin Kosnik c456e6f17c re PR libstdc++/33633 (-D_GLIBCXX_DEBUG vs ext/hash_*)
2007-10-10  Benjamin Kosnik  <bkoz@redhat.com>

	PR libstdc++/33633
	* include/debug/hash_multimap.h: Change _GLIBCXX_EXT to _GLIBCXX_EXT_D.
	* include/debug/hash_set.h: Same.
	* include/debug/hash_multiset.h: Same.
	* include/debug/hash_map.h: Same.

2007-10-10  Benjamin Kosnik  <bkoz@redhat.com>

	* include/parallel/losertree.h (loser_tree_traits_unguarded): To 
	loser_tree_unguarded_traits.
	* include/parallel/multiway_merge.h (__gnu_parallel): Same.

From-SVN: r129210
2007-10-10 15:23:59 +00:00
Wolfgang Bangerth c891154fad PR libstdc++/33485 continued.
2007-10-09  Wolfgang Bangerth  <bangerth@dealii.org>

	PR libstdc++/33485 continued.
	* include/parallel/multiway_mergesort.h: Use __builtin_alloca.

From-SVN: r129182
2007-10-09 21:51:06 +00:00
Benjamin Kosnik dfbed39786 PR libstdc++/33489 continued.
2007-10-09  Benjamin Kosnik  <bkoz@montsouris.artheist.org>

	PR libstdc++/33489 continued.		
	* include/parallel/features.h (_GLIBCXX_LOSER_TREE): Set to zero.
	(_GLIBCXX_LOSER_TREE_POINTER): Set to one.
	(_GLIBCXX_LOSER_TREE_UNGUARDED): Set to zero.
	(_GLIBCXX_LOSER_TREE_POINTER_UNGUARDED): Set to one.
	* include/parallel/multiway_merge.h (parallel_multiway_merge):
	Change array of value_type to array of value_type pointers.
 	(multiway_merge_bubble): Same.
	(multiway_merge_loser_tree): Same.
	* include/parallel/merge.h (merge_advance_movc): Change to avoid
	default construction.
	* include/parallel/multiseq_selection.h (multiseq_partition):
	Replace value_type, bool pair with value_type*, null-initialized.
	* include/parallel/multiway_mergesort.h (parallel_sort_mwms):
	Don't use array form of operator new for value_types.
	(parallel_sort_mwms_pu): Same.
	* include/parallel/quicksort.h (parallel_sort_qs_divide): Don't
	use array form to construct pointer to value_type on stack,
	instead use __builtin_alloca.	
	* include/parallel/random_shuffle.h (sequential_random_shuffle): Same,
	but use operator new.
	(parallel_random_shuffle_drs_pu): Same.
	* include/parallel/partial_sum.h ( parallel_partial_sum_linear): Same.

	* include/parallel/losertree.h: Format.
	* include/parallel/settings.h: Format.

	* include/parallel/multiway_merge.h: Move traits to....
	* include/parallel/losertree.h: ... here.

From-SVN: r129179
2007-10-09 20:48:38 +00:00
Johannes Singler 0e6c9eaa5c base.h: Added plus and multiplies functor for differently typed objects.
2007-10-08  Johannes Singler  <singler@ira.uka.de>

	* include/parallel/base.h: Added plus and multiplies functor
       for differently typed objects.
	* include/parallel/numeric: Use it.
	* include/parallel/for_each_selectors.h: Allowed different types.
	* include/parallel/partial_sum.h: Fixed return value.
	* testsuite/26_numerics/accumulate/1.cc: Tests for accumulate.
	* testsuite/26_numerics/inner_product/1.cc: Tests for inner_product.

From-SVN: r129140
2007-10-08 21:14:45 +00:00
Benjamin Kosnik a222efd88a re PR libstdc++/33489 (parallel v3: not default constructible issues)
2007-10-08  Benjamin Kosnik  <bkoz@redhat.com>

	PR libstdc++/33489	
	* include/parallel/multiseq_selection.h: Remove default constructed
	value_type.
	* include/parallel/partition.h: 
	* include/parallel/partial_sum.h: Format.

From-SVN: r129132
2007-10-08 15:58:06 +00:00
Johannes Singler 1904bef10a parallel_mode.html: Added reference to MCSTL.
* docs/html/parallel_mode.html: Added reference to MCSTL.
        More documentation on compile-time settings and tuning.
        * include/parallel/multiway_merge.h: Added reference to paper.
        * include/parallel/multiseq_selection.h: Added reference to paper.
        * include/parallel/workstealing.h: Added reference to paper.
        * include/parallel/balanced_quicksort.h: Added reference to paper.
        * include/parallel/tree.h: Added reference to paper.

From-SVN: r129129
2007-10-08 15:17:28 +00:00
Benjamin Kosnik 6f95a65aa1 re PR libstdc++/33487 (parallel v3: more functions not in right namespace)
2007-10-06  Benjamin Kosnik  <bkoz@redhat.com>

	PR libstdc++/33487
	* include/parallel/algorithmfwd.h (for_each, generate, generate_n,
	transform, replace, replace_if, max_element, min_element, count,
	count_if): Consistently construct overloads.
	* include/parallel/numericfwd.h (accumulate, adjacent_difference,
	inner_product): Same.
	* include/parallel/algobase.h: Same.
	* include/parallel/algo.h: Same.
	* include/parallel/numeric: Same.

	* include/bits/algorithmfwd.h: Correct find_end placement.

	* docs/html/parallel_mode.html: Document some of the interface
	conventions.

	* include/parallel/search.h (calc_borders): Only use operator ==.
	
	* include/parallel/algorithmfwd.h: Move __gnu_sequential bits to...
	* include/parallel/tags.h: ...here, and use a using directive.

	* include/parallel/random_shuffle.h: Include stl_numeric. Qualify
	uses of partial_num with __gnu_sequential.

	* include/parallel/tree.h: Formatting.

From-SVN: r129054
2007-10-06 15:08:58 +00:00
Benjamin Kosnik 18080e8e7a algorithmfwd.h: Spacing.
2007-09-28  Benjamin Kosnik  <bkoz@redhat.com>

	* include/parallel/algorithmfwd.h: Spacing.
	* include/parallel/tags.h: Correct comment.
	
	* testsuite/Makefile.am (AM_MAKEFLAGS, AM_RUNTESTFLAGS): Remove.
	* testsuite/Makefile.in: Regenerate.

From-SVN: r128869
2007-09-28 17:49:28 +00:00
Johannes Singler a3e6b31a0f for_each.h: Fixed comment/doxygen markup typos.
2007-09-17  Johannes Singler  <singler@ira.uka.de>

        * include/parallel/for_each.h: Fixed comment/doxygen markup typos.
        * include/parallel/base.h: Same.
        * include/parallel/numeric: Same.
        * include/parallel/quicksort.h: Same.
        * include/parallel/compiletime_settings.h: Same.
        * include/parallel/random_shuffle.h: Same.
        * include/parallel/balanced_quicksort.h: Same.
        * include/parallel/tree.h: Same.
        * include/parallel/settings.h: Same.
        * include/parallel/search.h: Same.
        * include/parallel/partition.h: Same.
        * include/parallel/partial_sum.h: Same.

From-SVN: r128545
2007-09-17 12:58:07 +00:00
Benjamin Kosnik c5654e49f0 base.h (__gnu_parallel::less<Tp>): Add partial specialization for one argument.
2007-09-14  Benjamin Kosnik  <bkoz@redhat.com>
        
	* include/parallel/base.h (__gnu_parallel::less<Tp>): Add partial
        specialization for one argument. 
	(__gnu_parallel::less): Add operator.

	* include/parallel/multiway_merge.h: Use __builtin_alloca. 
	* include/parallel/partial_sum.h: Same.
	* include/parallel/find.h: Same.

From-SVN: r128505
2007-09-14 20:37:25 +00:00
Benjamin Kosnik c417817a85 all_pedantic_errors.cc: New.
2007-09-14  Benjamin Kosnik  <bkoz@redhat.com>

        * testsuite/17_intro/headers/all_pedantic_errors.cc: New.
        * include/tr1_impl/cinttypes: Add pragma GCC system_header.
        * include/tr1_impl/cfenv: Same.
        * include/tr1_impl/cstdint: Same.
        * include/tr1/cstdbool: Same.
        * include/ext/pb_ds/detail/resize_policy/
        hash_prime_size_policy_imp.hpp: Same.
        * include/parallel/partial_sum.h: Avoid VLA error with
        __builtin_alloca.

From-SVN: r128500
2007-09-14 17:46:56 +00:00
Benjamin Kosnik 94dabea728 find.h: Doxygen fixups.
2007-09-12  Benjamin Kosnik  <bkoz@redhat.com>

	* include/parallel/find.h: Doxygen fixups.
	* include/bits/hashtable.h: Same.

From-SVN: r128440
2007-09-12 15:33:43 +00:00
Johannes Singler c2ba97097b Add parallel mode.
2007-09-11  Johannes Singler  <singler@ira.uka.de>
	    Leonor Frias Moya  <lfrias@lsi.upc.edu>
            Felix Putze  <kontakt@felix-putze.de>
            Marius Elvert  <marius.elvert@ira.uka.de>
	    Felix Bondarenko  <f.bondarenko@web.de>
	    Robert Geisberger  <robert.geisberger@stud.uni-karlsruhe.de>
	    Robin Dapp  <r.dapp@freenet.de>
  	    Benjamin Kosnik  <bkoz@redhat.com>

	Add parallel mode.
	* include/parallel: New.
	* include/parallel/iterator.h: New.
	* include/parallel/multiway_merge.h: New.
	* include/parallel/parallel.h: New.
	* include/parallel/algorithm
	* include/parallel/find_selectors.h: New.
	* include/parallel/losertree.h: New.
	* include/parallel/list_partition.h: New.
	* include/parallel/types.h: New.
	* include/parallel/for_each.h: New.
	* include/parallel/multiseq_selection.h: New.
	* include/parallel/workstealing.h: New.
	* include/parallel/base.h: New.
	* include/parallel/par_loop.h: New.
	* include/parallel/numeric
	* include/parallel/features.h: New.
	* include/parallel/quicksort.h: New.
	* include/parallel/algorithmfwd.h: New.
	* include/parallel/equally_split.h: New.
	* include/parallel/compiletime_settings.h: New.
	* include/parallel/for_each_selectors.h: New.
	* include/parallel/basic_iterator.h: New.
	* include/parallel/omp_loop_static.h: New.
	* include/parallel/random_shuffle.h: New.
	* include/parallel/balanced_quicksort.h: New.
	* include/parallel/set_operations.h: New.
	* include/parallel/tags.h: New.
	* include/parallel/merge.h: New.
	* include/parallel/tree.h: New.
	* include/parallel/settings.h: New.
	* include/parallel/unique_copy.h: New.
	* include/parallel/multiway_mergesort.h: New.
	* include/parallel/numericfwd.h: New.
	* include/parallel/search.h: New.
	* include/parallel/partition.h: New.
	* include/parallel/compatibility.h: New.
	* include/parallel/algobase.h: New.
	* include/parallel/find.h: New.
	* include/parallel/partial_sum.h: New.
	* include/parallel/algo.h: New.
	* include/parallel/omp_loop.h: New.
	* include/parallel/queue.h: New.
	* include/parallel/timing.h: New.
	* include/parallel/sort.h: New.
	* include/parallel/checkers.h: New.
	* include/parallel/random_number.h: New.
	* include/bits/algorithmfwd.h: New.

	* acinclude.m4 (GLIBCXX_ENABLE_PARALLEL): New.
	* configure.host: Add atomic_flags.
	* configure.ac: Export ATOMIC_FLAGS, call GLIBCXX_ENABLE_PARALLEL.
	* src/Makefile.am: Add parallel_list rules.
	* include/Makefile.am: Add parallel files.
	* testsuite/Makefile.am (check-parallel): Add.
	(check-performance-parallel): Add.
	* config.h.in: Regenerate.
	* configure: Same.
	* libsupc++/Makefile.in: Same.
	* testsuite/Makefile.in: Same.
	* Makefile.in: Same.
	* libmath/Makefile.in: Same.
	* include/Makefile.in: Same.
	* src/Makefile.in: Same.
	* po/Makefile.in: Same.
	
	* config/abi/pre/gnu.ver: Export parallel list bits.

	* docs/html/parallel_mode.html: New.
	* docs/html/documentation.html: Add link.
	* docs/doxygen/user.cfg.in: Adjust for new files and directory.
	* docs/doxygen/doxygroups.cc: Adjust namespace markup.

	* include/debug/set.h: Adjust for _GLIBCXX_STD_D or _P change.
	* include/debug/bitset: Same.
	* include/debug/multiset.h: Same.
	* include/debug/vector: Same.
	* include/debug/map.h: Same.
	* include/debug/deque: Same.
	* include/debug/list: Same.
	* include/debug/debug.h: Same.
	* include/debug/multimap.h: Same.
	* include/std/algorithm: Same.
	* include/std/numeric: Same.
	* include/std/bitset: Same.
	* include/std/string: Same.
	* include/ext/hash_map: Same.
	* include/ext/hash_set: Same.
	* include/bits/stl_list.h: Same.
	* include/bits/stl_map.h: Same.
	* include/bits/stl_algobase.h: Same.
	* include/bits/stl_set.h: Same.
	* include/bits/stl_multimap.h: Same.
	* include/bits/stl_vector.h: Same.
	* include/bits/stl_numeric.h: Same.
	* include/bits/stl_deque.h: Same.
	* include/bits/stl_multiset.h: Same.
	* include/bits/char_traits.h: Same.
	* include/bits/stl_algo.h: Same.
	* include/bits/c++config: Same.
	* include/bits/vector.tcc: Same.
	* include/bits/deque.tcc: Same.
	* include/bits/stl_bvector.h: Same.
	* include/bits/list.tcc: Same.
	* src/list.cc: Same.
	* src/parallel_list.cc: New.

	* testsuite/lib/libstdc++.exp (check_v3_target_parallel_mode): New.
	* testsuite/lib/dg-options.exp (dg-require-parallel-mode): New.
	* scripts/testsuite_flags.in (--cxxparallelflags): New.
	* scripts/check_performance: Adjust.
	* testsuite/25_algorithms/headers/parallel_algorithm.cc: New.
	* testsuite/25_algorithms/headers/algorithm_parallel_mode.cc: New.
	* testsuite/25_algorithms/headers/parallel_algorithm_mixed1.cc: New.
	* testsuite/25_algorithms/headers/parallel_algorithm_mixed2.cc: New.
	* testsuite/26_numerics/headers/numeric/parallel_numeric.cc: New.
	* testsuite/26_numerics/headers/numeric/numeric_parallel_mode.cc: New.
	* testsuite/26_numerics/headers/numeric/
	parallel_numeric_mixed1.cc: New.
	* testsuite/26_numerics/headers/numeric/
	parallel_numeric_mixed2.cc: New.
	

Co-Authored-By: Benjamin Kosnik <bkoz@redhat.com>
Co-Authored-By: Felix Bondarenko <f.bondarenko@web.de>
Co-Authored-By: Felix Putze <kontakt@felix-putze.de>
Co-Authored-By: Leonor Frias Moya <lfrias@lsi.upc.edu>
Co-Authored-By: Marius Elvert <marius.elvert@ira.uka.de>
Co-Authored-By: Robert Geisberger <robert.geisberger@stud.uni-karlsruhe.de>
Co-Authored-By: Robin Dapp <r.dapp@freenet.de>

From-SVN: r128395
2007-09-11 22:32:51 +00:00