Mondaic

salvus.flow.simple_config.memory

salvus.flow.simple_config.memory salvus flow simple_config memory

Estimate memory usage for simulations.

Functions

estimate_memory_usage_cpu()

def estimate_memory_usage_cpu(
    w: simple_config.simulation.Waveform,
    precision: typing.Literal["single", "double"],
    mesh: UnstructuredMesh | None = None,
    adjoint: bool = False,
) -> int: ...

Estimate the amount of memory required for a Salvus simulation.

Attempts to account for the various static and dynamic quantities stored during a simulation, including material properties, Jacobians, dynamic fields, and miscellaneous fields such as those required for absorbing sponge layers. This function does not account for memory used by input or output containers, and as such a buffer should be added to the returned value to account for these.

Parameters
  • w simple_config.simulation.Waveform — The waveform configuration.
  • precision typing.Literal['single', 'double'] — The precision of the simulation.
  • mesh UnstructuredMesh | None — The mesh object. If not given, the waveform configuration is expected to have an attached mesh object.
  • adjoint bool — Whether the simulation is adjoint.
Returns int — The estimated memory usage in bytes.

estimate_memory_usage_gpu()

def estimate_memory_usage_gpu(
    w: simple_config.simulation.Waveform,
    precision: typing.Literal["single", "double"],
    mesh: UnstructuredMesh | None = None,
    adjoint: bool = False,
) -> int: ...

Estimate the memory that a simulation will occupy on the GPU.

Parameters
  • w simple_config.simulation.Waveform — The waveform configuration.
  • precision typing.Literal['single', 'double'] — The precision of the simulation.
  • mesh UnstructuredMesh | None — The mesh object. If not given, the waveform configuration is expected to have an attached mesh object.
  • adjoint bool — Whether the simulation is adjoint.
Returns int — The estimated memory usage in bytes.