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)
TWSChannelsendMessage in interface TWSChannelid - worker idmessage - messagecallback - callback for message completionspublic boolean receiveMessage(int group,
int id,
int edge,
ChannelListener callback,
java.util.Queue<DataBuffer> receiveBuffers)
TWSChannelreceiveMessage in interface TWSChannelid - worker idedge - the graph edge to receive fromcallback - callback for message completionsreceiveBuffers - the list of receive bufferspublic void progress()
TWSChannelprogress in interface TWSChannelpublic void progressSends()
TWSChannelprogressSends in interface TWSChannelpublic void progressReceives(int group)
TWSChannelprogressReceives in interface TWSChannelpublic boolean isComplete()
TWSChannelisComplete in interface TWSChannelpublic java.nio.ByteBuffer createBuffer(int capacity)
TWSChannelcreateBuffer in interface TWSChannelcapacity - capacitypublic void close()
TWSChannelclose in interface TWSChannelpublic void releaseBuffers(int wId,
int e)
TWSChannelreleaseBuffers in interface TWSChannelwId - workere - edgepublic void reInit(java.util.List<JobMasterAPI.WorkerInfo> restartedWorkers)
TWSChannelreInit in interface TWSChannel