<div dir="ltr"><div class="gmail_extra"> ierr = DMDACreate(comm, da);CHKERRQ(ierr);<br> ierr = DMDASetDim(*da, 3);CHKERRQ(ierr); // <-- fix this line<br> ierr = DMDASetSizes(*da, M, N, P);CHKERRQ(ierr);<br>
ierr = DMDASetNumProcs(*da, m, n, p);CHKERRQ(ierr);<br> ierr = DMDASetBoundaryType(*da, bx, by, bz);CHKERRQ(ierr);<br> ierr = DMDASetDof(*da, dof);CHKERRQ(ierr);<br> ierr = DMDASetStencilType(*da, stencil_type);CHKERRQ(ierr);<br>
ierr = DMDASetStencilWidth(*da, s);CHKERRQ(ierr);<br> ierr = DMDASetOwnershipRanges(*da, lx, ly, lz);CHKERRQ(ierr);<br> /* This violates the behavior for other classes, but right now users expect negative dimensions to be handled this way */<br>
ierr = DMSetFromOptions(*da);CHKERRQ(ierr); // <--- delete this line<br> ierr = DMSetUp(*da);CHKERRQ(ierr);<br> ierr = DMViewFromOptions(*da,"-dm_view");CHKERRQ(ierr); // <--- delete or set a prefix</div>
<div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra" style>If I delete the line</div><div class="gmail_extra" style><br></div><div class="gmail_extra" style> ierr = DMSetFromOptions(*da);CHKERRQ(ierr); </div>
<div class="gmail_extra" style><br></div><div class="gmail_extra" style>which implies the partition has no overlaps when in fact I put the option -da_overlap 1 outside ( I need overlaps). How to fix it?</div><div class="gmail_extra" style>
<br></div><div class="gmail_extra" style>Thank you!</div><div class="gmail_extra" style><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Apr 30, 2013 at 9:20 PM, Jed Brown <span dir="ltr"><<a href="mailto:jedbrown@mcs.anl.gov" target="_blank">jedbrown@mcs.anl.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">Lulu Liu <<a href="mailto:lulu.liu@kaust.edu.sa">lulu.liu@kaust.edu.sa</a>> writes:<br>
<br>
> src/ts/examples/tutorials/ex29.c I want domain partition is 1x2<br>
><br>
> mpiexec -n 2 ./ex29 -da_refine 4 -ts_max_steps 10 -ts_rtol 1e-3 -ts_atol<br>
> 1e-3 -ts_type arkimex -ts_monitor -snes_monitor -snes_type ngmres<br>
> -npc_snes_type nasm -npc_snes_nasm_type restrict -da_overlap 4<br>
> -da_processors_x 1 -da_processors_y 2<br>
<br>
</div>Thanks for sending the command to reproduce.<br>
<div><div class="h5"><br>
> 0 TS dt 0.05 time 0<br>
> 0 SNES Function norm 1.762942085583e+01<br>
> [0]PETSC ERROR: --------------------- Error Message<br>
> ------------------------------------<br>
> [0]PETSC ERROR: Argument out of range!<br>
> [0]PETSC ERROR: Too many processors in Y direction: 2 1!<br>
> [0]PETSC ERROR: [1]PETSC ERROR: --------------------- Error Message<br>
> ------------------------------------<br>
> [1]PETSC ERROR: Argument out of range!<br>
> [1]PETSC ERROR: Too many processors in Y direction: 2 1!<br>
> [1]PETSC ERROR:<br>
> ------------------------------------------------------------------------<br>
> [1]PETSC ERROR: Petsc Development GIT revision:<br>
> bc51b945dfb4f1d1228fb677a132a806066a0f32 GIT Date: 2013-04-29 10:22:29<br>
> -0500<br>
> ------------------------------------------------------------------------<br>
> [0]PETSC ERROR: Petsc Development GIT revision:<br>
> bc51b945dfb4f1d1228fb677a132a806066a0f32 GIT Date: 2013-04-29 10:22:29<br>
> -0500<br>
> [0]PETSC ERROR: See docs/changes/index.html for recent updates.<br>
> [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.<br>
> [0]PETSC ERROR: See docs/index.html for manual pages.<br>
> [0]PETSC ERROR:<br>
> ------------------------------------------------------------------------<br>
> [0]PETSC ERROR: ./ex29 on a arch-basic named kl-12681.local by liul Tue Apr<br>
> 30 21:07:37 2013<br>
> [0]PETSC ERROR: [1]PETSC ERROR: See docs/changes/index.html for recent<br>
> updates.<br>
> [1]PETSC ERROR: See docs/faq.html for hints about trouble shooting.<br>
> [1]PETSC ERROR: See docs/index.html for manual pages.<br>
> [1]PETSC ERROR:<br>
> ------------------------------------------------------------------------<br>
> [1]PETSC ERROR: ./ex29 on a arch-basic named kl-12681.local by liul Tue Apr<br>
> 30 21:07:37 2013<br>
> [1]PETSC ERROR: Libraries linked from /Users/liul/soft/petsc/arch-basic/lib<br>
> [1]PETSC ERROR: Configure run at Tue Apr 30 15:46:16 2013<br>
> [1]PETSC ERROR: Configure options --download-cmake --download-f-blas-lapack<br>
> --download-mpich --with-cc=gcc --with-fc=gfortran PETSC_ARCH=arch-basic<br>
> [1]PETSC ERROR:<br>
> ------------------------------------------------------------------------<br>
> [1]PETSC ERROR: Libraries linked from /Users/liul/soft/petsc/arch-basic/lib<br>
> [0]PETSC ERROR: Configure run at Tue Apr 30 15:46:16 2013<br>
> [0]PETSC ERROR: Configure options --download-cmake --download-f-blas-lapack<br>
> --download-mpich --with-cc=gcc --with-fc=gfortran PETSC_ARCH=arch-basic<br>
> [0]PETSC ERROR:<br>
> ------------------------------------------------------------------------<br>
> [0]PETSC ERROR: DMSetUp_DA_2D() line 266 in<br>
> /Users/liul/soft/petsc/src/dm/impls/da/da2.c<br>
> DMSetUp_DA_2D() line 266 in /Users/liul/soft/petsc/src/dm/impls/da/da2.c<br>
> [1]PETSC ERROR: DMSetUp_DA() line 27 in<br>
> /Users/liul/soft/petsc/src/dm/impls/da/dareg.c<br>
> [1]PETSC ERROR: DMSetUp() line 469 in<br>
> /Users/liul/soft/petsc/src/dm/interface/dm.c<br>
> [1]PETSC ERROR: DMDACreate2d() line 888 in<br>
> /Users/liul/soft/petsc/src/dm/impls/da/da2.c<br>
> [1]PETSC ERROR: [0]PETSC ERROR: DMSetUp_DA() line 27 in<br>
> /Users/liul/soft/petsc/src/dm/impls/da/dareg.c<br>
> [0]PETSC ERROR: DMSetUp() line 469 in<br>
> /Users/liul/soft/petsc/src/dm/interface/dm.c<br>
> DMDAGetReducedDMDA() line 389 in<br>
> /Users/liul/soft/petsc/src/dm/impls/da/dacorn.c<br>
> [1]PETSC ERROR: CoefficientSubDomainRestrictHook() line 92 in<br>
> src/ts/examples/tutorials/ex29.c<br>
> [1]PETSC ERROR: DMCreateDomainDecomposition() line 1314 in<br>
> /Users/liul/soft/petsc/src/dm/interface/dm.c<br>
> [1]PETSC ERROR: SNESSetUp_NASM() line 112 in<br>
> /Users/liul/soft/petsc/src/snes/impls/nasm/nasm.c<br>
> [1]PETSC ERROR: SNESSetUp() line 2633 in<br>
> /Users/liul/soft/petsc/src/snes/interface/snes.c<br>
> [0]PETSC ERROR: DMDACreate2d() line 888 in<br>
> /Users/liul/soft/petsc/src/dm/impls/da/da2.c<br>
> [0]PETSC ERROR: DMDAGetReducedDMDA() line 389 in<br>
> /Users/liul/soft/petsc/src/dm/impls/da/dacorn.c<br>
<br>
</div></div> if (dim == 1) {<br>
ierr = DMDACreate1d(PetscObjectComm((PetscObject)da),bx,M,nfields,s,dd->lx,nda);CHKERRQ(ierr);<br>
} else if (dim == 2) {<br>
ierr = DMDACreate2d(PetscObjectComm((PetscObject)da),bx,by,stencil_type,M,N,m,n,nfields,s,lx,ly,nda);CHKERRQ(ierr);<br>
} else if (dim == 3) {<br>
ierr = DMDACreate3d(PetscObjectComm((PetscObject)da),bx,by,bz,stencil_type,M,N,P,m,n,p,nfields,s,lx,ly,lz,nda);CHKERRQ(ierr);<br>
}<br>
<br>
This code should be fixed to use the precise API instead of the<br>
convenience routines DMDACreate*d(), so that it does NOT call<br>
DMSetFromOptions (or if it does, call it after setting a prefix).<br>
<br>
Lulu, would you be up for taking a crack at this and submitting a patch?<br>
Just take the sequence of calls found in DMDACreate3d:<br>
<br>
ierr = DMDACreate(comm, da);CHKERRQ(ierr);<br>
ierr = DMDASetDim(*da, 3);CHKERRQ(ierr); // <-- fix this line<br>
ierr = DMDASetSizes(*da, M, N, P);CHKERRQ(ierr);<br>
ierr = DMDASetNumProcs(*da, m, n, p);CHKERRQ(ierr);<br>
ierr = DMDASetBoundaryType(*da, bx, by, bz);CHKERRQ(ierr);<br>
ierr = DMDASetDof(*da, dof);CHKERRQ(ierr);<br>
ierr = DMDASetStencilType(*da, stencil_type);CHKERRQ(ierr);<br>
ierr = DMDASetStencilWidth(*da, s);CHKERRQ(ierr);<br>
ierr = DMDASetOwnershipRanges(*da, lx, ly, lz);CHKERRQ(ierr);<br>
/* This violates the behavior for other classes, but right now users expect negative dimensions to be handled this way */<br>
ierr = DMSetFromOptions(*da);CHKERRQ(ierr); // <--- delete this<br>
ierr = DMSetUp(*da);CHKERRQ(ierr);<br>
ierr = DMViewFromOptions(*da,"-dm_view");CHKERRQ(ierr); // <--- delete or set a prefix<br>
<br>
I can help if you get stuck.<br>
<br>
<a href="https://bitbucket.org/petsc/petsc/wiki/Home" target="_blank">https://bitbucket.org/petsc/petsc/wiki/Home</a><br>
</blockquote></div><br><br clear="all"><div><br></div><br>
</div></div>
<br>
<div><hr></div><font face="Arial" size="1">This message and its contents, including attachments are intended solely for the original recipient. If you are not the intended recipient or have received this message in error, please notify me immediately and delete this message from your computer system. Any unauthorized use or distribution is prohibited. Please consider the environment before printing this email.</font>