Skip to content
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

improve the LocalExecutor builders #427

Merged
merged 5 commits into from
Nov 4, 2021

Commits on Nov 4, 2021

  1. embed the number of executors to create directly in the Placement policy

    Instead of having two orthogonal configurations (the number of executors
    to create and the CPU placement policy) that can conflict with each
    other (for instance, if we provide a custom placement and a different
    number of shards to create), merge the two.
    
    A `Placement` now takes (when appropriate) the number of executors to
    create in addition to the `CpuSet` to use. The
    `LocalExecutorPoolBuilder` constructor now takes a `Placement` directly
    instead of the number of executors to create.
    HippoBaro committed Nov 4, 2021
    Configuration menu
    Copy the full SHA
    6531faa View commit details
    Browse the repository at this point in the history
  2. rename Placement to PoolPlacement

    The next commit in this series will reintroduce the `Placement` that
    will be suited for when creating a single executor.
    HippoBaro committed Nov 4, 2021
    Configuration menu
    Copy the full SHA
    9c68685 View commit details
    Browse the repository at this point in the history
  3. align the LocalExecutorBuilder API with the pooled version.

    The pooled version is presently superior to the non-pooled one
    because it uses the `PoolPlacement` logic. With the existing
    `LocalExecutorBuilder,` an executor is either pinned to a specific CPU
    or none at all. Therefore, it's possible to spawn a single executor
    that's fenced to a collection of CPUs using the pooled API but not with
    the non-pooled one.
    
    This commit creates a new `Placement` enum that contains placement
    strategies that make sense for a single executor. In turn,
    `LocalExecutorBuilder::new` now takes a placement strategy, and the
    `pin_to_cpu` API is removed.
    HippoBaro committed Nov 4, 2021
    Configuration menu
    Copy the full SHA
    cb2f3e4 View commit details
    Browse the repository at this point in the history
  4. update documentation; assert the provided CPUs exist at runtime

    Now that we allow users to provide hand-crafter `CpuSet,` we open the
    door to receiving CPUs that don't exist. To prevent this we
    systematically check that they are part of the `online()` set of CPUs
    that are available to the current process.
    HippoBaro committed Nov 4, 2021
    Configuration menu
    Copy the full SHA
    37c7f69 View commit details
    Browse the repository at this point in the history
  5. update to rust 1.56

    HippoBaro committed Nov 4, 2021
    Configuration menu
    Copy the full SHA
    0e3a34e View commit details
    Browse the repository at this point in the history