Template Function opensn::MapAllToAll

Function Documentation

template<typename K, class T>
std::map<K, std::vector<T>> opensn::MapAllToAll(const std::map<K, std::vector<T>> &pid_data_pairs, const mpi::Communicator &comm = opensn::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.