xref: /petsc/src/mat/impls/dense/mpi/mpidense.h (revision ea709b57ddb8cc304f11df2e9a39d6a8fdb28b53)
1*ea709b57SSatish Balay /* $Id: mpidense.h,v 1.17 2000/10/24 20:25:30 bsmith Exp balay $ */
28965ea79SLois Curfman McInnes 
370f55243SBarry Smith #include "src/mat/impls/dense/seq/dense.h"
48965ea79SLois Curfman McInnes 
5052cd425SLois Curfman McInnes   /*  Data stuctures for basic parallel dense matrix  */
6052cd425SLois Curfman McInnes 
7052cd425SLois Curfman McInnes /* Structure to hold the information for factorization of a dense matrix */
826b0ef5dSLois Curfman McInnes /* Most of this info is used in the pipe send/recv routines */
9052cd425SLois Curfman McInnes typedef struct {
10052cd425SLois Curfman McInnes   int    nlnr;        /* number of local rows downstream */
1126b0ef5dSLois Curfman McInnes   int    nrend;       /* rend for downstream processor */
12052cd425SLois Curfman McInnes   int    nbr,pnbr;   /* Down and upstream neighbors */
138aaee692SLois Curfman McInnes   int    *tag;        /* message tags */
1426b0ef5dSLois Curfman McInnes   int    currow;      /* current row number */
158aaee692SLois Curfman McInnes   int    phase;       /* phase (used to indicate tag) */
1626b0ef5dSLois Curfman McInnes   int    up;          /* Are we moving up or down in row number? */
1726b0ef5dSLois Curfman McInnes   int    use_bcast;   /* Are we broadcasting max length? */
1826b0ef5dSLois Curfman McInnes   int    nsend;       /* number of sends */
1926b0ef5dSLois Curfman McInnes   int    nrecv;       /* number of receives */
2026b0ef5dSLois Curfman McInnes 
2126b0ef5dSLois Curfman McInnes   /* data initially in matrix context */
22052cd425SLois Curfman McInnes   int    k;           /* Blocking factor (unused as yet) */
23052cd425SLois Curfman McInnes   int    k2;          /* Blocking factor for solves */
24*ea709b57SSatish Balay   PetscScalar *temp;
2526b0ef5dSLois Curfman McInnes   int    nlptr;
2626b0ef5dSLois Curfman McInnes   int    *lrows;
278aaee692SLois Curfman McInnes   int    *nlrows;
28622d7880SLois Curfman McInnes   int    *pivots;
2926b0ef5dSLois Curfman McInnes } FactorCtx;
30052cd425SLois Curfman McInnes 
31052cd425SLois Curfman McInnes #define PIPEPHASE (ctx->phase == 0)
3267e560aaSBarry Smith 
338965ea79SLois Curfman McInnes typedef struct {
348965ea79SLois Curfman McInnes   int           *rowners,*cowners;     /* ranges owned by each processor */
35c6aed980SBarry Smith                                         /* note n == N */
36c6aed980SBarry Smith   int           nvec;                   /* this is the n size for the vector one multiplies with */
378965ea79SLois Curfman McInnes   int           rstart,rend;           /* starting and ending owned rows */
38bad5519cSBarry Smith   Mat           A;                      /* local submatrix */
398965ea79SLois Curfman McInnes   int           size;                   /* size of communicator */
408965ea79SLois Curfman McInnes   int           rank;                   /* rank of proc in communicator */
418965ea79SLois Curfman McInnes   /* The following variables are used for matrix assembly */
42273d9f13SBarry Smith   PetscTruth    donotstash;             /* Flag indicationg if values should be stashed */
438965ea79SLois Curfman McInnes   MPI_Request   *send_waits;            /* array of send requests */
448965ea79SLois Curfman McInnes   MPI_Request   *recv_waits;            /* array of receive requests */
458965ea79SLois Curfman McInnes   int           nsends,nrecvs;         /* numbers of sends and receives */
46*ea709b57SSatish Balay   PetscScalar   *svalues,*rvalues;     /* sending and receiving data */
478965ea79SLois Curfman McInnes   int           rmax;                   /* maximum message length */
488965ea79SLois Curfman McInnes 
498965ea79SLois Curfman McInnes   /* The following variables are used for matrix-vector products */
508965ea79SLois Curfman McInnes 
518965ea79SLois Curfman McInnes   Vec           lvec;                   /* local vector */
52bad5519cSBarry Smith   VecScatter    Mvctx;                  /* scatter context for vector */
53052cd425SLois Curfman McInnes 
54273d9f13SBarry Smith   PetscTruth    roworiented;            /* if true, row oriented input (default) */
55622d7880SLois Curfman McInnes   FactorCtx     *factor;                /* factorization context */
568965ea79SLois Curfman McInnes } Mat_MPIDense;
57