[petsc-dev] PetscSection

Jed Brown jedbrown at mcs.anl.gov
Tue Sep 10 21:05:23 CDT 2013


Shri <abhyshr at hawk.iit.edu> writes:
>    For my toy example, using four sections is fine. But in general I think there needs to 
> be a mechanism that the user can easily pack the data and I don't think the user would want
> to create tens of sections. 

Presumably they wouldn't be the ones creating all those sections.

> I'll take a look at in the next few days and get back to you. One
> thing that I am struggling to understand, and this is in reference to
> having one chunk of memory holding all the different parameters for
> vertices, edges etc, is how to manage heteregenous data, i.e., for
> example one vertex has a struct of type G1 and another has a type
> G2. Currently from PetscSection, we can only get the offset and the
> size.

This is the problem you have to solve.  If you don't know how to index
it locally, there's no sense going on about how to communicate it.

One option is a tagged union (can use a Label as the tag if you like),
the other is to partition the index space by node type.

Note that if you can have multiple structs at one node, you're asking
for two levels of nesting: number-of-units and number-of-bytes-per-unit.
-------------- 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/f064605c/attachment.sig>


More information about the petsc-dev mailing list