Actual source code: mpirowbs.h
5: #include include/private/matimpl.h
8: #include "BSsparse.h"
9: #include "BSprivate.h"
12: /*
13: Mat_MPIRowbs - Parallel, compressed row storage format that's the
14: interface to BlockSolve.
15: */
17: typedef struct {
18: int size; /* size of communicator */
19: int rank; /* rank of proc in communicator */
20: int sorted; /* if true, rows sorted by increasing cols */
21: PetscTruth roworiented; /* if true, row-oriented storage */
22: int nonew; /* if true, no new elements allowed */
23: int nz,maxnz; /* total nonzeros stored, allocated */
24: int *imax; /* allocated matrix space per row */
26: /* The following variables are used in matrix assembly */
27: PetscTruth donotstash; /* 1 if off processor entries dropped */
28: MPI_Request *send_waits; /* array of send requests */
29: MPI_Request *recv_waits; /* array of receive requests */
30: int nsends,nrecvs; /* numbers of sends and receives */
31: PetscScalar *svalues,*rvalues; /* sending and receiving data */
32: int rmax; /* maximum message length */
33: PetscTruth vecs_permscale; /* flag indicating permuted and scaled vectors */
34: int factor;
35: int bs_color_single; /* Indicates blocksolve should bypass cliques in coloring */
36: int reallocs; /* number of mallocs during MatSetValues() */
37: PetscTruth keepzeroedrows; /* keeps matrix structure same in calls to MatZeroRows()*/
39: /* BlockSolve data */
40: MPI_Comm comm_mpirowbs; /* use a different communicator for BlockSolve */
41: BSprocinfo *procinfo; /* BlockSolve processor context */
42: BSmapping *bsmap; /* BlockSolve mapping context */
43: BSspmat *A; /* initial matrix */
44: BSpar_mat *pA; /* permuted matrix */
45: BScomm *comm_pA; /* communication info for triangular solves */
46: BSpar_mat *fpA; /* factored permuted matrix */
47: BScomm *comm_fpA; /* communication info for factorization */
48: Vec diag; /* scaling vector (stores inverse of square
49: root of permuted diagonal of original matrix) */
50: Vec xwork; /* work space for mat-vec mult */
52: /* Cholesky factorization data */
53: double alpha; /* restart for failed factorization */
54: int ierr; /* BS factorization error */
55: int failures; /* number of BS factorization failures */
56: int blocksolveassembly; /* Indicates the matrix has been assembled for block solve */
57: int assembled_icc_storage; /* Indicates that the block solve assembly was performed for icc format */
58: } Mat_MPIRowbs;
60: EXTERN PetscErrorCode MatCholeskyFactorNumeric_MPIRowbs(Mat,MatFactorInfo*,Mat*);
61: EXTERN PetscErrorCode MatIncompleteCholeskyFactorSymbolic_MPIRowbs(Mat,IS,MatFactorInfo*,Mat *);
62: EXTERN PetscErrorCode MatLUFactorNumeric_MPIRowbs(Mat,MatFactorInfo*,Mat*);
63: EXTERN PetscErrorCode MatILUFactorSymbolic_MPIRowbs(Mat,IS,IS,MatFactorInfo*,Mat *);
64: EXTERN PetscErrorCode MatSolve_MPIRowbs(Mat,Vec,Vec);
65: EXTERN PetscErrorCode MatForwardSolve_MPIRowbs(Mat,Vec,Vec);
66: EXTERN PetscErrorCode MatBackwardSolve_MPIRowbs(Mat,Vec,Vec);
67: EXTERN PetscErrorCode MatScaleSystem_MPIRowbs(Mat,Vec,Vec);
68: EXTERN PetscErrorCode MatUnScaleSystem_MPIRowbs(Mat,Vec,Vec);
69: EXTERN PetscErrorCode MatUseScaledForm_MPIRowbs(Mat,PetscTruth);
70: EXTERN PetscErrorCode MatGetSubMatrices_MPIRowbs (Mat,int,const IS[],const IS[],MatReuse,Mat **);
71: EXTERN PetscErrorCode MatGetSubMatrix_MPIRowbs (Mat,IS,IS,int,MatReuse,Mat *);
72: EXTERN PetscErrorCode MatAssemblyEnd_MPIRowbs_ForBlockSolve(Mat);
73: EXTERN PetscErrorCode MatGetSubMatrices_MPIRowbs_Local(Mat,int,const IS[],const IS[],MatReuse,Mat*);
74: EXTERN PetscErrorCode MatLoad_MPIRowbs(PetscViewer,MatType,Mat*);
76: #define CHKERRBS(a) {if (__BSERROR_STATUS) {(*PetscErrorPrintf)(\
77: "BlockSolve95 Error Code %d\n",__BSERROR_STATUS);CHKERRQ(1);}}
79: #if defined(PETSC_USE_LOG) /* turn on BlockSolve logging */
80: #define MAINLOG
81: #endif
83: #endif