Mondaic
This API reference is not for the latest stable Salvus version.

salvus.mesh.algorithms.unstructured_mesh.parallel_utils

Store and retrieve UnstructuredMesh objects to and from shared memory objects.

Functions

list_shared_memory_blocks()

def list_shared_memory_blocks() -> builtins.list: ...

List the shared memory blocks available on this machine that are managed by Salvus.

Returns builtins.list

shared_memory_block_exists()

def shared_memory_block_exists(name: str) -> bool: ...

Return True if the given shared memory block exists on the current machine.

Parameters
  • name str — The name of the shared memory block.
Returns bool

Classes

SharedMemoryUnstructuredMeshStore

class SharedMemoryUnstructuredMeshStore(builtins.object):
    def __init__(
        self, identifier: str, array_dict: builtins.dict, is_owner: bool
    ) -> None: ...

A shared memory representation for Salvus unstructured meshes.

It will be kept alive as long as the process that created it is alive and has not garbage collected said object.

Parameters
  • identifier str — A globally unique identifier of the shared memory unstructured mesh object. Only one object of a given name can exist at any point in time.
  • array_dict builtins.dict — An UnstructuredMesh object is made up of several individual array and dictionaries. This object keeps track of all these object and their shared memory representations.
  • is_owner bool — Identify the owning process. If this is True, the shared memory will be freed in the object’s destructor.
Methods
from_identifier()
def from_identifier(identifier: str, readonly: bool = True) -> Self: ...

Get a shared memory unstructured mesh object from an identifier.

Parameters
  • identifier str — The identifier.
  • readonly bool — Return a readonly version.
Returns Self
from_unstructured_mesh()
def from_unstructured_mesh(
    identifier: str,
    m: salvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh,
) -> Self: ...

Create a shared memory unstructured mesh object from an unstructured mesh.

This will create one copy but once done multiple processes can access the same memory.

Parameters
  • identifier str — Globally unique identifier of the mesh.
  • m salvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh — The unstructured mesh.
Returns Self
close()
def close(self) -> None: ...

Close the object and free the underlying shared memory object if the current process is the owner of the memory.

Returns None
to_unstructured_mesh()
def to_unstructured_mesh(
    self,
) -> (
    salvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh
): ...

Get an unstructured mesh object from the shared structure.

Returns salvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh