12 #ifndef MFEM_COMMUNICATION
13 #define MFEM_COMMUNICATION
15 #include "../config/config.hpp"
49 int MyRank() {
int r; MPI_Comm_rank(MyComm, &r);
return r; }
50 int NRanks() {
int s; MPI_Comm_size(MyComm, &s);
return s; }
59 bool IAmMaster(
int g)
const {
return (groupmaster_lproc[g] == 0); }
65 {
return lproc_proc[groupmaster_lproc[g]]; }
82 MPI_Request *requests;
87 template <
class T>
static inline MPI_Datatype Get_MPI_Datatype();
105 template <
class T>
void Bcast(T *ldata);
122 { Reduce<T>((T *)ldata, Op); }
125 template <
class T>
static void Sum(OpData<T>);
127 template <
class T>
static void Min(OpData<T>);
129 template <
class T>
static void Max(OpData<T>);
131 template <
class T>
static void BitOR(OpData<T>);
int GetGroupMasterRank(int g) const
void Create(ListOfIntegerSets &groups, int mpitag)
int Size() const
Logical size of the array.
void Bcast(Array< T > &ldata)
int GetGroupMasterGroup(int g) const
GroupCommunicator(GroupTopology >)
GroupTopology(MPI_Comm comm)
int GetGroupSize(int g) const
const int * GetGroup(int g) const
void GetRow(int i, Array< int > &row) const
Return row i in array row (the Table must be finalized)
void Reduce(Array< T > &ldata, void(*Op)(OpData< T >))
bool IAmMaster(int g) const
static void Sum(OpData< T >)
Reduce operation Sum, instantiated for int and double.
int GetNumNeighbors() const
void Finalize()
Allocate internal buffers after the GroupLDofTable is defined.
static void Min(OpData< T >)
Reduce operation Min, instantiated for int and double.
int Size() const
Returns the number of TYPE I elements.
GroupTopology & GetGroupTopology()
Get a reference to the group topology object.
int GetGroupMaster(int g) const
int GetNeighborRank(int i) const
static void Max(OpData< T >)
Reduce operation Max, instantiated for int and double.
void Reduce(T *ldata, void(*Op)(OpData< T >))
void Create(Array< int > &ldof_group)
static void BitOR(OpData< T >)
Reduce operation bitwise OR, instantiated for int only.