MatGetOwnershipRange#
For matrices that own values by row, excludes MATELEMENTAL
and MATSCALAPACK
, returns the range of matrix rows owned by this MPI process.
Synopsis#
#include "petscmat.h"
PetscErrorCode MatGetOwnershipRange(Mat mat, PetscInt *m, PetscInt *n)
Not Collective
Input Parameter#
mat - the matrix
Output Parameters#
m - the global index of the first local row, use
NULL
to not obtain this valuen - one more than the global index of the last local row, use
NULL
to not obtain this value
Notes#
If the Mat
was obtained from a DM
with DMCreateMatrix()
, then the range values are determined by the specific DM
.
If the Mat
was created directly the range values are determined by the local size passed to MatSetSizes()
or MatCreateAIJ()
.
If PETSC_DECIDE
was passed as the local size, then the vector uses default values for the range using PetscSplitOwnership()
.
For certain DM
, such as DMDA
, it is better to use DM
specific routines, such as DMDAGetGhostCorners()
, to determine
the local values in the matrix.
The high argument is one more than the last element stored locally.
For all matrices it returns the range of matrix rows associated with rows of a vector that would contain the result of a matrix vector product with this matrix. See Matrix Layouts for details on matrix layouts.
See Also#
Matrices, Mat
, MatGetOwnershipRanges()
, MatGetOwnershipRangeColumn()
, MatGetOwnershipRangesColumn()
, PetscSplitOwnership()
,
PetscSplitOwnershipBlock()
, PetscLayout
, MatSetSizes()
, MatCreateAIJ()
, DMDAGetGhostCorners()
, DM
Level#
beginner
Location#
Examples#
src/mat/tutorials/ex17f.F90
src/mat/tutorials/ex4f.F90
src/mat/tutorials/ex4.c
src/mat/tutorials/ex15f.F90
src/tao/pde_constrained/tutorials/parabolic.c
src/tao/tutorials/ex4.c
src/tao/pde_constrained/tutorials/elliptic.c
src/mat/tutorials/ex16.c
src/mat/tutorials/ex15.c
src/mat/tutorials/ex17.c
Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages