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:
BaseModelDefinition 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 prefix which is needed to parallelize the give task
Max core count to use for this parallelization option.
Whether or not to always use the multiprocessing option.
save_locationDefinition of the save location of the logs and validation results.
logger_namename 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.