<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><br><div><br><blockquote type="cite"><div>On 27 Aug 2023, at 12:14 AM, Carl-Johan Thore <carl-johan.thore@liu.se> wrote:</div><br class="Apple-interchange-newline"><div><meta charset="UTF-8"><div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;">“Well, your A00 and A11 will possibly be SBAIJ also, so you’ll end up with the same issue.”<o:p></o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;">I’m not sure I follow. Does PCFIELDSPLIT extract further submatrices from these blocks, or is there<o:p></o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;">somewhere else in the code that things will go wrong?</div></div></div></blockquote><div><br></div><div>Ah, no, you are right, in that case it should work.</div><br><blockquote type="cite"><div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;">For the MATNEST I was thinking to get some savings from the block-symmetry at least<o:p></o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;">even if symmetry in A00 and A11 cannot be exploited; using SBAIJ for them would just be a<o:p></o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;">(pretty big) bonus.<o:p></o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;"><o:p> </o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;">“I’ll rebase on top of main and try to get it integrated if it could be useful to you (but I’m traveling<o:p></o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;">right now so everything gets done more slowly, sorry).”<o:p></o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;">Sound great, Thanks again!</div></div></blockquote><div><br></div><div>The MR is there <a href="https://gitlab.com/petsc/petsc/-/merge_requests/6841">https://gitlab.com/petsc/petsc/-/merge_requests/6841</a>.</div><div>I need to add a new code path in MatCreateRedundantMatrix() to make sure the resulting Mat is indeed SBAIJ, but that is orthogonal to the PCFIELDSPLIT issue.</div><div>The branch should be usable in its current state.</div><div><br></div><div>Thanks,</div><div>Pierre</div><div><br></div><blockquote type="cite"><div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;"><o:p> </o:p></div><div><div style="border-width: 1pt medium medium; border-style: solid none none; border-color: rgb(225, 225, 225) currentcolor currentcolor; border-image: none; padding: 3pt 0cm 0cm;"><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;"><b>From:</b><span class="Apple-converted-space"> </span>Pierre Jolivet <pierre.jolivet@lip6.fr><span class="Apple-converted-space"> </span><br><b>Sent:</b><span class="Apple-converted-space"> </span>Saturday, August 26, 2023 4:36 PM<br><b>To:</b><span class="Apple-converted-space"> </span>Carl-Johan Thore <carl-johan.thore@liu.se><br><b>Cc:</b><span class="Apple-converted-space"> </span>Carl-Johan Thore <carljohanthore@gmail.com>; petsc-users@mcs.anl.gov<br><b>Subject:</b><span class="Apple-converted-space"> </span>Re: [petsc-users] PCFIELDSPLIT with MATSBAIJ<o:p></o:p></div></div></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;"><o:p> </o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;"><o:p> </o:p></div><div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;"><br><br><o:p></o:p></div><blockquote style="margin-top: 5pt; margin-bottom: 5pt;"><div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;">On 26 Aug 2023, at 11:16 PM, Carl-Johan Thore <<a href="mailto:carl-johan.thore@liu.se" style="color: blue; text-decoration: underline;">carl-johan.thore@liu.se</a>> wrote:<o:p></o:p></div></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;"><o:p> </o:p></div><div><div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;">"(Sadly) MATSBAIJ is extremely broken, in particular, it cannot be used to retrieve rectangular blocks in MatCreateSubMatrices, thus you cannot get the A01 and A10 blocks in PCFIELDSPLIT.<br>I have a branch that fixes this, but I haven’t rebased in a while (and I’m AFK right now), would you want me to rebase and give it a go, or must you stick to a release tarball?"<br><br>Ok, would be great if you could look at this! I don't need to stick to any particular branch.<br><br>Do you think MATNEST could be an alternative here?<o:p></o:p></div></div></div></blockquote><div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;"><o:p> </o:p></div></div><div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;">Well, your A00 and A11 will possibly be SBAIJ also, so you’ll end up with the same issue.<o:p></o:p></div></div><div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;">I’m using both approaches (monolithic SBAIJ or Nest + SBAIJ), it was crashing but I think it was thoroughly fixed in <a href="https://gitlab.com/petsc/petsc/-/commits/jolivet/feature-matcreatesubmatrices-rectangular-sbaij/" style="color: blue; text-decoration: underline;">https://gitlab.com/petsc/petsc/-/commits/jolivet/feature-matcreatesubmatrices-rectangular-sbaij/</a><o:p></o:p></div></div><div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;">It is ugly code on top of ugly code, so I didn’t try to get it integrated and just used the branch locally, and then moved to some other stuff.<o:p></o:p></div></div><div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;">I’ll rebase on top of main and try to get it integrated if it could be useful to you (but I’m traveling right now so everything gets done more slowly, sorry).<o:p></o:p></div></div><div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;"><o:p> </o:p></div></div><div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;">Thanks,<o:p></o:p></div></div><div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;">Pierre<o:p></o:p></div></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;"><br><br><o:p></o:p></div><blockquote style="margin-top: 5pt; margin-bottom: 5pt;"><div><div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;">My matrix is<br>[A00 A01;<br>A01^t A11]<br>so perhaps with MATNEST I can make use of the block-symmetry at least, and then use MATSBAIJ for<span class="Apple-converted-space"> </span><br>A00 and A11 if it's possible to combine matrix types which the manual seems to imply.<span class="Apple-converted-space"> </span><br><br>Kind regards<br>Carl-Johan<br><br><br><br><o:p></o:p></div><blockquote style="margin-top: 5pt; margin-bottom: 5pt;"><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;">On 26 Aug 2023, at 10:09 PM, Carl-Johan Thore <<a href="mailto:carljohanthore@gmail.com" style="color: blue; text-decoration: underline;">carljohanthore@gmail.com</a>> wrote:<br><br>Hi,<br><br>I'm trying to use PCFIELDSPLIT with MATSBAIJ in PETSc 3.19.4.<span class="Apple-converted-space"> </span><br>According to the manual "[t]he fieldsplit preconditioner cannot<span class="Apple-converted-space"> </span><br>currently be used with the MATBAIJ or MATSBAIJ data formats if the<span class="Apple-converted-space"> </span><br>blocksize is larger than 1". Since my blocksize is exactly 1 it would seem that I can use PCFIELDSPLIT. But this fails with "PETSC ERROR: For symmetric format, iscol must equal isrow"<br>from MatCreateSubMatrix_MPISBAIJ. Tracing backwards one ends up in<span class="Apple-converted-space"> </span><br>fieldsplit.c at<br><br>/* extract the A01 and A10 matrices */ ilink = jac->head;<span class="Apple-converted-space"> </span><br>PetscCall(ISComplement(ilink->is_col, rstart, rend, &ccis)); if<span class="Apple-converted-space"> </span><br>(jac->offdiag_use_amat) { PetscCall(MatCreateSubMatrix(pc->mat,<span class="Apple-converted-space"> </span><br>ilink->is, ccis, MAT_INITIAL_MATRIX, &jac->B)); } else {<br> PetscCall(MatCreateSubMatrix(pc->pmat, ilink->is, ccis,<span class="Apple-converted-space"> </span><br>MAT_INITIAL_MATRIX, &jac->B)); }<br><br>This, since my A01 and A10 are not square, seems to explain why iscol is not equal to isrow.<br>From this I gather that it is in general NOT possible to use<span class="Apple-converted-space"> </span><br>PCFIELDSPLIT with MATSBAIJ even with block size 1?<br><br>Kind regards,<br>Carl-Johan</div></blockquote></div></div></blockquote></div></div></blockquote></div><br></body></html>