<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Nov 10, 2017 at 8:56 AM, Jed Brown <span dir="ltr"><<a href="mailto:jed@jedbrown.org" target="_blank">jed@jedbrown.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">Vaclav Hapla <<a href="mailto:vaclav.hapla@erdw.ethz.ch">vaclav.hapla@erdw.ethz.ch</a>> writes:<br>
<br>
>> 10. 11. 2017 v 5:09, Smith, Barry F. <<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>>:<br>
>><br>
>><br>
>><br>
>>> On Nov 8, 2017, at 3:52 AM, Vaclav Hapla <<a href="mailto:vaclav.hapla@erdw.ethz.ch">vaclav.hapla@erdw.ethz.ch</a>> wrote:<br>
>>><br>
>>><br>
>>>> 8. 11. 2017 v 9:06, Lisandro Dalcin <<a href="mailto:dalcinl@gmail.com">dalcinl@gmail.com</a>>:<br>
>>>><br>
>>>> On 8 November 2017 at 05:51, Smith, Barry F. <<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>> wrote:<br>
>>>>><br>
>>>>>> On Nov 7, 2017, at 1:33 AM, Lisandro Dalcin <<a href="mailto:dalcinl@gmail.com">dalcinl@gmail.com</a>> wrote:<br>
>>>>>><br>
>>>>>> The only concern I have about PetscPartitioner is that the API depends<br>
>>>>>> on DM (PetscPartitionerPartition_<<wbr>TYPE> routines). Maybe<br>
>>>>>> PetscPartitioner should eventually move to became more agnostic, and<br>
>>>>>> that way it can be used to partition matrices and meshes.<br>
>>>>><br>
>>>>> This is certainly a serious flaw if PetscPartitioner is intended as THE API to use for partitioning. If it is not intended as THE API for partitioning then that is also a problem, because why have multiple APIs for what is essentially one set of abstractions.<br>
>>>>><br>
>>>><br>
>>>> Note however that things looks easy to refactor. I'll try to team up<br>
>>>> with Matt to improve things.<br>
>>><br>
>>> Wait, now we are at the beginning again. I actually wanted to do some refactoring of PetscPartitioner, starting with few cosmetic changes to make it better settable from options. But Barry kept me back of any edits since he think it's anti-systematic to keep two independent classes doing essentially the same. And I agree with that to be honest. It's strange to have two ParMetis, two Scotch and two whatever interfaces.<br>
>><br>
>> Strange is not the word, f***up is the word<br>
>><br>
>>> The only thing I don't like on MatPartitioning is its name as it's not just for Mat Partitioning :-)<br>
>>><br>
>>> There are from my point of view multiple issues with PetscPartitioner. Let's look e.g. at PetscPartitionerPartition. It takes as arguments both PetscPartitioner and DM. This DM must be in fact DMPlex which is not checked so it will probably crash somewhere deep in the stack once the first DMPlex specific line is reached. Then there are two output arguments PetscSection partSection and IS *partition. The first must be created beforehand while the second is created inside. And I guess they must keep the same basic information just in two different forms.<br>
>>><br>
>>> Actually the original problem I wanted to solve is that src/dm/impls/plex/examples/<wbr>tutorials/ex5.c fails with partitioner set to PETSCPARTITIONERPARMETIS for certain numbers of processes, see below. Let me start with pull request altering ex5.c so that partitioner type can be set from options properly and this bug can be reproduced easily.<br>
>>> [ 0] ***ASSERTION failed on line 176 of file /scratch/petsc-dev/arch-linux-<wbr>gcc-salvus/externalpackages/<wbr>git.parmetis/libparmetis/comm.<wbr>c: j == nnbrs<br>
>>> [ 2] ***ASSERTION failed on line 176 of file /scratch/petsc-dev/arch-linux-<wbr>gcc-salvus/externalpackages/<wbr>git.parmetis/libparmetis/comm.<wbr>c: j == nnbrs<br>
>>> ex5: /scratch/petsc-dev/arch-linux-<wbr>gcc-salvus/externalpackages/<wbr>git.parmetis/libparmetis/comm.<wbr>c:176: libparmetis__CommSetup: Assertion `j == nnbrs' failed.<br>
>>> ex5: /scratch/petsc-dev/arch-linux-<wbr>gcc-salvus/externalpackages/<wbr>git.parmetis/libparmetis/comm.<wbr>c:176: libparmetis__CommSetup: Assertion `j == nnbrs' failed.<br>
>>><br>
>>> I'm wondering whether the MatPartitioning interface has the same problem. But anyhow I mean it's maybe time to decide about the two interfaces before chasing all these PetscPartitioner issues.<br>
>>><br>
>>> I propose<br>
>>> - to rename Mat Partitioning to just Partitioning/-er or take over the name PetscPartitioner,<br>
>><br>
>> Why? What is wrong with Mat? Mat can represent any graph and graphs are always what partitioning packages actually partition. I don't see a reason for a different name. MatPartitioner does not, nor should it, directly partition meshes etc, those can/should be done by; the proper massaging of data, the creation of a MatPartitioner object, calling the partitioner and then using the result of the partitioner to build whatever appropriate data structures are needed for the mesh partitioner.<br>
><br>
> Yes. Mat can represent any graph in several different ways -<br>
> e.g. Laplacian, adjacency, incidence, oriented incidence matrix. The<br>
> graph could be also represented in other way like a list of vertices<br>
> and edges.<br>
<br>
</div></div>Also known as COO format for a matrix.<br>
<span class=""><br>
> MatPartitioning picks just one representation as an input - the<br>
> adjacency matrix. But I mean the picked representation does not<br>
> matter, and the result is not a partitioning of any matrix, but<br>
> partitioning of the graph. The graph is the underlying concept. This<br>
> is why I don't consider the Mat prefix optimal.<br>
<br>
</span>Matrix and graph are equivalent concepts. </blockquote><div><br></div><div>This is clearly wrong. A matrix is the coordinate representation of a linear operator, and thus has a specific</div><div>behavior under coordinate transformations. A graph is just connectivity, and really just a relation. I cannot</div><div>count the number of times Barry has ranted about this on petsc-maint (usually about Vecs and arrays). The</div><div>mathematical object is not its data structure.</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"> Mat is already extensible in<br>
the sense that it can have many representations.<br>
<span class=""><br>
> (*) It's a similar problem as MatCreateVecs means to me "create a matrix of Vecs type" according to usual convention.<br>
<br>
</span>I think the key here is to look at the types. VecCreateFromMat() might<br>
be more clear in this context, but isn't clearly better. Alternatively,<br>
PetscCreateVec() and MatCreateVecs() would have this symmetry, but don't<br>
follow our usual prefix conventions.<br>
</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>