salvus.mesh.algorithms.unstructured_mesh.parallel_utils
Store and retrieve UnstructuredMesh objects to and from shared memory objects.
Functions
list_shared_memory_blocks()
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.
shared_memory_block_exists()
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.
namestr — The name of the shared memory block.
Classes
SharedMemoryUnstructuredMeshStore
SharedMemoryUnstructuredMeshStoreclass 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.
identifierstr — 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_dictbuiltins.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_ownerbool — Identify the owning process. If this is True, the shared memory will be freed in the object’s destructor.
from_identifier()
from_identifier()def from_identifier(identifier: str, readonly: bool = True) -> Self: ...Get a shared memory unstructured mesh object from an identifier.
identifierstr — The identifier.readonlybool — Return a readonly version.
from_unstructured_mesh()
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.
identifierstr — Globally unique identifier of the mesh.msalvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh — The unstructured mesh.
close()
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.
to_unstructured_mesh()
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.