[petsc-users] Mat local size zero

Barry Smith bsmith at mcs.anl.gov
Fri May 3 17:34:27 CDT 2013


On May 3, 2013, at 1:55 PM, Matthew Knepley <knepley at gmail.com> wrote:

> On Fri, May 3, 2013 at 1:52 PM, Hui Zhang <mike.hui.zhang at hotmail.com> wrote:
> Hello,
> 
> I'm implementing a coarse problem for a domain decomposition preconditioner.
> I use many processors to solve one subdomain and I want to pick one processor
> for each subdomain to solve the global coarse problem.  So I need to set the
> local sizes of the coarse operator on the other processors to be zero.  Is
> this a good idea?  Thanks in advance!
> 
> This is fine. The only drawback would be that collective operations would still take
> place over the entire communicator. If this ever becomes a problems (in a land
> far far away), you can just call MatGetSubmatrix() for that process.

    You can also use PCREDUNDANT (see manual page) this manages everything for you; You create the coarse grid matrix across all the processes in your communicator in the normal way and it manages getting that matrix down to a subset of processes (or 1 process) and solving there and getting the answer back up to all the processes. You likely really really should use this (since it makes the process trivial) compared to writing all the stuff yourself.

   Barry

> 
>    Matt
> 
> -- 
> 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 petsc-users mailing list