sieve-dev Manual mesh distrition
Matthew Knepley
knepley at gmail.com
Tue Jun 3 16:55:30 CDT 2008
On Tue, Jun 3, 2008 at 4:17 PM, Shi Jin <jinzishuai at gmail.com> wrote:
> Hi there,
>
> I brought up this question earlier about using the chaco graph partitioner
> to partition my mesh. It worked for that time being. Now I wanted to pursue
> it in a better way to follow Matt's suggestion on directly partition the
> graph to my own specific need. Here I quote Matt
>
> "If you have to have a certain partition for the algorithm,
> why not just provide that partition yourself instead of trying
> to force Chaco to do it. All the partitioner does is provide a
>
> list of which elements are in which partition, and then I do
> the rest. You can just run through all the elements, dumping them
> in the bin you want so that particle checks work. Then all the
> connections, communication, etc. will be worked out automatically."
>
>
> I further looked into the mesh source code and found that this is actually
> quite easy to do.
> All I need to do is to provide an array called assignment where each entry
> provides the rank of process the element belongs to.
> This way, I don't have to ask Chaco to do the partitioning. However, there
> is a practical issue of how to incorporate this change into the code.
>
> It is straightforward if I simply change the partitionSieve() function in
> the Partitioner.hh file.
>
> But I want to do this in my code (i.e. not changing the petsc-dev code so
> that I don't have to patch it every time I update petsc-dev).
> So we might need an interface to the petsc-dev library to take care of it.
>
> Maybe a "User" partitioner needs to be created in parallel to "Chaco" and
> "Parmetis" and the assignment array can be supplied as a function
> parameter?
>
> Please let me know if this is possible and I would love to hear your
> suggestions.
I have refactored partitioning to be much more modular. Look in Partitioner.hh
at the Partitioner class. It has a method createPartition() which makes the
equivalent of assignment[] in a section. This class is templated in
type GraphPartitioner.
Look at the class Simple::Partititoner (or Chaco::Partitioner). You
could write your
own class and then instantiate a Partitioner<MyGraphPartitioner>.
I agree that it is not perfect since it always makes a CSR dual graph,
but we can
work out what you need at the top level easily. This does change the
distribution
model a little, but not much. It replaces the assignment[] with a
section, but after
that they are mostly identical. You can see it looking at the updated petsc-dev.
Does this sound easy?
Thanks,
Matt
> Thank you very much.
> --
>
> Sincerely,
> Shi Jin, Ph.D.
> http://www.ualberta.ca/~sjin1/
--
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which
their experiments lead.
-- Norbert Wiener
More information about the sieve-dev
mailing list