<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Hello,</div><div class=""><br class=""></div><div class="">I found the problem, I declared the communicator as nonoverlapping. Thank you!</div><div class=""><br class=""></div><div class="">Best regards,</div><div class="">Feng Xing</div><div class="">Postdoc INRIA France</div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">On 22 Jul 2016, at 16:46, Feng Xing <<a href="mailto:snakexf@gmail.com" class="">snakexf@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Dear Markus,</div><div class=""><br class=""></div><div class="">Thank you very much for the help, I do really progresse a lot to realise a small test myself. </div><div class="">However, I would like to ask a little more help about a small difficulty. Thank you very much.</div><div class=""><br class=""></div><div class="">I try to consider a 1d Poisson problem with 2 MPI procs and each proc contains 4 nodes for example (0,1,2,3 are in MPI 0 etc.).</div><div class="">I follow the example “<span class=""><a href="http://parallelamgtest.cc/" class="">parallelamgtest.cc</a></span><span class="">” in dune/istl which consider a 2d Poisson problem with parallel AMG method.</span></div><div class=""><span class="">However I got</span><span class=""> 'Dune::ISTLError’ errors.</span></div><div class=""><span class=""><br class=""></span></div><div class=""><span class="">It seems that the matrix and the index are </span>correct and also the sparse pattern is symmetric. </div><div class="">I think perhaps the error is from "AMG amg(op, criterion, smootherArgs, comm);”</div><div class="">I copy my AMG configuration also in the mail.</div><div class=""><br class=""></div><div class="">Best regards,</div><div class="">Feng Xing</div><div class="">Postdoc INRIA France </div><div class=""><br class=""></div><div class=""><b class="">MPI Proc 0:</b></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>the matrix is </div><div class=""><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);" class="">row 0 2.00e+00 -1.00e+00 . . .</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);" class="">row 1 -1.00e+00 2.00e+00 -1.00e+00 . .</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);" class="">row 2 . -1.00e+00 2.00e+00 -1.00e+00 .</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);" class="">row 3 . . -1.00e+00 2.00e+00 -1.00e+00</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);" class="">row 4 . . . 0.00e+00 1.00e+00</div></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>the index is</div><div class=""><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);" class="">{global=0, local={local=0, attr=1, public=1}}</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);" class="">{global=1, local={local=1, attr=1, public=1}}</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);" class="">{global=2, local={local=2, attr=1, public=1}}</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);" class="">{global=3, local={local=3, attr=1, public=1}}</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);" class="">{global=4, local={local=4, attr=3, public=1}}</div></div><div class=""><br class=""></div><div class=""><b class="">MPI Proc 1: </b></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>the matrix is:</div><div class=""><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);" class="">row 0 1.00e+00 0.00e+00 . . .</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);" class="">row 1 -1.00e+00 2.00e+00 -1.00e+00 . .</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);" class="">row 2 . -1.00e+00 2.00e+00 -1.00e+00 .</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);" class="">row 3 . . -1.00e+00 2.00e+00 -1.00e+00</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);" class="">row 4 . . . -1.00e+00 2.00e+00</div></div><span class=""><div class=""><span class=""><span class="Apple-tab-span" style="white-space:pre"> </span>the index is:</span></div><div class=""><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);" class="">{global=3, local={local=0, attr=3, public=1}}</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);" class="">{global=4, local={local=1, attr=1, public=1}}</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);" class="">{global=5, local={local=2, attr=1, public=1}}</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);" class="">{global=6, local={local=3, attr=1, public=1}}</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);" class="">{global=7, local={local=4, attr=1, public=1}}</div></div><div class=""><span class=""><br class=""></span></div><div class=""><span class=""><b class="">AMG Configuration</b></span></div><div class=""><span class=""><div class=""> typedef Dune::Amg::CoarsenCriterion<Dune::Amg::SymmetricCriterion<BMat,Dune::Amg::FirstDiagonal> > Criterion;</div><div class=""> typedef Dune::SeqSSOR<BMat,BVec,BVec> Smoother;</div><div class=""> typedef Dune::BlockPreconditioner<BVec,BVec,Comm,Smoother> ParSmoother;</div><div class=""> typedef Dune::Amg::SmootherTraits<ParSmoother>::Arguments SmootherArgs;</div><div class=""><br class=""></div><div class=""> SmootherArgs smootherArgs;</div><div class=""> smootherArgs.iterations = 1;</div><div class=""><br class=""></div><div class=""> Criterion criterion; </div><div class=""> criterion.setNoPreSmoothSteps(1); </div><div class=""> criterion.setNoPostSmoothSteps(1);</div><div class=""> criterion.setGamma(1); // V-cycle=1, W-cycle=2</div><div class=""> criterion.setAdditive(false);</div><div class=""> criterion.setMaxLevel(2);</div><div class=""> criterion.setCoarsenTarget(4);</div><div class=""><br class=""></div><div class=""> typedef Dune::Amg::AMG<Operator,BVec,ParSmoother,Comm> AMG;</div><div class=""> AMG amg(op, criterion, smootherArgs, comm);</div><div class=""><br class=""></div></span></div><br class=""></span><span class=""><br class=""></span><div class=""><blockquote type="cite" class=""><div class="">On 18 Jul 2016, at 10:23, Markus Blatt <<a href="mailto:markus@dr-blatt.de" class="">markus@dr-blatt.de</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">On Mon, Jul 18, 2016 at 10:19:56AM +0200, Markus Blatt wrote:<br class=""><blockquote type="cite" class=""><br class="">Now you have your complete parallel index set with a global index and<br class="">a marker for each local index. Let l(i) be the function that<br class="">determines the local index of the global (PETSc) index i, them your<br class="">local matrix can be set up, if you insert an entry l(i),l(j) for each<br class="">PETSc sparse matrix entry (i,j). For all column indices g not in {n_i,<br class="">..., n_{i+1}-1}, you insert a row l(g) with a 1 on the diagonal and<br class="">zeros elsewhere. Please make sure that for a symmetric sparse matrix<br class="">the sparsity pattern should be symetric, too.<br class=""><br class=""></blockquote><br class="">Small addition: Now you can setup a parallel linear Operator by<br class="">passing the local sparse matrix and the communication object to<br class="">OverlappingSchwarzOperator. Or even write your own one.<br class=""><br class="">Markus<br class=""><br class="">-- <br class="">Dr. Markus Blatt - HPC-Simulation-Software & Services <a href="http://www.dr-blatt.de/" class="">http://www.dr-blatt.de</a><br class="">Hans-Bunte-Str. 8-10, 69123 Heidelberg, Germany<br class="">Tel.: +49 (0) 160 97590858<br class="">_______________________________________________<br class="">Dune mailing list<br class=""><a href="mailto:Dune@dune-project.org" class="">Dune@dune-project.org</a><br class=""><a href="http://lists.dune-project.org/mailman/listinfo/dune" class="">http://lists.dune-project.org/mailman/listinfo/dune</a><br class=""></div></blockquote></div><br class=""></div></div></blockquote></div><br class=""></body></html>