releso.spor.MPIClusterMultiProcessor

class releso.spor.MPIClusterMultiProcessor(*, save_location: Path, logger_name: str | None = None, command: str = '$MPIEXEC', max_core_count: ConstrainedIntValue, always_use: bool = False, location: Literal['cluster'], mpi_flags_variable: str = '$FLAGS_MPI_BATCH')

Bases: MultiProcessor

Multi-processor extension for the cluster MPI call.

__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

location

The location title needs to be set to cluster so that

command

command prefix which is needed to parallelize the give task

mpi_flags_variable

additional flags for the mpi call.

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.

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.

Note

Since the cluster uses PATH variables for its computation. This function will read these in and use them correspondingly. But will not change them. This limitation is done so that there is less interference during Multi-Environment training.

Parameters:

core_count (int) – Number of wanted cores.

Raises:
  • RuntimeError – This error is thrown if the mpi_flags PATH variable

  • is not of the shape expected by the function. Expected are 2 parts

  • -np [core_count] where -np can be anything and the core_count

  • should be a number.

Returns:

string representing the command line call prefix

Return type:

str

location: Literal['cluster']

The location title needs to be set to cluster so that

mpi_flags_variable: str

additional flags for the mpi call.