<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body>
Ok I see, thanks! I'll try PCSetUp_Redistribute() then.
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Barry Smith <bsmith@petsc.dev><br>
<b>Sent:</b> 16 April 2023 22:31:14<br>
<b>To:</b> Carl-Johan Thore <carl-johan.thore@liu.se><br>
<b>Cc:</b> petsc-users@mcs.anl.gov <petsc-users@mcs.anl.gov><br>
<b>Subject:</b> Re: [petsc-users] Fieldsplit with redistribute</font>
<div> </div>
</div>
<div style="line-break:after-white-space">
<div><br>
</div>
The manual page for ISEmbed is incomprehensible to me. Anyways no matter what, you need to know what degrees of freedom are removed by PCDistribute() in order to produce the reduced IS which is why I think you need information only available inside PCSetUp_Redistribute().
(Sorry it is PCSetUp_Redistribute() not PCApply_Redistribute())
<div><br>
</div>
<div> Barry</div>
<div><br>
<div><br>
<blockquote type="cite">
<div>On Apr 16, 2023, at 3:36 PM, Carl-Johan Thore <carl-johan.thore@liu.se> wrote:</div>
<br class="x_Apple-interchange-newline">
<div>
<div>Thanks for the quick reply Barry!<br>
I have not tried the version with PCApply_Redistribute that you suggest, but I have a code that does roughly what you describe. It works when running on one rank, but fails on multiple ranks. I suspect the issue is with the use of ISEmbed as, quoting the PETSc-manual,
"the resulting IS is sequential, since the index substitution it encodes is purely local" (admittedly I don't fully understand what that means). If you think using ISEmbed is not a good idea, I'll try PCApply_Redistribute()<br>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt"><b>From:</b> Barry Smith <bsmith@petsc.dev><br>
<b>Sent:</b> 16 April 2023 21:11:18<br>
<b>To:</b> Carl-Johan Thore <carl-johan.thore@liu.se><br>
<b>Cc:</b> petsc-users@mcs.anl.gov <petsc-users@mcs.anl.gov><br>
<b>Subject:</b> Re: [petsc-users] Fieldsplit with redistribute</font>
<div> </div>
</div>
<div class="x_BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="x_PlainText"><br>
There is no code to do this currently. <br>
<br>
I would start by building your IS for each split before the PCRedistribute and then adding to the PCApply_Redistribute() code that "fixes" these IS by "removing" the entries of the IS associated with removed degrees of freedom and then shifting the entries
indices of the IS by taking into account the removed indices. But you have probably already been trying this? It does require digging directly into the PCApply_Redistribute() to get the needed information (which degrees of freedom are removed by the redistribute
code), plus it requires shifting the MPI rank ownership of the entries of the IS in the same way the MPI rank ownership of the degrees of freedom of the vector are moved.<br>
<br>
If you have some code that you think should be doing this but doesn't work feel free to send it to us and we may be able to fix it.<br>
<br>
Barry<br>
<br>
<br>
> On Apr 16, 2023, at 2:50 PM, Carl-Johan Thore via petsc-users <petsc-users@mcs.anl.gov> wrote:<br>
> <br>
> Hello,<br>
> I'm solving a blocksystem<br>
> [A C;<br>
> C' D],<br>
> where D is not zero, using the PCFIELDSPLIT preconditioner and set the split using PetscFieldSplitSetIS. This works very well until I try PCREDISTRIBUTE (which is attractive as I have many locked DOFs). I suspect something goes wrong when constructing the
IS for the split (I've tried various things using the IS-routines). Can PETSc do this automatically? Or else, any hints?<br>
> Kind regards,<br>
> Carl-Johan<br>
<br>
</div>
</span></font></div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</body>
</html>