TECA
The Toolkit for Extreme Climate Analysis
teca_mpi_util.h
Go to the documentation of this file.
1 #ifndef teca_mpi_util_h
2 #define teca_mpi_util_h
3 
4 /// @file
5 
6 #include "teca_config.h"
7 #include "teca_mpi.h"
8 
9 /// Codes dealing with MPI
10 namespace teca_mpi_util
11 {
12 /** Subset the the communicator comm into a new communicator with new_comm_size
13  * ranks. ranks are selected from comm with a uniform stride spreading them
14  * approximatelyt equally across nodes.
15  */
17 int equipartition_communicator(MPI_Comm comm,
18  int new_comm_size, MPI_Comm *new_comm);
19 
20 /** Split the communicator into a number of new communicators such that each
21  * new communicator has group_size ranks.
22  */
24 int split_communicator(MPI_Comm comm,
25  int group_size, MPI_Comm *new_comm);
26 
27 /// return non-zero if this process is MPI rank 0
29 int mpi_rank_0(MPI_Comm comm);
30 };
31 
32 #endif
p_teca_error_handler error_handler TECA_EXPORT
The global error handler instance.
Codes dealing with MPI.
Definition: teca_mpi_util.h:11
TECA_EXPORT int split_communicator(MPI_Comm comm, int group_size, MPI_Comm *new_comm)
TECA_EXPORT int mpi_rank_0(MPI_Comm comm)
return non-zero if this process is MPI rank 0
TECA_EXPORT int equipartition_communicator(MPI_Comm comm, int new_comm_size, MPI_Comm *new_comm)