XActor Internals¶
MPI Async Communication Manager¶
-
class
xactor.mpi_acomm.
AsyncCommunicator
¶ Manager of async send and receive requests.
-
sender
¶ The send buffer manager
- Type
-
receiver
¶ The receive buffer manager
- Type
-
finish
()¶ Finalize the sender and receivers.
-
recv
()¶ Wait for and return a received message.
- Returns
frm (int) – Rank of the source of the received messsage
msg (object) – The received message.
-
send
(to, msg)¶ Send a messge.
- Parameters
to (int) – Rank of the destination.
msg (object) – The object to be sent.
-
-
class
xactor.mpi_acomm.
AsyncReceiver
¶ Manager for async receive requests.
-
bufs
¶ List of receive buffers
- Type
list of bytearray
-
reqs
¶ List of receive requests
- Type
list of MPI Request
-
stats
¶ List of status objects
- Type
list of MPI Status
-
msgq
¶ Queue of received messages
- Type
collections.deque
-
close
()¶ Cancel any pending receive requests.
-
recv
()¶ Return any received messages.
If returned message queue is empty this method will block until messges are available.
- Returns
frm (int) – Rank of the source of the received messsage
msg (object) – The received message.
-
-
class
xactor.mpi_acomm.
AsyncBufferedSender
¶ Manager for sending messages (Python objects).
-
sender
¶ The underlying raw sender object used to manage async send requests.
- Type
-
buffers
¶ The BytesIO objects used to manage the buffers for each destination rank.
- Type
list of io.BytesIO
-
n_messages
¶ The number of messages contained in each destination buffer.
- Type
list of int
-
close
()¶ Close the underlying sender.
-
do_flush
(to)¶ Flush the buffer for the destination rank.
- Parameters
to (int) – Rank of the destination.
-
flush
(to=None)¶ Flush out buffers for the destination rank.
- Parameters
to (int or None) – Rank of the destination. If to is None then flush out buffers for all destination ranks.
-
send
(to, msg)¶ Send a buffered messge.
- Parameters
to (int) – Rank of the destination.
msg (object) – The object to be sent.
-
-
class
xactor.mpi_acomm.
AsyncRawSender
¶ Manager for async send requests.
-
pending_reqs
¶ List of pending send requests
- Type
list of MPI Request objects
-
pending_bufs
¶ List of buffers corresponding to pending send requests
- Type
list of buffers
-
close
()¶ Wait for all pending send requests to finish.
-
send
(to, buf)¶ Send a messge.
- Parameters
to (int) – Rank of the destination.
buf (bytes-like object) – The buffer containing data to send.
-
MPI Rank Actor¶
-
class
xactor.mpi_rank_actor.
MPIRankActor
¶ MPI Rank Actor.
Container for actors that run on the current rank.
-
create_actor
(actor_id, cls, args, kwargs)¶ Create a local actor.
- Parameters
actor_id (str) – ID of the new actor
cls (type) – Class used to instantiate the new actor
args (list) – Positional arguments for the constructor
kwargs (dict) – Keyword arguments for the constructor
-
delete_actors
(actor_ids)¶ Delete local actors.
- Parameters
actor_ids (list) – IDs of local actors to be deleted
-
flush
(rank=None)¶ Flush out the send buffers.
- Parameters
rank (int or None) – If None, flush out all buffers otherwise, flush out only the buffer to the given rank.
-