Skip to content

Fix scheduler mode setters mapping of PU masks across pools - #7812

Open
Izpiz06 wants to merge 4 commits into
TheHPXProject:masterfrom
Izpiz06:7811
Open

Izpiz06 wants to merge 4 commits into
TheHPXProject:masterfrom
Izpiz06:7811

Conversation

@Izpiz06

@Izpiz06 Izpiz06 commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #7811

Proposed Changes

  • Map worker threads to their bound processing units using parent_pool_->get_used_processing_unit(worker_idx), with a size-safe fallback for standalone schedulers.
  • Remove outdated HPX_ASSERT checks that incorrectly assumed PU masks were limited to a single pool, preventing assertion failures and out-of-bounds writes in multi-pool configurations.
  • Add the scheduler_mode_7811 regression test to verify correct worker targeting with partial PU masks and safe operation of unmasked setters across multiple pools.

Any background context you want to provide?

Previously, scheduler mode operations mapped the n-th set bit in pu_mask to the n-th worker, regardless of the worker's actual PU binding. This caused partial masks to modify the wrong workers and pools with no matching PUs to modify their workers unnecessarily. Unmasked setters could also trigger assertions in Debug builds and cause out-of-bounds writes in Release builds when the mask spanned multiple pools.

The fix maps each worker to its actual PU, ensures the parent pool is available during initial mode configuration, and removes the invalid single-pool assumptions.

Checklist

Not all points below apply to all pull requests.

  • I have added a new feature and have added tests to go along with it.
  • I have fixed a bug and have added a regression test.
  • I have added a test using random numbers; I have made sure it uses a seed, and that random numbers generated are valid inputs for the tests.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scheduler mode setters apply PU masks to the wrong workers, and write past modes_ with several pools

4 participants