releso.spor.MultiProcessor

class releso.spor.MultiProcessor(*, save_location: Path, logger_name: str | None = None, command: str = 'mpiexec -n', max_core_count: ConstrainedIntValue, always_use: bool = False)

Bases: BaseModel

Definition of the utilized multiprocessor. Default MPIEXEC.

The MultiProcessor gives access to command prefixes which can enable parallelization. Currently only tested for MPI.

Note

The cluster uses PATH variables to correctly call mpi. IF you want to use MPI multiprocessing on the cluster please use ReLeSO.spor.MPIClusterMultiProcessor.

__init__(**data: Any) None

Constructor for the ReLeSO basemodel object.

Methods

convert_to_pathlib_add_datetime(v)

Add timestamp to save_location, of applicable.

get_command(core_count)

Return the string that represents the call for multiprocessing.

get_logger()

Gets the currently defined environment logger.

set_logger_name_recursively(logger_name)

Set the logger_name variable for all child elements.

Attributes

command

command prefix which is needed to parallelize the give task

max_core_count

Max core count to use for this parallelization option.

always_use

Whether or not to always use the multiprocessing option.

save_location

Definition of the save location of the logs and validation results.

logger_name

name of the logger.

always_use: bool

Whether or not to always use the multiprocessing option. This is helpful if multiprocessing command prefix is needed even if core count is 1. Defaults to False.

command: str

command prefix which is needed to parallelize the give task

get_command(core_count: int) str

Return the string that represents the call for multiprocessing.

Parameters:

core_count (int) – Number of wanted cores.

Returns:

string representing the command line call prefix

Return type:

str

max_core_count: ConstrainedIntValue

Max core count to use for this parallelization option. This variable is not shared between tasks or environments so the user has to split these up before hand.