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.
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 of0as1. This means that regardless of the number of available processors, only one process is used.Proposed Enhancement:
I suggest that a value of
0be 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 likemake -j0and version control systems likegit -j0, where0often indicates utilizing all available cores.Implementation:
I am working on a pull request to implement this change. The changes will include:
jobsvariable to interpret0as a signal to use all available processors.--jobsoption.Breaking Change:
This change will introduce a breaking change. Users who previously used
--jobs 0orjobs = 0in 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 viaargparseshould not result in parallelization and should therefore be adjusted. This keeps the breaking changes within limits.Benefits:
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.