ParallelOverlappingILU0_impl.hpp
Go to the documentation of this file.
1/*
2 Copyright 2015, 2022 Dr. Blatt - HPC-Simulation-Software & Services
3 Copyright 2015 Statoil AS
4
5 This file is part of the Open Porous Media project (OPM).
6
7 OPM is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 OPM is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with OPM. If not, see <http://www.gnu.org/licenses/>.
19*/
20
22
23#include <dune/common/version.hh>
24
25#include <dune/istl/ilu.hh>
26#include <dune/istl/owneroverlapcopy.hh>
27
28#include <opm/common/ErrorMacros.hpp>
29#include <opm/common/TimingMacros.hpp>
30
33
34#include <cassert>
35
36namespace Opm
37{
38namespace detail
39{
40
42template<class M>
43void ghost_last_bilu0_decomposition (M& A, std::size_t interiorSize)
44{
45 OPM_TIMEBLOCK(GhostLastBlockILU0Decomp);
46 // iterator types
47 assert(interiorSize <= A.N());
48 using rowiterator = typename M::RowIterator;
49 using coliterator = typename M::ColIterator;
50 using block = typename M::block_type;
51
52 // implement left looking variant with stored inverse
53 for (rowiterator i = A.begin(); i.index() < interiorSize; ++i)
54 {
55 // coliterator is diagonal after the following loop
56 coliterator endij=(*i).end(); // end of row i
57 coliterator ij;
58
59 // eliminate entries left of diagonal; store L factor
60 for (ij=(*i).begin(); ij.index()<i.index(); ++ij)
61 {
62 // find A_jj which eliminates A_ij
63 coliterator jj = A[ij.index()].find(ij.index());
64
65 // compute L_ij = A_jj^-1 * A_ij
66 (*ij).rightmultiply(*jj);
67
68 // modify row
69 coliterator endjk=A[ij.index()].end(); // end of row j
70 coliterator jk=jj; ++jk;
71 coliterator ik=ij; ++ik;
72 while (ik!=endij && jk!=endjk)
73 if (ik.index()==jk.index())
74 {
75 block B(*jk);
76 B.leftmultiply(*ij);
77 *ik -= B;
78 ++ik; ++jk;
79 }
80 else
81 {
82 if (ik.index()<jk.index())
83 ++ik;
84 else
85 ++jk;
86 }
87 }
88
89 // invert pivot and store it in A
90 if (ij.index()!=i.index())
91 DUNE_THROW(Dune::ISTLError,"diagonal entry missing");
92 try {
93 (*ij).invert(); // compute inverse of diagonal block
94 }
95 catch (Dune::FMatrixError & e) {
96 DUNE_THROW(Dune::ISTLError,"ILU failed to invert matrix block");
97 }
98 }
99}
100
102template<class M, class CRS, class InvVector>
103void convertToCRS(const M& A, CRS& lower, CRS& upper, InvVector& inv)
104{
105 OPM_TIMEBLOCK(convertToCRS);
106 // No need to do anything for 0 rows. Return to prevent indexing a
107 // a zero sized array.
108 if ( A.N() == 0 )
109 {
110 return;
111 }
112
113 using size_type = typename M :: size_type;
114
115 lower.clear();
116 upper.clear();
117 inv.clear();
118 lower.resize( A.N() );
119 upper.resize( A.N() );
120 inv.resize( A.N() );
121
122 // Count the lower and upper matrix entries.
123 size_type numLower = 0;
124 size_type numUpper = 0;
125 const auto endi = A.end();
126 for (auto i = A.begin(); i != endi; ++i) {
127 const size_type iIndex = i.index();
128 size_type numLowerRow = 0;
129 for (auto j = (*i).begin(); j.index() < iIndex; ++j) {
130 ++numLowerRow;
131 }
132 numLower += numLowerRow;
133 numUpper += (*i).size() - numLowerRow - 1;
134 }
135 assert(numLower + numUpper + A.N() == A.nonzeroes());
136
137 lower.reserveAdditional( numLower );
138
139 // implement left looking variant with stored inverse
140 size_type row = 0;
141 size_type colcount = 0;
142 lower.rows_[ 0 ] = colcount;
143 for (auto i=A.begin(); i!=endi; ++i, ++row)
144 {
145 const size_type iIndex = i.index();
146
147 // eliminate entries left of diagonal; store L factor
148 for (auto j=(*i).begin(); j.index() < iIndex; ++j )
149 {
150 lower.push_back( (*j), j.index() );
151 ++colcount;
152 }
153 lower.rows_[ iIndex+1 ] = colcount;
154 }
155
156 assert(colcount == numLower);
157
158 const auto rbegini = std::make_reverse_iterator(A.begin());
159 row = 0;
160 colcount = 0;
161 upper.rows_[ 0 ] = colcount ;
162
163 upper.reserveAdditional( numUpper );
164
165 // NOTE: upper and inv store entries in reverse order, reverse here
166 // relative to ILU
167 auto rindex = [](auto it) { return std::prev(it.base()).index(); };
168 for (auto i=std::make_reverse_iterator(A.end()); i!=rbegini; ++i, ++ row )
169 {
170 const size_type iIndex = rindex(i);
171
172 // store in reverse row order
173 // eliminate entries left of diagonal; store L factor
174 for (auto j=std::make_reverse_iterator(i->end()); rindex(j)>=iIndex; ++j )
175 {
176 const size_type jIndex = rindex(j);
177 if( rindex(j) == iIndex )
178 {
179 inv[ row ] = (*j);
180 break;
181 }
182 else if ( rindex(j) >= rindex(i) )
183 {
184 upper.push_back( (*j), jIndex );
185 ++colcount ;
186 }
187 }
188 upper.rows_[ row+1 ] = colcount;
189 }
190 assert(colcount == numUpper);
191}
192
193template <class PI>
194size_t set_interiorSize( [[maybe_unused]] size_t N, size_t interiorSize, [[maybe_unused]] const PI& comm)
195{
196 return interiorSize;
197}
198
199#if HAVE_MPI
200template<>
201size_t set_interiorSize(size_t N, size_t interiorSize, const Dune::OwnerOverlapCopyCommunication<int,int>& comm)
202{
203 // Fail with a clear message when a genuinely parallel smoother level (the
204 // communicator still spans more than one rank) has a process with zero rows.
205 //
206 // This is the symptom of an unbalanced partition meeting a limitation in
207 // dune-amg's parallel coarsening: AMG triggers redistribution to fewer ranks
208 // on the *global* level size vs coarsenTarget, not on a per-rank minimum, so
209 // a small partition can coarsen to zero rows at the first coarse level while
210 // the global size is still above coarsenTarget. That level is then NOT
211 // redistributed and AMG's presmooth() runs the smoother on the empty rank and
212 // segfaults. Detect it collectively (every rank on this level calls this) and
213 // throw the same error everywhere instead of crashing.
214 //
215 // TODO: the real fix belongs in dune-amg (redistribute/accumulate based on a
216 // per-rank minimum, or make presmooth tolerate an empty local partition);
217 // tracked as separate work. Workarounds: --linear-solver=ilu0 (no CPR/AMG),
218 // a larger coarsenTarget so the first coarse level is redistributed, or fewer
219 // MPI processes.
220 if (comm.communicator().size() > 1 && comm.communicator().min(N) == 0) {
221 OPM_THROW(std::runtime_error,
222 "Empty partition: too unbalanced partition for dune-amg? "
223 "A process has zero rows on a parallel AMG coarse level that "
224 "dune-amg did not redistribute to fewer processes. "
225 "Try --linear-solver=ilu0, a larger coarsenTarget, or fewer MPI "
226 "processes.");
227 }
228
229 if (interiorSize<=N)
230 return interiorSize;
231 auto indexSet = comm.indexSet();
232 if (indexSet.size() == 0)
233 return 0;
234
235 size_t new_is = 0;
236 bool anyOwner = false;
237 for (auto idx = indexSet.begin(); idx!=indexSet.end(); ++idx)
238 {
239 if (idx->local().attribute()==1)
240 {
241 anyOwner = true;
242 auto loc = idx->local().local();
243 if (loc > new_is) {
244 new_is = loc;
245 }
246 }
247 }
248 // An owner local index of new_is implies new_is+1 interior rows (owners are
249 // ordered first). But on a partition with no owner cells (e.g. an empty/
250 // zero-row sub-system on this rank, which an LGR distribution can produce)
251 // there are zero interior rows; returning new_is+1 == 1 would exceed N == 0
252 // and trip the interiorSize_ <= A.N() assertion. Guard the empty case.
253 if (!anyOwner) {
254 return 0;
255 }
256 return new_is + 1;
257}
258#endif
259
260} // end namespace detail
261
262
263template<class Matrix, class Domain, class Range, class ParallelInfoT>
264Dune::SolverCategory::Category
266{
267 return std::is_same_v<ParallelInfoT, Dune::Amg::SequentialInformation> ?
268 Dune::SolverCategory::sequential : Dune::SolverCategory::overlapping;
269}
270
271template<class Matrix, class Domain, class Range, class ParallelInfoT>
273ParallelOverlappingILU0(const Matrix& A,
274 const int n, const field_type w,
275 MILU_VARIANT milu, bool redblack,
276 bool reorder_sphere)
277 : lower_(),
278 upper_(),
279 inv_(),
280 comm_(nullptr), w_(w),
281 relaxation_( std::abs( w - 1.0 ) > 1e-15 ),
282 A_(&reinterpret_cast<const Matrix&>(A)), iluIteration_(n),
283 milu_(milu), redBlack_(redblack), reorderSphere_(reorder_sphere)
284{
285 interiorSize_ = A.N();
286 // BlockMatrix is a Subclass of FieldMatrix that just adds
287 // methods. Therefore this cast should be safe.
288 update();
289}
290
291template<class Matrix, class Domain, class Range, class ParallelInfoT>
293ParallelOverlappingILU0(const Matrix& A,
294 const ParallelInfo& comm, const int n, const field_type w,
295 MILU_VARIANT milu, bool redblack,
296 bool reorder_sphere)
297 : lower_(),
298 upper_(),
299 inv_(),
300 comm_(&comm), w_(w),
301 relaxation_( std::abs( w - 1.0 ) > 1e-15 ),
302 A_(&reinterpret_cast<const Matrix&>(A)), iluIteration_(n),
303 milu_(milu), redBlack_(redblack), reorderSphere_(reorder_sphere)
304{
305 interiorSize_ = A.N();
306 // BlockMatrix is a Subclass of FieldMatrix that just adds
307 // methods. Therefore this cast should be safe.
308 update();
309}
310
311template<class Matrix, class Domain, class Range, class ParallelInfoT>
313ParallelOverlappingILU0(const Matrix& A,
314 const field_type w, MILU_VARIANT milu, bool redblack,
315 bool reorder_sphere)
316 : ParallelOverlappingILU0( A, 0, w, milu, redblack, reorder_sphere )
317{}
318
319template<class Matrix, class Domain, class Range, class ParallelInfoT>
321ParallelOverlappingILU0(const Matrix& A,
322 const ParallelInfo& comm, const field_type w,
323 MILU_VARIANT milu, bool redblack,
324 bool reorder_sphere)
325 : lower_(),
326 upper_(),
327 inv_(),
328 comm_(&comm), w_(w),
329 relaxation_( std::abs( w - 1.0 ) > 1e-15 ),
330 A_(&reinterpret_cast<const Matrix&>(A)), iluIteration_(0),
331 milu_(milu), redBlack_(redblack), reorderSphere_(reorder_sphere)
332{
333 interiorSize_ = A.N();
334 // BlockMatrix is a Subclass of FieldMatrix that just adds
335 // methods. Therefore this cast should be safe.
336 update();
337}
338
339template<class Matrix, class Domain, class Range, class ParallelInfoT>
341ParallelOverlappingILU0(const Matrix& A,
342 const ParallelInfo& comm,
343 const field_type w, MILU_VARIANT milu,
344 size_type interiorSize, bool redblack,
345 bool reorder_sphere)
346 : lower_(),
347 upper_(),
348 inv_(),
349 comm_(&comm), w_(w),
350 relaxation_( std::abs( w - 1.0 ) > 1e-15 ),
351 interiorSize_(interiorSize),
352 A_(&reinterpret_cast<const Matrix&>(A)), iluIteration_(0),
353 milu_(milu), redBlack_(redblack), reorderSphere_(reorder_sphere)
354{
355 // BlockMatrix is a Subclass of FieldMatrix that just adds
356 // methods. Therefore this cast should be safe.
357 assert(interiorSize <= A_->N());
358 update( );
359}
360
361template<class Matrix, class Domain, class Range, class ParallelInfoT>
363apply (Domain& v, const Range& d)
364{
365 OPM_TIMEBLOCK(apply);
366 Range& md = reorderD(d);
367 Domain& mv = reorderV(v);
368
369 // iterator types
370 using dblock = typename Range ::block_type;
371 using vblock = typename Domain::block_type;
372
373 const size_type iEnd = lower_.rows();
374 const size_type lastRow = iEnd - 1;
375 size_type upperLoopStart = iEnd - interiorSize_;
376 size_type lowerLoopEnd = interiorSize_;
377 if (iEnd != upper_.rows())
378 {
379 OPM_THROW(std::logic_error,"ILU: number of lower and upper rows must be the same");
380 }
381
382 // lower triangular solve
383 for (size_type i = 0; i < lowerLoopEnd; ++i)
384 {
385 dblock rhs( md[ i ] );
386 const size_type rowI = lower_.rows_[ i ];
387 const size_type rowINext = lower_.rows_[ i+1 ];
388
389 for (size_type col = rowI; col < rowINext; ++col)
390 {
391 lower_.values_[ col ].mmv( mv[ lower_.cols_[ col ] ], rhs );
392 }
393
394 mv[ i ] = rhs; // Lii = I
395 }
396
397 for (size_type i = upperLoopStart; i < iEnd; ++i)
398 {
399 vblock& vBlock = mv[ lastRow - i ];
400 vblock rhs ( vBlock );
401 const size_type rowI = upper_.rows_[ i ];
402 const size_type rowINext = upper_.rows_[ i+1 ];
403
404 for (size_type col = rowI; col < rowINext; ++col)
405 {
406 upper_.values_[ col ].mmv( mv[ upper_.cols_[ col ] ], rhs );
407 }
408
409 // apply inverse and store result
410 inv_[ i ].mv( rhs, vBlock);
411 }
412
413 copyOwnerToAll( mv );
414
415 if( relaxation_ ) {
416 mv *= w_;
417 }
418 reorderBack(mv, v);
419}
420
421template<class Matrix, class Domain, class Range, class ParallelInfoT>
422template<class V>
424copyOwnerToAll(V& v) const
425{
426 if( comm_ ) {
427 comm_->copyOwnerToAll(v, v);
428 }
429}
430
431template<class Matrix, class Domain, class Range, class ParallelInfoT>
433update()
434{
435 OPM_TIMEBLOCK(update);
436 // (For older DUNE versions the communicator might be
437 // invalid if redistribution in AMG happened on the coarset level.
438 // Therefore we check for nonzero size
439 if (comm_ && comm_->communicator().size() <= 0)
440 {
441 if (A_->N() > 0)
442 {
443 OPM_THROW(std::logic_error, "Expected a matrix with zero rows for an invalid communicator.");
444 }
445 else
446 {
447 // simply set the communicator to null
448 comm_ = nullptr;
449 }
450 }
451
452 int ilu_setup_successful = 1;
453 std::string message;
454 const int rank = comm_ ? comm_->communicator().rank() : 0;
455
456 if (redBlack_)
457 {
458 using Graph = Dune::Amg::MatrixGraph<const Matrix>;
459 Graph graph(*A_);
460 auto colorsTuple = colorVerticesWelshPowell(graph);
461 const auto& colors = std::get<0>(colorsTuple);
462 const auto& verticesPerColor = std::get<2>(colorsTuple);
463 auto noColors = std::get<1>(colorsTuple);
464 if ( reorderSphere_ )
465 {
466 ordering_ = reorderVerticesSpheres(colors, noColors, verticesPerColor,
467 graph, 0);
468 }
469 else
470 {
471 ordering_ = reorderVerticesPreserving(colors, noColors, verticesPerColor,
472 graph);
473 }
474 }
475
476 std::vector<std::size_t> inverseOrdering(ordering_.size());
477 {
478 OPM_TIMEBLOCK(createInverseOrdering);
479 std::size_t index = 0;
480 for (const auto newIndex : ordering_)
481 {
482 inverseOrdering[newIndex] = index++;
483 }
484 }
485
486 try
487 {
488 OPM_TIMEBLOCK(iluDecomposition);
489 if (iluIteration_ == 0) {
490
491 if (comm_) {
492 interiorSize_ = detail::set_interiorSize(A_->N(), interiorSize_, *comm_);
493 assert(interiorSize_ <= A_->N());
494 }
495
496 // create ILU-0 decomposition
497 if (ordering_.empty())
498 {
499 OPM_TIMEBLOCK(iluDecompositionUpdateMatrix);
500 if (ILU_) {
501 OPM_TIMEBLOCK(iluDecompositionCopyEntries);
502 // The ILU_ matrix is already a copy with the same
503 // sparse structure as A_, but the values of A_ may
504 // have changed, so we must copy all elements.
505 for (std::size_t row = 0; row < A_->N(); ++row) {
506 const auto& Arow = (*A_)[row];
507 auto Ait = Arow.begin();
508 auto Iit = (*ILU_)[row].begin();
509 for (; Ait != Arow.end(); ++Ait, ++Iit) {
510 *Iit = *Ait;
511 }
512 }
513 } else {
514 OPM_TIMEBLOCK(iluDecompositionDuplicateMatrix);
515 // First call, must duplicate matrix.
516 ILU_ = std::make_unique<Matrix>(*A_);
517 }
518 }
519 else
520 {
521 ILU_ = std::make_unique<Matrix>(A_->N(), A_->M(),
522 A_->nonzeroes(), Matrix::row_wise);
523 auto& newA = *ILU_;
524 // Create sparsity pattern
525 auto endcreateA = newA.createend();
526 for (auto iter = newA.createbegin(); iter != endcreateA; ++iter)
527 {
528 const auto& row = (*A_)[inverseOrdering[iter.index()]];
529 for (auto col = row.begin(), cend = row.end(); col != cend; ++col)
530 {
531 iter.insert(ordering_[col.index()]);
532 }
533 }
534 // Copy values
535 for (auto iter = A_->begin(); iter != A_->end(); ++iter)
536 {
537 auto newRow = newA.begin() + ordering_[iter.index()];
538 for (auto&& [A_ij, j] : sparseRange(*newRow))
539 {
540 (*newRow)[ordering_[j]] = A_ij;
541 }
542 }
543 }
544
545 switch (milu_)
546 {
549 break;
551 detail::milu0_decomposition ( *ILU_, detail::identityFunctor<typename Matrix::field_type>,
552 detail::signFunctor<typename Matrix::field_type> );
553 break;
555 detail::milu0_decomposition ( *ILU_, detail::absFunctor<typename Matrix::field_type>,
556 detail::signFunctor<typename Matrix::field_type> );
557 break;
559 detail::milu0_decomposition ( *ILU_, detail::identityFunctor<typename Matrix::field_type>,
560 detail::isPositiveFunctor<typename Matrix::field_type> );
561 break;
562 default:
563 if (interiorSize_ == A_->N())
564 Dune::ILU::blockILU0Decomposition( *ILU_ );
565 else
566 detail::ghost_last_bilu0_decomposition(*ILU_, interiorSize_);
567 break;
568 }
569 }
570 else {
571 // create ILU-n decomposition
572 ILU_ = std::make_unique<Matrix>(A_->N(), A_->M(), Matrix::row_wise);
573 std::unique_ptr<detail::Reorderer> reorderer, inverseReorderer;
574 if (ordering_.empty())
575 {
576 reorderer.reset(new detail::NoReorderer());
577 inverseReorderer.reset(new detail::NoReorderer());
578 }
579 else
580 {
581 reorderer.reset(new detail::RealReorderer(ordering_));
582 inverseReorderer.reset(new detail::RealReorderer(inverseOrdering));
583 }
584
585 milun_decomposition( *A_, iluIteration_, milu_, *ILU_, *reorderer, *inverseReorderer );
586 }
587 }
588 catch (const Dune::MatrixBlockError& error)
589 {
590 message = error.what();
591 std::cerr << "Exception occurred on process " << rank << " during " <<
592 "setup of ILU0 preconditioner with message: "
593 << message<<std::endl;
594 ilu_setup_successful = 0;
595 }
596
597 // Check whether there was a problem on some process
598 {
599 OPM_TIMEBLOCK(checkParallelFailure);
600 const bool parallel_failure = comm_ && comm_->communicator().min(ilu_setup_successful) == 0;
601 const bool local_failure = ilu_setup_successful == 0;
602 if (local_failure || parallel_failure)
603 {
604 throw Dune::MatrixBlockError();
605 }
606 }
607
608 // store ILU in simple CRS format
609 detail::convertToCRS(*ILU_, lower_, upper_, inv_);
610}
611
612template<class Matrix, class Domain, class Range, class ParallelInfoT>
614reorderD(const Range& d)
615{
616 if (ordering_.empty())
617 {
618 // As d is non-const in the apply method of the
619 // solver casting away constness in this particular
620 // setting is not undefined. It is ugly though but due
621 // to the preconditioner interface of dune-istl.
622 return const_cast<Range&>(d);
623 }
624 else
625 {
626 reorderedD_.resize(d.size());
627 std::size_t i = 0;
628 for (const auto index : ordering_)
629 {
630 reorderedD_[index] = d[i++];
631 }
632 return reorderedD_;
633 }
634}
635
636template<class Matrix, class Domain, class Range, class ParallelInfoT>
638reorderV(Domain& v)
639{
640 if (ordering_.empty())
641 {
642 return v;
643 }
644 else
645 {
646 reorderedV_.resize(v.size());
647 std::size_t i = 0;
648 for (const auto index : ordering_)
649 {
650 reorderedV_[index] = v[i++];
651 }
652 return reorderedV_;
653 }
654}
655
656template<class Matrix, class Domain, class Range, class ParallelInfoT>
658reorderBack(const Range& reorderedV, Range& v)
659{
660 if (!ordering_.empty())
661 {
662 std::size_t i = 0;
663 for (const auto index : ordering_)
664 {
665 v[i++] = reorderedV[index];
666 }
667 }
668}
669
670} // end namespace Opm
A two-step version of an overlapping Schwarz preconditioner using one step ILU0 as.
Definition: ParallelOverlappingILU0.hpp:131
ParallelOverlappingILU0(const Matrix &A, const int n, const field_type w, MILU_VARIANT milu, bool redblack=false, bool reorder_sphere=true)
Constructor.
Definition: ParallelOverlappingILU0_impl.hpp:273
Domain & reorderV(Domain &v)
Reorder V if needed and return a reference to it.
Definition: ParallelOverlappingILU0_impl.hpp:638
size_type interiorSize_
Definition: ParallelOverlappingILU0.hpp:350
void reorderBack(const Range &reorderedV, Range &v)
Definition: ParallelOverlappingILU0_impl.hpp:658
Range & reorderD(const Range &d)
Reorder D if needed and return a reference to it.
Definition: ParallelOverlappingILU0_impl.hpp:614
void copyOwnerToAll(V &v) const
Definition: ParallelOverlappingILU0_impl.hpp:424
Dune::SolverCategory::Category category() const override
Definition: ParallelOverlappingILU0_impl.hpp:265
void update() override
Definition: ParallelOverlappingILU0_impl.hpp:433
void apply(Domain &v, const Range &d) override
Apply the preconditoner.
Definition: ParallelOverlappingILU0_impl.hpp:363
typename matrix_type::size_type size_type
Definition: ParallelOverlappingILU0.hpp:145
typename Domain::field_type field_type
The field type of the preconditioner.
Definition: ParallelOverlappingILU0.hpp:142
void milu0_decomposition(M &A, FieldFunct< M > absFunctor=signFunctor< typename M::field_type >, FieldFunct< M > signFunctor=oneFunctor< typename M::field_type >, std::vector< typename M::block_type > *diagonal=nullptr)
void convertToCRS(const M &A, CRS &lower, CRS &upper, InvVector &inv)
compute ILU decomposition of A. A is overwritten by its decomposition
Definition: ParallelOverlappingILU0_impl.hpp:103
void milun_decomposition(const M &A, int n, MILU_VARIANT milu, M &ILU, Reorderer &ordering, Reorderer &inverseOrdering)
size_t set_interiorSize(size_t N, size_t interiorSize, const PI &comm)
Definition: ParallelOverlappingILU0_impl.hpp:194
void ghost_last_bilu0_decomposition(M &A, std::size_t interiorSize)
Compute Blocked ILU0 decomposition, when we know junk ghost rows are located at the end of A.
Definition: ParallelOverlappingILU0_impl.hpp:43
Definition: blackoilbioeffectsmodules.hh:45
MILU_VARIANT
Definition: MILU.hpp:34
@ MILU_1
sum(dropped entries)
@ MILU_2
sum(dropped entries)
@ MILU_3
sum(|dropped entries|)
@ MILU_4
sum(dropped entries)
std::vector< std::size_t > reorderVerticesPreserving(const std::vector< int > &colors, int noColors, const std::vector< std::size_t > &verticesPerColor, const Graph &graph)
! Reorder colored graph preserving order of vertices with the same color.
Definition: GraphColoring.hpp:169
std::vector< std::size_t > reorderVerticesSpheres(const std::vector< int > &colors, int noColors, const std::vector< std::size_t > &verticesPerColor, const Graph &graph, typename Graph::VertexDescriptor root)
! Reorder Vetrices in spheres
Definition: GraphColoring.hpp:189
std::tuple< std::vector< int >, int, std::vector< std::size_t > > colorVerticesWelshPowell(const Graph &graph)
Color the vertices of graph.
Definition: GraphColoring.hpp:113
Definition: MILU.hpp:76
Definition: MILU.hpp:84