mstar.communication.communicator#
Module Attributes
The |
|
the one every deployment has exactly one of. |
Functions
|
Construct the process's communicator: |
Classes
|
|
|
A communicator whose sends never block: a send the peer can't take now (at its high-water mark) is queued, in order behind any earlier one to the same peer, and retried by |
- class mstar.communication.communicator.BaseCommunicator[source]#
Bases:
ABC- abstractmethod poll_for_messages(timeout_ms=20)[source]#
Block until a message is readable, the registered event fires, or
timeout_mselapses, whichever comes first. True when a message is waiting forget_all_new_messages; a fired event is drained.
- abstractmethod register_event_for_poll(event)[source]#
Have
poll_for_messages(andwait_for_work) also end wheneventis signalled.- Parameters:
event (EventWakeup)
- Return type:
None
- abstractmethod send(entity_id, msg)[source]#
entity_id: worker_xyz, conductor, or api_server
- Parameters:
entity_id (str)
- class mstar.communication.communicator.CommProtocol(*values)[source]#
Bases:
Enum- IPC = 'IPC'#
- RDMA = 'RDMA'#
- SHM = 'SHM'#
- TCP = 'TCP'#
- mstar.communication.communicator.DEPLOYMENT_ANCHOR_ENTITY = 'conductor'#
the one every deployment has exactly one of. Two deployments that agree on this endpoint ARE the same deployment as far as anything keyed off it is concerned – notably the tensor-file namespace in
mstar.communication.tensors.- Type:
The entity whose endpoint stands for the whole deployment
- mstar.communication.communicator.EXPECTED_MSTAR_RUST_VERSION = '0.1.1'#
The
mstar_rustextension version this tree expects (the vendoredrust/crate’s version). Every process sends on the extension’s transport, so a mismatching install - e.g. a stale wheel after an upgrade - is refused at startup rather than left to carry the mesh.
- class mstar.communication.communicator.OutboxCommunicator(inner)[source]#
Bases:
objectA communicator whose sends never block: a send the peer can’t take now (at its high-water mark) is queued, in order behind any earlier one to the same peer, and retried by
flush.For a loop that peers block on while it sends to them (the API server’s preprocess thread, against the conductor and the workers): if it blocked on a full peer it would stop reading the input that peer waits to deliver, and the two would wait on each other for good. Everything else is the wrapped communicator’s.
- Parameters:
inner (BaseCommunicator)
- mstar.communication.communicator.make_communicator(*args, nonblocking_send=False, **kwargs)[source]#
Construct the process’s communicator:
RustZMQCommunicator, on the vendoredrust/extension (seecommunication/rust_communicator.py).Raises when the extension is missing or is not the version this tree expects.
nonblocking_sendis for a communicatorOutboxCommunicatorwraps, which needstry_send_bytes: an extension built beforeZmqCommunicator.try_sendis refused for it.- Parameters:
nonblocking_send (bool)
- Return type: