Base class for stealing policies. More...
Public Member Functions | |
| steal_policy_base (size_type chunk_size, size_type fraction) noexcept | |
| Constructs a new steal_policy_base. More... | |
| template<typename Scheduler > | |
| bool | has_work (Scheduler const &scheduler) const noexcept |
Returns true if the scheduler has available work to be stolen. | |
| template<typename Scheduler > | |
| void | process_steal_requests (Scheduler &scheduler, task_graph *tg_ptr) |
| Processes steal requests that it got from thieves. More... | |
| template<typename Scheduler > | |
| void | migrate_work (Scheduler &scheduler, location_type loc, size_type num_to_migrate, task_graph *tg_ptr) |
| Migrate some work to a thief. More... | |
| int | expected_work (void) const noexcept |
| void | receive_work_notification (void) noexcept |
| Receive notification of a received work request. | |
| void | receive_steal_completion (const size_type loot) noexcept |
| Receive notification of a steal request completion. | |
Public Types | |
| typedef std::size_t | size_type |
Friends | |
| std::ostream & | operator<< (std::ostream &os, steal_policy_base const &p) |
Base class for stealing policies.
|
noexcept |
Constructs a new steal_policy_base.
| chunk_size | Number of entries to steal. |
| fraction | Fraction of the total entries to steal. |
| void stapl::steal_policy_base::process_steal_requests | ( | Scheduler & | scheduler, |
| task_graph * | tg_ptr | ||
| ) |
Processes steal requests that it got from thieves.
This function migrates work to the thieves. It will distribute work according to the steal requests that were received.
| void stapl::steal_policy_base::migrate_work | ( | Scheduler & | scheduler, |
| location_type | loc, | ||
| size_type | num_to_migrate, | ||
| task_graph * | tg_ptr | ||
| ) |
Migrate some work to a thief.
| scheduler | Scheduler to migrate work from. |
| loc | Thief to migrate work to. |
| num_to_migrate | How much work to migrate. |
1.8.13