Mondaic

salvus.flow.executors.task_chain.task_chain_site_config

salvus.flow.executors.task_chain.task_chain_site_config salvus flow executors task_chain task_chain_site_config

Task chain specific site configuration.

Classes

TaskChainSiteConfig

class TaskChainSiteConfig(
    salvus.flow.utils.serialization_helpers.SerializationMixin
):
    def __init__(
        self,
        site_name: str,
        number_of_parallel_workers: int,
        ranks_per_salvus_simulation: int,
        max_threads_per_worker: int,
        shared_file_system: bool,
        environment_variables_per_worker: _OptionalListOfStringDicts = None,
        memory_per_rank_in_MB: float | None = None,
        wall_time_in_seconds_per_task_chain: int | None = None,
        task_chain_runner_call_prefix: str | None = None,
        custom_mpi_template: str | None = None,
    ): ...

Keeps track of the initial arguments passed to an objects and can later on serialize them to JSON document.

It will only consider whatever is passed in the init.

Site configuration for a task chain runner site.

Parameters
  • site_name str — Name of the site.
  • number_of_parallel_workers int — The number of parallel task chain workers on the site.
  • ranks_per_salvus_simulation int — The number of ranks for a salvus simulation in each parallel task chain runner.
  • max_threads_per_worker int — The number of threads per worker. For GPU Salvus runs best set this to a multiple of the number of ranks per Salvus simulation.
  • shared_file_system bool — True if the filesystem is shared between the runner and the controller.
  • environment_variables_per_worker _OptionalListOfStringDicts — One set of environment variables per parallel worker. That way the different workers can for example use different GPUs.
  • memory_per_rank_in_MB float | None — The memory per rank in megabytes.
  • wall_time_in_seconds_per_task_chain int | None — The wall time in seconds per task chain.
  • task_chain_runner_call_prefix str | None — Arbitrary bash command that is placed right before the Python call that launches the local task chain runners on the remote sites. Useful if these have to be launched with special MPI commands for example.
  • custom_mpi_template str | None — Custom MPI call for calls to Salvus within the task chain.
Methods
from_json()
def from_json(d: builtins.dict) -> Any: ...

Recreate the object from a dictionary serialization of its initialization parameters.

Parameters
  • d builtins.dict — Dictionary containing its init parameters and a few other things.
Returns Any
to_json()
def to_json(
    self,
    external_file_hash: types = None,
    timer: types = None,
    log_to_logger: bool = False,
    comm: types = None,
) -> builtins.dict: ...

Serialize the object to a dictionary that can be written to JSON.

Parameters
  • external_file_hash types — Hash of any external files associated with this object. Can be passed here in which case it will be stored in a centralized location in the JSON file.
  • timer types — Execution timer.
  • log_to_logger bool — Log timings to the logger.
  • comm types — MPI communicator, if any.
Returns builtins.dict