[petsc-dev] Adding DMLocalToLocalBegin/End: What about PetscSF?

Jed Brown jedbrown at mcs.anl.gov
Wed Jun 12 10:25:18 CDT 2013

Richard Tran Mills <rtm at eecs.utk.edu> writes:

> PETSc developers,
> I am finally getting around to adding the DMLocalToLocalBegin/End routines 
> that I had mentioned several months ago.  Looking at 
> DMGlobalToLocalBegin() in src/interface/dm/dm.c, I see that a little over 
> a year ago, Matt added the use of a default 'PetscSF' ("star forest") if 
> present to handle the global-to-local and local-to-global operations.  I 
> am not familiar with PetscSF, but I assume that it should be possible to 
> use these somehow (maybe needing to add a little bit of code) for 
> local-to-local operations, since the communication pattern is the same as 
> for a global-to-local.  Could someone who is familiar with PetscSF comment 
> on this?

You can use PetscSFBcast for this.  For each point (which will be a leaf
in star-forest terminology), set the (rank, offset) of the owner
("root").  Use PetscSFSetGraph rather than PetscSFSetGraphLayout,
because you don't have a global ordering/PetscLayout to use the latter.

More information about the petsc-dev mailing list