[petsc-users] Quick question about ISCreateGeneral

Zhang, Junchao jczhang at mcs.anl.gov
Tue Apr 30 13:00:29 CDT 2019

On Tue, Apr 30, 2019 at 11:42 AM Sajid Ali via petsc-users <petsc-users at mcs.anl.gov<mailto:petsc-users at mcs.anl.gov>> wrote:
Hi PETSc Developers,

I see that in the examples for ISCreateGeneral, the index sets are created by copying values from int arrays (which were created by PetscMalloc1 which is not collective).

If I the ISCreateGeneral is called with PETSC_COMM_WORLD and the int arrays on each rank are independently created, does the index set created concatenate all the int-arrays into one ? If not, what needs to be done to get such an index set ?
From my understanding, they are independently created and not concatenated.  I like index sets created with PETSC_COMM_SELF. They are easy to understand.

PS: For context, I want to write a fftshift convenience function (like numpy, MATLAB) but for large distributed vectors. I thought that I could do this with VecScatter and two index sets, one shifted and one un-shifted.
To achieve this, index sets created with PETSC_COMM_SELF are enough. They just need to contain global indices to indicate the MPI vector to MPI vector scatter. You can think each process provides one piece of the scatter.

Thank You,
Sajid Ali
Applied Physics
Northwestern University
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20190430/54be1669/attachment.html>

More information about the petsc-users mailing list