Class Request
- All Implemented Interfaces:
Freeable
- Direct Known Subclasses:
Prequest
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final void
addRecvBufRef
(Buffer buf) Adds a receive buffer to this Request object.protected final void
addSendBufRef
(Buffer buf) Adds a send buffer to this Request object.final void
cancel()
Mark a pending nonblocking communication for cancellation.void
free()
Set the request object to be void.protected static long[]
getHandles
(Request[] r) protected static long
getNull()
final Status
Returns a status object if the operation identified by the request is complete, or a null reference otherwise.final boolean
isNull()
Test if request object is null.protected static void
setHandles
(Request[] r, long[] h) final boolean
test()
Returns true if the operation identified by the request is complete, or false otherwise.static boolean
Tests for completion of all of the operations associated with active requests.static Status[]
testAllStatus
(Request[] requests) Tests for completion of all of the operations associated with active requests.static int
Tests for completion of either one or none of the operations associated with active requests.static Status
testAnyStatus
(Request[] requests) Tests for completion of either one or none of the operations associated with active requests.static int[]
Behaves likewaitSome
, except that it returns immediately.static Status[]
testSomeStatus
(Request[] requests) Behaves likewaitSome
, except that it returns immediately.final Status
Returns a status object if the operation identified by the request is complete, or a null reference otherwise.static void
Blocks until all of the operations associated with the active requests in the array have completed.static Status[]
waitAllStatus
(Request[] requests) Blocks until all of the operations associated with the active requests in the array have completed.static int
Blocks until one of the operations associated with the active requests in the array has completed.static Status
waitAnyStatus
(Request[] requests) Blocks until one of the operations associated with the active requests in the array has completed.final void
waitFor()
Blocks until the operation identified by the request is complete.static int[]
Blocks until at least one of the operations associated with the active active requests in the array has completed.static Status[]
waitSomeStatus
(Request[] requests) Blocks until at least one of the operations associated with the active requests in the array has completed.final Status
Blocks until the operation identified by the request is complete.
-
Field Details
-
handle
protected long handle -
sendBuf
-
recvBuf
-
-
Constructor Details
-
Request
protected Request(long handle)
-
-
Method Details
-
getNull
protected static long getNull() -
free
Set the request object to be void. Java binding of the MPI operationMPI_REQUEST_FREE
.- Specified by:
free
in interfaceFreeable
- Throws:
MPIException
- Signals that an MPI exception of some sort has occurred.
-
cancel
Mark a pending nonblocking communication for cancellation. Java binding of the MPI operationMPI_CANCEL
.- Throws:
MPIException
- Signals that an MPI exception of some sort has occurred.
-
addRecvBufRef
Adds a receive buffer to this Request object. This method should be called by the internal api whenever a persistent request is created and any time a request object, that has an associated buffer, is returned from an opperation to protect the buffer from getting prematurely garbage collected.- Parameters:
buf
- buffer to add to the array list
-
addSendBufRef
Adds a send buffer to this Request object. This method should be called by the internal api whenever a persistent request is created and any time a request object, that has an associated buffer, is returned from an opperation to protect the buffer from getting prematurely garbage collected.- Parameters:
buf
- buffer to add to the array list
-
isNull
public final boolean isNull()Test if request object is null.- Returns:
- true if the request object is null, false otherwise
-
waitStatus
Blocks until the operation identified by the request is complete.Java binding of the MPI operation
MPI_WAIT
.After the call returns, the request object becomes inactive.
- Returns:
- status object
- Throws:
MPIException
- Signals that an MPI exception of some sort has occurred.
-
waitFor
Blocks until the operation identified by the request is complete.Java binding of the MPI operation
MPI_WAIT
.After the call returns, the request object becomes inactive.
- Throws:
MPIException
- Signals that an MPI exception of some sort has occurred.
-
testStatus
Returns a status object if the operation identified by the request is complete, or a null reference otherwise.Java binding of the MPI operation
MPI_TEST
.After the call, if the operation is complete (ie, if the return value is non-null), the request object becomes inactive.
- Returns:
- status object
- Throws:
MPIException
- Signals that an MPI exception of some sort has occurred.
-
getStatus
Returns a status object if the operation identified by the request is complete, or a null reference otherwise.Java binding of the MPI operation
MPI_REQUEST_GET_STATUS
.After the call, if the operation is complete (ie, if the return value is non-null), the request object remains active.
- Returns:
- status object
- Throws:
MPIException
- Signals that an MPI exception of some sort has occurred.
-
test
Returns true if the operation identified by the request is complete, or false otherwise.Java binding of the MPI operation
MPI_TEST
.After the call, if the operation is complete (ie, if the return value is true), the request object becomes inactive.
- Returns:
- true if the operation identified by the request, false otherwise
- Throws:
MPIException
- Signals that an MPI exception of some sort has occurred.
-
waitAnyStatus
Blocks until one of the operations associated with the active requests in the array has completed.Java binding of the MPI operation
MPI_WAITANY
.The index in array of
requests
for the request that completed can be obtained from the returned status object through theStatus.getIndex()
method. The corresponding element of array ofrequests
becomes inactive.- Parameters:
requests
- array of requests- Returns:
- status object
- Throws:
MPIException
- Signals that an MPI exception of some sort has occurred.
-
waitAny
Blocks until one of the operations associated with the active requests in the array has completed.Java binding of the MPI operation
MPI_WAITANY
.The request that completed becomes inactive.
- Parameters:
requests
- array of requests- Returns:
- The index in array of
requests
for the request that completed. If all of the requests are MPI_REQUEST_NULL, then index is returned asMPI.UNDEFINED
. - Throws:
MPIException
- Signals that an MPI exception of some sort has occurred.
-
testAnyStatus
Tests for completion of either one or none of the operations associated with active requests.Java binding of the MPI operation
MPI_TESTANY
.If some request completed, the index in array of
requests
for that request can be obtained from the returned status object. The corresponding element in array ofrequests
becomes inactive. If no request completed, {testAny} returnsnull
.- Parameters:
requests
- array of requests- Returns:
- status object if one request completed,
null
otherwise. - Throws:
MPIException
- Signals that an MPI exception of some sort has occurred.
-
testAny
Tests for completion of either one or none of the operations associated with active requests.Java binding of the MPI operation
MPI_TESTANY
.If some request completed, ii becomes inactive.
- Parameters:
requests
- array of requests- Returns:
- index of operation that completed, or
MPI.UNDEFINED
if none completed. - Throws:
MPIException
- Signals that an MPI exception of some sort has occurred.
-
waitAllStatus
Blocks until all of the operations associated with the active requests in the array have completed.Java binding of the MPI operation
MPI_WAITALL
.On exit, requests become inactive. If the input value of array of
requests
contains inactive requests, corresponding elements of the status array will contain null status references.- Parameters:
requests
- array of requests- Returns:
- array of statuses
- Throws:
MPIException
- Signals that an MPI exception of some sort has occurred.
-
waitAll
Blocks until all of the operations associated with the active requests in the array have completed.Java binding of the MPI operation
MPI_WAITALL
.- Parameters:
requests
- array of requests- Throws:
MPIException
- Signals that an MPI exception of some sort has occurred.
-
testAllStatus
Tests for completion of all of the operations associated with active requests.Java binding of the MPI operation
MPI_TESTALL
.If all operations have completed, the exit value of the argument array is as for
waitAllStatus
.- Parameters:
requests
- array of requests- Returns:
- array of statuses if all operations have completed,
null
otherwise. - Throws:
MPIException
- Signals that an MPI exception of some sort has occurred.
-
testAll
Tests for completion of all of the operations associated with active requests.Java binding of the MPI operation
MPI_TESTALL
.- Parameters:
requests
- array of requests- Returns:
true
if all operations have completed,false
otherwise.- Throws:
MPIException
- Signals that an MPI exception of some sort has occurred.
-
waitSomeStatus
Blocks until at least one of the operations associated with the active requests in the array has completed.Java binding of the MPI operation
MPI_WAITSOME
.The size of the result array will be the number of operations that completed. The index in array of
requests
for each request that completed can be obtained from the returned status objects through theStatus.getIndex()
method. The corresponding element in array ofrequests
becomes inactive.- Parameters:
requests
- array of requests- Returns:
- array of statuses or
null
if the number of operations completed isMPI_UNDEFINED
. - Throws:
MPIException
- Signals that an MPI exception of some sort has occurred.
-
waitSome
Blocks until at least one of the operations associated with the active active requests in the array has completed.Java binding of the MPI operation
MPI_WAITSOME
.The size of the result array will be the number of operations that completed. The corresponding element in array of
requests
becomes inactive.- Parameters:
requests
- array of requests- Returns:
- array of indexes of
requests
that completed ornull
if the number of operations completed isMPI_UNDEFINED
. - Throws:
MPIException
- Signals that an MPI exception of some sort has occurred.
-
testSomeStatus
Behaves likewaitSome
, except that it returns immediately.Java binding of the MPI operation
MPI_TESTSOME
.If no operation has completed,
testSome
returns an array of length zero, otherwise the return value are as forwaitSome
.- Parameters:
requests
- array of requests- Returns:
- array of statuses
- Throws:
MPIException
- Signals that an MPI exception of some sort has occurred.
-
testSome
Behaves likewaitSome
, except that it returns immediately.Java binding of the MPI operation
MPI_TESTSOME
.If no operation has completed,
testSome
returns an array of length zero, otherwise the return value are as forwaitSome
.- Parameters:
requests
- array of requests- Returns:
- array of indexes of
requests
that completed. - Throws:
MPIException
- Signals that an MPI exception of some sort has occurred.
-
getHandles
-
setHandles
-