xref: /petsc/src/mat/impls/baij/mpi/mpibaij.h (revision 47cb9d2738e224dc06b78fe077e3f21692e24e43)
1*47cb9d27SSatish Balay /* $Id: mpibaij.h,v 1.11 1998/01/13 00:35:22 balay 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 */
194c1c0d89SBarry Smith   int           Mbs, Nbs;               /* number block rows/cols in matrix; M/bs, N/bs */
204c1c0d89SBarry Smith   int           mbs, nbs;               /* number block rows/cols on processor; m/bs, n/bs */
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 
340bf34be7SSatish Balay   /* The following variable is used by blocked matrix assembly */
350bf34be7SSatish Balay   Scalar        *barray;                /* Block array of size bs2 */
360bf34be7SSatish 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;
52*47cb9d27SSatish Balay   int           *ht;              /* Hash table to speed up matrix assembly */
53*47cb9d27SSatish Balay   Scalar        **hd;             /* Hash table data */
54fef45726SSatish Balay   int           ht_size;
55*47cb9d27SSatish Balay   int           ht_ct,ht_max;     /* Hash table statistics */
56e8823a70SSatish Balay } Mat_MPIBAIJ;
5779bdfe76SSatish Balay 
5879bdfe76SSatish Balay 
5979bdfe76SSatish Balay #endif
60