petsc-3.14.6 2021-03-30
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/tutorials/ex4.c.html
src/mat/tutorials/ex15.c.html
src/mat/tutorials/ex16.c.html
src/mat/tutorials/ex17.c.html
src/mat/tutorials/ex4f.F90.html
src/mat/tutorials/ex15f.F90.html
src/mat/tutorials/ex17f.F90.html
src/ksp/pc/tutorials/ex3.c.html
src/ksp/ksp/tutorials/ex2.c.html
src/ksp/ksp/tutorials/ex4.c.html
src/ksp/ksp/tutorials/ex5.c.html

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