xref: /petsc/src/mat/impls/dense/mpi/mpidense.h (revision 70f55243aafb320636e2a54ff30cab5d1e8d3d7b)
1 /* $Id: mpidense.h,v 1.10 1996/01/24 05:45:49 bsmith Exp bsmith $ */
2 
3 #include "src/mat/impls/dense/seq/dense.h"
4 
5   /*  Data stuctures for basic parallel dense matrix  */
6 
7 /* Structure to hold the information for factorization of a dense matrix */
8 /* Most of this info is used in the pipe send/recv routines */
9 typedef struct {
10   int    nlnr;        /* number of local rows downstream */
11   int    nrend;       /* rend for downstream processor */
12   int    nbr, pnbr;   /* Down and upstream neighbors */
13   int    *tag;        /* message tags */
14   int    currow;      /* current row number */
15   int    phase;       /* phase (used to indicate tag) */
16   int    up;          /* Are we moving up or down in row number? */
17   int    use_bcast;   /* Are we broadcasting max length? */
18   int    nsend;       /* number of sends */
19   int    nrecv;       /* number of receives */
20 
21   /* data initially in matrix context */
22   int    k;           /* Blocking factor (unused as yet) */
23   int    k2;          /* Blocking factor for solves */
24   Scalar *temp;
25   int    nlptr;
26   int    *lrows;
27   int    *nlrows;
28   int    *pivots;
29 } FactorCtx;
30 
31 #define PIPEPHASE (ctx->phase == 0)
32 
33 typedef struct {
34   int           *rowners, *cowners;     /* ranges owned by each processor */
35   int           m, n;                   /* local rows and columns */
36   int           M, N;                   /* global rows and columns */
37   int           rstart, rend;           /* starting and ending owned rows */
38   Mat           A;                      /* local submatrix */
39   int           size;                   /* size of communicator */
40   int           rank;                   /* rank of proc in communicator */
41 
42   /* The following variables are used for matrix assembly */
43 
44   InsertMode    insertmode;             /* mode for MatSetValues */
45   Stash         stash;                  /* stash for non-local elements */
46   MPI_Request   *send_waits;            /* array of send requests */
47   MPI_Request   *recv_waits;            /* array of receive requests */
48   int           nsends, nrecvs;         /* numbers of sends and receives */
49   Scalar        *svalues, *rvalues;     /* sending and receiving data */
50   int           rmax;                   /* maximum message length */
51 
52   /* The following variables are used for matrix-vector products */
53 
54   Vec           lvec;                   /* local vector */
55   VecScatter    Mvctx;                  /* scatter context for vector */
56 
57   int           roworiented;            /* if true, row oriented input (default) */
58   FactorCtx     *factor;                /* factorization context */
59 } Mat_MPIDense;
60