<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Mar 5, 2018 at 9:25 AM, Åsmund Ervik <span dir="ltr"><<a href="mailto:Asmund.Ervik@sintef.no" target="_blank">Asmund.Ervik@sintef.no</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">My only argument "against" using Plex is that I don't understand how to use it. Is there a simple example anywhere that shows how to set up a 1D simplical (?) mesh, and then just get/return data between vectors associated with the Plex and (local) Fortran arrays on each proc? I don't have any KSP, SNES etc.<br></blockquote><div><br></div><div>I have not done a 1D example, because there is not much call for it. However, I did give the sequence of calls in my last mail.</div><div><br></div><div>I am killing myself getting ready for SIAM PP right now, but this is easily written when I get back.</div><div><br></div><div>However, I am not offended if you want to do it by hand.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I assume such a code would go something like<br>
<br>
<Plex mesh init stuff><br>
<Plex initial (uniform) parallel distribution><br>
<My code's init stuff><br>
<loop over time><br>
<Plex equivalent of DMDAGetCorners><br>
<Plex equivalent of DMDAVecGetArrayF90><br>
<My code that computes things with the array, and finds weights for redistribution><br>
<Plex equivalent of DMDAVecRestoreArrayF90><br>
<Plex redistribution><br>
<end loop><br>
<br>
Regards,<br>
Åsmund<br>
<br>
> -----Original Message-----<br>
> From: Matthew Knepley [mailto:<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>]<br>
> Sent: Monday, March 5, 2018 3:08 PM<br>
> To: Tobin Isaac <<a href="mailto:tisaac@cc.gatech.edu">tisaac@cc.gatech.edu</a>><br>
> Cc: Jed Brown <<a href="mailto:jed@jedbrown.org">jed@jedbrown.org</a>>; Dave May<br>
> <<a href="mailto:dave.mayhem23@gmail.com">dave.mayhem23@gmail.com</a>>; Åsmund Ervik <<a href="mailto:Asmund.Ervik@sintef.no">Asmund.Ervik@sintef.no</a>>;<br>
> <a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a><br>
> Subject: Re: [petsc-users] Load balancing / redistributing a 1D DM<br>
><br>
> On Mon, Mar 5, 2018 at 9:01 AM, Tobin Isaac <<a href="mailto:tisaac@cc.gatech.edu">tisaac@cc.gatech.edu</a><br>
> <mailto:<a href="mailto:tisaac@cc.gatech.edu">tisaac@cc.gatech.edu</a>> > wrote:<br>
><br>
><br>
> This is a somewhat incomplete description of the steps in linear<br>
> partitioning. The rest can be accomplished with PetscSF calls, but I should<br>
> wrap it up in a PetscPartitioner because it's a mistake-prone operation.<br>
><br>
><br>
><br>
> Jed likes to do everything by hand because it is transparent, but then you<br>
> become the maintainer.<br>
> I think this is easy to do in Plex, and we maintain the code. It is less<br>
> transparent, which is the tradeoff.<br>
><br>
> Matt<br>
><br>
><br>
> On March 5, 2018 8:31:42 AM EST, Jed Brown <<a href="mailto:jed@jedbrown.org">jed@jedbrown.org</a><br>
> <mailto:<a href="mailto:jed@jedbrown.org">jed@jedbrown.org</a>> > wrote:<br>
> >Dave May <<a href="mailto:dave.mayhem23@gmail.com">dave.mayhem23@gmail.com</a><br>
> <mailto:<a href="mailto:dave.mayhem23@gmail.com">dave.mayhem23@gmail.<wbr>com</a>> > writes:<br>
> ><br>
> >> For a 1D problem such as yours, I would use your favourite graph<br>
> >> partitioner (Metis,Parmetis, Scotch) together with your cell based<br>
> >> weighting and repartition the data yourself.<br>
> ><br>
> >That's overkill in 1D. You can MPI_Allreduce(SUM) and<br>
> MPI_Scan(SUM)<br>
> >the<br>
> >weights, then find the transition indices in each subdomain. It'll be<br>
> >cheaper, more intuitive/deterministic, and avoid the extra library<br>
> >dependency. Of course if you think you may want to move to<br>
> multiple<br>
> >dimensions, it would make sense to consider DMPlex or DMForest.<br>
><br>
><br>
><br>
><br>
<span class="HOEnZb"><font color="#888888">><br>
> --<br>
><br>
> What most experimenters take for granted before they begin their<br>
> experiments is infinitely more interesting than any results to which their<br>
> experiments lead.<br>
> -- Norbert Wiener<br>
><br>
> <a href="https://www.cse.buffalo.edu/~knepley/" rel="noreferrer" target="_blank">https://www.cse.buffalo.edu/~<wbr>knepley/</a><br>
> <<a href="http://www.caam.rice.edu/~mk51/" rel="noreferrer" target="_blank">http://www.caam.rice.edu/~<wbr>mk51/</a>><br>
<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.caam.rice.edu/~mk51/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div>
</div></div>