1e8823a70SSatish Balay 279bdfe76SSatish Balay #if !defined(__MPIBAIJ_H) 379bdfe76SSatish Balay #define __MPIBAIJ_H 4c833c1fbSBarry Smith #include "src/mat/impls/baij/seq/baij.h" 5c833c1fbSBarry Smith #include "src/sys/ctable.h" 679bdfe76SSatish Balay 7aa482453SBarry Smith #if defined (PETSC_USE_CTABLE) 8c66d48e9SBarry Smith #define PETSCTABLE PetscTable 932b39ab2SSatish Balay #else 10b24ad042SBarry Smith #define PETSCTABLE PetscInt* 1132b39ab2SSatish Balay #endif 12e8823a70SSatish Balay 136c6c5352SBarry Smith #define MPIBAIJHEADER \ 14b24ad042SBarry Smith PetscInt *rowners,*cowners; /* ranges owned by each processor, in blocks */ \ 15b24ad042SBarry Smith PetscInt *rowners_bs; /* rowners*bs */ \ 16b24ad042SBarry Smith PetscInt rstart,rend; /* starting and ending owned rows */ \ 17b24ad042SBarry Smith PetscInt cstart,cend; /* starting and ending owned columns */ \ 181d18e487SKris Buschelman Mat A,B; /* local submatrices: A (diag part), B (off-diag part) */ \ 19b24ad042SBarry Smith PetscMPIInt size; /* size of communicator */ \ 20b24ad042SBarry Smith PetscMPIInt rank; /* rank of proc in communicator */ \ 21521d7252SBarry Smith PetscInt bs2; /* block size, bs2 = bs*bs */ \ 22b24ad042SBarry Smith PetscInt Mbs,Nbs; /* number block rows/cols in matrix; M/bs, N/bs */ \ 23b24ad042SBarry Smith PetscInt mbs,nbs; /* number block rows/cols on processor; m/bs, n/bs */ \ 246c6c5352SBarry Smith \ 256c6c5352SBarry Smith /* The following variables are used for matrix assembly */ \ 266c6c5352SBarry Smith \ 276c6c5352SBarry Smith PetscTruth donotstash; /* if 1, off processor entries dropped */ \ 286c6c5352SBarry Smith MPI_Request *send_waits; /* array of send requests */ \ 296c6c5352SBarry Smith MPI_Request *recv_waits; /* array of receive requests */ \ 30b24ad042SBarry Smith PetscInt nsends,nrecvs; /* numbers of sends and receives */ \ 316c6c5352SBarry Smith MatScalar *svalues,*rvalues; /* sending and receiving data */ \ 32b24ad042SBarry Smith PetscInt rmax; /* maximum message length */ \ 336c6c5352SBarry Smith PETSCTABLE colmap; /* local col number of off-diag col */ \ 346c6c5352SBarry Smith \ 35b24ad042SBarry Smith PetscInt *garray; /* work array */ \ 366c6c5352SBarry Smith \ 376c6c5352SBarry Smith /* The following variable is used by blocked matrix assembly */ \ 386c6c5352SBarry Smith MatScalar *barray; /* Block array of size bs2 */ \ 396c6c5352SBarry Smith \ 406c6c5352SBarry Smith /* The following variables are used for matrix-vector products */ \ 416c6c5352SBarry Smith \ 426c6c5352SBarry Smith Vec lvec; /* local vector */ \ 436c6c5352SBarry Smith VecScatter Mvctx; /* scatter context for vector */ \ 446c6c5352SBarry Smith PetscTruth roworiented; /* if true, row-oriented input, default true */ \ 456c6c5352SBarry Smith \ 466c6c5352SBarry Smith /* The following variables are for MatGetRow() */ \ 476c6c5352SBarry Smith \ 48b24ad042SBarry Smith PetscInt *rowindices; /* column indices for row */ \ 496c6c5352SBarry Smith PetscScalar *rowvalues; /* nonzero values in row */ \ 506c6c5352SBarry Smith PetscTruth getrowactive; /* indicates MatGetRow(), not restored */ \ 516c6c5352SBarry Smith \ 526c6c5352SBarry Smith /* Some variables to make MatSetValues and others more efficient */ \ 53b24ad042SBarry Smith PetscInt rstart_bs,rend_bs; \ 54b24ad042SBarry Smith PetscInt cstart_bs,cend_bs; \ 55b24ad042SBarry Smith PetscInt *ht; /* Hash table to speed up matrix assembly */ \ 566c6c5352SBarry Smith MatScalar **hd; /* Hash table data */ \ 57b24ad042SBarry Smith PetscInt ht_size; \ 58b24ad042SBarry Smith PetscInt ht_total_ct,ht_insert_ct; /* Hash table statistics */ \ 596c6c5352SBarry Smith PetscTruth ht_flag; /* Flag to indicate if hash tables are used */ \ 606c6c5352SBarry Smith double ht_fact; /* Factor to determine the HT size */ \ 616c6c5352SBarry Smith \ 62b24ad042SBarry Smith PetscInt setvalueslen; /* only used for single precision computations */ \ 631d18e487SKris Buschelman MatScalar *setvaluescopy /* area double precision values in MatSetValuesXXX() are copied*/ \ 641d18e487SKris Buschelman /* before calling MatSetValuesXXX_MPIBAIJ_MatScalar() */ 656c6c5352SBarry Smith 666c6c5352SBarry Smith typedef struct { 671d18e487SKris Buschelman MPIBAIJHEADER; 68e8823a70SSatish Balay } Mat_MPIBAIJ; 6979bdfe76SSatish Balay 70*f69a0ea3SMatthew Knepley EXTERN PetscErrorCode MatLoad_MPIBAIJ(PetscViewer, MatType,Mat*); 71dfbe8321SBarry Smith EXTERN PetscErrorCode CreateColmap_MPIBAIJ_Private(Mat); 72b24ad042SBarry Smith EXTERN PetscErrorCode MatGetSubMatrices_MPIBAIJ(Mat,PetscInt,const IS[],const IS[],MatReuse,Mat*[]); 7379bdfe76SSatish Balay #endif 74