MatCreateMPIAdj

Creates a sparse matrix representing an adjacency list. The matrix does not have numerical values associated with it, but is intended for ordering (to reduce bandwidth etc) and partitioning.

Synopsis

int MatCreateMPIAdj(MPI_Comm comm,int m,int n,int *i,int *j,int *values,Mat *A)
Collective on MPI_Comm

Input Parameters

comm - MPI communicator
m - number of local rows
n - number of columns
i - the indices into j for the start of each row
j - the column indices for each row (sorted for each row). The indices in i and j start with zero (NOT with one).
values - [optional] edge weights

Output Parameter

A -the matrix

Notes: This matrix object does not support most matrix operations, include MatSetValues(). You must NOT free the ii, values and jj arrays yourself. PETSc will free them when the matrix is destroyed. And you must allocate them with PetscMalloc(). If you call from Fortran you need not create the arrays with PetscMalloc(). Should not include the matrix diagonals.

Possible values for MatSetOption() - MAT_STRUCTURALLY_SYMMETRIC

See Also

MatCreate(), MatCreateSeqAdj(), MatGetOrdering()

Level:intermediate
Location:
src/mat/impls/adj/mpi/mpiadj.c
Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages

Examples

src/dm/ao/examples/tutorials/ex2.c.html