<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 21 Oct 2022, at 10:46 AM, TARDIEU Nicolas <<a href="mailto:nicolas.tardieu@edf.fr" class="">nicolas.tardieu@edf.fr</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta charset="UTF-8" class=""><div class="elementToProof" style="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; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">Dear Pierre,</div><div class="elementToProof" style="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; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;"><br class=""></div><div class="elementToProof" style="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; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">To complete my last post, in fact, the initial code (playing with the LGMap) was correct. It was my test case that was wrong.</div><div style="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;" class=""><div class="elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">Once fixed according to your suggestion, everything turns out to be OK.</div><div class="elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">I am nevertheless wondering if this IS embeding according to the global numbering should not be a native PTESc's feature ?</div></div></div></blockquote><div><br class=""></div><div>I’m not sure about what you are asking for here.</div><div>I believe the most efficient way to deal with your problem is to use a MatNest instead of a MatAIJ.</div><div>Then, there are several ways to extract submatrices of the global MatNest without having to deal with the embedding.</div><div><br class=""></div><div>Thanks,</div><div>Pierre </div><br class=""><blockquote type="cite" class=""><div class=""><div style="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;" class=""><div id="Signature" class=""><div class=""><div name="divtagdefaultwrapper" style="font-family: Calibri, Arial, Helvetica, sans-serif; margin: 0px;" class=""><font size="3" class=""></font><div style="margin: 0px;" class=""><font size="3" face="Calibri,sans-serif" class="">Thank you again,</font></div><font size="3" class=""></font><div style="margin: 0px;" class=""><font face="Calibri,sans-serif" class=""><font size="3" class="">Nicolas<br class=""><span style="font-size: 11pt;" class="">--</span></font><br class=""></font><font size="2" face="Arial,sans-serif" color="#ff8100" class=""><span style="font-size: 9pt;" class=""><b class="">Nicolas Tardieu</b></span></font><br class=""><div style="margin: 0px;" class=""><font size="2" face="Calibri,sans-serif" class=""><span style="font-size: 11pt;" class=""><font size="1" face="Arial,sans-serif" color="#ff8100" class=""><span style="font-size: 8pt;" class=""><b class="">Ing PhD Computational Mechanics</b></span></font><font size="1" face="Arial,sans-serif" color="#ff8100" class=""><span style="font-size: 8pt;" class=""><b class=""><br class=""></b></span></font></span></font></div><div style="margin: 0px;" class=""><font size="2" face="Calibri,sans-serif" class=""><span style="font-size: 11pt;" class=""><font size="1" face="Arial,sans-serif" color="#0062e1" class=""><span lang="en-US" style="font-size: 8pt;" class="">EDF - R&D Dpt ERMES</span></font><font size="1" face="Helv,sans-serif" color="#0062e1" class=""><span lang="en-US" style="font-size: 2pt;" class=""><br class=""></span></font></span></font></div><div style="margin: 0px;" class=""><span style="font-family: Arial, sans-serif; font-size: 8pt; color: rgb(0, 98, 225); background-color: rgba(0, 0, 0, 0);" class="">PARIS-SACLAY, FRANCE</span></div></div></div></div></div></div><div id="appendonsend" style="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;" class=""></div><hr tabindex="-1" style="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; display: inline-block; width: 817.3125px;" class=""><span style="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; float: none; display: inline !important;" class=""></span><div id="divRplyFwdMsg" dir="ltr" style="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;" class=""><font face="Calibri, sans-serif" style="font-size: 11pt;" class=""><b class="">De :</b><span class="Apple-converted-space"> </span>TARDIEU Nicolas <<a href="mailto:nicolas.tardieu@edf.fr" class="">nicolas.tardieu@edf.fr</a>><br class=""><b class="">Envoyé :</b><span class="Apple-converted-space"> </span>jeudi 20 octobre 2022 11:45<br class=""><b class="">À :</b><span class="Apple-converted-space"> </span><a href="mailto:pierre@joliv.et" class="">pierre@joliv.et</a> <<a href="mailto:pierre@joliv.et" class="">pierre@joliv.et</a>><br class=""><b class="">Cc :</b><span class="Apple-converted-space"> </span><a href="mailto:petsc-users@mcs.anl.gov" class="">petsc-users@mcs.anl.gov</a> <<a href="mailto:petsc-users@mcs.anl.gov" class="">petsc-users@mcs.anl.gov</a>><br class=""><b class="">Objet :</b><span class="Apple-converted-space"> </span>RE: [petsc-users] Trouble with ISEmbed</font><div class=""> </div></div><div dir="ltr" style="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;" class=""><div class="x_elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">Dear Pierre,</div><div class="x_elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;"><br class=""></div><div class="x_elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">You fixed the problem! Thank you warmly for your precious help.</div><div class=""><div id="x_Signature" class=""><div class=""><div name="x_divtagdefaultwrapper" style="font-family: Calibri, Arial, Helvetica, sans-serif; margin: 0px;" class=""></div><div name="x_divtagdefaultwrapper" style="font-family: Calibri, Arial, Helvetica, sans-serif; margin: 0px;" class=""><div style="margin: 0px;" class=""><font size="3" face="Calibri,sans-serif" class=""><br class=""></font></div><font size="3" class=""></font><div style="margin: 0px;" class=""><font size="3" face="Calibri,sans-serif" class="">Best regards,<span class="Apple-converted-space"> </span></font></div><font size="3" class=""></font><div style="margin: 0px;" class=""><font face="Calibri,sans-serif" class=""><font size="3" class="">Nicolas<br class=""><span style="font-size: 11pt;" class="">--</span></font><br class=""></font><font size="2" face="Arial,sans-serif" color="#ff8100" class=""><span style="font-size: 9pt;" class=""><b class="">Nicolas Tardieu</b></span></font><br class=""><div style="margin: 0px;" class=""><font size="2" face="Calibri,sans-serif" class=""><span style="font-size: 11pt;" class=""><font size="1" face="Arial,sans-serif" color="#ff8100" class=""><span style="font-size: 8pt;" class=""><b class="">Ing PhD Computational Mechanics</b></span></font><font size="1" face="Arial,sans-serif" color="#ff8100" class=""><span style="font-size: 8pt;" class=""><b class=""><br class=""></b></span></font></span></font></div><div style="margin: 0px;" class=""><font size="2" face="Calibri,sans-serif" class=""><span style="font-size: 11pt;" class=""><font size="1" face="Arial,sans-serif" color="#0062e1" class=""><span lang="en-US" style="font-size: 8pt;" class="">EDF - R&D Dpt ERMES</span></font><font size="1" face="Helv,sans-serif" color="#0062e1" class=""><span lang="en-US" style="font-size: 2pt;" class=""><br class=""></span></font></span></font></div><div style="margin: 0px;" class=""><span style="font-family: Arial, sans-serif; font-size: 8pt; color: rgb(0, 98, 225); background-color: rgba(0, 0, 0, 0);" class="">PARIS-SACLAY, FRANCE</span></div></div></div></div></div></div><div id="x_appendonsend" class=""></div><hr tabindex="-1" style="display: inline-block; width: 817.3125px;" class=""><div id="x_divRplyFwdMsg" dir="ltr" class=""><font face="Calibri, sans-serif" style="font-size: 11pt;" class=""><b class="">De :</b><span class="Apple-converted-space"> </span><a href="mailto:pierre@joliv.et" class="">pierre@joliv.et</a> <<a href="mailto:pierre@joliv.et" class="">pierre@joliv.et</a>><br class=""><b class="">Envoyé :</b><span class="Apple-converted-space"> </span>mercredi 19 octobre 2022 22:22<br class=""><b class="">À :</b><span class="Apple-converted-space"> </span>TARDIEU Nicolas <<a href="mailto:nicolas.tardieu@edf.fr" class="">nicolas.tardieu@edf.fr</a>><br class=""><b class="">Cc :</b><span class="Apple-converted-space"> </span><a href="mailto:petsc-users@mcs.anl.gov" class="">petsc-users@mcs.anl.gov</a> <<a href="mailto:petsc-users@mcs.anl.gov" class="">petsc-users@mcs.anl.gov</a>><br class=""><b class="">Objet :</b><span class="Apple-converted-space"> </span>Re: [petsc-users] Trouble with ISEmbed</font><div class=""> </div></div><div class=""><div class="" style="word-wrap: break-word; line-break: after-white-space;">Sorry, I’m not very proficient in petsc4py, and there are a bunch of interfaces missing, e.g., ISShift(), so it may not be optimal, but I hope you’ll understand.<div class="">First, you’ll need to regenerate the .bin by uncommenting the proper part of the code.</div><div class="">That is because you were initially generating a 20x20 matrix, with 4 fields per unknown.</div><div class="">That’s 5 unknowns, and so, with two processes, 10 rows per process is not consistent as 10/4 is not an integer — I don’t know how to force, in petsc4py, the local size to 12 on process #0 and 8 on process #1.</div><div class="">The modified code generates a 16x16 matrices so it remains consistent.</div><div class="">If you then run the first part of the program, you’ll get both B_uu and B_pp from B instead of A, with one, two, or four processes.</div><div class="">Again, that should work for arbitrary number of processes, you just need to be careful that your local dimensions are consistent with the number of fields.</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Pierre</div><div class=""> </div><div class=""></div></div><div class="" style="word-wrap: break-word; line-break: after-white-space;"><div class=""><br class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">On 19 Oct 2022, at 5:01 PM, Pierre Jolivet <<a href="mailto:pierre@joliv.et" class="">pierre@joliv.et</a>> wrote:</div><br class="x_x_x_Apple-interchange-newline"><div class=""><br class="x_x_x_Apple-interchange-newline"><br class="" style="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; text-decoration: none;"><blockquote type="cite" class="" style="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; text-decoration: none;"><div class="">On 19 Oct 2022, at 4:32 PM, TARDIEU Nicolas <<a href="mailto:nicolas.tardieu@edf.fr" class="">nicolas.tardieu@edf.fr</a>> wrote:</div><br class="x_x_x_Apple-interchange-newline"><div class=""><div class="x_x_x_elementToProof" style="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; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">Dear Pierre,</div><div class="x_x_x_elementToProof" style="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; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;"><br class=""></div><div class="x_x_x_elementToProof" style="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; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">Thank you very much for your answer. I have the same explanation as you for the code I sent. </div><div class="" style="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; text-decoration: none;"><div class="x_x_x_elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">But what I would like to do is the following : I have the full matrix A with fields u, p and t (which are interlaced in the real application). I want to extract B=A(u+p, u+p). *Then* I would like to extract the (u, u) block from B - let us call it B_uu.</div><div class="x_x_x_elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">In fact, B_uu=A_uu but I really need to do the extraction from B.</div><div class="x_x_x_elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">And I am missing something since I have to play with different numberings when switching the IS from A to B.</div><div id="x_x_x_Signature" class=""><div class=""><div name="x_x_x_divtagdefaultwrapper" class="" style="font-family: Calibri, Arial, Helvetica, sans-serif; margin: 0px;"></div><div name="x_x_x_divtagdefaultwrapper" class="" style="font-family: Calibri, Arial, Helvetica, sans-serif; margin: 0px;"><div class="" style="margin: 0px;"><font size="3" face="Calibri,sans-serif" class=""><br class=""></font></div><div class="" style="margin: 0px;"><font size="3" face="Calibri,sans-serif" class="">Is it clear enough ???? </font></div></div></div></div></div></div></blockquote><div class="" style="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; text-decoration: none;"><br class=""></div><div class="" style="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; text-decoration: none;">That’s cristal clear.</div><div class="" style="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; text-decoration: none;">If the fields are interlaced, that’s actually easier to do, because you preserve the distribution, and there is less data movement.</div><div class="" style="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; text-decoration: none;">I’ll try to fix your code in the case where the fields are interlaced if now one gives you another answer in the meantime.</div><div class="" style="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; text-decoration: none;"><br class=""></div><div class="" style="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; text-decoration: none;">Thanks,</div><div class="" style="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; text-decoration: none;">Pierre</div><br class="" style="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; text-decoration: none;"><blockquote type="cite" class="" style="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; text-decoration: none;"><div class=""><div class="" style="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; text-decoration: none;"><div id="x_x_x_Signature" class=""><div class=""><div name="x_x_x_divtagdefaultwrapper" class="" style="font-family: Calibri, Arial, Helvetica, sans-serif; margin: 0px;"><font size="3" class=""></font><div class="" style="margin: 0px;"><font size="3" face="Calibri,sans-serif" class="">Regards,<span class="x_x_x_Apple-converted-space"> </span></font></div><font size="3" class=""></font><div class="" style="margin: 0px;"><font face="Calibri,sans-serif" class=""><font size="3" class="">Nicolas<br class=""><span class="" style="font-size: 11pt;">--</span></font><br class=""></font><font size="2" face="Arial,sans-serif" color="#ff8100" class=""><span class="" style="font-size: 9pt;"><b class="">Nicolas Tardieu</b></span></font><br class=""><div class="" style="margin: 0px;"><font size="2" face="Calibri,sans-serif" class=""><span class="" style="font-size: 11pt;"><font size="1" face="Arial,sans-serif" color="#ff8100" class=""><span class="" style="font-size: 8pt;"><b class="">Ing PhD Computational Mechanics</b></span></font><font size="1" face="Arial,sans-serif" color="#ff8100" class=""><span class="" style="font-size: 8pt;"><b class=""><br class=""></b></span></font></span></font></div><div class="" style="margin: 0px;"><font size="2" face="Calibri,sans-serif" class=""><span class="" style="font-size: 11pt;"><font size="1" face="Arial,sans-serif" color="#0062e1" class=""><span lang="en-US" class="" style="font-size: 8pt;">EDF - R&D Dpt ERMES</span></font><font size="1" face="Helv,sans-serif" color="#0062e1" class=""><span lang="en-US" class="" style="font-size: 2pt;"><br class=""></span></font></span></font></div><div class="" style="margin: 0px;"><span class="" style="font-family: Arial, sans-serif; font-size: 8pt; color: rgb(0, 98, 225); background-color: rgba(0, 0, 0, 0);">PARIS-SACLAY, FRANCE</span></div></div></div></div></div></div><div id="x_x_x_appendonsend" class="" style="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; text-decoration: none;"></div><hr tabindex="-1" class="" style="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; text-decoration: none; display: inline-block; width: 1146.59375px;"><span class="" style="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; text-decoration: none; float: none; display: inline !important;"></span><div id="x_x_x_divRplyFwdMsg" dir="ltr" class="" style="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; text-decoration: none;"><font face="Calibri, sans-serif" class="" style="font-size: 11pt;"><b class="">De :</b><span class="x_x_x_Apple-converted-space"> </span><a href="mailto:pierre@joliv.et" class="">pierre@joliv.et</a><span class="x_x_x_Apple-converted-space"> </span><<a href="mailto:pierre@joliv.et" class="">pierre@joliv.et</a>><br class=""><b class="">Envoyé :</b><span class="x_x_x_Apple-converted-space"> </span>mercredi 19 octobre 2022 14:51<br class=""><b class="">À :</b><span class="x_x_x_Apple-converted-space"> </span>TARDIEU Nicolas <<a href="mailto:nicolas.tardieu@edf.fr" class="">nicolas.tardieu@edf.fr</a>><br class=""><b class="">Cc :</b><span class="x_x_x_Apple-converted-space"> </span><a href="mailto:petsc-users@mcs.anl.gov" class="">petsc-users@mcs.anl.gov</a><span class="x_x_x_Apple-converted-space"> </span><<a href="mailto:petsc-users@mcs.anl.gov" class="">petsc-users@mcs.anl.gov</a>><br class=""><b class="">Objet :</b><span class="x_x_x_Apple-converted-space"> </span>Re: [petsc-users] Trouble with ISEmbed</font><div class=""> </div></div><div class="x_x_x_BodyFragment" style="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; text-decoration: none;"><font size="2" class=""><span class="" style="font-size: 11pt;"><div class="x_x_x_PlainText">On two processes, you have a different distribution for u and u+p.<br class="">IS Object: 2 MPI processes<br class="">  type: general<br class="">[0] Number of indices in set 5<br class="">[0] 0 0<br class="">[0] 1 1<br class="">[0] 2 2<br class="">[0] 3 3<br class="">[0] 4 4<br class="">[1] Number of indices in set 5<br class="">[1] 0 5<br class="">[1] 1 6<br class="">[1] 2 7<br class="">[1] 3 8<br class="">[1] 4 9<br class="">IS Object: 2 MPI processes<br class="">  type: general<br class="">[0] Number of indices in set 8<br class="">[0] 0 0<br class="">[0] 1 1<br class="">[0] 2 2<br class="">[0] 3 3<br class="">[0] 4 4<br class="">[0] 5 5<br class="">[0] 6 6<br class="">[0] 7 7<br class="">[1] Number of indices in set 7<br class="">[1] 0 8<br class="">[1] 1 9<br class="">[1] 2 10<br class="">[1] 3 11<br class="">[1] 4 12<br class="">[1] 5 13<br class="">[1] 6 14<br class="">ISEmbed() only works on local indices, so when you embed u into u+p, on the second process, you miss the row/column indices 5, 6, 7 of B = A(u+p, u+p).<br class="">Thus, you end up with a matrix of dimension size(u) - 3 = 10 - 3 = 7, with just the row/column indices 8 and 9 being selected by the second process.<br class="">What is it that you want to do exactly? Play with ISEmbed(), or get A(u, u) without using A but B instead?<br class=""><br class="">Thanks,<br class="">Pierre<br class=""><br class="">> On 19 Oct 2022, at 12:00 PM, TARDIEU Nicolas via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov" class="">petsc-users@mcs.anl.gov</a>> wrote:<br class="">><span class="x_x_x_Apple-converted-space"> </span><br class="">> Dear PETSc Team,<br class="">><span class="x_x_x_Apple-converted-space"> </span><br class="">> I am trying to use IS embeding in parallel.<span class="x_x_x_Apple-converted-space"> </span><br class="">> In order to (try to) understand how it works, I have built a simple example, attached to this email.<br class="">><span class="x_x_x_Apple-converted-space"> </span><br class="">> I consider a 20X20 matrix. The dof (u, p, t) in global numbering are the following :<span class="x_x_x_Apple-converted-space"> </span><br class="">> u: 0..9     p: 10..14     t: 15..19<br class="">><span class="x_x_x_Apple-converted-space"> </span><br class="">> I have defined 4 IS to describe the dof  u, p, t and the agglomeration of u and p, called up.<br class="">> I first extract the submatrix matrix(up,up), then  I would like to extract from it the (u,u) block.<br class="">><span class="x_x_x_Apple-converted-space"> </span><br class="">> The example runs OK in sequential but I do not obtain the (u,u) block on 2 processes.<br class="">><span class="x_x_x_Apple-converted-space"> </span><br class="">> I have a mistake in the build of the sub-IS but I cannot find it for days.<br class="">><span class="x_x_x_Apple-converted-space"> </span><br class="">> Best regards,<br class="">> Nicolas<br class="">> --<br class="">> Nicolas Tardieu<br class="">> Ing PhD Computational Mechanics<br class="">> EDF - R&D Dpt ERMES<br class="">> PARIS-SACLAY, FRANCE<br class="">><span class="x_x_x_Apple-converted-space"> </span><br class="">> Ce message et toutes les pièces jointes (ci-après le 'Message') sont établis à l'intention exclusive des destinataires et les informations qui y figurent sont strictement confidentielles. Toute utilisation de ce Message non conforme à sa destination, toute diffusion ou toute publication totale ou partielle, est interdite sauf autorisation expresse.<br class="">> Si vous n'êtes pas le destinataire de ce Message, il vous est interdit de le copier, de le faire suivre, de le divulguer ou d'en utiliser tout ou partie. Si vous avez reçu ce Message par erreur, merci de le supprimer de votre système, ainsi que toutes ses copies, et de n'en garder aucune trace sur quelque support que ce soit. Nous vous remercions également d'en avertir immédiatement l'expéditeur par retour du message.<br class="">> Il est impossible de garantir que les communications par messagerie électronique arrivent en temps utile, sont sécurisées ou dénuées de toute erreur ou virus.<br class="">> ____________________________________________________<br class="">> This message and any attachments (the 'Message') are intended solely for the addressees. The information contained in this Message is confidential. Any use of information contained in this Message not in accord with its purpose, any dissemination or disclosure, either whole or partial, is prohibited except formal approval.<br class="">> If you are not the addressee, you may not copy, forward, disclose or use any part of it. If you have received this message in error, please delete it and all copies from your system and notify the sender immediately by return message.<br class="">> E-mail communication cannot be guaranteed to be timely secure, error or virus-free.<br class="">> <is_pb.tgz><br class=""><br class=""></div></span></font></div><p class="" style="margin-top: 0px; margin-bottom: 0px; 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; text-decoration: none;"></p><div class="" style="margin-top: 0px; margin-bottom: 0px; 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; text-decoration: none;"><br class="">Ce message et toutes les pièces jointes (ci-après le 'Message') sont établis à l'intention exclusive des destinataires et les informations qui y figurent sont strictement confidentielles. Toute utilisation de ce Message non conforme à sa destination, toute diffusion ou toute publication totale ou partielle, est interdite sauf autorisation expresse.</div><div class="" style="margin-top: 0px; margin-bottom: 0px; 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; text-decoration: none;">Si vous n'êtes pas le destinataire de ce Message, il vous est interdit de le copier, de le faire suivre, de le divulguer ou d'en utiliser tout ou partie. Si vous avez reçu ce Message par erreur, merci de le supprimer de votre système, ainsi que toutes ses copies, et de n'en garder aucune trace sur quelque support que ce soit. Nous vous remercions également d'en avertir immédiatement l'expéditeur par retour du message.</div><div class="" style="margin-top: 0px; margin-bottom: 0px; 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; text-decoration: none;">Il est impossible de garantir que les communications par messagerie électronique arrivent en temps utile, sont sécurisées ou dénuées de toute erreur ou virus.<br class="">____________________________________________________</div><div class="" style="margin-top: 0px; margin-bottom: 0px; 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; text-decoration: none;">This message and any attachments (the 'Message') are intended solely for the addressees. The information contained in this Message is confidential. Any use of information contained in this Message not in accord with its purpose, any dissemination or disclosure, either whole or partial, is prohibited except formal approval.</div><div class="" style="margin-top: 0px; margin-bottom: 0px; 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; text-decoration: none;">If you are not the addressee, you may not copy, forward, disclose or use any part of it. If you have received this message in error, please delete it and all copies from your system and notify the sender immediately by return message.</div><div class="" style="margin-top: 0px; margin-bottom: 0px; 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; text-decoration: none;">E-mail communication cannot be guaranteed to be timely secure, error or virus-free.</div></div></blockquote></div></blockquote></div><br class=""></div></div></div></div><p style="margin-top: 0px; margin-bottom: 0px; 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;" class=""></p><div style="margin-top: 0px; margin-bottom: 0px; 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;" class=""><br class="">Ce message et toutes les pièces jointes (ci-après le 'Message') sont établis à l'intention exclusive des destinataires et les informations qui y figurent sont strictement confidentielles. Toute utilisation de ce Message non conforme à sa destination, toute diffusion ou toute publication totale ou partielle, est interdite sauf autorisation expresse.</div><div style="margin-top: 0px; margin-bottom: 0px; 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;" class="">Si vous n'êtes pas le destinataire de ce Message, il vous est interdit de le copier, de le faire suivre, de le divulguer ou d'en utiliser tout ou partie. Si vous avez reçu ce Message par erreur, merci de le supprimer de votre système, ainsi que toutes ses copies, et de n'en garder aucune trace sur quelque support que ce soit. Nous vous remercions également d'en avertir immédiatement l'expéditeur par retour du message.</div><div style="margin-top: 0px; margin-bottom: 0px; 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;" class="">Il est impossible de garantir que les communications par messagerie électronique arrivent en temps utile, sont sécurisées ou dénuées de toute erreur ou virus.<br class="">____________________________________________________</div><div style="margin-top: 0px; margin-bottom: 0px; 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;" class="">This message and any attachments (the 'Message') are intended solely for the addressees. The information contained in this Message is confidential. Any use of information contained in this Message not in accord with its purpose, any dissemination or disclosure, either whole or partial, is prohibited except formal approval.</div><div style="margin-top: 0px; margin-bottom: 0px; 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;" class="">If you are not the addressee, you may not copy, forward, disclose or use any part of it. If you have received this message in error, please delete it and all copies from your system and notify the sender immediately by return message.</div><div style="margin-top: 0px; margin-bottom: 0px; 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;" class="">E-mail communication cannot be guaranteed to be timely secure, error or virus-free.</div></div></blockquote></div><br class=""></body></html>