Mondaic

salvus.project.tools.task_chains.prebuilt_workflows.detail

salvus.project.tools.task_chains.prebuilt_workflows.detail salvus project tools task_chains prebuilt_workflows detail

Details for the misfit and gradient computations.

Functions

create_result_folders_on_all_sites()

def create_result_folders_on_all_sites(
    sites: dict[str, TaskChainSiteConfig],
) -> tuple[str, dict[str, dict[str, pathlib.Path]]]: ...

Create result folders on each site. A shared one and a local one.

It will return a dictionary mapping site names to another dictionary containing the shared and local results directories.

Parameters
  • sites dict[str, TaskChainSiteConfig] — The site configuration dictionary.
Returns tuple[str, dict[str, dict[str, pathlib.Path]]]

extract_from_project()

def extract_from_project(
    project: Project,
    simulation_configuration: str,
    misfit_configuration: str | None,
    sites: dict[str, TaskChainSiteConfig],
    wavefield_compression: WavefieldCompression | None,
    timer: Timer | None = None,
) -> ProjectData: ...

Extract all the necessary pieces from an existing Salvus project.

Parameters
  • project Project — The project.
  • simulation_configuration str — The simulation configuration name.
  • misfit_configuration str | None — The misfit configuration name.
  • sites dict[str, TaskChainSiteConfig] — The site configuration dictionary.
  • wavefield_compression WavefieldCompression | None — If given, the simulation template will include checkpoints.
  • timer Timer | None — Execution timer.
Returns ProjectData

extract_simulation_template()

def extract_simulation_template(
    sites: dict[str, TaskChainSiteConfig],
    project: Project,
    simulation_configuration: str,
    wavefield_compression: WavefieldCompression | None,
) -> Waveform: ...

Gets a simulation template from a project and modifies it two-fold:

  1. Convert the mesh paths to absolute paths - this will then work on the remote system under the assumption of a shared file system.
  2. Create them as promise files so the paths will not be checked by flow which should speed up the process.
Parameters
  • sites dict[str, TaskChainSiteConfig] — Sites this will run on. Used to extract information about GPUs and memory per rank.
  • project Project — The project.
  • simulation_configuration str — Name of the simulation configuration.
  • wavefield_compression WavefieldCompression | None — Wavefield compression. Will store checkpoints if given.
Returns Waveform

generate_adjoint_input_file_from_forward_input_files()

def generate_adjoint_input_file_from_forward_input_files(
    gradient_parameterization: str, w_forward: Waveform
) -> Waveform: ...

Generate a generic adjoint input file from a forward simulation objects.

Parameters
  • gradient_parameterization str — The gradient parameterization fields.
  • w_forward Waveform — The forward simulation objects.
Returns Waveform

get_memory_per_rank()

def get_memory_per_rank(
    sites: dict[str, TaskChainSiteConfig],
) -> float | None: ...

Parse the memory per rank from a site configuration dict.

Parameters
  • sites dict[str, TaskChainSiteConfig] — the sites.
Returns float | None

get_number_of_threads_per_rank()

def get_number_of_threads_per_rank(
    sites: dict[str, TaskChainSiteConfig],
) -> int: ...

Parse the number of threads per rank from a site configuration dict.

Parameters
  • sites dict[str, TaskChainSiteConfig] — the sites.
Returns int

get_use_cuda_gpus()

def get_use_cuda_gpus(sites: dict[str, TaskChainSiteConfig]) -> bool: ...

CUDA flags from a site configuration dict.

Parameters
  • sites dict[str, TaskChainSiteConfig] — The sites.
Returns bool

parse_per_node_runner_timings()

def parse_per_node_runner_timings(
    tcc: TaskChainController,
) -> dict[str, dict[str, float]]: ...

Collect per-node runner timings.

The runners on each node can also have some timing information. That looks like

TIMING []: sec

This function collects there per runner.

Parameters
  • tcc TaskChainController — The task chain controller.
Returns dict[str, dict[str, float]]

perform_sanity_checks()

def perform_sanity_checks(sites: dict[str, TaskChainSiteConfig]) -> None: ...

Perform a range of sanity checks.

Parameters
  • sites dict[str, TaskChainSiteConfig] — The sites.
Returns None

Classes

ProjectData

class ProjectData(builtins.object):
    def __init__(
        self,
        simulation_configuration: SimulationConfiguration,
        simulation_template: Waveform,
        mesh_filename: pathlib.Path | None,
        project_path: pathlib.Path,
        misfit_configuration: MisfitConfiguration | None = None,
        processing_configuration: ProcessingConfiguration | None = None,
        data_selection_configuration: DataSelectionConfiguration | None = None,
        data_proxy_filename: pathlib.Path | None = None,
        data_name: str | None = None,
    ) -> None: ...

A container collection information from project.

Parameters
  • simulation_configuration SimulationConfiguration — The simulation configuration object.
  • simulation_template Waveform — The simulation template.
  • mesh_filename pathlib.Path | None — Absolute path to the mesh if it should be stored in the shared memory context manager. If None (in the case of chunked meshes) it will not be stored in shared memory.
  • project_path pathlib.Path — Path to the project.
  • misfit_configuration MisfitConfiguration | None — The misfit configuration.
  • processing_configuration ProcessingConfiguration | None — The processing configuration.
  • data_selection_configuration DataSelectionConfiguration | None — The data configuration, if any.
  • data_proxy_filename pathlib.Path | None — Path to the data proxy, if it exists.
  • data_name str | None — Unprocessed data name, if there is no data proxy.