Distribute the input range [begin, end) across the thread_pool_type recursively as a collection of tasks.
More...
|
in_iterator | compute_end (typename std::iterator_traits< in_iterator >::difference_type const number_subranges) const noexcept(true) FORCE_INLINE |
|
container_type::size_type | num_wk_items_spawned () const noexcept(true) FORCE_INLINE |
|
std::ptrdiff_t | odd_third_buff_range () const noexcept(true) FORCE_INLINE |
|
std::ptrdiff_t | even_half_buff_range () const noexcept(true) FORCE_INLINE |
|
algo_work_heap_type::buffer_type | first_buff_part () const noexcept(true) FORCE_INLINE |
|
algo_work_heap_type::buffer_type | even_second_buff_part () const noexcept(true) FORCE_INLINE |
|
algo_work_heap_type::buffer_type | odd_second_buff_part () const noexcept(true) FORCE_INLINE |
|
algo_work_heap_type::buffer_type | odd_third_buff_part () const noexcept(true) FORCE_INLINE |
|
__stdcall | subdivide_n_gen_wk (thread_pool_type &p, operation_type &f, typename alg_wrap_t::work_complete_t &w, algo_work_heap_type const &wh) noexcept(true) FORCE_INLINE |
|
__stdcall | subdivide_n_gen_wk (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 |
|
__stdcall | subdivide_n_gen_wk (thread_pool_type &p, operation_type &f, typename alg_wrap_t::work_complete_t &w, algo_work_heap_type const &wh, in_iterator const &b, in_iterator const &e) noexcept(true) FORCE_INLINE |
|
__stdcall | subdivide_n_gen_wk (thread_pool_type &p, operation_type &f, typename alg_wrap_t::work_complete_t &w, algo_work_heap_type const &wh, in_iterator const &b, in_iterator const &e, typename thread_pool_type::pool_type::size_type const t_per_c) noexcept(true) FORCE_INLINE |
|
virtual | ~subdivide_n_gen_wk () FORCE_INLINE |
|
template<pool_traits::size_mode_t Ps, class TPB, class Alg>
class jmmcg::ppd::private_::subdivide_n_gen_wk< Ps, TPB, Alg >
Distribute the input range [begin, end) across the thread_pool_type recursively as a collection of tasks.
This algorithm recursively creates tasks non-joinably until it terminates, when it reaches the leaves which contain contiguous sub-ranges [begin, end) of the initial range and the functor, fn. i.e. it distributes the initial range across the threads_per_clique within the thread_pool_type. The algorithm contains all_done, a counter, that records the number of outstanding tasks, and when that counter reaches zero, the execution_context is released, as all of the sub-tasks have completed, the counter is required because the tasks are transferred non-joinably.
Definition at line 443 of file subdivide_n_gen_wk.hpp.
template<pool_traits::size_mode_t Ps, class TPB, class Alg>
An object that signals to the execution_context when all of the closure_base-derived closures has been process()ed, including being distributed across the threads_per_clique in the thread_pool via the tasks spawned by subdivide_n_gen_wk::process().
This is used so that we don't have to generate an execution_context at each branch, and wait upon it, thus causing vertical pool_threads to be held, and horizontal_execution would have to occur instead, i.e. reducing resources consumed.
Definition at line 457 of file subdivide_n_gen_wk.hpp.
template<pool_traits::size_mode_t Ps, class TPB , class Alg >
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.
- Todo:
- This is an O(n) operation, and we might want a faster algorithm, it doesn't have to be perfect, as long as the result is >= the true value.
- Returns
- The number of items allocated in the tree that subdivide_n_gen_wk::process() will generate. Not in bytes, but items.
- See also
- subdivide_n_gen_wk::process()
Definition at line 116 of file subdivide_n_gen_wk_impl.hpp.