Actual source code: mpiaij.h
5: #include src/mat/impls/aij/seq/aij.h
6: #include src/sys/ctable.h
8: typedef struct {
9: PetscInt *rowners,*cowners; /* ranges owned by each processor */
10: PetscInt rstart,rend; /* starting and ending owned rows */
11: PetscInt cstart,cend; /* starting and ending owned columns */
12: Mat A,B; /* local submatrices: A (diag part),
13: B (off-diag part) */
14: PetscMPIInt size; /* size of communicator */
15: PetscMPIInt rank; /* rank of proc in communicator */
17: /* The following variables are used for matrix assembly */
19: PetscTruth donotstash; /* PETSC_TRUE if off processor entries dropped */
20: MPI_Request *send_waits; /* array of send requests */
21: MPI_Request *recv_waits; /* array of receive requests */
22: PetscInt nsends,nrecvs; /* numbers of sends and receives */
23: PetscScalar *svalues,*rvalues; /* sending and receiving data */
24: PetscInt rmax; /* maximum message length */
25: #if defined (PETSC_USE_CTABLE)
26: PetscTable colmap;
27: #else
28: PetscInt *colmap; /* local col number of off-diag col */
29: #endif
30: PetscInt *garray; /* global index of all off-processor columns */
32: /* The following variables are used for matrix-vector products */
34: Vec lvec; /* local vector */
35: VecScatter Mvctx; /* scatter context for vector */
36: PetscTruth roworiented; /* if true, row-oriented input, default true */
38: /* The following variables are for MatGetRow() */
40: PetscInt *rowindices; /* column indices for row */
41: PetscScalar *rowvalues; /* nonzero values in row */
42: PetscTruth getrowactive; /* indicates MatGetRow(), not restored */
44: } Mat_MPIAIJ;
46: typedef struct { /* used by MatMatMult_MPIAIJ_MPIAIJ and MatPtAP_MPIAIJ_MPIAIJ for reusing symbolic mat product */
47: PetscInt *startsj;
48: PetscScalar *bufa;
49: IS isrowa,isrowb,iscolb;
50: Mat *aseq,*bseq,C_seq; /* A_seq=aseq[0], B_seq=bseq[0] */
51: Mat A_loc,B_seq;
52: Mat B_loc,B_oth; /* partial B_seq -- intend to replace B_seq */
53: PetscInt brstart; /* starting owned rows of B in matrix bseq[0]; brend = brstart+B->m */
54: PetscInt *abi,*abj; /* symbolic i and j arrays of the local product A_loc*B_seq */
55: PetscInt abnz_max; /* max(abi[i+1] - abi[i]), max num of nnz in a row of A_loc*B_seq */
56: MatReuse reuse;
57: PetscErrorCode (*MatDestroy)(Mat);
58: } Mat_MatMatMultMPI;
60: typedef struct { /* used by MatMerge_SeqsToMPI for reusing the merged matrix */
61: PetscMap rowmap;
62: PetscInt **buf_ri,**buf_rj;
63: PetscMPIInt *len_s,*len_r,*id_r; /* array of length of comm->size, store send/recv matrix values */
64: PetscMPIInt nsend,nrecv;
65: PetscInt *bi,*bj; /* i and j array of the local portion of mpi C=P^T*A*P */
66: PetscInt *owners_co,*coi,*coj; /* i and j array of (p->B)^T*A*P - used in the communication */
67: } Mat_Merge_SeqsToMPI;
69: EXTERN PetscErrorCode MatSetColoring_MPIAIJ(Mat,ISColoring);
70: EXTERN PetscErrorCode MatSetValuesAdic_MPIAIJ(Mat,void*);
71: EXTERN PetscErrorCode MatSetValuesAdifor_MPIAIJ(Mat,PetscInt,void*);
72: EXTERN PetscErrorCode MatSetUpMultiply_MPIAIJ(Mat);
73: EXTERN PetscErrorCode DisAssemble_MPIAIJ(Mat);
74: EXTERN PetscErrorCode MatDuplicate_MPIAIJ(Mat,MatDuplicateOption,Mat *);
75: EXTERN PetscErrorCode MatIncreaseOverlap_MPIAIJ(Mat,PetscInt,IS [],PetscInt);
76: EXTERN PetscErrorCode MatFDColoringCreate_MPIAIJ(Mat,ISColoring,MatFDColoring);
77: EXTERN PetscErrorCode MatGetSubMatrices_MPIAIJ (Mat,PetscInt,const IS[],const IS[],MatReuse,Mat *[]);
78: EXTERN PetscErrorCode MatGetSubMatrix_MPIAIJ (Mat,IS,IS,PetscInt,MatReuse,Mat *);
79: EXTERN PetscErrorCode MatLoad_MPIAIJ(PetscViewer, MatType,Mat*);
80: EXTERN PetscErrorCode MatMatMult_MPIAIJ_MPIAIJ(Mat,Mat,MatReuse,PetscReal,Mat*);
81: EXTERN PetscErrorCode MatMatMultSymbolic_MPIAIJ_MPIAIJ(Mat,Mat,PetscReal,Mat*);
82: EXTERN PetscErrorCode MatMatMultNumeric_MPIAIJ_MPIAIJ(Mat,Mat,Mat);
83: EXTERN PetscErrorCode MatPtAPSymbolic_MPIAIJ(Mat,Mat,PetscReal,Mat*);
84: EXTERN PetscErrorCode MatPtAPNumeric_MPIAIJ(Mat,Mat,Mat);
85: EXTERN PetscErrorCode MatPtAPSymbolic_MPIAIJ_MPIAIJ(Mat,Mat,PetscReal,Mat*);
86: EXTERN PetscErrorCode MatPtAPNumeric_MPIAIJ_MPIAIJ(Mat,Mat,Mat);
87: EXTERN PetscErrorCode MatSetValues_MPIAIJ(Mat,PetscInt,const PetscInt[],PetscInt,const PetscInt[],const PetscScalar [],InsertMode);
88: EXTERN PetscErrorCode MatDestroy_MPIAIJ_MatMatMult(Mat);
89: EXTERN PetscErrorCode PetscObjectContainerDestroy_Mat_MatMatMultMPI(void*);
92: #if !defined(PETSC_USE_COMPLEX) && !defined(PETSC_USE_SINGLE) && !defined(PETSC_USE_MAT_SINGLE)
93: EXTERN PetscErrorCode MatLUFactorSymbolic_MPIAIJ_TFS(Mat,IS,IS,MatFactorInfo*,Mat*);
94: #endif
97: EXTERN PetscErrorCode PETSCMAT_DLLEXPORT MatGetDiagonalBlock_MPIAIJ(Mat,PetscTruth *,MatReuse,Mat *);
98: EXTERN PetscErrorCode PETSCMAT_DLLEXPORT MatDiagonalScaleLocal_MPIAIJ(Mat,Vec);
101: #endif