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

Add `fmpi_mpi_world_gather_in_place()`

parent 96e2c187
No related branches found
No related tags found
No related merge requests found
...@@ -216,6 +216,13 @@ int fmpi_mpi_gather_in_place( ...@@ -216,6 +216,13 @@ int fmpi_mpi_gather_in_place(
const struct fmpi_mpi_ctx * ctx, void * buf, MPI_Datatype type, const struct fmpi_mpi_ctx * ctx, void * buf, MPI_Datatype type,
size_t send_cnt, size_t recv_cnt, int root, MPI_Comm comm size_t send_cnt, size_t recv_cnt, int root, MPI_Comm comm
); );
/*------------------------------------------------------------------------------
fmpi_mpi_world_gather_in_place()
------------------------------------------------------------------------------*/
int fmpi_mpi_world_gather_in_place(
const struct fmpi_mpi_ctx * ctx, void * buf, MPI_Datatype type,
size_t send_cnt, size_t recv_cnt
);
/*============================================================================== /*==============================================================================
GUARD GUARD
==============================================================================*/ ==============================================================================*/
......
...@@ -239,7 +239,7 @@ int fmpi_mpi_gather_in_place( ...@@ -239,7 +239,7 @@ int fmpi_mpi_gather_in_place(
if(ctx->rank == root) { if(ctx->rank == root) {
err = MPI_Gather( err = MPI_Gather(
MPI_IN_PLACE, (int)send_cnt, type, MPI_IN_PLACE, (int)send_cnt, type,
buf , (int)recv_cnt, type, buf , (int)recv_cnt, type,
root, comm root, comm
); );
} else { } else {
...@@ -251,3 +251,26 @@ int fmpi_mpi_gather_in_place( ...@@ -251,3 +251,26 @@ int fmpi_mpi_gather_in_place(
} }
return fmpi_mpi_check_error(ctx, err, "MPI_Gather"); return fmpi_mpi_check_error(ctx, err, "MPI_Gather");
} }
/*------------------------------------------------------------------------------
fmpi_mpi_world_gather_in_place()
------------------------------------------------------------------------------*/
int fmpi_mpi_world_gather_in_place(
const struct fmpi_mpi_ctx * const ctx, void * const buf, MPI_Datatype type,
const size_t send_cnt, const size_t recv_cnt
){
assert(ctx != NULL);
assert(buf != NULL);
assert(send_cnt <= INT_MAX);
assert(recv_cnt <= INT_MAX);
assert(send_cnt <= recv_cnt);
const int err = fmpi_mpi_gather_in_place(
ctx, buf, type, send_cnt, recv_cnt, ctx->root, ctx->world
);
if(err != FMPI_SUCCESS) {
FMPI_RAISE_ERROR(ctx->err_handler, "FMPI",
"fmpi_mpi_gather_in_place() failed!"
);
}
return err;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment