petsc-3.10.5 2019-03-28
Report Typos and Errors

MatGetOwnershipRange

Returns the range of matrix rows owned by this processor, assuming that the matrix is laid out with the first n1 rows on the first processor, the next n2 rows on the second, etc. For certain parallel layouts this range may not be well defined.

Synopsis

#include "petscmat.h" 
PetscErrorCode MatGetOwnershipRange(Mat mat,PetscInt *m,PetscInt *n)
Not Collective

Input Parameters

mat -the matrix

Output Parameters

m - the global index of the first local row
n - one more than the global index of the last local row

Note: Both output parameters can be NULL on input.

 This function requires that the matrix be preallocated. If you have not preallocated, consider using
   PetscSplitOwnership(MPI_Comm comm, PetscInt *n, PetscInt *N)
 and then MPI_Scan() to calculate prefix sums of the local sizes.

See Also

MatGetOwnershipRanges(), MatGetOwnershipRangeColumn(), MatGetOwnershipRangesColumn(), PetscSplitOwnership(), PetscSplitOwnershipBlock()

Level

beginner

Location

src/mat/interface/matrix.c

Examples

src/mat/examples/tutorials/ex4.c.html
src/mat/examples/tutorials/ex15.c.html
src/mat/examples/tutorials/ex16.c.html
src/mat/examples/tutorials/ex17.c.html
src/ksp/pc/examples/tutorials/ex3.c.html
src/ksp/ksp/examples/tutorials/ex2.c.html
src/ksp/ksp/examples/tutorials/ex5.c.html
src/ksp/ksp/examples/tutorials/ex6.c.html
src/ksp/ksp/examples/tutorials/ex7.c.html
src/ksp/ksp/examples/tutorials/ex8.c.html
src/ksp/ksp/examples/tutorials/ex9.c.html

Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages