File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -171,6 +171,18 @@ JNIEXPORT jobject JNICALL Java_mpi_Request_testStatus(
171171 return flag ? ompi_java_status_new (env , & status ) : NULL ;
172172}
173173
174+ JNIEXPORT jobject JNICALL Java_mpi_Request_getStatus (
175+ JNIEnv * env , jobject jthis , jlong handle )
176+ {
177+ MPI_Request req = (MPI_Request )handle ;
178+ int flag ;
179+ MPI_Status status ;
180+ int rc = MPI_Request_get_status (req , & flag , & status );
181+ ompi_java_exceptionCheck (env , rc );
182+ (* env )-> SetLongField (env , jthis , ompi_java .ReqHandle , (jlong )req );
183+ return flag ? ompi_java_status_new (env , & status ) : NULL ;
184+ }
185+
174186JNIEXPORT jboolean JNICALL Java_mpi_Request_test (
175187 JNIEnv * env , jobject jthis , jlong handle )
176188{
Original file line number Diff line number Diff line change @@ -169,6 +169,23 @@ public final Status testStatus() throws MPIException
169169
170170 private native Status testStatus (long request ) throws MPIException ;
171171
172+ /**
173+ * Returns a status object if the operation identified by the request
174+ * is complete, or a null reference otherwise.
175+ * <p>Java binding of the MPI operation {@code MPI_REQUEST_GET_STATUS}.
176+ * <p>After the call, if the operation is complete (ie, if the return
177+ * value is non-null), the request object remains active.
178+ * @return status object
179+ * @throws MPIException Signals that an MPI exception of some sort has occurred.
180+ */
181+ public final Status getStatus () throws MPIException
182+ {
183+ MPI .check ();
184+ return getStatus (handle );
185+ }
186+
187+ private native Status getStatus (long request ) throws MPIException ;
188+
172189 /**
173190 * Returns true if the operation identified by the request
174191 * is complete, or false otherwise.
You can’t perform that action at this time.
0 commit comments