173f4d377SMatthew Knepley /* $Id: mpibaij.h,v 1.30 2001/08/07 03:02:58 balay Exp $ */ 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 { 10273d9f13SBarry Smith int *rowners,*cowners; /* ranges owned by each processor, in blocks */ 11e0d8be96SSatish Balay int *rowners_bs; /* rowners*bs */ 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 247c922b88SBarry Smith PetscTruth donotstash; /* if 1, off processor entries dropped */ 25e8823a70SSatish Balay MPI_Request *send_waits; /* array of send requests */ 26e8823a70SSatish Balay MPI_Request *recv_waits; /* array of receive requests */ 27e8823a70SSatish Balay int nsends,nrecvs; /* numbers of sends and receives */ 283eda8832SBarry Smith MatScalar *svalues,*rvalues; /* sending and receiving data */ 29e8823a70SSatish Balay int rmax; /* maximum message length */ 30aa482453SBarry Smith #if defined (PETSC_USE_CTABLE) 310f5bd95cSBarry Smith PetscTable colmap; 3232b39ab2SSatish Balay #else 33e8823a70SSatish Balay int *colmap; /* local col number of off-diag col */ 3432b39ab2SSatish Balay #endif 35e8823a70SSatish Balay int *garray; /* work array */ 36e8823a70SSatish Balay 370bf34be7SSatish Balay /* The following variable is used by blocked matrix assembly */ 3895d5f7c2SBarry Smith MatScalar *barray; /* Block array of size bs2 */ 390bf34be7SSatish Balay 40e8823a70SSatish Balay /* The following variables are used for matrix-vector products */ 41e8823a70SSatish Balay 42e8823a70SSatish Balay Vec lvec; /* local vector */ 43e8823a70SSatish Balay VecScatter Mvctx; /* scatter context for vector */ 447c922b88SBarry Smith PetscTruth roworiented; /* if true, row-oriented input, default true */ 45e8823a70SSatish Balay 46e8823a70SSatish Balay /* The following variables are for MatGetRow() */ 47e8823a70SSatish Balay 48e8823a70SSatish Balay int *rowindices; /* column indices for row */ 49ea709b57SSatish Balay PetscScalar *rowvalues; /* nonzero values in row */ 50e8823a70SSatish Balay PetscTruth getrowactive; /* indicates MatGetRow(), not restored */ 514fa0d573SSatish Balay 524fa0d573SSatish Balay /* Some variables to make MatSetValues and others more efficient */ 534fa0d573SSatish Balay int rstart_bs,rend_bs; 544fa0d573SSatish Balay int cstart_bs,cend_bs; 5547cb9d27SSatish Balay int *ht; /* Hash table to speed up matrix assembly */ 563eda8832SBarry Smith MatScalar **hd; /* Hash table data */ 57fef45726SSatish Balay int ht_size; 58187ce0cbSSatish Balay int ht_total_ct,ht_insert_ct; /* Hash table statistics */ 597c922b88SBarry Smith PetscTruth ht_flag; /* Flag to indicate if hash tables are used */ 60133cdb44SSatish Balay double ht_fact; /* Factor to determine the HT size */ 61a377f70aSBarry Smith 62a377f70aSBarry Smith #if defined(PETSC_USE_MAT_SINGLE) 63e7592fafSBarry Smith int setvalueslen; 64a377f70aSBarry Smith MatScalar *setvaluescopy; /* area double precision values in MatSetValuesXXX() are copied 65a377f70aSBarry Smith before calling MatSetValuesXXX_MPIBAIJ_MatScalar() */ 66a377f70aSBarry Smith #endif 67e8823a70SSatish Balay } Mat_MPIBAIJ; 6879bdfe76SSatish Balay 69*c2999512SBarry Smith EXTERN int MatLoad_MPIBAIJ(PetscViewer,const MatType,Mat*); 7079bdfe76SSatish Balay 7179bdfe76SSatish Balay #endif 72