Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions ompi/mpi/java/c/mpi_MPI.c
Original file line number Diff line number Diff line change
Expand Up @@ -1128,23 +1128,22 @@ void ompi_java_releasePtrArray(JNIEnv *env, jlongArray array,

jboolean ompi_java_exceptionCheck(JNIEnv *env, int rc)
{
jboolean jni_exception;

if (rc < 0) {
/* handle ompi error code */
rc = ompi_errcode_get_mpi_code (rc);
/* ompi_mpi_errcode_get_class CAN NOT handle negative error codes.
* all Open MPI MPI error codes should be > 0. */
assert (rc >= 0);
}
jni_exception = (*env)->ExceptionCheck(env);

if(MPI_SUCCESS == rc)
if(MPI_SUCCESS == rc && JNI_FALSE == jni_exception)
{
return JNI_FALSE;
}
else if((*env)->ExceptionCheck(env))
{
return JNI_TRUE;
}
else
else if(MPI_SUCCESS != rc)
{
int errClass = ompi_mpi_errcode_get_class(rc);
char *message = ompi_mpi_errnum_get_string(rc);
Expand All @@ -1158,6 +1157,8 @@ jboolean ompi_java_exceptionCheck(JNIEnv *env, int rc)
(*env)->DeleteLocalRef(env, jmessage);
return JNI_TRUE;
}
/* If we get here, a JNI error has occurred. */
return JNI_TRUE;
}

void* ompi_java_attrSet(JNIEnv *env, jbyteArray jval)
Expand Down