37#include "dune/istl/bcrsmatrix.hh"
64 template <
class Subdomain>
70 size_t size()
const {
return slots.size(); }
71 bool has(
size_t id)
const {
return id < slots.size() && bool(slots[
id]); }
76 throw std::runtime_error(
"access to non-owned BDDC subdomain");
83 throw std::runtime_error(
"access to non-owned BDDC subdomain");
87 template <
class... Args>
90 slots[id] = std::make_unique<Subdomain>(std::forward<Args>(args)...);
94 std::vector<std::unique_ptr<Subdomain>> slots;
127 template <
int m=1,
class Index=
size_t>
142 std::vector<Index>
const& subdomainSize,
159 std::vector<Index>
const& subdomainSize,
161 std::vector<int>
const& partitions);
178 template <
class Scalar=
double>
199 assert(0 <=
id &&
id <
static_cast<int>(cornerDofs_.size()));
200 return cornerDofs_[id];
205 assert(0 <=
id &&
id <
static_cast<int>(interfaceClassifications_.size()));
206 return interfaceClassifications_[id];
210 std::vector<Interfaces> ifs;
212 std::vector<Index> subdomainSize;
214 std::vector<std::vector<std::vector<int>>> cifs;
215 std::array<int,3> ifCount;
216 std::vector<std::vector<int>> cornerDofs_;
217 std::vector<InterfaceClassification> interfaceClassifications_;
262 template <
int m,
class Scalar_=double,
class CoarseScalar=Scalar_,
263 class Transfer=SpaceTransfer<m,Scalar_>>
311 template <
int cComponents>
329 template <
class Interface>
331 bool excludeCornersFromCompression =
false);
370 trans.getInterfaceAveragingWeights(s,rho);
380 trans.setInterfaceAveragingWeights(s,rho);
443 trans.getInterfaceResidualUpdate(s,dres);
453 trans.setInterfaceResidualUpdate(s,dres);
551 trans.preProlongate(du);
561 trans.getInterfaceValues(s,values);
571 trans.setInterfaceValues(s,values);
629 flexibleCg = enabled;
632 cgUseOriginalResidual =
true;
633 previousCgResidual.resize(nx);
634 previousCgResidual = 0;
659 for (
int i: globalIndex_notActive) result[i] = 0;
667 trans.diagnosticProlongationWeights(weights);
668 for (
int i: globalIndex_notActive) weights[i] = 0;
685 return activeSubdomains_sub;
690 activeSubdomains_sub.resize(activeSubdomains_.size());
692 for (
int i = 0; i < activeSubdomains_.size(); ++i)
694 activeSubdomains_sub[i] = activeSubdomains_[i];
719 bool cgUseOriginalResidual =
false;
720 bool flexibleCg =
false;
721 Vector previousCgResidual;
731 bool activeId =
true;
733 std::vector<int> interiorDofs;
734 std::vector<int> interfaceDofs;
735 std::vector<bool> activeSubdomains_sub;
737 Vector rawCorrection, residual, restrictedResidual;
739 std::vector<int> globalIndex_notActive;
743std::vector<int> cIndices;
750 void solveDirichlet(
Vector& x,
Vector const& rhs)
const;
760 template <
class Subdomain,
class Storage=std::vector<Subdomain>>
771 bool master_worker=
false);
797 return subdomains->size();
800 std::vector<DynamicMatrix<Dune::FieldMatrix<Scalar,1,1>>>
getS()
const;
818 return activeSubdomains;
823 activeSubdomains.resize(
size());
824 for (
int i = 0; i < activeIds.size(); ++i)
825 activeSubdomains[activeIds[i]] =
true;
837 return std::array<int,6>{exchangeCount,transfers,initTraffic,restrictionTraffic,
838 prolongationTraffic,coarseGridTraffic};
862 histogramOutputDirectory = std::move(directory);
868 for (
int i=0;i<subdomains->size();++i)
871 auto& transfer=(*subdomains)[i].transfer();
872 if constexpr (
requires { transfer.setSymbolHistogramOutput(std::string{}); })
873 transfer.setSymbolHistogramOutput(directory.empty() ? std::string{} :
874 directory+
"/subdomain"+std::to_string(i));
875 else if (!directory.empty())
876 throw std::runtime_error(
"Selected transfer cannot record packet histograms");
885 codebookRebuildInterval = interval;
891 forceRestrictCodebookRebuild =
true;
892 forceProlongateCodebookRebuild =
true;
899 mpiLayout.configure(enabled,
size());
909 if (restrictionTraffic || prolongationTraffic)
910 throw std::logic_error(
"Configure MPI routing before the first BDDC exchange");
912 throw std::invalid_argument(
"Destination routing requires MPI BDDC");
913 destinationRouting = enabled;
916 nodeTopology.configure();
919 std::cout <<
"BDDC MPI routing: destination; shared-memory domains="
920 << nodeTopology.nodes() <<
"; rank leaders=";
921 for (
auto leader : nodeTopology.leaders()) std::cout <<
' ' << leader;
922 std::cout <<
"; compression policy=unchanged\n";
928 int mpiRank()
const {
return mpiLayout.rank(); }
929 int mpiSize()
const {
return mpiLayout.size(); }
933 int mpiOwner(
int subdomain)
const {
return mpiLayout.owner(subdomain); }
934 bool mpiOwns(
int subdomain)
const {
return mpiLayout.owns(subdomain); }
937 if constexpr (
requires(Storage
const& storage) { storage.has(0); })
938 return subdomains->has(subdomain);
944 return storageHas(subdomain) && activeSubdomains[subdomain]
950 std::vector<std::pair<int,int>> neighbors;
951 std::vector<bool> activeSubdomains;
955 int exchangeCount = 0;
958 int restrictionTraffic = 0;
959 int prolongationTraffic = 0;
960 int coarseGridTraffic = 0;
963 int codebookRebuildInterval = 0;
964 int restrictExchangeCount = 0;
965 int prolongateExchangeCount = 0;
966 bool forceRestrictCodebookRebuild =
false;
967 bool forceProlongateCodebookRebuild =
false;
968 std::string histogramOutputDirectory;
970 bool destinationRouting =
false;
974#ifdef KASKADE_HAVE_MPI
976 void mpiInitializeAveragingWeights();
979 void mpiRestrictExchange();
980 void mpiProlongateExchange();
1078 template <
class Domain>
1099 , constraints(domain->size())
1100 , localConstraintsSize(domain->size())
1101 , sOffsets(constr.size()+1)
1106 for (
int k=0; k<constr.size(); ++k)
1108 auto const& [s,m] = constr[k];
1111 assert(0<=i && i<domain->size());
1112 constraints[i].push_back(k);
1113 localConstraintsSize[i] += m;
1117 std::partial_sum(begin(sOffsets),end(sOffsets),begin(sOffsets));
1121 int const ns = sOffsets.back();
1125 for (
auto const& ss: constraints)
1129 sOffsets[sCol],sOffsets[sCol+1]);
1135 using SortedIdx = std::vector<std::pair<int,int>>;
1137 auto localSchurComplements = domain->getS();
1138 for (
int i=0; i<domain->size(); ++i)
1143 if (!domain->storageHas(i) ||
1144 (domain->mpiEnabled() && !domain->mpiOwns(i)))
1148 int localIndex = 0 ;
1149 for (
int k: constraints[i])
1150 for (
int l=sOffsets[k]; l<sOffsets[k+1]; ++l)
1151 rows.push_back({l,localIndex++});
1152 assert(std::is_sorted(rows.begin(),rows.end(),
FirstLess()));
1154 lm.
back() = localSchurComplements[i];
1159#ifdef KASKADE_HAVE_MPI
1160 if (domain->mpiEnabled())
1165 reduceCoarseMatrix(S);
1182 int const ns = sOffsets.back();
1191 timer.
start(
"get Schur rhs");
1193 getRightHandSide(f);
1194 timer.
stop(
"get Schur rhs");
1197 std::vector<int> d(ns,1);
1198 for (
int i=0; i<domain->size(); ++i)
1200 if(not domain->getActiveSubdomains()[i])
1202 for (
auto const k: constraints[i])
1204 int const off = sOffsets[k];
1205 int const nsk = sOffsets[k+1]-off;
1206 for (
int l=0; l<nsk; ++l)
1212 std::vector<size_t> d_AA;
1213 for (
int i = 0; i < ns; ++i)
1215 if(d[i]!=0) d_AA.push_back(i);
1218 bool solveHere =
true;
1219#ifdef KASKADE_HAVE_MPI
1220 solveHere = !domain->mpiMasterWorker() || domain->mpiIsMaster();
1225 bool const fullCoarseSystem = d_AA.size() ==
static_cast<size_t>(ns);
1226 if (solveHere && !fullCoarseSystem
1227 && (!activeFactorizationReady || factoredActiveDofs != d_AA))
1233 factoredActiveDofs = d_AA;
1234 activeFactorizationReady =
true;
1238 Vector f_AA(d_AA.size());
1239 for (
int i = 0; i < d_AA.size(); ++i)
1241 f_AA[i] = f[d_AA[i]];
1244 timer.
start(
"solve Schur system");
1248 if (fullCoarseSystem)
1249 Sinv.apply(s_AA,f_AA);
1251 Sinv_AA.apply(s_AA,f_AA);
1253 timer.
stop(
"solve Schur system");
1260 for (
int i = 0; i < d_AA.size(); ++i)
1262 s[d_AA[i]] = s_AA[i];
1265#ifdef KASKADE_HAVE_MPI
1266 if (domain->mpiMasterWorker())
1268 std::vector<double> coarse(ns, 0.0);
1269 if (domain->mpiIsMaster())
1270 for (
int i = 0; i < ns; ++i)
1271 coarse[i] = s[i][0];
1272 MPI_Bcast(coarse.data(), ns, MPI_DOUBLE, 0, MPI_COMM_WORLD);
1273 for (
int i = 0; i < ns; ++i)
1274 s[i][0] = coarse[i];
1278 timer.
start(
"set corrections");
1279 std::vector<Vector> dcs(domain->size());
1280 for (
int i=0; i<domain->size(); ++i)
1282 Vector si(localConstraintsSize[i]);
1283 if(domain->activeOnThisRank(i))
1287 for (
auto const k: constraints[i])
1289 int const off = sOffsets[k];
1290 int const nsk = sOffsets[k+1]-off;
1291 for (
int l=0; l<nsk; ++l)
1292 si[pos++] = s[l+off];
1302 domain->setCorrections(dcs);
1303 timer.
stop(
"set corrections");
1309 void getRightHandSide(Vector& f)
const
1312 auto floc = domain->getSchurResiduals();
1314 for (
int i=0; i<domain->size(); ++i)
1316 if(domain->activeOnThisRank(i))
1319 for (
auto const k: constraints[i])
1321 int const off = sOffsets[k];
1322 int const nsk = sOffsets[k+1]-off;
1323 for (
int l=0; l<nsk; ++l)
1324 f[l+off] += floc[i][pos++];
1329#ifdef KASKADE_HAVE_MPI
1330 if (domain->mpiEnabled())
1341 std::vector<std::vector<int>> constraints;
1342 std::vector<int> localConstraintsSize;
1343 std::vector<int> sOffsets;
1344 DirectSolver<Vector,Vector> Sinv;
1345 DirectSolver<Vector,Vector> Sinv_AA;
1346 std::vector<size_t> factoredActiveDofs;
1347 bool activeFactorizationReady =
false;
1349 NumaBCRSMatrix<Dune::FieldMatrix<Scalar,1,1>> S_original;
1479 template <
class Subdomain,
class Storage=std::vector<Subdomain>>
1521 double rho = std::numeric_limits<double>::quiet_NaN();
1522 double beta = std::numeric_limits<double>::quiet_NaN();
1523 double curvature = std::numeric_limits<double>::quiet_NaN();
1529 diagnosticObserver_ = std::move(observer);
1545 if (systemIteration != 0 || (enabled && !cg_solver))
1546 throw std::invalid_argument(
"Flexible CG requires CG and configuration before solving");
1547 flexibleCg_ = enabled;
1548 for (
int i=0; i<subdomains->size(); ++i)
1549 if (domain.storageHas(i) && (!domain.mpiEnabled() || domain.mpiOwns(i)))
1550 (*subdomains)[i].setFlexibleCg(enabled);
1573 bool mpi_enabled=
false,
1574 bool master_worker=
false);
1578 std::vector<int> & activeIds,
1579 bool cg_solver=
false,
1580 bool BDDC_verbose=
false,
1581 bool mpi_enabled=
false,
1582 bool master_worker=
false);
1592 if (!domain.mpiEnabled() || domain.mpiOwns(i))
1593 (*subdomains)[i].setRhs(Fs[i]);
1608 if (rhs.size() != subdomains->size())
1609 throw std::invalid_argument(
"BDDC restart RHS has wrong subdomain count");
1610 systemIteration = 0;
1615 previousNorm_ = std::numeric_limits<double>::infinity();
1616 stagnationCount_ = 0;
1619 if (domain.storageHas(i) && (!domain.mpiEnabled() || domain.mpiOwns(i)))
1621 (*subdomains)[i].resetForNewRhs();
1622 (*subdomains)[i].setRhs(rhs[i]);
1645 std::vector<XVector>& output)
1648 domain.updateIteration(0);
1649 if (domain.size()>1)
1651 for (
int pass=0; pass<restrictionPasses_; ++pass) domain.restrict();
1652 coarseSolver.solve();
1655 domain.prolongate();
1657 output.resize(rhs.size());
1660 if (domain.storageHas(i) && (!domain.mpiEnabled() || domain.mpiOwns(i)))
1662 output[i].resize(rhs[i].size());
1663 (*subdomains)[i].getSolution(output[i]);
1664 if (domain.size()>1)
1666 XVector correction(rhs[i].size());
1667 (*subdomains)[i].getCorrection(correction);
1668 output[i] += correction;
1692 return domain.traffic();
1702 domain.setHistogramOutput(std::move(directory));
1708 domain.setSymbolHistogramOutput(directory);
1723 throw std::invalid_argument(
"BDDC restriction passes must be positive");
1724 restrictionPasses_ = passes;
1730 domain.setCodebookRebuildInterval(interval);
1735 domain.setMpiEnabled(enabled);
1736 if (enabled && domain.mpiRank() == 0)
1737 std::cout <<
"BDDC MPI layout: " << domain.mpiSize()
1738 <<
" ranks, " << domain.size()
1739 <<
" subdomains, deterministic round-robin ownership\n";
1748 domain.requestCodebookRebuild();
1753 Storage* subdomains;
1757 std::vector<XVector>
const Fs;
1759 int systemIteration = 0;
1760 int restrictionPasses_ = 1;
1761 bool flexibleCg_ =
false;
1762 double sigma_pre = 0;
1763 double BDDC_verbose =
false;
1764 SolveStatus lastStatus_ = SolveStatus::updated;
1766 std::function<void(DiagnosticEvent
const&)> diagnosticObserver_;
1767 double initialP0_ = 0;
1768 double previousNorm_ = std::numeric_limits<double>::infinity();
1769 int stagnationCount_ = 0;
1773 bool hasStagnated(
double norm,
double p0)
1775 constexpr double p0RelativeThreshold = 1e-14;
1776 constexpr double relativeDecrease = 1e-3;
1778 constexpr int stagnationWindow = 3;
1780 if (initialP0_ == 0)
1781 initialP0_ = std::abs(p0);
1783 bool noMeaningfulDecrease = std::isfinite(previousNorm_)
1784 && norm >= previousNorm_ * (1.0 - relativeDecrease);
1785 stagnationCount_ = noMeaningfulDecrease ? stagnationCount_ + 1 : 0;
1786 previousNorm_ = norm;
1788 return std::abs(p0) <= p0RelativeThreshold * initialP0_
1789 && stagnationCount_ >= stagnationWindow;
MpiRoutingTraffic const & routingTraffic() const
SharedMemoryDomain< Subdomain, Storage >::CompressionTraffic compressionTraffic() const
void restartRhs(std::vector< XVector > const &rhs)
Starts a new RHS solve from zero, retaining the fixed BDDC setup.
void setSymbolHistogramOutput(std::string const &directory)
Dune::FieldVector< Scalar, m > XEntry
The scalar field type used in coefficients.
void setRhs(std::vector< XVector > &Fs)
update rhs for each subdomain
void setDiagnosticObserver(std::function< void(DiagnosticEvent const &)> observer)
SolveStatus lastStatus() const
Dune::BlockVector< XEntry > XVector
void requestCodebookRebuild()
void setFlexibleCg(bool enabled)
void setHistogramOutput(std::string directory)
CgStep const & lastCgStep() const
Read-only diagnostic; no additional operator applications or reductions.
void setRestrictionPasses(int passes)
void applyPreconditioner(std::vector< XVector > const &rhs, std::vector< XVector > &output)
Apply one BDDC preconditioner sequence to a new subassembled RHS.
void setCodebookRebuildInterval(int interval)
std::array< int, 6 > traffic() const
Reports the amount of data exchanged between subdomains.
BDDCSolver(Storage &subdomains, CoarseConstraints const &constraints, bool mpi_enabled=false, bool master_worker=false)
Constructor.
typename Subdom::Scalar Scalar
typename Subdom::Vector Vector
BDDCSolver(Storage &subdomains, CoarseConstraints const &constraints, std::vector< int > &activeIds, bool cg_solver=false, bool BDDC_verbose=false, bool mpi_enabled=false, bool master_worker=false)
void setMpiEnabled(bool enabled)
void setMpiDestinationRouting(bool enabled)
double solve()
Performs a gradient step.
std::vector< int > const & cornerDofs(int id) const
CoarseConstraints coarseConstraints() const
Provides information about subdomains sharing coarse constraints.
InterfaceAverages(std::vector< std::vector< LocalDof > > const &sharedDofs, std::vector< Index > const &subdomainSize, int types, std::vector< int > const &partitions)
Constructs averages with a caller-provided partition of shared dofs.
std::array< int, 3 > interfaceCount() const
Reports on number of corners, edges, and faces.
NumaBCRSMatrix< Dune::FieldMatrix< Scalar, m, m > > coarseConstraint(int id) const
Creates the subdomain-local constraints defining the coarse space.
static constexpr int components
InterfaceAverages(std::vector< std::vector< LocalDof > > const &sharedDofs, std::vector< Index > const &subdomainSize, int types=CORNER|FACE)
Constructor.
InterfaceClassification const & interfaceClassifications(int id) const
Interfaces const & interfaces(int id) const
For the given subdomain, tells with which neighboring domain which dofs are shared.
A class for solving a block-diagonal-structured KKT system.
void solve()
solves the system.
KKTSolver(Domain &domain_, CoarseConstraints const &constr)
Constructor.
std::tuple< int, int, int > Constraint
typename Domain::Scalar Scalar
Cache the MPI_COMM_TYPE_SHARED partition without retaining communicators. configure() is collective o...
bool has(size_t id) const
void emplace(size_t id, Args &&... args)
OwnedSubdomainStorage(size_t size)
Subdomain const & operator[](size_t id) const
Subdomain & operator[](size_t id)
A class that orchestrates the exchange of data between BDDC subdomains.
std::vector< Vector > getSchurResiduals()
Dune::FieldVector< double, 1 > updateSearchDirectionNorm()
void set_solver_type(bool cg_solver)
bool storageHas(int subdomain) const
typename Subdom::XVector XVector
void setMpiEnabled(bool enabled)
SharedMemoryDomain(Storage &subdomains, bool mpi_enabled=false, bool master_worker=false)
bool mpiOwns(int subdomain) const
int size() const
Reports the number of subdomains.
void updateSearchDirection(double beta)
void setActiveSubdomains(std::vector< int > &activeIds)
void restrict()
Performs restriction in BDDC.
MpiRoutingTraffic const & routingTraffic() const
void setMpiDestinationRouting(bool enabled)
typename Subdom::Scalar Scalar
bool mpiMasterWorker() const
std::vector< bool > getActiveSubdomains()
void updateIteration(int iteration)
Sets the iteration index within the current linear system.
bool activeOnThisRank(int subdomain) const
void setHistogramOutput(std::string directory)
typename Subdom::Vector Vector
void setCodebookRebuildInterval(int interval)
std::vector< DynamicMatrix< Dune::FieldMatrix< Scalar, 1, 1 > > > getS() const
void requestCodebookRebuild()
int mpiOwner(int subdomain) const
void updateSolution(Scalar alpha)
CompressionTraffic compressionTraffic() const
std::array< int, 6 > traffic() const
Reports the amount of data exchanged between subdomains.
Dune::FieldVector< double, 2 > prolongate()
Performs prolongation in BDDC.
void setCorrections(std::vector< Vector > const &dcs)
void setSymbolHistogramOutput(std::string const &directory)
A class representing small KKT systems on a single subdomain.
void setFlexibleCg(bool enabled)
Configured by BDDCSolver before the first update; one previous residual.
void setCorrection(Vector const &c)
Computes the correction vector .
Subdomain(int id, AMatrix const &A, Interfaces const &interfaces, NumaBCRSMatrix< Dune::FieldMatrix< Scalar, cComponents, components > > const &C)
Constructor.
Vector diagnosticExactProlongation(Vector const &averaged) const
Diagnostic-only exact prolongation of the stored raw correction. Given the globally averaged raw inte...
Dune::FieldVector< Scalar, components > XEntry
Vector diagnosticProlongationWeights() const
Actual transfer averaging weights, including the inactive-interface mask.
Dune::FieldVector< double, 1 > updateSearchDirectionNorm()
std::vector< int > neighbors() const
Reports a list of its neighbor subdomains.
Vector const & diagnosticRawCorrection() const
Snapshot of the local/coarse correction before interface communication.
XVector getSolution() const
Provides the current solution vector .
void updateSolution(Scalar alpha)
Updates the solution approximation.
void preRestrict()
First step of the restriction: Dirichlet solve.
void setInterfaceAveragingWeights(int s, XVector const &rho)
Accumulates interface weights of adjacent subdomains.
Transfer const & transfer() const
void getRawCorrection(XVector &dx) const
Vector diagnosticProlongatedCorrection() const
Current prolongated correction with the solver's inactive-DOF mask.
void setActiveId(bool active)
void getCorrection(XVector &dx) const
Provides the current correction vector .
Vector const & getRestrictedResidual() const
Dune::FieldVector< double, 2 > prolongate()
Perform averaging on the shared interfaces, projecting the solution to the subspace of functions cont...
void getS(SMatrix &S) const
Compute .
static const int components
Number of (vectorial) components of .
void getResidual(XVector &rr) const
void set_solver_type(bool cg_solver)
Set solver type.
void preProlongate()
Prepares the exchange of interface values.
void setInterfaceResidualUpdate(int s, TransmissionType const &dres)
Sets interface residual of the correction from neighboring subdomains.
void setCgUseOriginalResidual(bool enabled)
Vector const & diagnosticSearchDirection() const
Read-only views for optional CG diagnostics, before the solution update.
std::vector< bool > getActiveSubdomains()
Scalar_ Scalar
The scalar field type used in coefficients.
void getInterfaceAveragingWeights(int s, XVector &rho) const
Reports own interface averaging weights.
void getSolution(XVector &x) const
Provides the current solution vector .
void resetForNewRhs()
Clears the solution and iteration work vectors for another RHS.
Dune::BlockVector< XEntry > XVector
Subdomain(int id, AMatrix const &A, Interface const &interfaces, bool excludeCornersFromCompression=false)
Constructor.
Dune::BlockVector< Dune::FieldVector< Scalar, 1 > > Vector
void imposeDC_inActiveInterface(Vector &Aq, Vector &q)
Vector const & diagnosticPreconditionedResidual() const
void imposeDCq(Vector &q)
DynamicMatrix< Dune::FieldMatrix< Scalar, 1, 1 > > SMatrix
A matrix type with scalar entries, used for the Schur complement matrix.
void getSchurResidual(Vector &lambda) const
Provides the Schur residual.
void resetForNewSystem()
Prepares a factorized subdomain for a new solver with the same operator.
void updateSearchDirection(double beta)
Update search direction q for cg solver.
void getInterfaceResidualUpdate(int s, TransmissionType &dres) const
Gets interface residual that shall be shared with neighboring subdomain.
void setRhs(XVector const &f)
Provides a (new) right hand side for the linear equation system to be solved.
void updateIteration(int cg_itr)
typename Transfer::TransmissionType TransmissionType
A container type used for exchanging coefficients between subdomains.
NumaBCRSMatrix< Dune::FieldMatrix< Scalar, components, components > > AMatrix
void setActiveSubdomains_sub(std::vector< bool > &activeSubdomains_)
void restrict()
Performs the restriction of the residual vector.
void getInterfaceValues(int s, TransmissionType &values) const
Gets boundary values that shall be shared with neighboring subdomain.
void setInterfaceValues(int s, TransmissionType const &values)
Sets boundary values of the correction from neighboring subdomains.
A LAPACK-compatible dense matrix class with shape specified at runtime.
A structure for holding a sequence of several local matrices to be filled sequentially and to be scat...
void scatter()
Scatters the local matrices into the global one and removes them from the local container.
value_type & back()
A reference to the last pushed local matrix.
void push_back(SortedRowIdx const &ridx, SortedColIdx const &cidx)
Appends another (zero-initialized) local matrix.
A NUMA-aware compressed row storage matrix adhering mostly to the Dune ISTL interface (to complete....
A NUMA-aware creator for matrix sparsity patterns.
void addDenseBlock(Index fromRow, Index toRow, Index fromCol, Index toCol)
Enters a contiguous dense block into the sparsity pattern.
Supports gathering and reporting execution times information for nested program parts.
static Timings & instance()
Returns a reference to a single default instance.
void stop(std::string const &name)
Stops the timing of given section.
struct Times const * start(std::string const &name)
Starts or continues the timing of given section.
@ UMFPACK
UMFPack from SuiteSparse, using 32 bit integer indices.
std::vector< std::pair< int, std::vector< int > > > Interfaces
A data structure describing the interfaces of a subdomain.
InterfaceType
Discrimination of different interface types.
void parallelFor(Func const &f, int maxTasks=std::numeric_limits< int >::max())
A parallel for loop that executes the given functor in parallel on different CPUs.
std::vector< std::pair< std::vector< int >, int > > CoarseConstraints
A data structure describing coarse constraints.
std::vector< std::pair< int, int > > InterfaceClassification
Scalars of the last accepted preconditioned CG update.
A pair of subdomain id and local dof index denotes a subdomain-local reference to a global dof.
Rank-local sent payload accounting for R/P and the three endpoint classes. Count each directed interf...
std::uint64_t codebookBits
std::uint64_t decodeCount
std::uint64_t receivedBytes
std::uint64_t encodeCount
std::uint64_t originalSentBytes
std::uint64_t streamPaddingBytes
std::uint64_t originalReceivedBytes
std::uint64_t streamBytes
A comparator functor that supports sorting std::pair by their first component.