Required
simulation_template| Type: | simple_config.simulation.Waveform |
| Description: | Template for the simulation containing all non-event-dependent information, such as start/end time or a template for the boundary conditions. |
def get_simulation_input_file(
simulation_template: simple_config.simulation.Waveform,
event: Event,
event_configuration: EventConfiguration,
project_path: pathlib.Path,
event_dependent_mesh_masking: typing.Callable | None = None,
wavefield_compression: WavefieldCompression | None = None,
extra_output_configuration: dict[str, typing.Any] | None = None,
) -> simple_config.simulation.Waveform: ...| Type: | simple_config.simulation.Waveform |
| Description: | Template for the simulation containing all non-event-dependent information, such as start/end time or a template for the boundary conditions. |
| Type: | Event |
| Description: | Event object to extract the source(s) and receivers from. |
| Type: | EventConfiguration |
| Description: | EventConfiguration object. |
| Type: | pathlib.Path |
| Description: | Root path to the project. |
| Type: | typing.Callable | None |
| Default value: | None |
| Description: | Optional callback function for event- dependent mesh masking. The function signature must take the global mesh and the event as arguments. Boundary conditions will be applied automatically. |
| Type: | WavefieldCompression | None |
| Default value: | None |
| Description: | Options that have an effect on the output of subsequent simulations but must already be known now. Currently allows the specification of some techniques to compress wavefields for the purpose of gradient computations. Must be given for checkpoints to be generated during the forward simulation. |
| Type: | dict[str, typing.Any] | None |
| Default value: | None |
| Description: | Extra settings for the waveform simulations. Can only be used for settings that do not change the resulting waveforms. python extra_output_configuration={ "volume_data": { "sampling_interval_in_time_steps": 50, "fields": ["displacement"], }, "surface_data": { "sampling_interval_in_time_steps": 20, "fields": ["acceleration", "velocity"], "side_sets": ["x0", "x1"], }, "memory_per_rank_in_MB": 2000.0, } |
simple_config.simulation.Waveformclass SimulationComponent(builtins.object):
def __init__(self, project: Project): ...| Type: | Project |
| Description: | The project to attach the components to. |
simulations.launch(), all jobs in this job array will be cancelled.def cancel(
self,
simulation_configuration: str | None = None,
events: (
str
| typing.Sequence[str]
| Event
| typing.Sequence[Event]
| EventCollection
| None
) = None,
misfit_configuration: str | MisfitConfiguration | None = None,
wavefield_compression: WavefieldCompression | None = None,
gradient_parameters: set[str] | None = None,
) -> None: ...| Type: | str | None |
| Default value: | None |
| Description: | Name of the simulation configuration. |
| Type: | str | typing.Sequence[str] | Event | typing.Sequence[Event] | EventCollection | None |
| Default value: | None |
| Description: | One or more events. |
| Type: | str | MisfitConfiguration | None |
| Default value: | None |
| Description: | Optional misfit configuration to query adjoint simulations |
| Type: | WavefieldCompression | None |
| Default value: | None |
| Description: | Must be given for adjoint simulations. |
| Type: | set[str] | None |
| Default value: | None |
| Description: | Model parameters to compute the gradients for. Must be a subset of the model parameters. If not given, gradients will be computed for all model fields. |
def cancel_all(self) -> None: ...def clear_simulation_store(self) -> None: ...query() unless there still exists remote
data.def delete_jobs(
self,
simulation_configuration: str | SimulationConfiguration,
events: (
str
| typing.Sequence[str]
| Event
| typing.Sequence[Event]
| EventCollection
),
verbosity: int = 0,
) -> None: ...| Type: | str | SimulationConfiguration |
| Description: | The simulation configuration. |
| Type: | str | typing.Sequence[str] | Event | typing.Sequence[Event] | EventCollection |
| Description: | One or more events. |
| Type: | int |
| Default value: | 0 |
| Description: | Verbosity level. |
def delete_results(
self,
simulation_configuration: str,
events: (
str
| typing.Sequence[str]
| Event
| typing.Sequence[Event]
| EventCollection
),
misfit_configuration: str | None = None,
wavefield_compression: WavefieldCompression | None = None,
gradient_parameters: set[str] | None = None,
verbosity: int = 1,
) -> int: ...| Type: | str |
| Description: | The name of the simulation configuration. |
| Type: | str | typing.Sequence[str] | Event | typing.Sequence[Event] | EventCollection |
| Description: | One or more events. |
| Type: | str | None |
| Default value: | None |
| Description: | The name of the misfit configuration for deleting gradients. |
| Type: | WavefieldCompression | None |
| Default value: | None |
| Description: | The wavefield compression settings for deleting gradients. |
| Type: | set[str] | None |
| Default value: | None |
| Description: | Model parameters to compute the gradients for. Must be a subset of the model parameters. If not given, gradients will be computed for all model fields. |
| Type: | int |
| Default value: | 1 |
| Description: | Verbosity level. |
.launch_adjoint() method.skip_existing_simulations is True that list
might be a subset of the input list.def get_adjoint_input_files(
self,
simulation_configuration: str,
misfit_configuration: str | MisfitConfiguration,
wavefield_compression: WavefieldCompression,
gradient_parameters: set[str] | None,
events: (
str
| typing.Sequence[str]
| Event
| typing.Sequence[Event]
| EventCollection
),
skip_existing_simulations: bool = False,
verbose: bool = True,
site_name: str | None = None,
ranks_per_job: salvus._core.types.int_ | None = None,
) -> tuple[
list[simple_config.simulation.Waveform], list[Event], dict[str, str]
]: ...| Type: | str |
| Description: | Name of the simulation configuration for the forward run. |
| Type: | str | MisfitConfiguration |
| Description: | Name of the misfit configuration. |
| Type: | WavefieldCompression |
| Description: | The wavefield compression settings. Used to check compatibility of potentially already existing checkpoints. |
| Type: | set[str] | None |
| Description: | Model parameters to compute the gradients for. Must be a subset of the model parameters. If not given, gradients will be computed for all model fields. |
| Type: | str | typing.Sequence[str] | Event | typing.Sequence[Event] | EventCollection |
| Description: | One or more events. |
| Type: | bool |
| Default value: | False |
| Description: | If True, do not return input files for simulations that already exist as part of the project. |
| Type: | bool |
| Default value: | True |
| Description: | Verbosity. |
| Type: | str | None |
| Default value: | None |
| Description: | Optionally provide site name to check for remote files. |
| Type: | salvus._core.types.int_ | None |
| Default value: | None |
| Description: | Optionally provide the number of ranks to check for consistent checkpoints. |
.launch()
method.skip_existing_simulations is True that list
might be a subset of the input list.def get_input_files(
self,
simulation_configuration: str | _SimulationConfigurationBase,
events: (
str
| typing.Sequence[str]
| Event
| typing.Sequence[Event]
| EventCollection
),
skip_existing_simulations: bool = False,
derived_job_config: WavefieldCompression | None = None,
verbose: bool = True,
site_name: str | None = None,
ranks_per_job: salvus._core.types.int_ | None = None,
extra_output_configuration: dict[str, typing.Any] | None = None,
delete_conflicting_previous_results: bool = False,
allow_empty_output: bool = False,
) -> tuple[
list[simple_config.simulation.Waveform], list[Event], dict[str, str]
]: ...| Type: | str | _SimulationConfigurationBase |
| Description: | Name of the simulation configuration. |
| Type: | str | typing.Sequence[str] | Event | typing.Sequence[Event] | EventCollection |
| Description: | One or more events. If not given, it will return a generic input file without any sources or receivers. |
| Type: | bool |
| Default value: | False |
| Description: | If True, do not return input files for simulations that already exist as part of the project. |
| Type: | WavefieldCompression | None |
| Default value: | None |
| Description: | Options that have an effect on the output of subsequent simulations but must already be known now. Currently allows the specification of some techniques to compress wavefields for the purpose of gradient computations. Must be given for checkpoints to be generated during the forward simulation. |
| Type: | bool |
| Default value: | True |
| Description: | Verbosity. |
| Type: | str | None |
| Default value: | None |
| Description: | Optionally provide site name to check for remote files. |
| Type: | salvus._core.types.int_ | None |
| Default value: | None |
| Description: | Optionally provide the number of ranks to check for consistent checkpoints. |
| Type: | dict[str, typing.Any] | None |
| Default value: | None |
| Description: | Extra settings for the waveform simulations. Can only be used for settings that do not change the resulting waveforms. python extra_output_configuration={ "volume_data": { "sampling_interval_in_time_steps": 50, "fields": ["displacement"], }, "surface_data": { "sampling_interval_in_time_steps": 20, "fields": ["acceleration", "velocity"], "side_sets": ["x0", "x1"], }, "memory_per_rank_in_MB": 2000.0, } |
| Type: | bool |
| Default value: | False |
| Description: | If skip_existing_simulations is True, simulations with existing results but different extra_output_configurations would cause an error. If this options is set to True, it will delete the potentially conflicting existing results. |
| Type: | bool |
| Default value: | False |
| Description: | By default, this method will raise a ValueError if one attempts to get an input file for an event that would have no output at all. This argument overwrites that which is useful for example for visualization purposes. |
def get_mesh(
self,
simulation_configuration: str,
event: Event | str | None = None,
verbosity: int = 1,
execution_policy: bindings.ExecutionPolicy = salvus._core.lib.salvus_core_python_bindings.ExecutionPolicy,
skip_validation: bool = True,
comm: int | None = None,
) -> UnstructuredMesh | DistributedMesh: ...| Type: | str |
| Description: | Simulation for which to get the mesh. |
| Type: | Event | str | None |
| Default value: | None |
| Description: | Optional event to retrieve an event-dependent mesh. If not given, the master mesh is returned. |
| Type: | int |
| Default value: | 1 |
| Description: | Verbosity level. |
| Type: | bindings.ExecutionPolicy |
| Default value: | <salvus._core.lib.salvus_core_python_bindings.ExecutionPolicy object at 0x7c0325e38ab0> |
| Description: | Execution policy governing the maximum allowable parallelism of child routines. |
| Type: | bool |
| Default value: | True |
| Description: | Whether to skip mesh quality control after mesh creation. Will only trigger if the mesh has not been created yet. |
| Type: | int | None |
| Default value: | None |
| Description: | MPI communicator for distributed mesh loading. |
UnstructuredMesh object).minimal and minimal_fast mesh
file modes.def get_mesh_filenames(
self,
simulation_configuration: str,
event: Event | str | None = None,
verbosity: int = 1,
execution_policy: bindings.ExecutionPolicy = salvus._core.lib.salvus_core_python_bindings.ExecutionPolicy,
skip_validation: bool = True,
) -> dict[str, pathlib.Path]: ...| Type: | str |
| Description: | Simulation for which to create the mesh. |
| Type: | Event | str | None |
| Default value: | None |
| Description: | Not active yet but serves as scaffolding for the future possibility to build event dependent meshes. |
| Type: | int |
| Default value: | 1 |
| Description: | Verbosity level. |
| Type: | bindings.ExecutionPolicy |
| Default value: | <salvus._core.lib.salvus_core_python_bindings.ExecutionPolicy object at 0x7c0325e38530> |
| Description: | Execution policy governing the maximum allowable parallelism of child routines. |
| Type: | bool |
| Default value: | True |
| Description: | Whether to skip mesh quality control after mesh creation. Will only trigger if the mesh has not been created yet. |
def get_remote_output_directory(
self, simulation_configuration: str, event: str | Event
) -> dict[str, typing.Any]: ...| Type: | str |
| Description: | The name of the simulation configuration. |
| Type: | str | Event |
| Description: | The used event. |
def get_simulation_output_directories(
self,
simulation_configuration: str | _SimulationConfigurationBase,
events: (
str
| typing.Sequence[str]
| Event
| typing.Sequence[Event]
| EventCollection
),
) -> dict[str, pathlib.Path]: ...| Type: | str | _SimulationConfigurationBase |
| Description: | The name of the simulation configuration. |
| Type: | str | typing.Sequence[str] | Event | typing.Sequence[Event] | EventCollection |
| Description: | One or several events. |
def get_simulation_output_directory(
self,
simulation_configuration: str | _SimulationConfigurationBase,
event: str | Event,
) -> pathlib.Path: ...| Type: | str | _SimulationConfigurationBase |
| Description: | The name of the simulation configuration. |
| Type: | str | Event |
| Description: | The used event. |
def get_simulation_template(
self,
simulation_configuration: str | _SimulationConfigurationBase,
events: (
str
| typing.Sequence[str]
| Event
| typing.Sequence[Event]
| EventCollection
| None
) = None,
extra_output_configuration: dict[str, typing.Any] | None = None,
apply_waveform_simulation_configuration: bool = True,
execution_policy: bindings.ExecutionPolicy = salvus._core.lib.salvus_core_python_bindings.ExecutionPolicy,
) -> simple_config.simulation.Waveform: ...| Type: | str | _SimulationConfigurationBase |
| Description: | Simulation configuration, or name thereof. |
| Type: | str | typing.Sequence[str] | Event | typing.Sequence[Event] | EventCollection | None |
| Default value: | None |
| Description: | Optionally pass a list of event to check for consistency regarding attenuation. |
| Type: | dict[str, typing.Any] | None |
| Default value: | None |
| Description: | Extra settings for the waveform simulations. Can only be used for settings that do not change the resulting waveforms. python extra_output_configuration={ "volume_data": { "sampling_interval_in_time_steps": 50, "fields": ["displacement"], }, "surface_data": { "sampling_interval_in_time_steps": 20, "fields": ["acceleration", "velocity"], "side_sets": ["x0", "x1"], }, "memory_per_rank_in_MB": 2000.0, } |
| Type: | bool |
| Default value: | True |
| Description: | Apply the waveform simulation configuration before returning the template. A ValueError will be raised in case the waveform simulation configuration is event-dependent. |
| Type: | bindings.ExecutionPolicy |
| Default value: | <salvus._core.lib.salvus_core_python_bindings.ExecutionPolicy object at 0x7c0325e384f0> |
| Description: | Execution policy governing the maximum allowable parallelism of child routines. |
def launch(
self,
simulation_configuration: str,
events: (
str
| typing.Sequence[str]
| Event
| typing.Sequence[Event]
| EventCollection
),
site_name: str,
ranks_per_job: salvus._core.types.int_,
wall_time_in_seconds_per_job: salvus._core.types.float_ | None = None,
derived_job_config: WavefieldCompression | None = None,
store_adjoint_checkpoints: bool | None = None,
verbosity: salvus._core.types.int_ = 2,
max_block_in_seconds: salvus._core.types.float_ = 0,
extra_output_configuration: dict[str, typing.Any] | None = None,
delete_conflicting_previous_results: bool = False,
) -> int: ...| Type: | str |
| Description: | Name of the simulation configuration. |
| Type: | str | typing.Sequence[str] | Event | typing.Sequence[Event] | EventCollection |
| Description: | One or more events. |
| Type: | str |
| Description: | Site to use. |
| Type: | salvus._core.types.int_ |
| Description: | Ranks per job. |
| Type: | salvus._core.types.float_ | None |
| Default value: | None |
| Description: | Wall time per job. |
| Type: | WavefieldCompression | None |
| Default value: | None |
| Description: | Options that have an effect on the output of subsequent simulations but must already be known now. Currently allows the specification of some techniques to compress wavefields for the purpose of gradient computations. |
| Type: | bool | None |
| Default value: | None |
| Description: | Deprecated. Please use the derived_job_config parameter. |
| Type: | salvus._core.types.int_ |
| Default value: | 2 |
| Description: | Verbosity. |
| Type: | salvus._core.types.float_ |
| Default value: | 0 |
| Description: | If set, the function will wait for the specified time for the simulations to finish. |
| Type: | dict[str, typing.Any] | None |
| Default value: | None |
| Description: | Extra settings for the waveform simulations. Can only be used for settings that do not change the resulting waveforms. python extra_output_configuration={ "volume_data": { "sampling_interval_in_time_steps": 50, "fields": ["displacement"], }, "surface_data": { "sampling_interval_in_time_steps": 20, "fields": ["acceleration", "velocity"], "side_sets": ["x0", "x1"], }, "memory_per_rank_in_MB": 2000.0, } |
| Type: | bool |
| Default value: | False |
| Description: | If data for an event but a different extra_output_configuration already exists, an error will be raised. If this option is set to True, it will delete pre-existing conflicting output. Use with caution, as this can delete expensive-to-compute outputs. |
def launch_adjoint(
self,
simulation_configuration: str,
misfit_configuration: str,
wavefield_compression: WavefieldCompression,
gradient_parameters: set[str] | None,
events: (
str
| typing.Sequence[str]
| Event
| typing.Sequence[Event]
| EventCollection
),
site_name: str,
ranks_per_job: int,
wall_time_in_seconds_per_job: salvus._core.types.float_ | None = None,
verbosity: bool = True,
max_block_in_seconds: int = 0,
) -> int: ...| Type: | str |
| Description: | Name of the simulation configuration for the forward run. |
| Type: | str |
| Description: | Name of the misfit configuration. |
| Type: | WavefieldCompression |
| Description: | The gradient compression settings. |
| Type: | set[str] | None |
| Description: | Model parameters to compute the gradients for. Must be a subset of the model parameters. If not given, gradients will be computed for all model fields. |
| Type: | str | typing.Sequence[str] | Event | typing.Sequence[Event] | EventCollection |
| Description: | One or more events. |
| Type: | str |
| Description: | Site to use. |
| Type: | int |
| Description: | Ranks per job. |
| Type: | salvus._core.types.float_ | None |
| Default value: | None |
| Description: | Wall time per job. |
| Type: | bool |
| Default value: | True |
| Description: | Verbosity. |
| Type: | int |
| Default value: | 0 |
| Description: | If set, the function will wait for the specified time for the simulations to finish. |
def list(self) -> list[str]: ...def list_events(
self, simulation_configuration: str, verbosity: int = 1
) -> dict[str, typing.Any]: ...| Type: | str |
| Description: | Name of the simulation configuration. |
| Type: | int |
| Default value: | 1 |
| Description: | Verbosity level. |
def query(
self,
simulation_configuration: str | None = None,
events: (
str
| typing.Sequence[str]
| Event
| typing.Sequence[Event]
| EventCollection
| None
) = None,
misfit_configuration: str | MisfitConfiguration | None = None,
wavefield_compression: WavefieldCompression | None = None,
gradient_parameters: set[str] | None = None,
get_all_outputs: bool | None = None,
block: bool = False,
ping_interval_in_seconds: salvus._core.types.float_ | None = None,
raise_on_failed_jobs: bool = True,
verbosity: int = 1,
) -> bool: ...| Type: | str | None |
| Default value: | None |
| Description: | Name of the simulation configuration. |
| Type: | str | typing.Sequence[str] | Event | typing.Sequence[Event] | EventCollection | None |
| Default value: | None |
| Description: | One or more events. |
| Type: | str | MisfitConfiguration | None |
| Default value: | None |
| Description: | Optional misfit configuration to query adjoint simulations |
| Type: | WavefieldCompression | None |
| Default value: | None |
| Description: | Must be given for querying adjoint simulations. |
| Type: | set[str] | None |
| Default value: | None |
| Description: | Model parameters to compute the gradients for. Must be a subset of the model parameters. If not given, gradients will be computed for all model fields. |
| Type: | bool | None |
| Default value: | None |
| Description: | Optional flag to skip the download of large output files. If not set, checkpoints will remain on the remote site, while all other outputs are downloaded. If False, the data can manually be downloaded using EventData.download_extra_outputs(). |
| Type: | bool |
| Default value: | False |
| Description: | If True, wait for all simulations to finish. |
| Type: | salvus._core.types.float_ | None |
| Default value: | None |
| Description: | Update interval of the status of the jobs if block=True. |
| Type: | bool |
| Default value: | True |
| Description: | If True, querying failed or cancelled jobs will raise an error. When set to false, errors for the failed jobs will be retrieved and printed in the in the widget, but no error will be thrown. |
| Type: | int |
| Default value: | 1 |
| Description: | Verbosity level. Negative values hide the widget. |
launch() instead.def run(
self,
simulation_configuration: str,
events: (
str
| typing.Sequence[str]
| Event
| typing.Sequence[Event]
| EventCollection
),
site_config: (
SiteConfig
| TaskChainSiteConfig
| dict[str, TaskChainSiteConfig]
| MPIExecutionConfiguration
),
timer: Timer | None = None,
) -> None: ...| Type: | str |
| Description: | Name of the simulation configuration. |
| Type: | str | typing.Sequence[str] | Event | typing.Sequence[Event] | EventCollection |
| Description: | One or more events. |
| Type: | SiteConfig | TaskChainSiteConfig | dict[str, TaskChainSiteConfig] | MPIExecutionConfiguration |
| Description: | The site configuration and job submission settings. |
| Type: | Timer | None |
| Default value: | None |
| Description: | Execution timer. |