21 MPI_Comm_size(comm, &numProcs);
22 MPI_Comm_rank(comm, &localProc);
24 std::vector<int> local(numProcs*2, 0);
27 if (numLocalEqns < 0) {
28 throw std::runtime_error(
"fei::EqnComm ERROR, negative numLocalEqns not allowed.");
33 MPI_Allreduce(&local[0], global, numProcs, MPI_INT, MPI_MAX,
comm_);
52 globalOffsets_(globalOffsets)
60 const std::vector<int>&
84 if (proc >= numProcs) {
86 osstr <<
"fei::EqnComm::getOwnerProc: input eqn="<<eqn<<
", proc="<<proc
87 <<
", ERROR, proc should be in [0.."<<numProcs-1<<
"].";
88 throw std::runtime_error(std::string(osstr.str().c_str()));
int getOwnerProc(int eqn) const
std::vector< int > globalOffsets_
EqnComm(MPI_Comm comm, int numLocalEqns)
const std::vector< int > & getGlobalOffsets() const
int localProc(MPI_Comm comm)
#define FEI_OSTRINGSTREAM
int numProcs(MPI_Comm comm)