[petsc-dev] PetscSection

Jed Brown jedbrown at mcs.anl.gov
Tue Sep 10 20:50:50 CDT 2013


Shri <abhyshr at mcs.anl.gov> writes:
> After speaking with Barry today, I realized that I was abusing
> PetscSection and doing a roundabout indexing to access the desired
> data. I was using four sections to distribute data for four different
> structures. I understand now that I need to
>
> i) Create only one section to manage the parameters and use
> PetscSectionAddDof() to add the dofs (sizes of structs) for the
> different structs required for residual evaluation.

This is not what I remember from our discussion yesterday.

> I tried to use MPI_BYTE as the MPI_DataType in DMPlexDistributeData()
> but got the following error. Jed explained that it had something to do
> with how the data is packed and suggested to divide the sizes of the
> structs in (ii) by PetscInt and use MPI_INT for DMPlexDistributeData()
> as a workaround.

That was a hack, but with separate sections, you have homogeneous-sized units.

You said that you have some nodes with an array of structs.  How do you
distinguish four structs of 25 bytes each from one struct of 100 bytes?
What would the section look like and what would you tell PetscSF?

> Btw, DMPlexDistributeData() is missing an extern declaration in petscdmplex.h.

I fixed this yesterday.  It is in 'knepley/feature-plex-generic-distribute' and 'next'.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20130910/e21b3041/attachment.sig>


More information about the petsc-dev mailing list