Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 8 additions & 0 deletions ompi/mpi/java/c/mpi_Comm.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* and Technology (RIST). All rights reserved.
* Copyright (c) 2016 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2017 FUJITSU LIMITED. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -708,6 +709,13 @@ JNIEXPORT jlong JNICALL Java_mpi_Comm_getErrhandler(
return (jlong)errhandler;
}

JNIEXPORT void JNICALL Java_mpi_Comm_callErrhandler(
JNIEnv *env, jobject jthis, jlong comm, jint errorCode)
{
int rc = MPI_Comm_call_errhandler((MPI_Comm)comm, errorCode);
ompi_java_exceptionCheck(env, rc);
}

static int commCopyAttr(MPI_Comm oldcomm, int keyval, void *extraState,
void *attrValIn, void *attrValOut, int *flag)
{
Expand Down
91 changes: 91 additions & 0 deletions ompi/mpi/java/c/mpi_File.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* All rights reserved.
* Copyright (c) 2016 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2017 FUJITSU LIMITED. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -236,6 +237,20 @@ JNIEXPORT jlong JNICALL Java_mpi_File_iReadAt(
return (jlong)request;
}

JNIEXPORT jlong JNICALL Java_mpi_File_iReadAtAll(
JNIEnv *env, jobject jthis, jlong fh, jlong offset,
jobject buf, jint count, jlong type)
{
void *ptr = (*env)->GetDirectBufferAddress(env, buf);
MPI_Request request;

int rc = MPI_File_iread_at_all((MPI_File)fh, (MPI_Offset)offset,
ptr, count, (MPI_Datatype)type, &request);

ompi_java_exceptionCheck(env, rc);
return (jlong)request;
}

JNIEXPORT jlong JNICALL Java_mpi_File_iWriteAt(
JNIEnv *env, jobject jthis, jlong fh, jlong offset,
jobject buf, jint count, jlong type)
Expand All @@ -250,6 +265,20 @@ JNIEXPORT jlong JNICALL Java_mpi_File_iWriteAt(
return (jlong)request;
}

JNIEXPORT jlong JNICALL Java_mpi_File_iWriteAtAll(
JNIEnv *env, jobject jthis, jlong fh, jlong offset,
jobject buf, jint count, jlong type)
{
void *ptr = (*env)->GetDirectBufferAddress(env, buf);
MPI_Request request;

int rc = MPI_File_iwrite_at_all((MPI_File)fh, (MPI_Offset)offset,
ptr, count, (MPI_Datatype)type, &request);

ompi_java_exceptionCheck(env, rc);
return (jlong)request;
}

JNIEXPORT void JNICALL Java_mpi_File_read(
JNIEnv *env, jobject jthis, jlong fh, jobject buf, jboolean db,
jint off, jint count, jlong jType, jint bType, jlongArray stat)
Expand Down Expand Up @@ -336,6 +365,20 @@ JNIEXPORT jlong JNICALL Java_mpi_File_iRead(
return (jlong)request;
}

JNIEXPORT jlong JNICALL Java_mpi_File_iReadAll(
JNIEnv *env, jobject jthis, jlong fh,
jobject buf, jint count, jlong type)
{
void *ptr = (*env)->GetDirectBufferAddress(env, buf);
MPI_Request request;

int rc = MPI_File_iread_all((MPI_File)fh, ptr, count,
(MPI_Datatype)type, &request);

ompi_java_exceptionCheck(env, rc);
return (jlong)request;
}

JNIEXPORT jlong JNICALL Java_mpi_File_iWrite(
JNIEnv *env, jobject jthis, jlong fh,
jobject buf, jint count, jlong type)
Expand All @@ -350,6 +393,20 @@ JNIEXPORT jlong JNICALL Java_mpi_File_iWrite(
return (jlong)request;
}

JNIEXPORT jlong JNICALL Java_mpi_File_iWriteAll(
JNIEnv *env, jobject jthis, jlong fh,
jobject buf, jint count, jlong type)
{
void *ptr = (*env)->GetDirectBufferAddress(env, buf);
MPI_Request request;

int rc = MPI_File_iwrite_all((MPI_File)fh, ptr, count,
(MPI_Datatype)type, &request);

ompi_java_exceptionCheck(env, rc);
return (jlong)request;
}

JNIEXPORT void JNICALL Java_mpi_File_seek(
JNIEnv *env, jobject jthis, jlong fh, jlong offset, jint whence)
{
Expand Down Expand Up @@ -646,9 +703,43 @@ JNIEXPORT void JNICALL Java_mpi_File_setAtomicity(
ompi_java_exceptionCheck(env, rc);
}

JNIEXPORT jboolean JNICALL Java_mpi_File_getAtomicity(
JNIEnv *env, jobject jthis, jlong fh)
{
int atomicity;
int rc = MPI_File_get_atomicity((MPI_File)fh, &atomicity);
ompi_java_exceptionCheck(env, rc);
return atomicity ? JNI_TRUE : JNI_FALSE;
}

JNIEXPORT void JNICALL Java_mpi_File_sync(
JNIEnv *env, jobject jthis, jlong fh)
{
int rc = MPI_File_sync((MPI_File)fh);
ompi_java_exceptionCheck(env, rc);
}

JNIEXPORT void JNICALL Java_mpi_File_setErrhandler(
JNIEnv *env, jobject jthis, jlong fh, jlong errhandler)
{
int rc = MPI_File_set_errhandler(
(MPI_File)fh, (MPI_Errhandler)errhandler);

ompi_java_exceptionCheck(env, rc);
}

JNIEXPORT jlong JNICALL Java_mpi_File_getErrhandler(
JNIEnv *env, jobject jthis, jlong fh)
{
MPI_Errhandler errhandler;
int rc = MPI_File_get_errhandler((MPI_File)fh, &errhandler);
ompi_java_exceptionCheck(env, rc);
return (jlong)errhandler;
}

JNIEXPORT void JNICALL Java_mpi_File_callErrhandler(
JNIEnv *env, jobject jthis, jlong fh, jint errorCode)
{
int rc = MPI_File_call_errhandler((MPI_File)fh, errorCode);
ompi_java_exceptionCheck(env, rc);
}
12 changes: 11 additions & 1 deletion ompi/mpi/java/c/mpi_Win.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* and Technology (RIST). All rights reserved.
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2017 FUJITSU LIMITED. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -221,11 +222,20 @@ JNIEXPORT void JNICALL Java_mpi_Win_setErrhandler(
JNIEnv *env, jobject jthis, jlong win, jlong errhandler)
{
int rc = MPI_Win_set_errhandler(
(MPI_Win)win, (MPI_Errhandler)MPI_ERRORS_RETURN);
(MPI_Win)win, (MPI_Errhandler)errhandler);

ompi_java_exceptionCheck(env, rc);
}

JNIEXPORT jlong JNICALL Java_mpi_Win_getErrhandler(
JNIEnv *env, jobject jthis, jlong win)
{
MPI_Errhandler errhandler;
int rc = MPI_Win_get_errhandler((MPI_Win)win, &errhandler);
ompi_java_exceptionCheck(env, rc);
return (jlong)errhandler;
}

JNIEXPORT void JNICALL Java_mpi_Win_callErrhandler(
JNIEnv *env, jobject jthis, jlong win, jint errorCode)
{
Expand Down
15 changes: 15 additions & 0 deletions ompi/mpi/java/java/Comm.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* and Technology (RIST). All rights reserved.
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2017 FUJITSU LIMITED. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -1196,6 +1197,20 @@ public final Errhandler getErrhandler() throws MPIException

private native long getErrhandler(long comm);

/**
* Calls the error handler currently associated with the communicator.
* <p>Java binding of the MPI operation {@code MPI_COMM_CALL_ERRHANDLER}.
* @param errorCode error code
* @throws MPIException Signals that an MPI exception of some sort has occurred.
*/
public void callErrhandler(int errorCode) throws MPIException
{
callErrhandler(handle, errorCode);
}

private native void callErrhandler(long handle, int errorCode)
throws MPIException;

// Collective Communication

/**
Expand Down
Loading