public class TWSUCXChannel extends java.lang.Object implements TWSChannel
TWSUCXChannel
leverages tags based communication of UCX
to virtually create multiple communication channels between the workers based on the edge.
The tag for each message is calculated as follows.
tag = sendingWorkerId * tagWIdOffset + edge
Constructor and Description |
---|
TWSUCXChannel(Config config,
IWorkerController workerController) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the channel
|
java.nio.ByteBuffer |
createBuffer(int capacity)
Create a buffer
|
boolean |
isComplete()
Check weather we have any pending sends
|
void |
progress()
Progress both sends and receives
|
void |
progressReceives(int group)
Progress only receives belonging to a group
|
void |
progressSends()
Progress only the sends
|
boolean |
receiveMessage(int group,
int id,
int edge,
ChannelListener callback,
java.util.Queue<DataBuffer> receiveBuffers)
Receive a message
|
void |
reInit(java.util.List<JobMasterAPI.WorkerInfo> restartedWorkers)
re-initialize the channel with restarted workers
|
void |
releaseBuffers(int wId,
int e)
Release the buffers for worker and edge
|
boolean |
sendMessage(int id,
ChannelMessage message,
ChannelListener callback)
Send a message
|
public TWSUCXChannel(Config config, IWorkerController workerController)
public boolean sendMessage(int id, ChannelMessage message, ChannelListener callback)
TWSChannel
sendMessage
in interface TWSChannel
id
- worker idmessage
- messagecallback
- callback for message completionspublic boolean receiveMessage(int group, int id, int edge, ChannelListener callback, java.util.Queue<DataBuffer> receiveBuffers)
TWSChannel
receiveMessage
in interface TWSChannel
id
- worker idedge
- the graph edge to receive fromcallback
- callback for message completionsreceiveBuffers
- the list of receive bufferspublic void progress()
TWSChannel
progress
in interface TWSChannel
public void progressSends()
TWSChannel
progressSends
in interface TWSChannel
public void progressReceives(int group)
TWSChannel
progressReceives
in interface TWSChannel
public boolean isComplete()
TWSChannel
isComplete
in interface TWSChannel
public java.nio.ByteBuffer createBuffer(int capacity)
TWSChannel
createBuffer
in interface TWSChannel
capacity
- capacitypublic void close()
TWSChannel
close
in interface TWSChannel
public void releaseBuffers(int wId, int e)
TWSChannel
releaseBuffers
in interface TWSChannel
wId
- workere
- edgepublic void reInit(java.util.List<JobMasterAPI.WorkerInfo> restartedWorkers)
TWSChannel
reInit
in interface TWSChannel