[petsc-users] DMPlex and HDF5 vector ordering

Justin Chang jychang48 at gmail.com
Fri May 8 01:48:52 CDT 2015


I also had the same issue. My current work around is the following.

1) Run the first DMPlex program on one process and write the vector into
HDF5.

2) Run the second DMPlex program with any number of processes but do the
following:

3) After you create the initial DMPlex on rank 0, but before distributing
it, duplicate it and create its petscsection and vector.

4) Load the HDF5 file into that vector. At this point the ordering is the
same.

5) Distribute the original DM and save the PetscSF.

6) Call DMPlexDistributeField() to distribute the vector.


This will guarantee the right ordering for the second program no matter how
many processes it uses. Only drawback is that the first program has to be
run in serial. I am also looking for a better way. Matt any thoughts?

Thanks,
Justin

On Friday, May 8, 2015, Adrian Croucher <a.croucher at auckland.ac.nz
<javascript:_e(%7B%7D,'cvml','a.croucher at auckland.ac.nz');>> wrote:

> hi,
>
> I create a Vec on a DMPlex using DMPlexCreateGlobalVec(), then write it to
> HDF5 using PetscViewerHDF5Open() and VecView().
>
> I then try to read it back in later (in another program, but using the
> same DMPlex) using PetscViewerHDF5Open() and VecLoad().
>
> It looks like the ordering of the final vector entries in the second
> program depends on how many processors I use. If they are the same in both
> programs, I get the right ordering, but if they aren't, I don't. Is that
> expected? If so, is there any way to guarantee the right ordering when I
> read the Vec back in?
>
> - Adrian
>
> --
> Dr Adrian Croucher
> Senior Research Fellow
> Department of Engineering Science
> University of Auckland, New Zealand
> email: a.croucher at auckland.ac.nz
> tel: +64 (0)9 923 84611
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20150508/8ba0f106/attachment.html>


More information about the petsc-users mailing list