Communicators¶
Communicator¶
MPICommunicator¶
- class disropt.communicators.MPICommunicator[source]¶
Bases:
disropt.communicators.communicators.Communicator
Communicator class that performs communications through MPI. Requires mpi4py.
- comm¶
communication world
- neighbors_exchange(send_obj, in_neighbors, out_neighbors, dict_neigh=False, stop_event=None)[source]¶
Exchange information (synchronously) with neighbors.
- Parameters
send_obj (
Any
) – object to senddict_neigh (
bool
) – True if send_obj contains a dictionary with different objects for each neighbor. Defaults to Falsestop_event (
Optional
[Event
]) – an Event object that is monitored during the execution. If the event is set, the function returns immediately. Defaults to None (does not wait upon any event)
- Return type
- Returns
data received by in-neighbors
- neighbors_receive(neighbors, stop_event=None)[source]¶
Receive data from neighbors (waits until data are received from all neighbors).
- Parameters
- Return type
- Returns
data received by in-neighbors