Merge pull request #749 from nrgraham23/additional_comm_java_bindings
Additional java bindings for the Comm class
Этот коммит содержится в:
Коммит
ea6f5b31fd
@ -214,6 +214,15 @@ JNIEXPORT jlongArray JNICALL Java_mpi_Comm_iDup(
|
||||
return jcr;
|
||||
}
|
||||
|
||||
JNIEXPORT jlong JNICALL Java_mpi_Comm_dupWithInfo(
|
||||
JNIEnv *env, jobject jthis, jlong comm, jlong info)
|
||||
{
|
||||
MPI_Comm newcomm;
|
||||
int rc = MPI_Comm_dup_with_info((MPI_Comm)comm, (MPI_Info)info, &newcomm);
|
||||
ompi_java_exceptionCheck(env, rc);
|
||||
return (jlong)newcomm;
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL Java_mpi_Comm_getSize(
|
||||
JNIEnv *env, jobject jthis, jlong comm)
|
||||
{
|
||||
|
@ -86,6 +86,15 @@ JNIEXPORT jlong JNICALL Java_mpi_Intracomm_create(
|
||||
return (jlong)newcomm;
|
||||
}
|
||||
|
||||
JNIEXPORT jlong JNICALL Java_mpi_Intracomm_createGroup(
|
||||
JNIEnv *env, jobject jthis, jlong comm, jlong group, int tag)
|
||||
{
|
||||
MPI_Comm newcomm;
|
||||
int rc = MPI_Comm_create_group((MPI_Comm)comm, (MPI_Group)group, tag, &newcomm);
|
||||
ompi_java_exceptionCheck(env, rc);
|
||||
return (jlong)newcomm;
|
||||
}
|
||||
|
||||
JNIEXPORT jlong JNICALL Java_mpi_Intracomm_createCart(
|
||||
JNIEnv *env, jobject jthis, jlong comm,
|
||||
jintArray dims, jbooleanArray periods, jboolean reorder)
|
||||
|
@ -114,6 +114,19 @@ public final class CartComm extends Intracomm
|
||||
return new CartComm(iDup(handle));
|
||||
}
|
||||
|
||||
/**
|
||||
* Duplicates this communicator with the info object used in the call.
|
||||
* <p>Java binding of {@code MPI_COMM_DUP_WITH_INFO}.
|
||||
* @param info info object to associate with the new communicator
|
||||
* @return copy of this communicator
|
||||
* @throws MPIException Signals that an MPI exception of some sort has occurred.
|
||||
*/
|
||||
@Override public CartComm dupWithInfo(Info info) throws MPIException
|
||||
{
|
||||
MPI.check();
|
||||
return new CartComm(dupWithInfo(handle, info.handle));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns cartesian topology information.
|
||||
* <p>Java binding of the MPI operations {@code MPI_CARTDIM_GET} and
|
||||
|
@ -152,7 +152,22 @@ public class Comm implements Freeable
|
||||
}
|
||||
|
||||
protected final native long[] iDup(long comm) throws MPIException;
|
||||
|
||||
/**
|
||||
* Duplicates this communicator with the info object used in the call.
|
||||
* <p>Java binding of {@code MPI_COMM_DUP_WITH_INFO}.
|
||||
* @param info info object to associate with the new communicator
|
||||
* @return copy of this communicator
|
||||
* @throws MPIException Signals that an MPI exception of some sort has occurred.
|
||||
*/
|
||||
public Comm dupWithInfo(Info info) throws MPIException
|
||||
{
|
||||
MPI.check();
|
||||
return new Comm(dupWithInfo(handle, info.handle));
|
||||
}
|
||||
|
||||
protected final native long dupWithInfo(long comm, long info) throws MPIException;
|
||||
|
||||
/**
|
||||
* Returns the associated request to this communicator if it was
|
||||
* created using {@link #iDup}.
|
||||
|
@ -114,6 +114,19 @@ public final class GraphComm extends Intracomm
|
||||
return new GraphComm(iDup(handle));
|
||||
}
|
||||
|
||||
/**
|
||||
* Duplicates this communicator with the info object used in the call.
|
||||
* <p>Java binding of {@code MPI_COMM_DUP_WITH_INFO}.
|
||||
* @param info info object to associate with the new communicator
|
||||
* @return copy of this communicator
|
||||
* @throws MPIException Signals that an MPI exception of some sort has occurred.
|
||||
*/
|
||||
@Override public GraphComm dupWithInfo(Info info) throws MPIException
|
||||
{
|
||||
MPI.check();
|
||||
return new GraphComm(dupWithInfo(handle, info.handle));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns graph topology information.
|
||||
* <p>Java binding of the MPI operations {@code MPI_GRAPHDIMS_GET}
|
||||
|
@ -106,7 +106,20 @@ public final class Intercomm extends Comm
|
||||
MPI.check();
|
||||
return new Intercomm(iDup(handle));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Duplicates this communicator with the info object used in the call.
|
||||
* <p>Java binding of {@code MPI_COMM_DUP_WITH_INFO}.
|
||||
* @param info info object to associate with the new communicator
|
||||
* @return copy of this communicator
|
||||
* @throws MPIException Signals that an MPI exception of some sort has occurred.
|
||||
*/
|
||||
@Override public Intercomm dupWithInfo(Info info) throws MPIException
|
||||
{
|
||||
MPI.check();
|
||||
return new Intercomm(dupWithInfo(handle, info.handle));
|
||||
}
|
||||
|
||||
// Inter-Communication
|
||||
|
||||
/**
|
||||
|
@ -123,7 +123,20 @@ public class Intracomm extends Comm
|
||||
MPI.check();
|
||||
return new Intracomm(iDup(handle));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Duplicates this communicator with the info object used in the call.
|
||||
* <p>Java binding of {@code MPI_COMM_DUP_WITH_INFO}.
|
||||
* @param info info object to associate with the new communicator
|
||||
* @return copy of this communicator
|
||||
* @throws MPIException Signals that an MPI exception of some sort has occurred.
|
||||
*/
|
||||
@Override public Intracomm dupWithInfo(Info info) throws MPIException
|
||||
{
|
||||
MPI.check();
|
||||
return new Intracomm(dupWithInfo(handle, info.handle));
|
||||
}
|
||||
|
||||
/**
|
||||
* Partition the group associated with this communicator and create
|
||||
* a new communicator within each subgroup.
|
||||
@ -173,7 +186,23 @@ public class Intracomm extends Comm
|
||||
}
|
||||
|
||||
private native long create(long comm, long group);
|
||||
|
||||
/**
|
||||
* Create a new intracommunicator for the given group.
|
||||
* <p>Java binding of the MPI operation {@code MPI_COMM_CREATE_GROUP}.
|
||||
* @param group group which is a subset of the group of this communicator
|
||||
* @param tag an integer tag
|
||||
* @return new communicator
|
||||
* @throws MPIException Signals that an MPI exception of some sort has occurred.
|
||||
*/
|
||||
public final Intracomm createGroup(Group group, int tag) throws MPIException
|
||||
{
|
||||
MPI.check();
|
||||
return new Intracomm(createGroup(handle, group.handle, tag));
|
||||
}
|
||||
|
||||
private native long createGroup(long comm, long group, int tag);
|
||||
|
||||
// Topology Constructors
|
||||
|
||||
/**
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user