xref: /petsc/src/mat/impls/sell/mpi/mpisell.h (revision b31b2f82859ff8548562364efb89146f661bbcd9)
1 #pragma once
2 
3 #include <../src/mat/impls/sell/seq/sell.h>
4 
5 typedef struct {
6   Mat         A, B; /* local submatrices: A (diag part),
7                                            B (off-diag part) */
8   PetscMPIInt size; /* size of communicator */
9   PetscMPIInt rank; /* rank of proc in communicator */
10 
11   /* The following variables are used for matrix assembly */
12   PetscBool    donotstash;        /* PETSC_TRUE if off processor entries dropped */
13   MPI_Request *send_waits;        /* array of send requests */
14   MPI_Request *recv_waits;        /* array of receive requests */
15   PetscInt     nsends, nrecvs;    /* numbers of sends and receives */
16   PetscScalar *svalues, *rvalues; /* sending and receiving data */
17   PetscInt     rmax;              /* maximum message length */
18 #if defined(PETSC_USE_CTABLE)
19   PetscHMapI colmap;
20 #else
21   PetscInt *colmap; /* local col number of off-diag col */
22 #endif
23   PetscInt *garray; /* global index of all off-processor columns */
24 
25   /* The following variables are used for matrix-vector products */
26   Vec        lvec; /* local vector */
27   Vec        diag;
28   VecScatter Mvctx;       /* scatter context for vector */
29   PetscBool  roworiented; /* if true, row-oriented input, default true */
30 
31   /* The following variables are for MatGetRow() */
32   PetscInt    *rowindices;   /* column indices for row */
33   PetscScalar *rowvalues;    /* nonzero values in row */
34   PetscBool    getrowactive; /* indicates MatGetRow(), not restored */
35 
36   PetscInt *ld; /* number of entries per row left of diagona block */
37 } Mat_MPISELL;
38 
39 PETSC_EXTERN PetscErrorCode MatCreate_MPISELL(Mat);
40 
41 PETSC_INTERN PetscErrorCode MatAssemblyEnd_MPISELL(Mat, MatAssemblyType);
42 
43 PETSC_INTERN PetscErrorCode MatSetUpMultiply_MPISELL(Mat);
44 PETSC_INTERN PetscErrorCode MatDisAssemble_MPISELL(Mat);
45 
46 PETSC_INTERN PetscErrorCode MatProductCtxDestroy_MPISELL_PtAP(Mat);
47 PETSC_INTERN PetscErrorCode MatDestroy_MPISELL(Mat);
48 
49 PETSC_INTERN PetscErrorCode MatGetSeqNonzeroStructure_MPISELL(Mat, Mat *);
50 
51 PETSC_INTERN PetscErrorCode MatConvert_MPISELL_MPIAIJ(Mat, MatType, MatReuse, Mat *);
52 PETSC_INTERN PetscErrorCode MatConvert_MPIAIJ_MPISELL(Mat, MatType, MatReuse, Mat *);
53 
54 PETSC_INTERN PetscErrorCode MatSOR_MPISELL(Mat, Vec, PetscReal, MatSORType, PetscReal, PetscInt, PetscInt, Vec);
55 
56 PETSC_INTERN PetscErrorCode MatCreateColmap_MPISELL_Private(Mat);
57 PETSC_INTERN PetscErrorCode MatDiagonalScaleLocal_MPISELL(Mat, Vec);
58