xref: /petsc/src/mat/impls/dense/mpi/mpidense.h (revision 8aaee692685d94bd6e1da88bda46f2dd3a40ee38)
1*8aaee692SLois Curfman McInnes /* $Id: mpidense.h,v 1.7 1995/12/23 21:37:37 bsmith Exp curfman $ */
28965ea79SLois Curfman McInnes 
38965ea79SLois Curfman McInnes #include "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 */
13*8aaee692SLois Curfman McInnes   int    *tag;        /* message tags */
1426b0ef5dSLois Curfman McInnes   int    currow;      /* current row number */
15*8aaee692SLois 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 */
2426b0ef5dSLois Curfman McInnes   Scalar *temp;
2526b0ef5dSLois Curfman McInnes   int    nlptr;
2626b0ef5dSLois Curfman McInnes   int    *lrows;
27*8aaee692SLois Curfman McInnes   int    *nlrows;
2826b0ef5dSLois Curfman McInnes } FactorCtx;
29052cd425SLois Curfman McInnes 
30052cd425SLois Curfman McInnes #define PIPEPHASE (ctx->phase == 0)
3167e560aaSBarry Smith 
328965ea79SLois Curfman McInnes typedef struct {
338965ea79SLois Curfman McInnes   int           *rowners, *cowners;     /* ranges owned by each processor */
348965ea79SLois Curfman McInnes   int           m, n;                   /* local rows and columns */
358965ea79SLois Curfman McInnes   int           M, N;                   /* global rows and columns */
368965ea79SLois Curfman McInnes   int           rstart, rend;           /* starting and ending owned rows */
37bad5519cSBarry Smith   Mat           A;                      /* local submatrix */
388965ea79SLois Curfman McInnes   int           size;                   /* size of communicator */
398965ea79SLois Curfman McInnes   int           rank;                   /* rank of proc in communicator */
408965ea79SLois Curfman McInnes 
418965ea79SLois Curfman McInnes   /* The following variables are used for matrix assembly */
428965ea79SLois Curfman McInnes 
438965ea79SLois Curfman McInnes   int           assembled;              /* MatAssemble has been called */
448965ea79SLois Curfman McInnes   InsertMode    insertmode;             /* mode for MatSetValues */
458965ea79SLois Curfman McInnes   Stash         stash;                  /* stash for non-local elements */
468965ea79SLois Curfman McInnes   MPI_Request   *send_waits;            /* array of send requests */
478965ea79SLois Curfman McInnes   MPI_Request   *recv_waits;            /* array of receive requests */
488965ea79SLois Curfman McInnes   int           nsends, nrecvs;         /* numbers of sends and receives */
498965ea79SLois Curfman McInnes   Scalar        *svalues, *rvalues;     /* sending and receiving data */
508965ea79SLois Curfman McInnes   int           rmax;                   /* maximum message length */
518965ea79SLois Curfman McInnes 
528965ea79SLois Curfman McInnes   /* The following variables are used for matrix-vector products */
538965ea79SLois Curfman McInnes 
548965ea79SLois Curfman McInnes   Vec           lvec;                   /* local vector */
55bad5519cSBarry Smith   VecScatter    Mvctx;                  /* scatter context for vector */
56052cd425SLois Curfman McInnes 
5726b0ef5dSLois Curfman McInnes   FactorCtx     *factor;                /* factorization context */
585e0100a6SBarry Smith   int           roworiented;            /* if true, row oriented input (default) */
598965ea79SLois Curfman McInnes } Mat_MPIDense;
60