[petsc-users] AOCreateBasic & AOCreateBasicIS

Hui Zhang mike.hui.zhang at hotmail.com
Mon Apr 15 10:22:21 CDT 2013


On Apr 15, 2013, at 5:11 PM, Matthew Knepley wrote:

> On Mon, Apr 15, 2013 at 10:04 AM, Hui Zhang <mike.hui.zhang at hotmail.com> wrote:
> 
> On Apr 15, 2013, at 4:53 PM, Jed Brown wrote:
> 
> > Hui Zhang <mike.hui.zhang at hotmail.com> writes:
> >
> >> Is the following correct?
> >>
> >> From my understanding before,
> >>
> >> AOCreateBasic(MPI_Comm comm,PetscInt napp,const PetscInt myapp[],const PetscInt mypetsc[],AO *aoout)
> >>
> >> should be called by all the processors in 'comm' and each involved processor provides only part of all the indices.
> >> For example, 'comm' contains two processors proc0,
> >>
> >> on proc0:  napp= 3, myapp[]= {0,1,2}, mypetsc[]= {4,3,2}
> >>
> >> on proc1:  napp= 2, myapp[]= {3,4}, mypetsc[]= {0,1}
> >>
> >> so that union of myapp[] of proc0 and proc1 gives 0,..,4, and union of myapp[] of proc0 and proc1 also gives 0,..,4.
> >>
> >> This seemed to work even if I fed AOApplicationToPetsc with indices on proc0 larger than 2.
> >> But now I suspect I was wrong after reading
> >>
> >>      http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/AO/AOCreateBasic.html
> >>
> >> The question is whether AOCreateBasic will do union of the input indices automatically, or the AO is only for the input indices?
> >
> > AOCreateBasic does an allgather on the indices so it can translate any
> > indices.  This is not memory scalable and we don't recommend using it
> > unless you know your problem sizes are not very large, but some people
> > want to translate arbitrary indices non-collectively.
> 
> Thanks! Is the problem you mentioned serious when the indices to be translated on each processor include only a few ones beyond the input myapp[] of AOCreateBasic?
> Because I only use AO for FEM assembly so I would not translate too many beyond local ranges.
> 
> If your problem gets large, this will be a problem.

Thanks!  I see.  I can make another local AO based on the global AO.  For assembly, as I learned from you, I use ISLocalToGlobalMapping.

> Another question: do the inputs IS's to AOCreateBasicIS include all the indices, and AOCreateBasicIS would not do any gathering of indices?
> 
> No, its the same thing.

Maybe my question was unclear.  From the manual

http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/AO/AOCreateBasicIS.html#AOCreateBasicIS

AOCreateBasicIS(IS isapp,IS ispetsc,AO *aoout)

is collective on IS so the parallel IS's must already conceptually contain all the indices from all the processors in the 'comm' of IS.  Is this also what you meant?

> 
>    Matt
> 
> -- 
> What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.
> -- Norbert Wiener



More information about the petsc-users mailing list