MatCreateAIJCUSPARSE#
Creates a sparse matrix in MATAIJCUSPARSE (compressed row) format. This matrix will ultimately be pushed down to NVIDIA GPUs and use the CuSPARSE library for calculations.
Synopsis#
Collective
Input Parameters#
- comm - MPI communicator, set to - PETSC_COMM_SELF
- m - number of local rows (or - PETSC_DECIDEto have calculated if- Mis given) This value should be the same as the local size used in creating the \(y\) vector for the matrix-vector product \(y = Ax\).
- n - This value should be the same as the local size used in creating the \(x\) vector for the matrix-vector product \(y = Ax\). (or - PETSC_DECIDEto have calculated if- Nis given) For square matrices- nis almost always- m.
- M - number of global rows (or - PETSC_DETERMINEto have calculated if- mis given)
- N - number of global columns (or - PETSC_DETERMINEto have calculated if- nis given)
- d_nz - number of nonzeros per row in DIAGONAL portion of local submatrix (same value is used for all local rows) 
- d_nnz - array containing the number of nonzeros in the various rows of the DIAGONAL portion of the local submatrix (possibly different for each row) or - NULL, if- d_nzis used to specify the nonzero structure. The size of this array is equal to the number of local rows, i.e- m. For matrices you plan to factor you must leave room for the diagonal entry and put in the entry even if it is zero.
- o_nz - number of nonzeros per row in the OFF-DIAGONAL portion of local submatrix (same value is used for all local rows). 
- o_nnz - array containing the number of nonzeros in the various rows of the OFF-DIAGONAL portion of the local submatrix (possibly different for each row) or - NULL, if- o_nzis used to specify the nonzero structure. The size of this array is equal to the number of local rows, i.e- m.
Output Parameter#
- A - the matrix 
Notes#
It is recommended that one use the MatCreate(), MatSetType() and/or MatSetFromOptions(),
MatXXXXSetPreallocation() paradigm instead of this routine directly.
[MatXXXXSetPreallocation() is, for example, MatSeqAIJSetPreallocation()]
The AIJ format, also called the compressed row storage), is fully compatible with standard Fortran storage. That is, the stored row and column indices can begin at either one (as in Fortran) or zero.
When working with matrices for GPUs, it is often better to use the MatSetPreallocationCOO() and MatSetValuesCOO() paradigm rather than using this routine and MatSetValues()
See Also#
Matrices, Mat, MATAIJCUSPARSE, MatCreate(), MatCreateAIJ(), MatSetValues(), MatSeqAIJSetColumnIndices(), MatCreateSeqAIJWithArrays(), MATMPIAIJCUSPARSE
Level#
intermediate
Location#
src/mat/impls/aij/mpi/mpicusparse/mpiaijcusparse.cu
Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages