New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding flags to scheduler allowing to control thread stealing and idle back-off #3768
Conversation
- reduce false sharing in local priority scheduler and thread_queue - reduce false sharing in latch and condition_variable - disable stealing counters by default
- disable exponential idle backoff by default - simplify wait_or_add_new functionality
…::reset - flyby: add warning suppression for MSVC
- flyby: don't use alignment with NVCC
@@ -822,10 +846,11 @@ namespace hpx { namespace threads { namespace detail | |||
// if nothing else has to be done either wait or terminate | |||
else | |||
{ | |||
++idle_loop_count; | |||
--idle_loop_count; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to be reversed? Just thinking about naming. Right now it's more like idle_loop_countdown
;) and it's different from the other counts that actually grow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reversed this as it helped me not to carry around the end value to the point where it needed to be reset.
@@ -247,7 +247,7 @@ namespace hpx { namespace threads { namespace policies | |||
num_pending_misses += high_priority_queues_[num_thread].data_-> | |||
get_num_pending_misses(reset); | |||
} | |||
if (num_thread == 0) | |||
if (num_thread == num_queues_-1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this make a difference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was some inconsistency that we were accessing the low-priority queue from different cores, sometimes it was core zero sometimes the last one. I made it consistent to reduce false sharing on that queue.
044e0e9
to
b1b9e7a
Compare
…e back-off This adds a couple of things: - adding mark_end_of_scheduling hook to execution parameters allowing to be called back after the scheduling phase of the parallel algorithm - added invocation of mark_begin/mark_end scheduling parameters to sequential for_each and for_loop - added flags to scheduling loop that allows to control thread stealing and idle back-off (effective only for schedulers that support it) - changed implementation of static_priority_scheduler to full rely on local_priority_scheduler except that it starts of with stealing disabled - made fast_idle_mode scheduler flag more useful as it now speeds up idle back-off in case of unsuccessful thread stealing (no work available through thread stealing) - set HPX_WITH_THREAD_MANAGER_IDLE_BACKOFF=ON by default (can now be disabled at runtime) - added add_scheduler_mode/remove_scheduler_mode/add_remove_scheduler_mode APIs allowing to control the scheduler mode dynamically - flyby: removed unused arguments for get_next_thread, added argument controlling enable_stealing for wait_or_add_new - modified for_each_scaling test to not measure data initialization also added command line options `--disable_stealing` and `--fast_idle_mode`
ba55402
to
01b43d2
Compare
- flyby: remove obsolete periodic_maintenance
01b43d2
to
89b45d3
Compare
What was the reason the |
@msimberg the |
This adds a couple of things:
mark_end_of_scheduling
hook to execution parameters allowing to be called back after the scheduling phase of the parallel algorithmHPX_WITH_THREAD_MANAGER_IDLE_BACKOFF=ON
by default (can now be disabled at runtime)add_scheduler_mode
/remove_scheduler_mode
/add_remove_scheduler_mode
APIs allowing to control the scheduler mode dynamically--disable_stealing
and--fast_idle_mode
This relies on #3745 being merged first.This subsumes #3745Fixes #3744