[petsc-users] AOCreateBasic & AOCreateBasicIS

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


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. 

Another question: do the inputs IS's to AOCreateBasicIS include all the indices, and AOCreateBasicIS would not do any gathering of indices?


More information about the petsc-users mailing list