VecGetOwnershipRange() works with any vector, including DM created vectors. You could not have the global ownership you provide below.
Perhaps you are thinking about the Natural ownership values? For those if you using DMDA take a look at DMDAGetAO() and DMDACreateNaturalVector() Barry > On Jan 30, 2023, at 10:36 AM, Venugopal, Vysakh (venugovh) via petsc-users > <[email protected]> wrote: > > Hello, > > I am using a DMCreateGlobalVector to create a vector V. If V is divided into > m processes, is there a way to get the global indices of V assigned to each > process? > > For example: V = [10, 20, 30, 40, 50, 60, 70, 80]. > If MPI process 0 has [10, 40, 50, 60] and process 1 has [20, 30, 70, 80], is > it possible to get the indices for process 0 as [0,3,4,5] and process 1 as > [1,2,6,7]? > > Thanks, > > Vysakh > --- > Vysakh Venugopal > Ph.D. Candidate > Department of Mechanical Engineering > University of Cincinnati, Cincinnati, OH 45221-0072
