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