xref: /petsc/src/mat/impls/baij/mpi/mpibaij.h (revision 0bf34be7f81e0c7db2f2f58c0c58ac38d8a62fd1)
1*0bf34be7SSatish Balay /* $Id: mpibaij.h,v 1.6 1997/03/09 17:58:43 bsmith Exp balay $ */
2e8823a70SSatish Balay 
370f55243SBarry Smith #include "src/mat/impls/baij/seq/baij.h"
4e8823a70SSatish Balay 
579bdfe76SSatish Balay #if !defined(__MPIBAIJ_H)
679bdfe76SSatish Balay #define __MPIBAIJ_H
779bdfe76SSatish Balay 
8e8823a70SSatish Balay typedef struct {
9e8823a70SSatish Balay   int           *rowners, *cowners;     /* ranges owned by each processor */
10e8823a70SSatish Balay   int           m, n;                   /* local rows and columns */
11e8823a70SSatish Balay   int           M, N;                   /* global rows and columns */
12e8823a70SSatish Balay   int           rstart, rend;           /* starting and ending owned rows */
13e8823a70SSatish Balay   int           cstart, cend;           /* starting and ending owned columns */
14e8823a70SSatish Balay   Mat           A, B;                   /* local submatrices: A (diag part),
15e8823a70SSatish Balay                                            B (off-diag part) */
16e8823a70SSatish Balay   int           size;                   /* size of communicator */
17e8823a70SSatish Balay   int           rank;                   /* rank of proc in communicator */
1879bdfe76SSatish Balay   int           bs, bs2;                /* block size, bs2 = bs*bs */
1979bdfe76SSatish Balay   int           Mbs, Nbs;
2079bdfe76SSatish Balay   int           mbs, nbs;
21e8823a70SSatish Balay 
22e8823a70SSatish Balay   /* The following variables are used for matrix assembly */
23e8823a70SSatish Balay 
24e8823a70SSatish Balay   Stash         stash;                  /* stash for non-local elements */
2590f02eecSBarry Smith   int           donotstash;             /* if 1, off processor entries dropped */
26e8823a70SSatish Balay   MPI_Request   *send_waits;            /* array of send requests */
27e8823a70SSatish Balay   MPI_Request   *recv_waits;            /* array of receive requests */
28e8823a70SSatish Balay   int           nsends, nrecvs;         /* numbers of sends and receives */
29e8823a70SSatish Balay   Scalar        *svalues, *rvalues;     /* sending and receiving data */
30e8823a70SSatish Balay   int           rmax;                   /* maximum message length */
31e8823a70SSatish Balay   int           *colmap;                /* local col number of off-diag col */
32e8823a70SSatish Balay   int           *garray;                /* work array */
33e8823a70SSatish Balay 
34*0bf34be7SSatish Balay   /* The following variable is used by blocked matrix assembly */
35*0bf34be7SSatish Balay   Scalar        *barray;                /* Block array of size bs2 */
36*0bf34be7SSatish Balay 
37e8823a70SSatish Balay   /* The following variables are used for matrix-vector products */
38e8823a70SSatish Balay 
39e8823a70SSatish Balay   Vec           lvec;              /* local vector */
40e8823a70SSatish Balay   VecScatter    Mvctx;             /* scatter context for vector */
41e8823a70SSatish Balay   int           roworiented;       /* if true, row-oriented input, default true */
42e8823a70SSatish Balay 
43e8823a70SSatish Balay   /* The following variables are for MatGetRow() */
44e8823a70SSatish Balay 
45e8823a70SSatish Balay   int           *rowindices;       /* column indices for row */
46e8823a70SSatish Balay   Scalar        *rowvalues;        /* nonzero values in row */
47e8823a70SSatish Balay   PetscTruth    getrowactive;      /* indicates MatGetRow(), not restored */
484fa0d573SSatish Balay 
494fa0d573SSatish Balay   /* Some variables to make MatSetValues and others more efficient */
504fa0d573SSatish Balay   int           rstart_bs, rend_bs;
514fa0d573SSatish Balay   int           cstart_bs, cend_bs;
52e8823a70SSatish Balay } Mat_MPIBAIJ;
5379bdfe76SSatish Balay 
5479bdfe76SSatish Balay 
5579bdfe76SSatish Balay #endif
56