Skip to content
Snippets Groups Projects
Verified Commit 96e2c187 authored by raphael.bach's avatar raphael.bach
Browse files

Remove unnecessary parameters from ` fmpi_mpi_gather_in_place()`

parent dff08f84
No related branches found
No related tags found
No related merge requests found
......@@ -213,9 +213,8 @@ MPI_Datatype fmpi_mpi_type(enum fmpi_type_base type);
fmpi_mpi_gather_in_place()
------------------------------------------------------------------------------*/
int fmpi_mpi_gather_in_place(
const struct fmpi_mpi_ctx * ctx, const void * send_buf, size_t send_cnt,
MPI_Datatype send_type, void * recv_buf, size_t recv_cnt,
MPI_Datatype recv_type, int root, MPI_Comm comm
const struct fmpi_mpi_ctx * ctx, void * buf, MPI_Datatype type,
size_t send_cnt, size_t recv_cnt, int root, MPI_Comm comm
);
/*==============================================================================
GUARD
......
......@@ -226,30 +226,26 @@ MPI_Datatype fmpi_mpi_type(const enum fmpi_type_base type)
fmpi_mpi_gather_in_place()
------------------------------------------------------------------------------*/
int fmpi_mpi_gather_in_place(
const struct fmpi_mpi_ctx * const ctx,
const void * const send_buf, const size_t send_cnt, MPI_Datatype send_type,
void * const recv_buf, const size_t recv_cnt, MPI_Datatype recv_type,
const int root, MPI_Comm comm
const struct fmpi_mpi_ctx * const ctx, void * const buf, MPI_Datatype type,
const size_t send_cnt, const size_t recv_cnt, const int root, MPI_Comm comm
) {
assert(ctx != NULL);
assert(send_buf != NULL);
assert(recv_buf != NULL);
assert(buf != NULL);
assert(send_cnt <= INT_MAX);
assert(recv_cnt <= INT_MAX);
if(send_type == recv_type) {
assert(send_cnt <= recv_cnt);
}
assert(send_cnt <= recv_cnt);
int err = MPI_SUCCESS;
if(ctx->rank == root) {
err = MPI_Gather(
MPI_IN_PLACE, (int)send_cnt, send_type,
recv_buf , (int)recv_cnt, recv_type,
MPI_IN_PLACE, (int)send_cnt, type,
buf , (int)recv_cnt, type,
root, comm
);
} else {
err = MPI_Gather(
send_buf, (int)send_cnt, send_type,
recv_buf, (int)recv_cnt, recv_type,
buf, (int)send_cnt, type,
buf, (int)recv_cnt, type,
root, comm
);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment