pymoose.runtime module
pymoose.runtime module#
- class pymoose.runtime.GrpcMooseRuntime(identities: Dict)[source]#
Bases:
GrpcRuntime
Moose runtime backed by gRPC choreography.
Creates a Moose runtime backed by a fixed set of gRPC servers.
Example
runtime = GrpcMooseRuntime( identities={ "alice": "172.16.254.1:50001", "bob": "172.16.254.2:50002", "carole": "172.16.254.3:50003", }, )
- Parameters
identities – Mapping of identities (e.g. host placement identifiers) to gRPC host addresses.
- class pymoose.runtime.LocalMooseRuntime(identities: List[str], storage_mapping: Optional[Dict[str, Dict]] = None)[source]#
Bases:
LocalRuntime
Locally-simulated Moose runtime.
Creates a local runtime with several virtual hosts and optional storage for each.
Example
runtime = LocalMooseRuntime( ["alice", "bob", "carole"], storage_mapping={ "alice": { "alice_array": np.ones((3, 3)), "alice_string": "hello i'm alice", "alice_number": 42, }, }, )
- Parameters
identities – A list of names of identities for virtual hosts.
storage_mapping – A dictionary mapping Identities to storage dictionaries. Storage dictionaries are dicts/named tuples of Python objects that correspond to valid PyMoose Values (e.g. native Python numbers, ndarrays, strings, etc.).