toil.batchSystems.options

Attributes

DEFAULT_BATCH_SYSTEM

logger

Classes

OptionSetter

Protocol for the setOption function we get to let us set up CLI options for

Functions

get_batch_system(key)

Get a batch system class by name.

get_batch_systems()

Get the names of all the availsble batch systems.

cpu_count()

Get the rounded-up integer number of whole CPUs available.

set_batchsystem_options(batch_system, set_option)

Call set_option for all the options for the given named batch system, or

add_all_batchsystem_options(parser)

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:

int

toil.batchSystems.options.logger
class toil.batchSystems.options.OptionSetter[source]

Bases: Protocol

Protocol 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
__call__(option_name, parsing_function=None, check_function=None, default=None, env=None, old_names=None)[source]
Parameters:
  • option_name (str)

  • parsing_function (Optional[Callable[[Any], OptionType]])

  • check_function (Optional[Callable[[OptionType], Union[None, bool]]])

  • default (Optional[OptionType])

  • env (Optional[List[str]])

  • old_names (Optional[List[str]])

Return type:

bool

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:
Return type:

None

toil.batchSystems.options.add_all_batchsystem_options(parser)[source]
Parameters:

parser (Union[argparse.ArgumentParser, argparse._ArgumentGroup])

Return type:

None