@@ -109,6 +109,21 @@ JNIEXPORT jint JNICALL Java_mpi_Status_getElements(
109109 return count ;
110110}
111111
112+ JNIEXPORT jobject JNICALL Java_mpi_Status_getElementsX (
113+ JNIEnv * env , jobject jthis , jint source , jint tag ,
114+ jint error , jint cancelled , jlong ucount , jlong jType )
115+ {
116+ MPI_Count count ;
117+ MPI_Status stat ;
118+ getStatus (& stat , source , tag , error , cancelled , ucount );
119+ MPI_Datatype datatype = (MPI_Datatype )jType ;
120+ int rc = MPI_Get_elements_x (& stat , datatype , & count );
121+ ompi_java_exceptionCheck (env , rc );
122+
123+ return (* env )-> NewObject (env , ompi_java .CountClass ,
124+ ompi_java .CountInit , (jlong )count );
125+ }
126+
112127JNIEXPORT jint JNICALL Java_mpi_Status_setElements (
113128 JNIEnv * env , jobject jthis , jint source , jint tag ,
114129 jint error , jint cancelled , jlong ucount , jlong jType , int count )
@@ -121,6 +136,19 @@ JNIEXPORT jint JNICALL Java_mpi_Status_setElements(
121136 return stat ._ucount ;
122137}
123138
139+ JNIEXPORT jlong JNICALL Java_mpi_Status_setElementsX (
140+ JNIEnv * env , jobject jthis , jint source , jint tag ,
141+ jint error , jint cancelled , jlong ucount , jlong jType , jlong jcount )
142+ {
143+ MPI_Status stat ;
144+ MPI_Count count = (long )jcount ;
145+ getStatus (& stat , source , tag , error , cancelled , ucount );
146+ MPI_Datatype datatype = (MPI_Datatype )jType ;
147+ int rc = MPI_Status_set_elements_x (& stat , datatype , count );
148+ ompi_java_exceptionCheck (env , rc );
149+ return (jlong )stat ._ucount ;
150+ }
151+
124152JNIEXPORT void JNICALL Java_mpi_Status_setCancelled (
125153 JNIEnv * env , jobject jthis , jint source , jint tag ,
126154 jint error , jint cancelled , jlong ucount , int flag )
0 commit comments