xref: /petsc/src/mat/impls/dense/mpi/mpidense.h (revision ea709b57ddb8cc304f11df2e9a39d6a8fdb28b53)
1 /* $Id: mpidense.h,v 1.17 2000/10/24 20:25:30 bsmith Exp balay $ */
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   PetscScalar *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                                         /* note n == N */
36   int           nvec;                   /* this is the n size for the vector one multiplies with */
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   /* The following variables are used for matrix assembly */
42   PetscTruth    donotstash;             /* Flag indicationg if values should be stashed */
43   MPI_Request   *send_waits;            /* array of send requests */
44   MPI_Request   *recv_waits;            /* array of receive requests */
45   int           nsends,nrecvs;         /* numbers of sends and receives */
46   PetscScalar   *svalues,*rvalues;     /* sending and receiving data */
47   int           rmax;                   /* maximum message length */
48 
49   /* The following variables are used for matrix-vector products */
50 
51   Vec           lvec;                   /* local vector */
52   VecScatter    Mvctx;                  /* scatter context for vector */
53 
54   PetscTruth    roworiented;            /* if true, row oriented input (default) */
55   FactorCtx     *factor;                /* factorization context */
56 } Mat_MPIDense;
57