toil.batchSystems.options¶
Attributes¶
Classes¶
Protocol for the setOption function we get to let us set up CLI options for |
Functions¶
|
Get a batch system class by name. |
Get the names of all the availsble batch systems. |
|
Get the rounded-up integer number of whole CPUs available. |
|
|
Call set_option for all the options for the given named batch system, or |
|
Module Contents¶
- toil.batchSystems.options.DEFAULT_BATCH_SYSTEM = 'single_machine'¶
- toil.batchSystems.options.get_batch_system(key)[source]¶
Get a batch system class by name.
- Raises:
KeyError if the key is not the name of a batch system, and ImportError if the batch system’s class cannot be loaded.
- Parameters:
key (str)
- Return type:
Type[toil.batchSystems.abstractBatchSystem.AbstractBatchSystem]
- toil.batchSystems.options.get_batch_systems()[source]¶
Get the names of all the availsble batch systems.
- Return type:
Sequence[str]
- toil.batchSystems.options.cpu_count()[source]¶
Get the rounded-up integer number of whole CPUs available.
Counts hyperthreads as CPUs.
Uses the system’s actual CPU count, or the current v1 cgroup’s quota per period, if the quota is set.
Ignores the cgroup’s cpu shares value, because it’s extremely difficult to interpret. See https://github.com/kubernetes/kubernetes/issues/81021.
Caches result for efficiency.
- Returns:
Integer count of available CPUs, minimum 1.
- Return type:
- toil.batchSystems.options.logger¶
- class toil.batchSystems.options.OptionSetter[source]¶
Bases:
ProtocolProtocol for the setOption function we get to let us set up CLI options for each batch system.
Actual functionality is defined in the Config class.
- OptionType¶
- toil.batchSystems.options.set_batchsystem_options(batch_system, set_option)[source]¶
Call set_option for all the options for the given named batch system, or all batch systems if no name is provided.
- Parameters:
batch_system (Optional[str])
set_option (OptionSetter)
- Return type:
None
- toil.batchSystems.options.add_all_batchsystem_options(parser)[source]¶
- Parameters:
parser (Union[argparse.ArgumentParser, argparse._ArgumentGroup])
- Return type:
None