Skip to content

Commit ade7de5

Browse files
committed
MPI_Win_create_dynamic : add Java bindings
1 parent 2fa8167 commit ade7de5

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

ompi/mpi/java/c/mpi_Win.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
* University of Stuttgart. All rights reserved.
1010
* Copyright (c) 2004-2005 The Regents of the University of California.
1111
* All rights reserved.
12+
* Copyright (c) 2015 Research Organization for Information Science
13+
* and Technology (RIST). All rights reserved.
1214
* $COPYRIGHT$
1315
*
1416
* Additional copyrights may follow
@@ -41,6 +43,18 @@ JNIEXPORT jlong JNICALL Java_mpi_Win_createWin(
4143
return (jlong)win;
4244
}
4345

46+
JNIEXPORT jlong JNICALL Java_mpi_Win_create_dynamicWin(
47+
jlong info, jlong comm)
48+
{
49+
MPI_Win win;
50+
51+
int rc = MPI_Win_create_dynamic(
52+
(MPI_Info)info, (MPI_Comm)comm, &win);
53+
54+
ompi_java_exceptionCheck(env, rc);
55+
return (jlong)win;
56+
}
57+
4458
JNIEXPORT jlong JNICALL Java_mpi_Win_getGroup(
4559
JNIEnv *env, jobject jthis, jlong win)
4660
{

ompi/mpi/java/java/Win.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
* University of Stuttgart. All rights reserved.
1010
* Copyright (c) 2004-2005 The Regents of the University of California.
1111
* All rights reserved.
12+
* Copyright (c) 2015 Research Organization for Information Science
13+
* and Technology (RIST). All rights reserved.
1214
* $COPYRIGHT$
1315
*
1416
* Additional copyrights may follow
@@ -65,6 +67,22 @@ private native long createWin(
6567
Buffer base, int size, int dispUnit, long info, long comm)
6668
throws MPIException;
6769

70+
/**
71+
* Java binding of {@code MPI_WIN_CREATE_DYNAMIC}.
72+
* @param info info object
73+
* @param comm communicator
74+
* @throws MPIException
75+
*/
76+
public Win(Info info, Comm comm)
77+
throws MPIException
78+
{
79+
handle = createWinDynamic(info.handle, comm.handle);
80+
}
81+
82+
private native long createWinDynamic(
83+
long info, long comm)
84+
throws MPIException;
85+
6886
private int getBaseType(Datatype orgType, Datatype targetType)
6987
{
7088
int baseType = orgType.baseType;

0 commit comments

Comments
 (0)