Java: Comm.set/getInfo
This commit was SVN r31289.
Этот коммит содержится в:
родитель
70ee3fb000
Коммит
0e177597c3
@ -337,6 +337,27 @@ JNIEXPORT jlong JNICALL Java_mpi_Comm_free(
|
||||
return (jlong)comm;
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_mpi_Comm_setInfo(
|
||||
JNIEnv *env, jobject jthis, jlong comm, jlong info)
|
||||
{
|
||||
int rc = MPI_Comm_set_info((MPI_Comm)comm, (MPI_Info)info);
|
||||
ompi_java_exceptionCheck(env, rc);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: mpi_Comm
|
||||
* Method: getInfo
|
||||
* Signature: (J)J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL Java_mpi_Comm_getInfo(
|
||||
JNIEnv *env, jobject jthis, jlong comm)
|
||||
{
|
||||
MPI_Info info;
|
||||
int rc = MPI_Comm_get_info((MPI_Comm)comm, &info);
|
||||
ompi_java_exceptionCheck(env, rc);
|
||||
return (jlong)info;
|
||||
}
|
||||
|
||||
JNIEXPORT jlong JNICALL Java_mpi_Comm_disconnect(
|
||||
JNIEnv *env, jobject jthis, jlong handle)
|
||||
{
|
||||
@ -346,14 +367,6 @@ JNIEXPORT jlong JNICALL Java_mpi_Comm_disconnect(
|
||||
return (jlong)comm;
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL Java_mpi_Comm_isNull(JNIEnv *env, jobject jthis)
|
||||
{
|
||||
MPI_Comm comm = (MPI_Comm)((*env)->GetLongField(
|
||||
env, jthis, ompi_java.CommHandle));
|
||||
|
||||
return comm == MPI_COMM_NULL ? JNI_TRUE : JNI_FALSE;
|
||||
}
|
||||
|
||||
JNIEXPORT jlong JNICALL Java_mpi_Comm_getGroup(
|
||||
JNIEnv *env, jobject jthis, jlong comm)
|
||||
{
|
||||
|
@ -67,7 +67,7 @@ protected final static int SELF = 1;
|
||||
protected final static int WORLD = 2;
|
||||
protected long handle;
|
||||
|
||||
protected static long nullHandle;
|
||||
private static long nullHandle;
|
||||
|
||||
static
|
||||
{
|
||||
@ -169,7 +169,7 @@ private static native int compare(long comm1, long comm2) throws MPIException;
|
||||
* Java binding of the MPI operation {@code MPI_COMM_FREE}.
|
||||
* @throws MPIException
|
||||
*/
|
||||
@Override public void free() throws MPIException
|
||||
@Override final public void free() throws MPIException
|
||||
{
|
||||
MPI.check();
|
||||
handle = free(handle);
|
||||
@ -177,6 +177,41 @@ private static native int compare(long comm1, long comm2) throws MPIException;
|
||||
|
||||
private native long free(long comm) throws MPIException;
|
||||
|
||||
/**
|
||||
* Test if communicator object is null (has been freed).
|
||||
* @return true if the comm object is null, false otherwise
|
||||
*/
|
||||
public final boolean isNull()
|
||||
{
|
||||
return handle == nullHandle;
|
||||
}
|
||||
|
||||
/**
|
||||
* Java binding of {@code MPI_COMM_SET_INFO}.
|
||||
* @param info info object
|
||||
* @throws MPIException
|
||||
*/
|
||||
public final void setInfo(Info info) throws MPIException
|
||||
{
|
||||
MPI.check();
|
||||
setInfo(handle, info.handle);
|
||||
}
|
||||
|
||||
private native void setInfo(long fh, long info) throws MPIException;
|
||||
|
||||
/**
|
||||
* Java binding of {@code MPI_COMM_GET_INFO}.
|
||||
* @return new info object
|
||||
* @throws MPIException
|
||||
*/
|
||||
public final Info getInfo() throws MPIException
|
||||
{
|
||||
MPI.check();
|
||||
return new Info(getInfo(handle));
|
||||
}
|
||||
|
||||
private native long getInfo(long fh) throws MPIException;
|
||||
|
||||
/**
|
||||
* Java binding of the MPI operation {@code MPI_COMM_DISCONNECT}.
|
||||
* @throws MPIException
|
||||
@ -189,12 +224,6 @@ public final void disconnect() throws MPIException
|
||||
|
||||
private native long disconnect(long comm) throws MPIException;
|
||||
|
||||
/**
|
||||
* Test if communicator object is void (has been freed).
|
||||
* @return true if the comm object is void, false otherwise
|
||||
*/
|
||||
public final native boolean isNull();
|
||||
|
||||
/**
|
||||
* Return group associated with a communicator.
|
||||
* <p>Java binding of the MPI operation {@code MPI_COMM_GROUP}.
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user