Version:

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()

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.
SIGNATURE
def create_result_folders_on_all_sites(
    sites: dict[str, TaskChainSiteConfig],
) -> tuple[str, dict[str, dict[str, pathlib.Path]]]: ...
ARGUMENTS
Required
sites
Type:dict[str, TaskChainSiteConfig]
Description:
The site configuration dictionary.
RETURNS
Return type: tuple[str, dict[str, dict[str, pathlib.Path]]]

extract_from_project()

Extract all the necessary pieces from an existing Salvus project.
SIGNATURE
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: ...
ARGUMENTS
Required
project
Type:Project
Description:
The project.
Required
simulation_configuration
Type:str
Description:
The simulation configuration name.
Required
misfit_configuration
Type:str | None
Description:
The misfit configuration name.
Required
sites
Type:dict[str, TaskChainSiteConfig]
Description:
The site configuration dictionary.
Required
wavefield_compression
Type:WavefieldCompression | None
Description:
If given, the simulation template will include checkpoints.
Optional
timer
Type:Timer | None
Default value:None
Description:
Execution timer.
RETURNS
Return type: ProjectData

extract_simulation_template()

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.
SIGNATURE
def extract_simulation_template(
    sites: dict[str, TaskChainSiteConfig],
    project: Project,
    simulation_configuration: str,
    wavefield_compression: WavefieldCompression | None,
) -> Waveform: ...
ARGUMENTS
Required
sites
Type:dict[str, TaskChainSiteConfig]
Description:
Sites this will run on. Used to extract information about GPUs and memory per rank.
Required
project
Type:Project
Description:
The project.
Required
simulation_configuration
Type:str
Description:
Name of the simulation configuration.
Required
wavefield_compression
Type:WavefieldCompression | None
Description:
Wavefield compression. Will store checkpoints if given.
RETURNS
Return type: Waveform

generate_adjoint_input_file_from_forward_input_files()

Generate a generic adjoint input file from a forward simulation objects.
SIGNATURE
def generate_adjoint_input_file_from_forward_input_files(
    gradient_parameterization: str, w_forward: Waveform
) -> Waveform: ...
ARGUMENTS
Required
gradient_parameterization
Type:str
Description:
The gradient parameterization fields.
Required
w_forward
Type:Waveform
Description:
The forward simulation objects.
RETURNS
Return type: Waveform

get_memory_per_rank()

Parse the memory per rank from a site configuration dict.
SIGNATURE
def get_memory_per_rank(
    sites: dict[str, TaskChainSiteConfig],
) -> float | None: ...
ARGUMENTS
Required
sites
Type:dict[str, TaskChainSiteConfig]
Description:
the sites.
RETURNS
Return type: float | None

get_number_of_threads_per_rank()

Parse the number of threads per rank from a site configuration dict.
SIGNATURE
def get_number_of_threads_per_rank(
    sites: dict[str, TaskChainSiteConfig],
) -> int: ...
ARGUMENTS
Required
sites
Type:dict[str, TaskChainSiteConfig]
Description:
the sites.
RETURNS
Return type: int

get_use_cuda_gpus()

CUDA flags from a site configuration dict.
SIGNATURE
def get_use_cuda_gpus(sites: dict[str, TaskChainSiteConfig]) -> bool: ...
ARGUMENTS
Required
sites
Type:dict[str, TaskChainSiteConfig]
Description:
The sites.
RETURNS
Return type: bool

parse_per_node_runner_timings()

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.
SIGNATURE
def parse_per_node_runner_timings(
    tcc: TaskChainController,
) -> dict[str, dict[str, float]]: ...
ARGUMENTS
Required
tcc
Type:TaskChainController
Description:
The task chain controller.
RETURNS
Return type: dict[str, dict[str, float]]

perform_sanity_checks()

Perform a range of sanity checks.
SIGNATURE
def perform_sanity_checks(sites: dict[str, TaskChainSiteConfig]) -> None: ...
ARGUMENTS
Required
sites
Type:dict[str, TaskChainSiteConfig]
Description:
The sites.

Classes

ProjectData

A container collection information from project.
SIGNATURE
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: ...
ARGUMENTS
Required
simulation_configuration
Type:SimulationConfiguration
Description:
The simulation configuration object.
Required
simulation_template
Type:Waveform
Description:
The simulation template.
Required
mesh_filename
Type:pathlib.Path | None
Description:
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.
Required
project_path
Type:pathlib.Path
Description:
Path to the project.
Optional
misfit_configuration
Type:MisfitConfiguration | None
Default value:None
Description:
The misfit configuration.
Optional
processing_configuration
Type:ProcessingConfiguration | None
Default value:None
Description:
The processing configuration.
Optional
data_selection_configuration
Type:DataSelectionConfiguration | None
Default value:None
Description:
The data configuration, if any.
Optional
data_proxy_filename
Type:pathlib.Path | None
Default value:None
Description:
Path to the data proxy, if it exists.
Optional
data_name
Type:str | None
Default value:None
Description:
Unprocessed data name, if there is no data proxy.
PAGE CONTENTS