public class UcpWorker extends UcxNativeStruct implements Closeable
UcpContext "UCX application context".
All communication functions require a context to perform the operation on
the dedicated hardware resource(s) and an "endpoint" to address the
destination.
Worker are parallel "threading points" that an upper layer may use to optimize concurrent communications.
| Constructor and Description |
|---|
UcpWorker(UcpContext context,
UcpWorkerParams params) |
| Modifier and Type | Method and Description |
|---|---|
void |
amDataRelease(long address)
This routine releases data that persisted through an Active Message
callback because that callback returned UCS_INPROGRESS.
|
void |
cancelRequest(UcpRequest request)
This routine tries to cancels an outstanding communication request.
|
void |
close() |
UcpRequest |
flushNonBlocking(UcxCallback callback)
This routine flushes all outstanding AMO and RMA communications on the
this worker.
|
ByteBuffer |
getAddress()
This routine returns the address of the worker object.
|
long |
getMaxAmHeaderSize()
Maximal allowed header size for
UcpEndpoint.sendAmNonBlocking(int, long, long, long, long, long, org.openucx.jucx.UcxCallback, int) routine. |
UcpEndpoint |
newEndpoint(UcpEndpointParams params)
Creates new UcpEndpoint on current worker.
|
UcpListener |
newListener(UcpListenerParams params)
Creates new UcpListener on current worker.
|
int |
progress()
This routine explicitly progresses all communication operations on a worker.
|
void |
progressRequest(UcpRequest request)
Blocking progress for request until it's not completed.
|
UcpRequest |
recvAmDataNonBlocking(long dataDesc,
long address,
long size,
UcxCallback callback,
int memoryType)
This routine receives a message that is described by the data descriptor
dataDesc, local address address and size size on a worker. |
UcpRequest |
recvTaggedMessageNonBlocking(ByteBuffer buffer,
UcpTagMessage message,
UcxCallback callback) |
UcpRequest |
recvTaggedMessageNonBlocking(long address,
long size,
UcpTagMessage message,
UcxCallback callback) |
UcpRequest |
recvTaggedMessageNonBlocking(long address,
long size,
UcpTagMessage message,
UcxCallback callback,
int memoryType)
Non-blocking receive operation for a probed message.
|
UcpRequest |
recvTaggedNonBlocking(ByteBuffer recvBuffer,
long tag,
long tagMask,
UcxCallback callback)
Non-blocking tagged-receive operation.
|
UcpRequest |
recvTaggedNonBlocking(ByteBuffer recvBuffer,
UcxCallback callback)
Non-blocking receive operation.
|
UcpRequest |
recvTaggedNonBlocking(long[] localAddresses,
long[] sizes,
long tag,
long tagMask,
UcxCallback callback) |
UcpRequest |
recvTaggedNonBlocking(long[] localAddresses,
long[] sizes,
long tag,
long tagMask,
UcxCallback callback,
int memoryType) |
UcpRequest |
recvTaggedNonBlocking(long localAddress,
long size,
long tag,
long tagMask,
UcxCallback callback) |
UcpRequest |
recvTaggedNonBlocking(long localAddress,
long size,
long tag,
long tagMask,
UcxCallback callback,
int memoryType) |
void |
removeAmRecvHandler(int amId)
Clears Active Message callback.
|
void |
setAmRecvHandler(int amId,
UcpAmRecvCallback callback) |
void |
setAmRecvHandler(int amId,
UcpAmRecvCallback callback,
long flags)
This routine installs a user defined callback to handle incoming Active
Messages with a specific id.
|
void |
signal()
This routine signals that the event has happened, as part of the wake-up
mechanism.
|
UcpTagMessage |
tagProbeNonBlocking(long tag,
long tagMask,
boolean remove)
Non-blocking probe and return a message.
|
void |
waitForEvents()
This routine waits (blocking) until an event has happened, as part of the
wake-up mechanism.
|
equals, getNativeId, hashCode, setNativeIdpublic UcpWorker(UcpContext context, UcpWorkerParams params)
public UcpEndpoint newEndpoint(UcpEndpointParams params)
public UcpListener newListener(UcpListenerParams params)
public void close()
close in interface Closeableclose in interface AutoCloseablepublic long getMaxAmHeaderSize()
UcpEndpoint.sendAmNonBlocking(int, long, long, long, long, long, org.openucx.jucx.UcxCallback, int) routine.public void setAmRecvHandler(int amId,
UcpAmRecvCallback callback,
long flags)
callback - - Active Message callback. To clear the already set callback,
this value should be set to null.public void setAmRecvHandler(int amId,
UcpAmRecvCallback callback)
public void removeAmRecvHandler(int amId)
public void amDataRelease(long address)
public UcpRequest recvAmDataNonBlocking(long dataDesc, long address, long size, UcxCallback callback, int memoryType)
dataDesc, local address address and size size on a worker.
The routine is non-blocking and therefore returns immediately.
The receive operation is considered completed when the message is delivered to the buffer.public int progress()
throws Exception
Exceptionpublic void progressRequest(UcpRequest request) throws Exception
Exceptionpublic UcpRequest flushNonBlocking(UcxCallback callback)
public void waitForEvents()
progress() repeatedly until it returns 0.public void signal()
waitForEvents()
to return, even if no event from the underlying interfaces has taken place.
It’s safe to use this routine from any thread, even if UCX is compiled
without multi-threading support and/or initialized without
UcpWorkerParams.requestThreadSafety(). However UcpContext has to be
created with UcpParams.requestWakeupFeature().public UcpRequest recvTaggedNonBlocking(ByteBuffer recvBuffer, long tag, long tagMask, UcxCallback callback)
recvBuffer
buffer on the current worker. The tag value of the receive message has to match
the tag of sent message. The routine is a non-blocking and therefore returns
immediately. The receive operation is considered completed when the message is delivered
to the recvBuffer at position recvBuffer.position() and size
recvBuffer.remaining().
In order to notify the application about completion of the receive
operation the UCP library will invoke the call-back callback when the received
message is in the receive buffer and ready for application access.tagMask - - bit mask that indicates the bits that are used for the matching of the
incoming tag against the expected tag.public UcpRequest recvTaggedNonBlocking(long localAddress, long size, long tag, long tagMask, UcxCallback callback)
public UcpRequest recvTaggedNonBlocking(long localAddress, long size, long tag, long tagMask, UcxCallback callback, int memoryType)
public UcpRequest recvTaggedNonBlocking(ByteBuffer recvBuffer, UcxCallback callback)
recvTaggedNonBlocking(ByteBuffer, long, long, UcxCallback)
with default tag=0 and tagMask=0.public UcpRequest recvTaggedNonBlocking(long[] localAddresses, long[] sizes, long tag, long tagMask, UcxCallback callback)
public UcpRequest recvTaggedNonBlocking(long[] localAddresses, long[] sizes, long tag, long tagMask, UcxCallback callback, int memoryType)
public UcpTagMessage tagProbeNonBlocking(long tag, long tagMask, boolean remove)
tag and
tagMask was received (fully or partially) on the worker. The tag
value of the received message has to match the tag and tagMask
values, where the tagMask indicates what bits of the tag have to be
matched. The function returns immediately and if the message is matched it
returns a handle for the message.
This function does not advance the communication state of the network.
If this routine is used in busy-poll mode, need to make sure
progress() is called periodically to extract messages from the transport.remove - - The flag indicates if the matched message has to be removed from UCP library.
If true, the message handle is removed from the UCP library
and the application is responsible to call
recvTaggedMessageNonBlocking(long, long, UcpTagMessage,
UcxCallback) in order to receive the data and release the resources
associated with the message handle.
If false, the return value is merely an indication to whether a matching
message is present, and it cannot be used in any other way,
and in particular it cannot be passed to
recvTaggedMessageNonBlocking(long, long, UcpTagMessage,
UcxCallback)public UcpRequest recvTaggedMessageNonBlocking(long address, long size, UcpTagMessage message, UcxCallback callback, int memoryType)
address,
size, and a message handle. The message handle can be obtain
by calling the tagProbeNonBlocking(long, long, boolean). This routine
is a non-blocking and therefore returns immediately. The receive operation is considered
completed when the message is delivered to the buffer, described by address
and size.
In order to notify the application about completion of the receive operation
the UCP library will invoke the call-back callback when the received message
is in the receive buffer and ready for application access.
If the receive operation cannot be stated the routine returns an error.public UcpRequest recvTaggedMessageNonBlocking(long address, long size, UcpTagMessage message, UcxCallback callback)
public UcpRequest recvTaggedMessageNonBlocking(ByteBuffer buffer, UcpTagMessage message, UcxCallback callback)
public void cancelRequest(UcpRequest request)
public ByteBuffer getAddress()
UcpWorker instance.Copyright © 2021. All rights reserved.