8 #ifndef COMMON_LIBMESH_CODE_MPI_CARL_TOOLS_H_
9 #define COMMON_LIBMESH_CODE_MPI_CARL_TOOLS_H_
17 std::unordered_map<int,int>& index_map,
18 const libMesh::Parallel::Communicator& CommComm,
22 inline void MPI_reduce_vector(std::vector<T> & r,
int root,
const libMesh::Parallel::Communicator& Comm)
24 if (Comm.size() > 1 && !r.empty())
26 libmesh_assert(Comm.verify(r.size()));
28 std::vector<T> temp(r);
29 MPI_Reduce(&temp[0], &r[0], libMesh::cast_int<int>(r.size()),
30 libMesh::Parallel::StandardType<T>(&temp[0]), MPI_SUM, root,
void broadcast_index_unordered_map(std::unordered_map< int, int > &index_map, const libMesh::Parallel::Communicator &CommComm, int origin_rank=0)
void MPI_reduce_vector(std::vector< T > &r, int root, const libMesh::Parallel::Communicator &Comm)