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

Add `fmpi_mpi_world_size()`

parent a1672665
No related branches found
No related tags found
No related merge requests found
...@@ -243,6 +243,10 @@ int fmpi_mpi_world_reduce_in_place( ...@@ -243,6 +243,10 @@ int fmpi_mpi_world_reduce_in_place(
int fmpi_mpi_dims_create( int fmpi_mpi_dims_create(
const struct fmpi_mpi_ctx * ctx, size_t * const dim_len, size_t dim_cnt const struct fmpi_mpi_ctx * ctx, size_t * const dim_len, size_t dim_cnt
); );
/*------------------------------------------------------------------------------
fmpi_mpi_world_size()
------------------------------------------------------------------------------*/
int fmpi_mpi_world_size(const struct fmpi_mpi_ctx * ctx);
/*============================================================================== /*==============================================================================
GUARD GUARD
==============================================================================*/ ==============================================================================*/
......
...@@ -336,3 +336,17 @@ int fmpi_mpi_dims_create( ...@@ -336,3 +336,17 @@ int fmpi_mpi_dims_create(
} }
return fmpi_mpi_check_error(ctx, err, "MPI_Dims_create"); return fmpi_mpi_check_error(ctx, err, "MPI_Dims_create");
} }
/*------------------------------------------------------------------------------
fmpi_mpi_world_size()
------------------------------------------------------------------------------*/
int fmpi_mpi_world_size(const struct fmpi_mpi_ctx * const ctx)
{
assert(ctx != NULL);
int size = FMPI_ERROR;
int err = MPI_Comm_size(ctx->world, &size);
err = fmpi_mpi_check_error(ctx, err, "MPI_Comm_size");
if(err != FMPI_SUCCESS) {
return err;
}
return size;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment