[petsc-users] Domain partitioning using DAs

Barry Smith bsmith at mcs.anl.gov
Sat Oct 8 08:32:10 CDT 2011


  The "dividing up" is done in DMSetUp_DA_3D() in src/dm/impls/da/da3.c  

   If you don't like the algorithm PETSc uses to "divide up" you can pass in the partitioning you want with the final arguments to DMDACreate3d() or DMDASetOwnershipRanges().

    Barry



On Oct 8, 2011, at 7:27 AM, Mohamad M. Nasr-Azadani wrote:

> Thanks Jed. I guess the whole point I am missing is in that "squarish". 
> I, for instance, use two processors for a domain of the global size:
> nx=50
> ny=40
> nz=4
> 
> To my surprise, the way it was decomposed was in y-direction, i.e. 
> processor 0: 
> 0-49
> 0-19
> 0-3
> 
> processor 1:
> 0-49
> 20-39
> 0-3
> 
> and not x-direction which minimizes the surface area between the two processors. 
> Obviously "2" is a prime number. In that case, is PETSc biased to choose any of the directions? 
> 
> Thanks again
> Best, 
> Mohamad
> 
> 
> On Fri, Oct 7, 2011 at 5:34 AM, Jed Brown <jedbrown at mcs.anl.gov> wrote:
> On Fri, Oct 7, 2011 at 02:58, Mohamad M. Nasr-Azadani <mmnasr at gmail.com> wrote:
> How does DACreate3d() partition the domain among processors? 
> Is it based on the minimizing the surface between the processors? Or it is just a simple x-y-z order? 
> 
> It tries to produce a "squarish" partition based on divisibility of the number of processes. It will only partition in one direction if you use a prime number of processes, for example.
> 



More information about the petsc-users mailing list