On two processes, you have a different distribution for u and u+p. IS Object: 2 MPI processes type: general [0] Number of indices in set 5 [0] 0 0 [0] 1 1 [0] 2 2 [0] 3 3 [0] 4 4 [1] Number of indices in set 5 [1] 0 5 [1] 1 6 [1] 2 7 [1] 3 8 [1] 4 9 IS Object: 2 MPI processes type: general [0] Number of indices in set 8 [0] 0 0 [0] 1 1 [0] 2 2 [0] 3 3 [0] 4 4 [0] 5 5 [0] 6 6 [0] 7 7 [1] Number of indices in set 7 [1] 0 8 [1] 1 9 [1] 2 10 [1] 3 11 [1] 4 12 [1] 5 13 [1] 6 14 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). 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. What is it that you want to do exactly? Play with ISEmbed(), or get A(u, u) without using A but B instead?
Thanks, Pierre > On 19 Oct 2022, at 12:00 PM, TARDIEU Nicolas via petsc-users > <petsc-users@mcs.anl.gov> wrote: > > Dear PETSc Team, > > I am trying to use IS embeding in parallel. > In order to (try to) understand how it works, I have built a simple example, > attached to this email. > > I consider a 20X20 matrix. The dof (u, p, t) in global numbering are the > following : > u: 0..9 p: 10..14 t: 15..19 > > I have defined 4 IS to describe the dof u, p, t and the agglomeration of u > and p, called up. > I first extract the submatrix matrix(up,up), then I would like to extract > from it the (u,u) block. > > The example runs OK in sequential but I do not obtain the (u,u) block on 2 > processes. > > I have a mistake in the build of the sub-IS but I cannot find it for days. > > Best regards, > Nicolas > -- > Nicolas Tardieu > Ing PhD Computational Mechanics > EDF - R&D Dpt ERMES > PARIS-SACLAY, FRANCE > > 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. > 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. > 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. > ____________________________________________________ > 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. > 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. > E-mail communication cannot be guaranteed to be timely secure, error or > virus-free. > <is_pb.tgz>