xref: /petsc/src/mat/impls/baij/mpi/mpibaij.h (revision a2d1c673a0257ed9b5719df99a4d7488fb13e120)
1*a2d1c673SSatish Balay /* $Id: mpibaij.h,v 1.16 1999/01/08 16:43:56 balay Exp balay $ */
2e8823a70SSatish Balay 
370f55243SBarry Smith #include "src/mat/impls/baij/seq/baij.h"
432b39ab2SSatish Balay #include "src/sys/ctable.h"
5e8823a70SSatish Balay 
679bdfe76SSatish Balay #if !defined(__MPIBAIJ_H)
779bdfe76SSatish Balay #define __MPIBAIJ_H
879bdfe76SSatish Balay 
9e8823a70SSatish Balay typedef struct {
10e8823a70SSatish Balay   int           *rowners, *cowners;     /* ranges owned by each processor */
11e8823a70SSatish Balay   int           m, n;                   /* local rows and columns */
12e8823a70SSatish Balay   int           M, N;                   /* global rows and columns */
13e8823a70SSatish Balay   int           rstart, rend;           /* starting and ending owned rows */
14e8823a70SSatish Balay   int           cstart, cend;           /* starting and ending owned columns */
15e8823a70SSatish Balay   Mat           A, B;                   /* local submatrices: A (diag part),
16e8823a70SSatish Balay                                            B (off-diag part) */
17e8823a70SSatish Balay   int           size;                   /* size of communicator */
18e8823a70SSatish Balay   int           rank;                   /* rank of proc in communicator */
1979bdfe76SSatish Balay   int           bs, bs2;                /* block size, bs2 = bs*bs */
204c1c0d89SBarry Smith   int           Mbs, Nbs;               /* number block rows/cols in matrix; M/bs, N/bs */
214c1c0d89SBarry Smith   int           mbs, nbs;               /* number block rows/cols on processor; m/bs, n/bs */
22e8823a70SSatish Balay 
23e8823a70SSatish Balay   /* The following variables are used for matrix assembly */
24e8823a70SSatish Balay 
25*a2d1c673SSatish Balay   Stash         stash,bstash;           /* stash for non-local elements */
2690f02eecSBarry Smith   int           donotstash;             /* if 1, off processor entries dropped */
27e8823a70SSatish Balay   MPI_Request   *send_waits;            /* array of send requests */
28e8823a70SSatish Balay   MPI_Request   *recv_waits;            /* array of receive requests */
29e8823a70SSatish Balay   int           nsends, nrecvs;         /* numbers of sends and receives */
30e8823a70SSatish Balay   Scalar        *svalues, *rvalues;     /* sending and receiving data */
31e8823a70SSatish Balay   int           rmax;                   /* maximum message length */
3232b39ab2SSatish Balay #if defined (USE_CTABLE)
3332b39ab2SSatish Balay   Table         colmap;
3432b39ab2SSatish Balay #else
35e8823a70SSatish Balay   int           *colmap;                /* local col number of off-diag col */
3632b39ab2SSatish Balay #endif
37e8823a70SSatish Balay   int           *garray;                /* work array */
38e8823a70SSatish Balay 
390bf34be7SSatish Balay   /* The following variable is used by blocked matrix assembly */
400bf34be7SSatish Balay   Scalar        *barray;                /* Block array of size bs2 */
410bf34be7SSatish Balay 
42e8823a70SSatish Balay   /* The following variables are used for matrix-vector products */
43e8823a70SSatish Balay 
44e8823a70SSatish Balay   Vec           lvec;              /* local vector */
45e8823a70SSatish Balay   VecScatter    Mvctx;             /* scatter context for vector */
46e8823a70SSatish Balay   int           roworiented;       /* if true, row-oriented input, default true */
47e8823a70SSatish Balay 
48e8823a70SSatish Balay   /* The following variables are for MatGetRow() */
49e8823a70SSatish Balay 
50e8823a70SSatish Balay   int           *rowindices;       /* column indices for row */
51e8823a70SSatish Balay   Scalar        *rowvalues;        /* nonzero values in row */
52e8823a70SSatish Balay   PetscTruth    getrowactive;      /* indicates MatGetRow(), not restored */
534fa0d573SSatish Balay 
544fa0d573SSatish Balay   /* Some variables to make MatSetValues and others more efficient */
554fa0d573SSatish Balay   int           rstart_bs, rend_bs;
564fa0d573SSatish Balay   int           cstart_bs, cend_bs;
5747cb9d27SSatish Balay   int           *ht;                      /* Hash table to speed up matrix assembly */
5847cb9d27SSatish Balay   Scalar        **hd;                     /* Hash table data */
59fef45726SSatish Balay   int           ht_size;
60187ce0cbSSatish Balay   int           ht_total_ct,ht_insert_ct; /* Hash table statistics */
61b133499aSSatish Balay   int           ht_flag;                  /* Flag to indicate if hash tables are used */
62133cdb44SSatish Balay   double        ht_fact;                  /* Factor to determine the HT size */
63e8823a70SSatish Balay } Mat_MPIBAIJ;
6479bdfe76SSatish Balay 
6579bdfe76SSatish Balay 
6679bdfe76SSatish Balay #endif
67