[petsc-users] how to know the original global index after the partition.

Shri abhyshr at mcs.anl.gov
Wed Aug 7 11:18:52 CDT 2013


One way to do this is to call ISPartitioningCount() first to get the number of indices on each process and then call ISInvertPermutation() to get the IS that has the original global index. Here's what I've done in one of my code.

/* Convert the processor mapping IS to new global numbering */
    ierr = ISPartitioningToNumbering(is,&is_globalnew);CHKERRQ(ierr);
    PetscInt *nloc;
/* Convert new global numbering to old global numbering */
    ierr = PetscMalloc(nps*sizeof(PetscInt),&nloc);CHKERRQ(ierr);
    ierr = ISPartitioningCount(is,nps,nloc);CHKERRQ(ierr);  // nps is the number of processors.
    ierr = ISDestroy(is);CHKERRQ(ierr);
    ierr = ISInvertPermutation(is_globalnew,nloc[rank],&is);CHKERRQ(ierr);

The resultant "is" is the index set in the old global numbering.

Shri

On Aug 7, 2013, at 5:46 AM, 丁老师 wrote:

> In the ISPartitioningToNumbering(IS part,IS *is) 
> is define thee index set that defines the global numbers on each part.
> but how to get the original global index. 
> 
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20130807/8839ba28/attachment.html>


More information about the petsc-users mailing list