[petsc-dev] DMPlex VecView to HDF5

Adrian Croucher a.croucher at auckland.ac.nz
Wed Feb 21 22:12:33 CST 2018


hi Matt,


On 20/02/18 12:32, Matthew Knepley wrote:
> On Mon, Feb 19, 2018 at 4:33 PM, Adrian Croucher 
> <a.croucher at auckland.ac.nz <mailto:a.croucher at auckland.ac.nz>> wrote:
>
>     hi Matt
>
>     I tried what you suggested and modified
>     DMPlexGetFieldType_Internal() so that all processes have the same
>     field type (ft):
>
> Yep, this is going to take specifying in the interface that it is 
> collective. It looks like it might be used as if it is not.

It looks to me like that may not be the problem, actually. I think I may 
have tracked it down though.

In vec/vec/interface/rvector.c:1280, in VecGetSubVector():

       if (n%bs || bs == 1) bs = -1; /* Do not decide block size if we 
do not have to */

If there are no cells on one process (n = 0) then n%bs = 0, so if bs > 1 
the reassignment bs = -1 doesn't happen.

If I alter it to:

       if (n%bs || bs == 1 || !n) bs = -1; /* Do not decide block size 
if we do not have to */

then it also sets bs = -1 on the n = 0 process, and it works fine for my 
case.

I'm not sure I fully understand the purpose of this line though, so 
don't know if what I've done is always going to be the right thing?

I also wondered if it would be desirable to ensure bs is consistent 
across all processes, but am not sure what the right value would be in 
that case. I tried doing an MPI_allreduce() on bs, to find the minimum 
across processes (so if any were -1 then they all were) and that also 
worked for my case.

- 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 4611

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20180222/78c5f27e/attachment.html>


More information about the petsc-dev mailing list