@ -50,10 +50,10 @@ JNIEXPORT jlong JNICALL Java_mpi_Win_allocateWin(JNIEnv *env, jobject jthis,
|
||||
{
|
||||
void *basePtr = (*env)->GetDirectBufferAddress(env, jBase);
|
||||
MPI_Win win;
|
||||
|
||||
|
||||
int rc = MPI_Win_allocate((MPI_Aint)size, dispUnit,
|
||||
(MPI_Info)info, (MPI_Comm)comm, basePtr, &win);
|
||||
|
||||
|
||||
ompi_java_exceptionCheck(env, rc);
|
||||
return (jlong)win;
|
||||
}
|
||||
@ -63,10 +63,10 @@ JNIEXPORT jlong JNICALL Java_mpi_Win_allocateSharedWin(JNIEnv *env, jobject jthi
|
||||
{
|
||||
void *basePtr = (*env)->GetDirectBufferAddress(env, jBase);
|
||||
MPI_Win win;
|
||||
|
||||
|
||||
int rc = MPI_Win_allocate_shared((MPI_Aint)size, dispUnit,
|
||||
(MPI_Info)info, (MPI_Comm)comm, basePtr, &win);
|
||||
|
||||
|
||||
ompi_java_exceptionCheck(env, rc);
|
||||
return (jlong)win;
|
||||
}
|
||||
@ -333,11 +333,11 @@ JNIEXPORT jlong JNICALL Java_mpi_Win_rPut(JNIEnv *env, jobject jthis,
|
||||
{
|
||||
void *origPtr = ompi_java_getDirectBufferAddress(env, origin_addr);
|
||||
MPI_Request request;
|
||||
|
||||
|
||||
int rc = MPI_Rput(origPtr, origin_count, (MPI_Datatype)origin_type,
|
||||
target_rank, (MPI_Aint)target_disp, target_count, (MPI_Datatype)target_datatype,
|
||||
(MPI_Win)win, &request);
|
||||
|
||||
|
||||
ompi_java_exceptionCheck(env, rc);
|
||||
return (jlong)request;
|
||||
}
|
||||
@ -348,11 +348,11 @@ JNIEXPORT jlong JNICALL Java_mpi_Win_rGet(JNIEnv *env, jobject jthis, jlong win,
|
||||
{
|
||||
void *orgPtr = (*env)->GetDirectBufferAddress(env, origin);
|
||||
MPI_Request request;
|
||||
|
||||
|
||||
int rc = MPI_Rget(orgPtr, orgCount, (MPI_Datatype)orgType,
|
||||
targetRank, (MPI_Aint)targetDisp, targetCount,
|
||||
(MPI_Datatype)targetType, (MPI_Win)win, &request);
|
||||
|
||||
|
||||
ompi_java_exceptionCheck(env, rc);
|
||||
return (jlong)request;
|
||||
}
|
||||
@ -364,11 +364,11 @@ JNIEXPORT jlong JNICALL Java_mpi_Win_rAccumulate(JNIEnv *env, jobject jthis, jlo
|
||||
void *orgPtr = (*env)->GetDirectBufferAddress(env, origin);
|
||||
MPI_Op op = ompi_java_op_getHandle(env, jOp, hOp, baseType);
|
||||
MPI_Request request;
|
||||
|
||||
|
||||
int rc = MPI_Raccumulate(orgPtr, orgCount, (MPI_Datatype)orgType,
|
||||
targetRank, (MPI_Aint)targetDisp, targetCount,
|
||||
(MPI_Datatype)targetType, op, (MPI_Win)win, &request);
|
||||
|
||||
|
||||
ompi_java_exceptionCheck(env, rc);
|
||||
return (jlong)request;
|
||||
}
|
||||
@ -381,12 +381,12 @@ JNIEXPORT void JNICALL Java_mpi_Win_getAccumulate(JNIEnv *env, jobject jthis, jl
|
||||
void *orgPtr = (*env)->GetDirectBufferAddress(env, origin);
|
||||
void *resultPtr = (*env)->GetDirectBufferAddress(env, resultBuff);
|
||||
MPI_Op op = ompi_java_op_getHandle(env, jOp, hOp, baseType);
|
||||
|
||||
|
||||
int rc = MPI_Get_accumulate(orgPtr, orgCount, (MPI_Datatype)orgType,
|
||||
resultPtr, resultCount, (MPI_Datatype)resultType,
|
||||
targetRank, (MPI_Aint)targetDisp, targetCount,
|
||||
(MPI_Datatype)targetType, op, (MPI_Win)win);
|
||||
|
||||
|
||||
ompi_java_exceptionCheck(env, rc);
|
||||
}
|
||||
|
||||
@ -399,12 +399,12 @@ JNIEXPORT jlong JNICALL Java_mpi_Win_rGetAccumulate(JNIEnv *env, jobject jthis,
|
||||
void *resultPtr = (*env)->GetDirectBufferAddress(env, resultBuff);
|
||||
MPI_Op op = ompi_java_op_getHandle(env, jOp, hOp, baseType);
|
||||
MPI_Request request;
|
||||
|
||||
|
||||
int rc = MPI_Rget_accumulate(orgPtr, orgCount, (MPI_Datatype)orgType,
|
||||
resultPtr, resultCount, (MPI_Datatype)resultType,
|
||||
targetRank, (MPI_Aint)targetDisp, targetCount,
|
||||
(MPI_Datatype)targetType, op, (MPI_Win)win, &request);
|
||||
|
||||
|
||||
ompi_java_exceptionCheck(env, rc);
|
||||
return (jlong)request;
|
||||
}
|
||||
@ -445,7 +445,7 @@ JNIEXPORT void JNICALL Java_mpi_Win_compareAndSwap (JNIEnv *env, jobject jthis,
|
||||
void *orgPtr = (*env)->GetDirectBufferAddress(env, origin);
|
||||
void *compPtr = (*env)->GetDirectBufferAddress(env, compareAddr);
|
||||
void *resultPtr = (*env)->GetDirectBufferAddress(env, resultAddr);
|
||||
|
||||
|
||||
int rc = MPI_Compare_and_swap(orgPtr, compPtr, resultPtr, dataType, targetRank, targetDisp, (MPI_Win)win);
|
||||
ompi_java_exceptionCheck(env, rc);
|
||||
}
|
||||
@ -456,7 +456,7 @@ JNIEXPORT void JNICALL Java_mpi_Win_fetchAndOp(JNIEnv *env, jobject jthis, jlong
|
||||
void *orgPtr = (*env)->GetDirectBufferAddress(env, origin);
|
||||
void *resultPtr = (*env)->GetDirectBufferAddress(env, resultAddr);
|
||||
MPI_Op op = ompi_java_op_getHandle(env, jOp, hOp, baseType);
|
||||
|
||||
|
||||
int rc = MPI_Fetch_and_op(orgPtr, resultPtr, dataType, targetRank, targetDisp, op, (MPI_Win)win);
|
||||
ompi_java_exceptionCheck(env, rc);
|
||||
}
|
||||
|
Ссылка в новой задаче
Block a user