[petsc-users] Multiple in-flight communications with PetscSFs

Lawrence Mitchell lawrence.mitchell at imperial.ac.uk
Sat Feb 7 05:13:06 CST 2015


On 6 Feb 2015, at 18:09, Jed Brown <jed at jedbrown.org> wrote:

> Lawrence Mitchell <lawrence.mitchell at imperial.ac.uk> writes:
> 
...

>> 
>> Or is this not something that is supposed to work at all and I'm just lucky.
> 
> It's supposed to work, but I think not tested.  Can you test the above
> (have the conditional check the key instead of changing "match"; there
> is no implicit conversion from bool to PetscBool) and submit as a patch?

Thanks, patch (plus simple test) here https://bitbucket.org/petsc/petsc/pull-request/255/sf-fix-multiple-in-flight-comm-rounds-for/diff

Before this change the communication completion into A get's B's data and vice versa.  This doesn't occur for -sf_type window.

While I'm here, is there any reason that DMs don't call setfromoptions on their SFs: it looks like one can't select an an sf type except programmatically.

Maybe the following:

diff --git a/src/dm/interface/dm.c b/src/dm/interface/dm.c
index 324b101..9e9b130 100644
--- a/src/dm/interface/dm.c
+++ b/src/dm/interface/dm.c
@@ -49,6 +49,8 @@ PetscErrorCode  DMCreate(MPI_Comm comm,DM *dm)
   v->coloringtype             = IS_COLORING_GLOBAL;
   ierr                        = PetscSFCreate(comm, &v->sf);CHKERRQ(ierr);
   ierr                        = PetscSFCreate(comm, &v->defaultSF);CHKERRQ(ierr);
+  ierr                        = PetscSFSetFromOptions(v->sf); CHKERRQ(ierr);
+  ierr                        = PetscSFSetFromOptions(v->defaultSF); CHKERRQ(ierr);
   v->defaultSection           = NULL;
   v->defaultGlobalSection     = NULL;
   v->defaultConstraintSection = NULL;



Cheers,

Lawrence
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20150207/6e01b337/attachment.pgp>


More information about the petsc-users mailing list