libjmmcg
build_2783
A C++ library containing an eclectic mix of useful, advanced components.
|
#include <subdivide_n_gen_wk.hpp>
Public Types | |
typedef subdivide_n_gen_wk< Ps, TPB, alg_wrapper1< typename TPB::pool_traits_type, Alg< Conts, Fn >, TPB::pool_traits_type::result_traits_ > > | base_t |
typedef base_t::container_type | container_type |
typedef base_t::in_iterator | in_iterator |
typedef base_t::operation_type | operation_type |
typedef base_t::result_type | result_type |
typedef base_t::alg_wrap_t | alg_wrap_t |
typedef base_t::thread_pool_type | thread_pool_type |
typedef base_t::pool_traits_type | pool_traits_type |
typedef base_t::os_traits | os_traits |
typedef base_t::ensure_wk_complete_t | ensure_wk_complete_t |
typedef base_t::algo_work_heap_type | algo_work_heap_type |
Public Member Functions | |
__stdcall | subdivide_n_gen_wk1 (thread_pool_type &p, operation_type &f, typename alg_wrap_t::work_complete_t &w, algo_work_heap_type const &wh, typename std::iterator_traits< in_iterator >::difference_type const number_subranges, typename thread_pool_type::pool_type::size_type const cliques) noexcept(true) FORCE_INLINE |
void __fastcall | process () noexcept(false) |
Recursively call subdivide_n_gen_wk1::process(), on disjoint left and right-subsets (assuming even numbers of processors in the clique) of the input collection, until the number of work items generated is 2^n just larger than the number of threads in the pool, which implements a form of GSS(k) scheduling. More... | |
constexpr bool __fastcall | operator< (subdivide_n_gen_wk1 const &) const noexcept(true) FORCE_INLINE |
Static Public Member Functions | |
static thread_pool_type::pool_type::size_type | compute_threads_per_clique (typename thread_pool_type::pool_type::size_type num_threads, typename thread_pool_type::pool_type::size_type const cliques) noexcept(true) FORCE_INLINE |
static thread_pool_type::pool_type::size_type | compute_buffer_items (typename thread_pool_type::pool_type::size_type const num_threads_per_clique) noexcept(true) FORCE_INLINE |
Static Public Attributes | |
static constexpr ppd::generic_traits::memory_access_modes | memory_access_mode |
This recursive process ensures that it takes O(log(n)) time to submit the work to the pool.
Algorithm derived from [1]. Note that if the wrapped collection implements CREW or EREW semantics, as safe_colln does, then this algorithm is an implementation CREW/EREW P-RAM model, therefore if the thread_pool is large enough, it implements an optimal schedule according to section 3.3 & Theorem 3.3 in [1].
[1] Alan Gibbons, Wojciech Rytter, "Efficient Parallel Algorithms", Cambridge University Press, 1989.
Definition at line 621 of file subdivide_n_gen_wk.hpp.
typedef base_t::alg_wrap_t jmmcg::ppd::private_::subdivide_n_gen_wk1< Ps, TPB, Fn, Conts, Alg >::alg_wrap_t |
Definition at line 644 of file subdivide_n_gen_wk.hpp.
typedef base_t::algo_work_heap_type jmmcg::ppd::private_::subdivide_n_gen_wk1< Ps, TPB, Fn, Conts, Alg >::algo_work_heap_type |
Definition at line 649 of file subdivide_n_gen_wk.hpp.
typedef subdivide_n_gen_wk< Ps, TPB, alg_wrapper1< typename TPB::pool_traits_type, Alg<Conts, Fn>, TPB::pool_traits_type::result_traits_ > > jmmcg::ppd::private_::subdivide_n_gen_wk1< Ps, TPB, Fn, Conts, Alg >::base_t |
Definition at line 639 of file subdivide_n_gen_wk.hpp.
typedef base_t::container_type jmmcg::ppd::private_::subdivide_n_gen_wk1< Ps, TPB, Fn, Conts, Alg >::container_type |
Definition at line 640 of file subdivide_n_gen_wk.hpp.
typedef base_t::ensure_wk_complete_t jmmcg::ppd::private_::subdivide_n_gen_wk1< Ps, TPB, Fn, Conts, Alg >::ensure_wk_complete_t |
Definition at line 648 of file subdivide_n_gen_wk.hpp.
typedef base_t::in_iterator jmmcg::ppd::private_::subdivide_n_gen_wk1< Ps, TPB, Fn, Conts, Alg >::in_iterator |
Definition at line 641 of file subdivide_n_gen_wk.hpp.
typedef base_t::operation_type jmmcg::ppd::private_::subdivide_n_gen_wk1< Ps, TPB, Fn, Conts, Alg >::operation_type |
Definition at line 642 of file subdivide_n_gen_wk.hpp.
typedef base_t::os_traits jmmcg::ppd::private_::subdivide_n_gen_wk1< Ps, TPB, Fn, Conts, Alg >::os_traits |
Definition at line 647 of file subdivide_n_gen_wk.hpp.
typedef base_t::pool_traits_type jmmcg::ppd::private_::subdivide_n_gen_wk1< Ps, TPB, Fn, Conts, Alg >::pool_traits_type |
Definition at line 646 of file subdivide_n_gen_wk.hpp.
typedef base_t::result_type jmmcg::ppd::private_::subdivide_n_gen_wk1< Ps, TPB, Fn, Conts, Alg >::result_type |
Definition at line 643 of file subdivide_n_gen_wk.hpp.
typedef base_t::thread_pool_type jmmcg::ppd::private_::subdivide_n_gen_wk1< Ps, TPB, Fn, Conts, Alg >::thread_pool_type |
Definition at line 645 of file subdivide_n_gen_wk.hpp.
|
inlinenoexcept |
Definition at line 356 of file subdivide_n_gen_wk_impl.hpp.
|
inlinestaticnoexcept |
This computation is intimately related to the way subdivide_n_gen_wk::process() spawns sub-tasks, and the two must operate in a similar manner, otherwise we might get memory-allocation errors. Note that it over-allocates memory, because it doesn't allow for memory re-use: children could re-use memory of parents.
Definition at line 116 of file subdivide_n_gen_wk_impl.hpp.
|
inlinestaticnoexcept |
Definition at line 107 of file subdivide_n_gen_wk_impl.hpp.
|
inlineconstexprnoexcept |
Definition at line 678 of file subdivide_n_gen_wk.hpp.
References jmmcg::ppd::private_::priority_t< joinable_t, TPB, Pri >::operator<<().
|
inlinenoexcept |
Recursively call subdivide_n_gen_wk1::process(), on disjoint left and right-subsets (assuming even numbers of processors in the clique) of the input collection, until the number of work items generated is 2^n just larger than the number of threads in the pool, which implements a form of GSS(k) scheduling.
As the subsets are disjoint inter-subset operations are effectively CRCW operations, whereas intra-subset operations are strictly EREW. This subdivision is valid according to Proposition 1.1 in section 1.2 and Brent's Theorem [1].
[1] Casanova, H., Legrand, A., Robert, Y., "Parallel Algorithms", CRC Press, 2008.
Definition at line 363 of file subdivide_n_gen_wk_impl.hpp.
|
staticconstexpr |
To assist in allowing compile-time computation of the algorithmic order of the threading model.
Definition at line 466 of file subdivide_n_gen_wk.hpp.