Skip to content

Enhancement: --jobs Option - Enable Auto-Detection with Value 0 & Breaking Change Consideration #207

@daniel-mohr

Description

@daniel-mohr

I'm proposing an enhancement to the --jobs (or -j) option to increase the flexibility of the program.

Current Behavior:

Currently, the --jobs (or -j) option interprets a value of 0 as 1. This means that regardless of the number of available processors, only one process is used.

Proposed Enhancement:

I suggest that a value of 0 be interpreted as a signal to use the maximum number of available processors. This would allow the user to easily enable automatic parallelization without needing to specify a particular number of processes. This approach is common in build systems like make -j0 and version control systems like git -j0, where 0 often indicates utilizing all available cores.

Implementation:

I am working on a pull request to implement this change. The changes will include:

  • Modification of the default logic for the jobs variable to interpret 0 as a signal to use all available processors.
  • Updating the documentation to explain the new behavior of the --jobs option.

Breaking Change:

This change will introduce a breaking change. Users who previously used --jobs 0 or jobs = 0 in their configuration to force single-threaded execution will suddenly experience parallelization after this pull request is accepted.

However, I would expect that very few users have configured --jobs 0. The default value via argparse should not result in parallelization and should therefore be adjusted. This keeps the breaking changes within limits.

Benefits:

  • Flexibility: Users can easily enable automatic parallelization without manually configuring the number of processes.
  • Optimization: The program can optimally utilize available resources.
  • User Friendliness: Simplifies configuration for users who want automatic parallelization.

I am open to feedback and willing to adjust the changes as needed.

Pull Request: I am currently working on a pull request and will provide a link as soon as it's available.

Metadata

Metadata

Assignees

No one assigned

    Labels

    S: triageIssue needs triage.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions