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
*/
16
TECA_EXPORT
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
*/
23
TECA_EXPORT
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
28
TECA_EXPORT
29
int
mpi_rank_0
(MPI_Comm comm);
30
};
31
32
#endif
teca_mpi_util::mpi_rank_0
TECA_EXPORT int mpi_rank_0(MPI_Comm comm)
return non-zero if this process is MPI rank 0
teca_mpi_util
Codes dealing with MPI.
Definition:
teca_mpi_util.h:10
teca_mpi_util::equipartition_communicator
TECA_EXPORT int equipartition_communicator(MPI_Comm comm, int new_comm_size, MPI_Comm *new_comm)
teca_mpi_util::split_communicator
TECA_EXPORT int split_communicator(MPI_Comm comm, int group_size, MPI_Comm *new_comm)
teca_error::TECA_EXPORT
p_teca_error_handler error_handler TECA_EXPORT
The global error handler instance.
stable
core
teca_mpi_util.h
Generated on Wed Jun 22 2022 00:00:21 for TECA by
1.8.17