xref: /petsc/src/mat/impls/baij/mpi/mpibaij.h (revision e0d8be968326e2ee1486cdda04ea90ca542a5275)
1 /* $Id: mpibaij.h,v 1.17 1999/03/11 22:30:39 balay Exp balay $ */
2 
3 #include "src/mat/impls/baij/seq/baij.h"
4 #include "src/sys/ctable.h"
5 
6 #if !defined(__MPIBAIJ_H)
7 #define __MPIBAIJ_H
8 
9 typedef struct {
10   int           *rowners,*cowners;      /* ranges owned by each processor */
11   int           *rowners_bs;            /* rowners*bs */
12   int           m, n;                   /* local rows and columns */
13   int           M, N;                   /* global rows and columns */
14   int           rstart, rend;           /* starting and ending owned rows */
15   int           cstart, cend;           /* starting and ending owned columns */
16   Mat           A, B;                   /* local submatrices: A (diag part),
17                                            B (off-diag part) */
18   int           size;                   /* size of communicator */
19   int           rank;                   /* rank of proc in communicator */
20   int           bs, bs2;                /* block size, bs2 = bs*bs */
21   int           Mbs, Nbs;               /* number block rows/cols in matrix; M/bs, N/bs */
22   int           mbs, nbs;               /* number block rows/cols on processor; m/bs, n/bs */
23 
24   /* The following variables are used for matrix assembly */
25 
26   Stash         stash,bstash;           /* stash for non-local elements */
27   int           donotstash;             /* if 1, off processor entries dropped */
28   MPI_Request   *send_waits;            /* array of send requests */
29   MPI_Request   *recv_waits;            /* array of receive requests */
30   int           nsends, nrecvs;         /* numbers of sends and receives */
31   Scalar        *svalues, *rvalues;     /* sending and receiving data */
32   int           rmax;                   /* maximum message length */
33 #if defined (USE_CTABLE)
34   Table         colmap;
35 #else
36   int           *colmap;                /* local col number of off-diag col */
37 #endif
38   int           *garray;                /* work array */
39 
40   /* The following variable is used by blocked matrix assembly */
41   Scalar        *barray;                /* Block array of size bs2 */
42 
43   /* The following variables are used for matrix-vector products */
44 
45   Vec           lvec;              /* local vector */
46   VecScatter    Mvctx;             /* scatter context for vector */
47   int           roworiented;       /* if true, row-oriented input, default true */
48 
49   /* The following variables are for MatGetRow() */
50 
51   int           *rowindices;       /* column indices for row */
52   Scalar        *rowvalues;        /* nonzero values in row */
53   PetscTruth    getrowactive;      /* indicates MatGetRow(), not restored */
54 
55   /* Some variables to make MatSetValues and others more efficient */
56   int           rstart_bs, rend_bs;
57   int           cstart_bs, cend_bs;
58   int           *ht;                      /* Hash table to speed up matrix assembly */
59   Scalar        **hd;                     /* Hash table data */
60   int           ht_size;
61   int           ht_total_ct,ht_insert_ct; /* Hash table statistics */
62   int           ht_flag;                  /* Flag to indicate if hash tables are used */
63   double        ht_fact;                  /* Factor to determine the HT size */
64 } Mat_MPIBAIJ;
65 
66 
67 #endif
68