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_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.
sitesdict[str, TaskChainSiteConfig] — The site configuration dictionary.
extract_from_project()
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.
projectProject — The project.simulation_configurationstr — The simulation configuration name.misfit_configurationstr | None — The misfit configuration name.sitesdict[str, TaskChainSiteConfig] — The site configuration dictionary.wavefield_compressionWavefieldCompression | None — If given, the simulation template will include checkpoints.timerTimer | None — Execution timer.
extract_simulation_template()
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:
- Convert the mesh paths to absolute paths - this will then work on the remote system under the assumption of a shared file system.
- Create them as promise files so the paths will not be checked by flow which should speed up the process.
sitesdict[str, TaskChainSiteConfig] — Sites this will run on. Used to extract information about GPUs and memory per rank.projectProject — The project.simulation_configurationstr — Name of the simulation configuration.wavefield_compressionWavefieldCompression | None — Wavefield compression. Will store checkpoints if given.
generate_adjoint_input_file_from_forward_input_files()
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.
gradient_parameterizationstr — The gradient parameterization fields.w_forwardWaveform — The forward simulation objects.
get_memory_per_rank()
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.
sitesdict[str, TaskChainSiteConfig] — the sites.
get_number_of_threads_per_rank()
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.
sitesdict[str, TaskChainSiteConfig] — the sites.
get_use_cuda_gpus()
get_use_cuda_gpus()def get_use_cuda_gpus(sites: dict[str, TaskChainSiteConfig]) -> bool: ...CUDA flags from a site configuration dict.
sitesdict[str, TaskChainSiteConfig] — The sites.
parse_per_node_runner_timings()
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 [
This function collects there per runner.
tccTaskChainController — The task chain controller.
perform_sanity_checks()
perform_sanity_checks()def perform_sanity_checks(sites: dict[str, TaskChainSiteConfig]) -> None: ...Perform a range of sanity checks.
sitesdict[str, TaskChainSiteConfig] — The sites.
Classes
ProjectData
ProjectDataclass 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.
simulation_configurationSimulationConfiguration — The simulation configuration object.simulation_templateWaveform — The simulation template.mesh_filenamepathlib.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_pathpathlib.Path — Path to the project.misfit_configurationMisfitConfiguration | None — The misfit configuration.processing_configurationProcessingConfiguration | None — The processing configuration.data_selection_configurationDataSelectionConfiguration | None — The data configuration, if any.data_proxy_filenamepathlib.Path | None — Path to the data proxy, if it exists.data_namestr | None — Unprocessed data name, if there is no data proxy.