xref: /petsc/src/mat/impls/baij/mpi/mpibaij.h (revision 5ed2d596fd9914de76abbaed56c65f4792ae57ae)
1 /* $Id: mpibaij.h,v 1.30 2001/08/07 03:02:58 balay Exp $ */
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, in blocks */
11   int           *rowners_bs;            /* rowners*bs */
12   int           rstart,rend;           /* starting and ending owned rows */
13   int           cstart,cend;           /* starting and ending owned columns */
14   Mat           A,B;                   /* local submatrices: A (diag part),
15                                            B (off-diag part) */
16   int           size;                   /* size of communicator */
17   int           rank;                   /* rank of proc in communicator */
18   int           bs,bs2;                /* block size, bs2 = bs*bs */
19   int           Mbs,Nbs;               /* number block rows/cols in matrix; M/bs, N/bs */
20   int           mbs,nbs;               /* number block rows/cols on processor; m/bs, n/bs */
21 
22   /* The following variables are used for matrix assembly */
23 
24   PetscTruth    donotstash;             /* if 1, off processor entries dropped */
25   MPI_Request   *send_waits;            /* array of send requests */
26   MPI_Request   *recv_waits;            /* array of receive requests */
27   int           nsends,nrecvs;         /* numbers of sends and receives */
28   MatScalar     *svalues,*rvalues;     /* sending and receiving data */
29   int           rmax;                   /* maximum message length */
30 #if defined (PETSC_USE_CTABLE)
31   PetscTable    colmap;
32 #else
33   int           *colmap;                /* local col number of off-diag col */
34 #endif
35   int           *garray;                /* work array */
36 
37   /* The following variable is used by blocked matrix assembly */
38   MatScalar     *barray;                /* Block array of size bs2 */
39 
40   /* The following variables are used for matrix-vector products */
41 
42   Vec           lvec;              /* local vector */
43   VecScatter    Mvctx;             /* scatter context for vector */
44   PetscTruth    roworiented;       /* if true, row-oriented input, default true */
45 
46   /* The following variables are for MatGetRow() */
47 
48   int           *rowindices;       /* column indices for row */
49   PetscScalar   *rowvalues;        /* nonzero values in row */
50   PetscTruth    getrowactive;      /* indicates MatGetRow(), not restored */
51 
52   /* Some variables to make MatSetValues and others more efficient */
53   int           rstart_bs,rend_bs;
54   int           cstart_bs,cend_bs;
55   int           *ht;                      /* Hash table to speed up matrix assembly */
56   MatScalar     **hd;                     /* Hash table data */
57   int           ht_size;
58   int           ht_total_ct,ht_insert_ct; /* Hash table statistics */
59   PetscTruth    ht_flag;                  /* Flag to indicate if hash tables are used */
60   double        ht_fact;                  /* Factor to determine the HT size */
61 
62 #if defined(PETSC_USE_MAT_SINGLE)
63   int           setvalueslen;
64   MatScalar     *setvaluescopy; /* area double precision values in MatSetValuesXXX() are copied
65                                       before calling MatSetValuesXXX_MPIBAIJ_MatScalar() */
66 #endif
67 } Mat_MPIBAIJ;
68 
69 
70 #endif
71