<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Dear PETSc community,</p>
<p>in our CFD code we use a 3D DMDA to organize our data.</p>
<p>Now I need to compute a derived quantity in a subregion of the
global domain and to write these data to disk for further
post-processing.</p>
<p>The subregion is actually a planar slice for now, but it could
also be a boxed-shaped region in future applications.</p>
<p>Hence, I figured I would create a new DMDA for this subregion by
writing something along the lines of <br>
</p>
<p><tt>call DMDACreate3d( & !
<a class="moz-txt-link-freetext" href="https://www.mcs.anl.gov/petsc/petsc-3.8.4/docs/manualpages/DMDA/DMDACreate3d.html">https://www.mcs.anl.gov/petsc/petsc-3.8.4/docs/manualpages/DMDA/DMDACreate3d.html</a><br>
PETSC_COMM_WORLD, &<br>
DM_BOUNDARY_NONE, DM_BOUNDARY_NONE, DM_BOUNDARY_NONE, &<br>
DMDA_STENCIL_BOX, & ! <= stencil type<br>
sum(lx), sum(ly), sum(lz), & ! <= global
dimension (of data) in each direction<br>
px, py, pz, & ! <= number of
processors in each dimension<br>
1, 0, & ! <= dof per node,
stencil width (no ghost cell)<br>
lx, ly, lz, & ! <= numbers of
nodes held by processors<br>
dmobject, ierr )</tt><tt><br>
</tt></p>
<p>where lx, ly and lz could look like<br>
</p>
<p><tt>lx = (/ 0, 1, 0 /)<br>
ly = (/ 16, 16 /)<br>
lz = (/ 16, 16 /)<br>
</tt></p>
<p>Unfortunately, this does not work:</p>
<p>
<blockquote type="cite"><tt>[0]PETSC ERROR: ---------------------
Error Message
--------------------------------------------------------------</tt><tt><br>
</tt><tt>[0]PETSC ERROR: Argument out of range</tt><tt><br>
</tt><tt>[0]PETSC ERROR: Partition in x direction is too fine! 1
2</tt><tt><br>
</tt><tt>[0]PETSC ERROR: See
<a class="moz-txt-link-freetext" href="http://www.mcs.anl.gov/petsc/documentation/faq.html">http://www.mcs.anl.gov/petsc/documentation/faq.html</a> for
trouble shooting.</tt><tt><br>
</tt><tt>[0]PETSC ERROR: Petsc Release Version 3.8.4, Mar, 24,
2018 </tt><tt><br>
</tt><tt>[0]PETSC ERROR: ./prime on a foss_debug named laptwo by
bastian Tue Jan 25 23:32:30 2022</tt><tt><br>
</tt><tt>[0]PETSC ERROR: Configure options PETSC_ARCH=foss_debug
--with-cc=gcc --with-cxx=g++ --with-fc=gfortran
--download-mpich --with-large-file-io=1
--with-shared-libraries=1 COPTFLAGS=" " CXXOPTFLAGS=" "
FOPTFLAGS=" " --march=native --mtune=native
--download-hypre=/soft/petsc-3.8.4/foss_debug/hypre-v2.12.0.tar.gz
--with-debugging=yes</tt><tt><br>
</tt><tt>[0]PETSC ERROR: #1 DMSetUp_DA_3D() line 318 in
/soft/petsc-3.8.4/src/dm/impls/da/da3.c</tt><tt><br>
</tt><tt>[0]PETSC ERROR: #2 DMSetUp_DA() line 25 in
/soft/petsc-3.8.4/src/dm/impls/da/dareg.c</tt><tt><br>
</tt><tt>[0]PETSC ERROR: #3 DMSetUp() line 720 in
/soft/petsc-3.8.4/src/dm/interface/dm.c</tt><tt><br>
</tt><tt>[0]PETSC ERROR: #4 User provided function() line 0 in
User file</tt><tt><br>
</tt><tt>application called MPI_Abort(MPI_COMM_WORLD, 63) -
process 0</tt><br>
</blockquote>
Apparently, <tt>lx</tt>, <tt>ly</tt> and <tt>lz</tt> cannot
contain zeros.<br>
(Which would be a useful information in the documentation, too.)</p>
<p>Is there any workaround?<br>
</p>
<p>My current understanding is that I need to go the extra mile of
creating an additional Communicator involving only those ranks
that will share at least one cell in the subregion DMDA.</p>
<p>If this is the way to go? If so, how can I control which rank
receives which subdomain in the subregion? DMDACreate3d does not
enable me to do so, but I need to make sure that a rank holds only
those cells of the subregion which are also present in its share
of the global domain.</p>
<p>Many thanks in advance,<br>
Bastian Löhrer<br>
</p>
<div class="moz-signature"><br>
</div>
</body>
</html>