Chi-Tech
chi_mpi_utils Namespace Reference

Functions

int GetLocationID (MPI_Comm mpi_comm)
 
int GetProcessCount (MPI_Comm mpi_comm)
 
std::vector< uint64_t > BuildLocationExtents (uint64_t local_size, MPI_Comm comm)
 
template<typename K , class T >
std::map< K, std::vector< T > > MapAllToAll (const std::map< K, std::vector< T > > &pid_data_pairs, const MPI_Datatype data_mpi_type, const MPI_Comm communicator=Chi::mpi.comm)
 

Function Documentation

◆ BuildLocationExtents()

std::vector< uint64_t > chi_mpi_utils::BuildLocationExtents ( uint64_t  local_size,
MPI_Comm  comm 
)

Given each location's local size (of items), builds a vector (dimension comm-size plus 1) of where each location's global indices start and end. Example: location i starts at extents[i] and ends at extents[i+1]

Definition at line 27 of file chi_mpi_utils.cc.

◆ GetLocationID()

int chi_mpi_utils::GetLocationID ( MPI_Comm  mpi_comm)

Returns the current rank on the specified communicator.

Definition at line 7 of file chi_mpi_utils.cc.

◆ GetProcessCount()

int chi_mpi_utils::GetProcessCount ( MPI_Comm  mpi_comm)

Returns the total number of ranks on the specified communicator.

Definition at line 16 of file chi_mpi_utils.cc.

◆ MapAllToAll()

template<typename K , class T >
std::map< K, std::vector< T > > chi_mpi_utils::MapAllToAll ( const std::map< K, std::vector< T > > &  pid_data_pairs,
const MPI_Datatype  data_mpi_type,
const MPI_Comm  communicator = Chi::mpi.comm 
)

Given a map with keys indicating the destination process-ids and the values for each key a list of values of type T (T must have an MPI_Datatype). Returns a map with the keys indicating the source process-ids and the values for each key a list of values of type T (sent by the respective process).

The keys must be "castable" to int.

Also expects the MPI_Datatype of T.

Definition at line 25 of file chi_mpi_utils_map_all2all.h.