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() */
41: /* BlockSolve data */
42: BSprocinfo *procinfo; /* BlockSolve processor context */
43: BSmapping *bsmap; /* BlockSolve mapping context */
44: BSspmat *A; /* initial matrix */
45: BSpar_mat *pA; /* permuted matrix */
46: BScomm *comm_pA; /* communication info for triangular solves */
47: BSpar_mat *fpA; /* factored permuted matrix */
48: BScomm *comm_fpA; /* communication info for factorization */
49: Vec diag; /* scaling vector (stores inverse of square
50: root of permuted diagonal of original matrix) */
51: Vec xwork; /* work space for mat-vec mult */
53: /* Cholesky factorization data */
54: double alpha; /* restart for failed factorization */
55: int ierr; /* BS factorization error */
56: int failures; /* number of BS factorization failures */
57: int blocksolveassembly;/* Indicates the matrix has been assembled
58: for block solve */
59: } Mat_MPIRowbs;
62: EXTERN int MatAssemblyEnd_MPIRowbs_ForBlockSolve(Mat);
64: #define CHKERRBS(a) {if (__BSERROR_STATUS) {(*PetscErrorPrintf)(
65: "BlockSolve95 Error Code %dn",__BSERROR_STATUS);CHKERRQ(1);}}
67: #if defined(PETSC_USE_LOG) /* turn on BlockSolve logging */
68: #define MAINLOG
69: #endif
71: #endif