[petsc-dev] proposed minor PetscPartitioner changes
Jed Brown
jed at jedbrown.org
Wed Nov 8 12:49:27 CST 2017
Matthew Knepley <knepley at gmail.com> writes:
>> > No, this is the right structure.
>>
>> Oh come on. You're defending a quadratic algorithm.
>>
>> ierr = ParMETIS_V3_PartKway(vtxdist, xadj, adjncy, vwgt, adjwgt,
>> &wgtflag, &numflag, &ncon, &nparts, tpwgts, ubvec, options, &edgeCut,
>> assignment, &comm);
>> // ...
>> for (p = 0, i = 0; p < nparts; ++p) {
>> for (v = 0; v < nvtxs; ++v) {
>> if (assignment[v] == p) points[i++] = v;
>> }
>> }
>>
>> MatPartitioningApply creates an IS with "assignment" and can be
>> converted to a global numbering with ISPartitioningToNumbering. You
>> could as well have an ISPartitioningToSectionAndIS() that produces your
>> representation, preferably without this silly quadratic algorithm.
>>
>
> Time it. Tell me if it matters. Telling me it matters in the long run is
> metaphysics.
I realize ParMETIS isn't scalable and that if you have a modest number
of parts and only a million or so elements per rank, the cost of what
you do here will be acceptable for most uses.
But you didn't refute my point that ISPartitioningToSectionAndIS can
produce the representation you want. The IS you're creating is similar
to the inverse of the Numbering (which is a permutation). You are the
one that replaced a scalable algorithm that has existed for a long time
and uses types correctly with PetscPartitioner which has some ugly
warts, duplicates a lot of code, and isn't a viable replacement for
MatPartitioning. And now you seem to be arguing against Vaclav unifying
it, claiming technical rationale that don't appear to hold up. I don't
understand why, but it certainly looks like PetscPartitioner can be
implemented as a thin layer around MatPartitioning, then that layer can
be refactored into helper functions at the IS/PetscSection level. If
there is a solid technical reason why this is fundamentally poor design,
please explain so we can figure out a better design.
More information about the petsc-dev
mailing list