Comm.reduceLocal: add missing offset artifact
This commit was SVN r30108.
Этот коммит содержится в:
родитель
fb0f7d7fa5
Коммит
c9b7ea6d1a
@ -1965,18 +1965,17 @@ JNIEXPORT jlong JNICALL Java_mpi_Comm_iReduceScatterBlock(
|
|||||||
return (jlong)request;
|
return (jlong)request;
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_mpi_Comm_reduceLocal_1jni(
|
JNIEXPORT void JNICALL Java_mpi_Comm_reduceLocal(
|
||||||
JNIEnv *env, jobject jthis,
|
JNIEnv *env, jobject jthis, jobject inbuf, jint inoff,
|
||||||
jobject inbuf, jobject inoutbuf,
|
jobject inoutbuf, jint inoutoff, jint count, jobject type, jobject op)
|
||||||
jint count, jobject type, jobject op)
|
|
||||||
{
|
{
|
||||||
MPI_Datatype mpi_type =
|
MPI_Datatype mpi_type =
|
||||||
(MPI_Datatype)((*env)->GetLongField(env,type,ompi_java.DatatypeHandle));
|
(MPI_Datatype)((*env)->GetLongField(env,type,ompi_java.DatatypeHandle));
|
||||||
|
|
||||||
int baseType = (*env)->GetIntField(env, type, ompi_java.DatatypeBaseType);
|
int baseType = (*env)->GetIntField(env, type, ompi_java.DatatypeBaseType);
|
||||||
void *inptr, *inbase, *inoutptr, *inoutbase;
|
void *inptr, *inbase, *inoutptr, *inoutbase;
|
||||||
inptr = ompi_java_getBufPtr(&inbase, env, inbuf, baseType, 0);
|
inptr = ompi_java_getBufPtr(&inbase, env, inbuf, baseType, inoff);
|
||||||
inoutptr = ompi_java_getBufPtr(&inoutbase, env, inoutbuf, baseType, 0);
|
inoutptr = ompi_java_getBufPtr(&inoutbase, env, inoutbuf, baseType, inoutoff);
|
||||||
|
|
||||||
int rc = MPI_Reduce_local(inptr, inoutptr, count, mpi_type,
|
int rc = MPI_Reduce_local(inptr, inoutptr, count, mpi_type,
|
||||||
ompi_java_op_getHandle(env, op, baseType));
|
ompi_java_op_getHandle(env, op, baseType));
|
||||||
|
@ -2631,12 +2631,28 @@ public final void reduceLocal(Object inbuf, Object inoutbuf, int count,
|
|||||||
{
|
{
|
||||||
MPI.check();
|
MPI.check();
|
||||||
op.setDatatype(type);
|
op.setDatatype(type);
|
||||||
reduceLocal_jni(inbuf, inoutbuf, count, type, op);
|
|
||||||
|
int inoff = 0,
|
||||||
|
inoutoff = 0;
|
||||||
|
|
||||||
|
if(isHeapBuffer(inbuf))
|
||||||
|
{
|
||||||
|
inoff = ((Buffer)inbuf).arrayOffset();
|
||||||
|
inbuf = ((Buffer)inbuf).array();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isHeapBuffer(inoutbuf))
|
||||||
|
{
|
||||||
|
inoutoff = ((Buffer)inoutbuf).arrayOffset();
|
||||||
|
inoutbuf = ((Buffer)inoutbuf).array();
|
||||||
|
}
|
||||||
|
|
||||||
|
reduceLocal(inbuf, inoff, inoutbuf, inoutoff, count, type, op);
|
||||||
}
|
}
|
||||||
|
|
||||||
private native void reduceLocal_jni(Object inbuf, Object inoutbuf, int count,
|
private native void reduceLocal(
|
||||||
Datatype datatype, Op op)
|
Object inbuf, int inoff, Object inoutbuf, int inoutoff,
|
||||||
throws MPIException;
|
int count, Datatype datatype, Op op) throws MPIException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the print name for the communicator.
|
* Sets the print name for the communicator.
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user