Actual source code: mpisbaijspooles.c

  1: /*$Id: mpisbaijspooles.c,v 1.10 2001/08/15 15:56:50 bsmith Exp $*/
  2: /* 
  3:    Provides an interface to the Spooles parallel sparse solver (MPI SPOOLES)
  4: */


 7:  #include src/mat/impls/sbaij/mpi/mpisbaij.h

  9: #if defined(PETSC_HAVE_SPOOLES) && !defined(PETSC_USE_SINGLE) && !defined(PETSC_USE_COMPLEX)
 10:  #include src/mat/impls/aij/seq/spooles.h

 12: /* Note the Petsc r permutation is ignored */
 13: int MatCholeskyFactorSymbolic_MPISBAIJ_Spooles(Mat A,IS r,PetscReal f,Mat *F)
 14: {
 15:   Mat_MPISBAIJ  *mat = (Mat_MPISBAIJ*)A->data;
 16:   Mat_Spooles   *lu;
 17:   int           ierr,M=A->M,N=A->N;
 18: 
 20:   A->ops->lufactornumeric  = MatFactorNumeric_MPIAIJ_Spooles;

 22:   /* Create the factorization matrix F */
 23:   MatCreateMPIAIJ(A->comm,PETSC_DECIDE,PETSC_DECIDE,M,N,0,PETSC_NULL,0,PETSC_NULL,F);
 24: 
 25:   (*F)->ops->choleskyfactornumeric = MatFactorNumeric_MPIAIJ_Spooles;
 26:   (*F)->factor                     = FACTOR_CHOLESKY;

 28:   ierr                     = PetscNew(Mat_Spooles,&lu);
 29:   (*F)->spptr              = (void*)lu;
 30:   lu->options.symflag      = SPOOLES_SYMMETRIC;
 31:   lu->options.pivotingflag = SPOOLES_NO_PIVOTING;
 32:   lu->flg                  = DIFFERENT_NONZERO_PATTERN;

 34:   return(0);
 35: }

 37: int MatUseSpooles_MPISBAIJ(Mat A)
 38: {
 39:   Mat_MPISBAIJ *sbaij = (Mat_MPISBAIJ*)A->data;
 40:   int          bs = sbaij->bs;

 43:   if (bs > 1) SETERRQ1(1,"Block size %d not supported by Spooles",bs);
 44:   A->ops->choleskyfactorsymbolic = MatCholeskyFactorSymbolic_MPISBAIJ_Spooles;
 45:   return(0);
 46: }

 48: #else

 50: int MatUseSpooles_MPISBAIJ(Mat A)
 51: {
 53:   return(0);
 54: }

 56: #endif