MatGetOwnershipRange#
For matrices that own values by row, excludes MATELEMENTAL
and MATSCALAPACK
, returns the range of matrix rows owned by this MPI rank. 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
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
Note#
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#
Matrices, Mat
, MatGetOwnershipRanges()
, MatGetOwnershipRangeColumn()
, MatGetOwnershipRangesColumn()
, PetscSplitOwnership()
, PetscSplitOwnershipBlock()
,
PetscLayout
Level#
beginner
Location#
Examples#
src/ksp/ksp/tutorials/bench_kspsolve.c
src/ksp/ksp/tutorials/ex11.c
src/ksp/ksp/tutorials/ex11f.F90
src/ksp/ksp/tutorials/ex12.c
src/ksp/ksp/tutorials/ex15.c
src/ksp/ksp/tutorials/ex15f.F90
src/ksp/ksp/tutorials/ex16.c
src/ksp/ksp/tutorials/ex18.c
src/ksp/ksp/tutorials/ex19.c
src/ksp/ksp/tutorials/ex2.c
src/ksp/ksp/tutorials/ex2f.F90
Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages