Chi-Tech
chi_mpi_utils.h
Go to the documentation of this file.
1#ifndef CHITECH_CHI_MPI_UTILS_H
2#define CHITECH_CHI_MPI_UTILS_H
3
5
6namespace chi_mpi_utils
7{
8/**Returns the current rank on the specified communicator.*/
9int GetLocationID(MPI_Comm mpi_comm);
10/**Returns the total number of ranks on the specified communicator.*/
11int GetProcessCount(MPI_Comm mpi_comm);
12
13/**Given each location's local size (of items), builds a vector (dimension
14* comm-size plus 1) of where each location's global indices start and end.
15* Example: location i starts at extents[i] and ends at extents[i+1]*/
16std::vector<uint64_t> BuildLocationExtents(uint64_t local_size, MPI_Comm comm);
17}//namespace chi_mpi_utils
18
19#endif //CHITECH_CHI_MPI_UTILS_H
int GetProcessCount(MPI_Comm mpi_comm)
std::vector< uint64_t > BuildLocationExtents(uint64_t local_size, MPI_Comm comm)
int GetLocationID(MPI_Comm mpi_comm)
Definition: chi_mpi_utils.cc:7