[petsc-dev] Integrating PFLOTRAN, PETSC & SAMRAI

Boyce Griffith griffith at cims.nyu.edu
Tue Jun 7 13:41:35 CDT 2011



On 6/7/11 2:32 PM, Jed Brown wrote:
>     An alternative, which I had in mind when I said that I was
>     interested in trying to use PETSc to provide the storage for the
>     SAMRAI data structures, is to use SAMRAI to provide basic grid
>     management, and to use PETSc to provide data storage.  One would
>     allocate appropriately sized PETSc vectors and set various pointers
>     appropriately so that the SAMRAI data would continue to "look like"
>     regular SAMRAI data.  Because the data is actually stored in a PETSc
>     Vec, it would also "look like" regular PETSc data from the
>     standpoint of a PETSc solver.  Doing this would mean including some
>     redundant ghost cell data in the PETSc Vec that provides the actual
>     storage.
>
> It makes a big difference where those redundant entries go. If they can
> go at the end, then you can share storage. If they go with "their
> patch", then you can't have them share the global vector. A different
> model is to have SAMRAIGlobalToLocalBegin/End() that internally used
> VecScatter (perhaps) and put the result in a SAMRAI vector. If you are
> usually running in parallel, this step usually does a copy anyway (e.g.
> DMDA).

Nope; to keep SAMRAI stuff working like regular SAMRAI stuff, the ghost 
values wind up in the middle of the vector.  At least with the standard 
data types, local data storage, including ghost cells, for each patch is 
contiguous.

-- Boyce



More information about the petsc-dev mailing list