<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 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="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;">Thank you very much for your answer. I have the same explanation as you for the code I sent. </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;">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="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="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="Signature" class=""><div class=""><div name="divtagdefaultwrapper" style="font-family: Calibri, Arial, Helvetica, sans-serif; margin: 0px;" class=""></div><div name="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><div style="margin: 0px;" class=""><font size="3" face="Calibri,sans-serif" class="">Is it clear enough ???? </font></div></div></div></div></div></div></blockquote><div><br class=""></div><div>That’s cristal clear.</div><div>If the fields are interlaced, that’s actually easier to do, because you preserve the distribution, and there is less data movement.</div><div>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><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="">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="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: 1146.59375px;" 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><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 14:51<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="BodyFragment" 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;"><font size="2" class=""><span style="font-size: 11pt;" class=""><div class="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="Apple-converted-space"> </span><br class="">> Dear PETSc Team,<br class="">><span class="Apple-converted-space"> </span><br class="">> I am trying to use IS embeding in parallel.<span class="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="Apple-converted-space"> </span><br class="">> I consider a 20X20 matrix. The dof (u, p, t) in global numbering are the following :<span class="Apple-converted-space"> </span><br class="">> u: 0..9     p: 10..14     t: 15..19<br class="">><span class="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="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="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="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="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 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>