1*a377f70aSBarry Smith /* $Id: mpibaij.h,v 1.25 2000/04/12 04:23:40 bsmith Exp bsmith $ */ 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 */ 11e0d8be96SSatish Balay int *rowners_bs; /* rowners*bs */ 12e8823a70SSatish Balay int m,n; /* local rows and columns */ 13e8823a70SSatish Balay int M,N; /* global rows and columns */ 14e8823a70SSatish Balay int rstart,rend; /* starting and ending owned rows */ 15e8823a70SSatish Balay int cstart,cend; /* starting and ending owned columns */ 16e8823a70SSatish Balay Mat A,B; /* local submatrices: A (diag part), 17e8823a70SSatish Balay B (off-diag part) */ 18e8823a70SSatish Balay int size; /* size of communicator */ 19e8823a70SSatish Balay int rank; /* rank of proc in communicator */ 2079bdfe76SSatish Balay int bs,bs2; /* block size, bs2 = bs*bs */ 214c1c0d89SBarry Smith int Mbs,Nbs; /* number block rows/cols in matrix; M/bs, N/bs */ 224c1c0d89SBarry Smith int mbs,nbs; /* number block rows/cols on processor; m/bs, n/bs */ 23e8823a70SSatish Balay 24e8823a70SSatish Balay /* The following variables are used for matrix assembly */ 25e8823a70SSatish Balay 267c922b88SBarry Smith PetscTruth 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 */ 303eda8832SBarry Smith MatScalar *svalues,*rvalues; /* sending and receiving data */ 31e8823a70SSatish Balay int rmax; /* maximum message length */ 32aa482453SBarry Smith #if defined (PETSC_USE_CTABLE) 330f5bd95cSBarry Smith PetscTable 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 */ 4095d5f7c2SBarry Smith MatScalar *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 */ 467c922b88SBarry Smith PetscTruth 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 */ 583eda8832SBarry Smith MatScalar **hd; /* Hash table data */ 59fef45726SSatish Balay int ht_size; 60187ce0cbSSatish Balay int ht_total_ct,ht_insert_ct; /* Hash table statistics */ 617c922b88SBarry Smith PetscTruth ht_flag; /* Flag to indicate if hash tables are used */ 62133cdb44SSatish Balay double ht_fact; /* Factor to determine the HT size */ 63*a377f70aSBarry Smith 64*a377f70aSBarry Smith #if defined(PETSC_USE_MAT_SINGLE) 65*a377f70aSBarry Smith MatScalar *setvaluescopy; /* area double precision values in MatSetValuesXXX() are copied 66*a377f70aSBarry Smith before calling MatSetValuesXXX_MPIBAIJ_MatScalar() */ 67*a377f70aSBarry Smith #endif 68e8823a70SSatish Balay } Mat_MPIBAIJ; 6979bdfe76SSatish Balay 7079bdfe76SSatish Balay 7179bdfe76SSatish Balay #endif 72