Xiangdong <[email protected]> writes:
> This works fine. However, when I add the option -da_grid_x 8, the same
> error messages pop up.

There was a memory error introduced when Barry changed PetscMPIIntCast
to be better behaved.  For equal-aspect grids, the uninitialized slot
contained the right value by accident.  Thanks.

If you are using PETSc from Git, run "git pull && make", otherwise you
can apply the patch below and rebuild.

commit 334634e2e3b3ad30f394a243f8d8200a86444220
Author: Jed Brown <[email protected]>
Date:   Thu Mar 6 17:28:37 2014 -0700

    VecView_MPI_DA: fix gsizes bug (bad conversion in parent commit)
    
    Reported-by: Xiangdong <[email protected]>

diff --git a/src/dm/impls/da/gr2.c b/src/dm/impls/da/gr2.c
index f726037..abb8dea 100644
--- a/src/dm/impls/da/gr2.c
+++ b/src/dm/impls/da/gr2.c
@@ -472,7 +472,7 @@ static PetscErrorCode DMDAArrayMPIIO(DM da,PetscViewer 
viewer,Vec xin,PetscBool
   gsizes[0]  = dof;
   ierr       = PetscMPIIntCast(dd->M,gsizes+1);CHKERRQ(ierr);
   ierr       = PetscMPIIntCast(dd->N,gsizes+2);CHKERRQ(ierr);
-  ierr       = PetscMPIIntCast(dd->P,gsizes+1);CHKERRQ(ierr);
+  ierr       = PetscMPIIntCast(dd->P,gsizes+3);CHKERRQ(ierr);
   lsizes[0]  = dof;
   ierr       = PetscMPIIntCast((dd->xe-dd->xs)/dof,lsizes+1);CHKERRQ(ierr);
   ierr       = PetscMPIIntCast(dd->ye-dd->ys,lsizes+2);CHKERRQ(ierr);

Attachment: pgpsMhP9v6Jyw.pgp
Description: PGP signature

Reply via email to