diff -r 8224017c60ff config/PETSc/packages/MUMPS.py --- a/config/PETSc/packages/MUMPS.py Tue Sep 18 10:11:50 2012 +0200 +++ b/config/PETSc/packages/MUMPS.py Fri Sep 21 16:25:42 2012 +0200 @@ -12,6 +12,7 @@ # # Mumps does NOT work with 64 bit integers without a huge number of hacks we ain't making self.complex = 1 + self.double = 0 self.worksonWindows = 1 self.downloadonWindows= 1 return diff -r 8224017c60ff config/PETSc/packages/SuperLU.py --- a/config/PETSc/packages/SuperLU.py Tue Sep 18 10:11:50 2012 +0200 +++ b/config/PETSc/packages/SuperLU.py Fri Sep 21 16:25:42 2012 +0200 @@ -7,6 +7,7 @@ self.functions = ['set_default_options'] self.includes = ['slu_ddefs.h'] self.liblist = [['libsuperlu_4.3.a']] + self.double = 0 self.complex = 1 # SuperLU has NO support for 64 bit integers, use SuperLU_Dist if you need that self.excludedDirs = ['SuperLU_DIST'] diff -r 8224017c60ff config/PETSc/packages/blacs.py --- a/config/PETSc/packages/blacs.py Tue Sep 18 10:11:50 2012 +0200 +++ b/config/PETSc/packages/blacs.py Fri Sep 21 16:25:42 2012 +0200 @@ -11,6 +11,7 @@ self.requires32bitint = 0 self.functionsFortran = 1 self.complex = 1 + self.double = 0 self.useddirectly = 0 # PETSc does not use BLACS, it is only used by ScaLAPACK which is used by MUMPS self.worksonWindows = 1 self.downloadonWindows= 1 diff -r 8224017c60ff src/mat/impls/aij/mpi/mumps/makefile --- a/src/mat/impls/aij/mpi/mumps/makefile Tue Sep 18 10:11:50 2012 +0200 +++ b/src/mat/impls/aij/mpi/mumps/makefile Fri Sep 21 16:25:42 2012 +0200 @@ -1,6 +1,5 @@ #requirespackage 'PETSC_HAVE_MUMPS' -#requiresprecision double ALL: lib diff -r 8224017c60ff src/mat/impls/aij/mpi/mumps/mumps.c --- a/src/mat/impls/aij/mpi/mumps/mumps.c Tue Sep 18 10:11:50 2012 +0200 +++ b/src/mat/impls/aij/mpi/mumps/mumps.c Fri Sep 21 16:25:42 2012 +0200 @@ -8,9 +8,17 @@ EXTERN_C_BEGIN #if defined(PETSC_USE_COMPLEX) +#if defined(PETSC_USE_REAL_SINGLE) +#include +#else #include +#endif #else -#include +#if defined(PETSC_USE_REAL_SINGLE) +#include +#else +#include +#endif #endif EXTERN_C_END #define JOB_INIT -1 @@ -19,6 +27,21 @@ #define JOB_SOLVE 3 #define JOB_END -2 +/* calls to MUMPS */ +#if defined(PETSC_USE_COMPLEX) +#if defined(PETSC_USE_REAL_SINGLE) +#define PetscMUMPS_c cmumps_c +#else +#define PetscMUMPS_c zmumps_c +#endif +#else +#if defined(PETSC_USE_REAL_SINGLE) +#define PetscMUMPS_c smumps_c +#else +#define PetscMUMPS_c dmumps_c +#endif +#endif + /* macros s.t. indices match MUMPS documentation */ #define ICNTL(I) icntl[(I)-1] @@ -30,10 +53,19 @@ typedef struct { #if defined(PETSC_USE_COMPLEX) +#if defined(PETSC_USE_REAL_SINGLE) + CMUMPS_STRUC_C id; +#else ZMUMPS_STRUC_C id; +#endif +#else +#if defined(PETSC_USE_REAL_SINGLE) + SMUMPS_STRUC_C id; #else DMUMPS_STRUC_C id; #endif +#endif + MatStructure matstruc; PetscMPIInt myid,size; PetscInt *irn,*jcn,nz,sym,nSolve; @@ -489,11 +521,7 @@ ierr=PetscFree(lu->id.perm_in);CHKERRQ(ierr); ierr = PetscFree(lu->irn);CHKERRQ(ierr); lu->id.job=JOB_END; -#if defined(PETSC_USE_COMPLEX) - zmumps_c(&lu->id); -#else - dmumps_c(&lu->id); -#endif + PetscMUMPS_c(&lu->id); ierr = MPI_Comm_free(&(lu->comm_mumps));CHKERRQ(ierr); } if (lu && lu->Destroy) { @@ -533,7 +561,11 @@ if (!lu->myid) { /* define rhs on the host */ lu->id.nrhs = 1; #if defined(PETSC_USE_COMPLEX) +#if defined(PETSC_USE_REAL_SINGLE) + lu->id.rhs = (mumps_complex*)array; +#else lu->id.rhs = (mumps_double_complex*)array; +#endif #else lu->id.rhs = array; #endif @@ -542,11 +574,7 @@ /* solve phase */ /*-------------*/ lu->id.job = JOB_SOLVE; -#if defined(PETSC_USE_COMPLEX) - zmumps_c(&lu->id); -#else - dmumps_c(&lu->id); -#endif + PetscMUMPS_c(&lu->id); if (lu->id.INFOG(1) < 0) SETERRQ1(PETSC_COMM_SELF,PETSC_ERR_LIB,"Error reported by MUMPS in solve phase: INFOG(1)=%d\n",lu->id.INFOG(1)); if (lu->size > 1) { /* convert mumps distributed solution to petsc mpi x */ @@ -648,23 +676,27 @@ if (!lu->id.ICNTL(18)) { if (!lu->myid) { #if defined(PETSC_USE_COMPLEX) +#if defined(PETSC_USE_REAL_SINGLE) + lu->id.a = (mumps_complex*)lu->val; +#else lu->id.a = (mumps_double_complex*)lu->val; +#endif #else lu->id.a = lu->val; #endif } } else { #if defined(PETSC_USE_COMPLEX) +#if defined(PETSC_USE_REAL_SINGLE) + lu->id.a_loc = (mumps_complex*)lu->val; +#else lu->id.a_loc = (mumps_double_complex*)lu->val; +#endif #else lu->id.a_loc = lu->val; #endif } -#if defined(PETSC_USE_COMPLEX) - zmumps_c(&lu->id); -#else - dmumps_c(&lu->id); -#endif + PetscMUMPS_c(&lu->id); if (lu->id.INFOG(1) < 0) { if (lu->id.INFO(1) == -13) SETERRQ1(PETSC_COMM_SELF,PETSC_ERR_LIB,"Error reported by MUMPS in numerical factorization phase: Cannot allocate required memory %d megabytes\n",lu->id.INFO(2)); else SETERRQ2(PETSC_COMM_SELF,PETSC_ERR_LIB,"Error reported by MUMPS in numerical factorization phase: INFO(1)=%d, INFO(2)=%d\n",lu->id.INFO(1),lu->id.INFO(2)); @@ -700,7 +732,11 @@ ierr = PetscMalloc2(lsol_loc,PetscScalar,&sol_loc,lsol_loc,PetscInt,&lu->id.isol_loc);CHKERRQ(ierr); lu->id.lsol_loc = lsol_loc; #if defined(PETSC_USE_COMPLEX) +#if defined(PETSC_USE_REAL_SINGLE) + lu->id.sol_loc = (mumps_complex*)sol_loc; +#else lu->id.sol_loc = (mumps_double_complex*)sol_loc; +#endif #else lu->id.sol_loc = sol_loc; #endif @@ -795,11 +831,7 @@ mumps->id.job = JOB_INIT; mumps->id.par = 1; /* host participates factorizaton and solve */ mumps->id.sym = mumps->sym; -#if defined(PETSC_USE_COMPLEX) - zmumps_c(&mumps->id); -#else - dmumps_c(&mumps->id); -#endif + PetscMUMPS_c(&mumps->id); mumps->CleanUpMUMPS = PETSC_FALSE; mumps->scat_rhs = PETSC_NULL; @@ -847,7 +879,11 @@ lu->id.nz =lu->nz; lu->id.irn=lu->irn; lu->id.jcn=lu->jcn; if (lu->id.ICNTL(6)>1){ #if defined(PETSC_USE_COMPLEX) +#if defined(PETSC_USE_REAL_SINGLE) + lu->id.a = (mumps_complex*)lu->val; +#else lu->id.a = (mumps_double_complex*)lu->val; +#endif #else lu->id.a = lu->val; #endif @@ -870,7 +906,11 @@ lu->id.irn_loc=lu->irn; lu->id.jcn_loc=lu->jcn; if (lu->id.ICNTL(6)>1) { #if defined(PETSC_USE_COMPLEX) +#if defined(PETSC_USE_REAL_SINGLE) + lu->id.a_loc = (mumps_complex*)lu->val; +#else lu->id.a_loc = (mumps_double_complex*)lu->val; +#endif #else lu->id.a_loc = lu->val; #endif @@ -892,11 +932,7 @@ ierr = VecDestroy(&b);CHKERRQ(ierr); break; } -#if defined(PETSC_USE_COMPLEX) - zmumps_c(&lu->id); -#else - dmumps_c(&lu->id); -#endif + PetscMUMPS_c(&lu->id); if (lu->id.INFOG(1) < 0) SETERRQ1(PETSC_COMM_SELF,PETSC_ERR_LIB,"Error reported by MUMPS in analysis phase: INFOG(1)=%d\n",lu->id.INFOG(1)); F->ops->lufactornumeric = MatFactorNumeric_MUMPS; @@ -936,7 +972,11 @@ lu->id.nz =lu->nz; lu->id.irn=lu->irn; lu->id.jcn=lu->jcn; if (lu->id.ICNTL(6)>1){ #if defined(PETSC_USE_COMPLEX) +#if defined(PETSC_USE_REAL_SINGLE) + lu->id.a = (mumps_complex*)lu->val; +#else lu->id.a = (mumps_double_complex*)lu->val; +#endif #else lu->id.a = lu->val; #endif @@ -948,7 +988,11 @@ lu->id.irn_loc=lu->irn; lu->id.jcn_loc=lu->jcn; if (lu->id.ICNTL(6)>1) { #if defined(PETSC_USE_COMPLEX) +#if defined(PETSC_USE_REAL_SINGLE) + lu->id.a_loc = (mumps_complex*)lu->val; +#else lu->id.a_loc = (mumps_double_complex*)lu->val; +#endif #else lu->id.a_loc = lu->val; #endif @@ -970,11 +1014,7 @@ ierr = VecDestroy(&b);CHKERRQ(ierr); break; } -#if defined(PETSC_USE_COMPLEX) - zmumps_c(&lu->id); -#else - dmumps_c(&lu->id); -#endif + PetscMUMPS_c(&lu->id); if (lu->id.INFOG(1) < 0) SETERRQ1(PETSC_COMM_SELF,PETSC_ERR_LIB,"Error reported by MUMPS in analysis phase: INFOG(1)=%d\n",lu->id.INFOG(1)); F->ops->lufactornumeric = MatFactorNumeric_MUMPS; @@ -1012,7 +1052,11 @@ lu->id.nz =lu->nz; lu->id.irn=lu->irn; lu->id.jcn=lu->jcn; if (lu->id.ICNTL(6)>1){ #if defined(PETSC_USE_COMPLEX) +#if defined(PETSC_USE_REAL_SINGLE) + lu->id.a = (mumps_complex*)lu->val; +#else lu->id.a = (mumps_double_complex*)lu->val; +#endif #else lu->id.a = lu->val; #endif @@ -1024,7 +1068,11 @@ lu->id.irn_loc=lu->irn; lu->id.jcn_loc=lu->jcn; if (lu->id.ICNTL(6)>1) { #if defined(PETSC_USE_COMPLEX) +#if defined(PETSC_USE_REAL_SINGLE) + lu->id.a_loc = (mumps_complex*)lu->val; +#else lu->id.a_loc = (mumps_double_complex*)lu->val; +#endif #else lu->id.a_loc = lu->val; #endif @@ -1046,11 +1094,7 @@ ierr = VecDestroy(&b);CHKERRQ(ierr); break; } -#if defined(PETSC_USE_COMPLEX) - zmumps_c(&lu->id); -#else - dmumps_c(&lu->id); -#endif + PetscMUMPS_c(&lu->id); if (lu->id.INFOG(1) < 0) SETERRQ1(PETSC_COMM_SELF,PETSC_ERR_LIB,"Error reported by MUMPS in analysis phase: INFOG(1)=%d\n",lu->id.INFOG(1)); F->ops->choleskyfactornumeric = MatFactorNumeric_MUMPS; diff -r 8224017c60ff src/mat/impls/aij/seq/superlu/makefile --- a/src/mat/impls/aij/seq/superlu/makefile Tue Sep 18 10:11:50 2012 +0200 +++ b/src/mat/impls/aij/seq/superlu/makefile Fri Sep 21 16:25:42 2012 +0200 @@ -1,5 +1,4 @@ #requirespackage 'PETSC_HAVE_SUPERLU' -#requiresprecision double ALL: lib diff -r 8224017c60ff src/mat/impls/aij/seq/superlu/superlu.c --- a/src/mat/impls/aij/seq/superlu/superlu.c Tue Sep 18 10:11:50 2012 +0200 +++ b/src/mat/impls/aij/seq/superlu/superlu.c Fri Sep 21 16:25:42 2012 +0200 @@ -21,10 +21,18 @@ */ EXTERN_C_BEGIN #if defined(PETSC_USE_COMPLEX) +#if defined(PETSC_USE_REAL_SINGLE) +#include +#else #include +#endif +#else +#if defined(PETSC_USE_REAL_SINGLE) +#include #else #include #endif +#endif #include EXTERN_C_END @@ -142,36 +150,70 @@ aa = (Mat_SeqAIJ*)(A)->data; } #if defined(PETSC_USE_COMPLEX) +#if defined(PETSC_USE_REAL_SINGLE) + cCreate_CompCol_Matrix(&lu->A,A->cmap->n,A->rmap->n,aa->nz,(singlecomplex*)aa->a,aa->j,aa->i, + SLU_NC,SLU_C,SLU_GE); +#else zCreate_CompCol_Matrix(&lu->A,A->cmap->n,A->rmap->n,aa->nz,(doublecomplex*)aa->a,aa->j,aa->i, SLU_NC,SLU_Z,SLU_GE); +#endif +#else +#if defined(PETSC_USE_REAL_SINGLE) + sCreate_CompCol_Matrix(&lu->A,A->cmap->n,A->rmap->n,aa->nz,aa->a,aa->j,aa->i, + SLU_NC,SLU_S,SLU_GE); #else dCreate_CompCol_Matrix(&lu->A,A->cmap->n,A->rmap->n,aa->nz,aa->a,aa->j,aa->i, SLU_NC,SLU_D,SLU_GE); #endif +#endif /* Numerical factorization */ lu->B.ncol = 0; /* Indicate not to solve the system */ if (F->factortype == MAT_FACTOR_LU){ #if defined(PETSC_USE_COMPLEX) +#if defined(PETSC_USE_REAL_SINGLE) + cgssvx(&lu->options, &lu->A, lu->perm_c, lu->perm_r, lu->etree, lu->equed, lu->R, lu->C, + &lu->L, &lu->U, lu->work, lu->lwork, &lu->B, &lu->X, &lu->rpg, &lu->rcond, &ferr, &berr, + &lu->mem_usage, &lu->stat, &sinfo); +#else zgssvx(&lu->options, &lu->A, lu->perm_c, lu->perm_r, lu->etree, lu->equed, lu->R, lu->C, &lu->L, &lu->U, lu->work, lu->lwork, &lu->B, &lu->X, &lu->rpg, &lu->rcond, &ferr, &berr, &lu->mem_usage, &lu->stat, &sinfo); +#endif +#else +#if defined(PETSC_USE_REAL_SINGLE) + sgssvx(&lu->options, &lu->A, lu->perm_c, lu->perm_r, lu->etree, lu->equed, lu->R, lu->C, + &lu->L, &lu->U, lu->work, lu->lwork, &lu->B, &lu->X, &lu->rpg, &lu->rcond, &ferr, &berr, + &lu->mem_usage, &lu->stat, &sinfo); #else dgssvx(&lu->options, &lu->A, lu->perm_c, lu->perm_r, lu->etree, lu->equed, lu->R, lu->C, &lu->L, &lu->U, lu->work, lu->lwork, &lu->B, &lu->X, &lu->rpg, &lu->rcond, &ferr, &berr, &lu->mem_usage, &lu->stat, &sinfo); #endif +#endif } else if (F->factortype == MAT_FACTOR_ILU){ /* Compute the incomplete factorization, condition number and pivot growth */ #if defined(PETSC_USE_COMPLEX) +#if defined(PETSC_USE_REAL_SINGLE) + cgsisx(&lu->options, &lu->A, lu->perm_c, lu->perm_r,lu->etree, lu->equed, lu->R, lu->C, + &lu->L, &lu->U, lu->work, lu->lwork, &lu->B, &lu->X, &lu->rpg, &lu->rcond, + &lu->mem_usage, &lu->stat, &sinfo); +#else zgsisx(&lu->options, &lu->A, lu->perm_c, lu->perm_r,lu->etree, lu->equed, lu->R, lu->C, &lu->L, &lu->U, lu->work, lu->lwork, &lu->B, &lu->X, &lu->rpg, &lu->rcond, &lu->mem_usage, &lu->stat, &sinfo); +#endif +#else +#if defined(PETSC_USE_REAL_SINGLE) + sgsisx(&lu->options, &lu->A, lu->perm_c, lu->perm_r, lu->etree, lu->equed, lu->R, lu->C, + &lu->L, &lu->U, lu->work, lu->lwork, &lu->B, &lu->X, &lu->rpg, &lu->rcond, + &lu->mem_usage, &lu->stat, &sinfo); #else dgsisx(&lu->options, &lu->A, lu->perm_c, lu->perm_r, lu->etree, lu->equed, lu->R, lu->C, &lu->L, &lu->U, lu->work, lu->lwork, &lu->B, &lu->X, &lu->rpg, &lu->rcond, &lu->mem_usage, &lu->stat, &sinfo); #endif +#endif } else { SETERRQ(PETSC_COMM_SELF,PETSC_ERR_SUP,"Factor type not supported"); } @@ -296,8 +338,13 @@ ierr = VecGetArray(x,&xarray);CHKERRQ(ierr); #if defined(PETSC_USE_COMPLEX) +#if defined(PETSC_USE_REAL_SINGLE) + ((DNformat*)lu->B.Store)->nzval = (singlecomplex*)barray; + ((DNformat*)lu->X.Store)->nzval = (singlecomplex*)xarray; +#else ((DNformat*)lu->B.Store)->nzval = (doublecomplex*)barray; ((DNformat*)lu->X.Store)->nzval = (doublecomplex*)xarray; +#endif #else ((DNformat*)lu->B.Store)->nzval = barray; ((DNformat*)lu->X.Store)->nzval = xarray; @@ -306,24 +353,48 @@ lu->options.Fact = FACTORED; /* Indicate the factored form of A is supplied. */ if (A->factortype == MAT_FACTOR_LU){ #if defined(PETSC_USE_COMPLEX) +#if defined(PETSC_USE_REAL_SINGLE) + cgssvx(&lu->options, &lu->A, lu->perm_c, lu->perm_r, lu->etree, lu->equed, lu->R, lu->C, + &lu->L, &lu->U, lu->work, lu->lwork, &lu->B, &lu->X, &lu->rpg, &lu->rcond, &ferr, &berr, + &lu->mem_usage, &lu->stat, &info); +#else zgssvx(&lu->options, &lu->A, lu->perm_c, lu->perm_r, lu->etree, lu->equed, lu->R, lu->C, &lu->L, &lu->U, lu->work, lu->lwork, &lu->B, &lu->X, &lu->rpg, &lu->rcond, &ferr, &berr, &lu->mem_usage, &lu->stat, &info); +#endif +#else +#if defined(PETSC_USE_REAL_SINGLE) + sgssvx(&lu->options, &lu->A, lu->perm_c, lu->perm_r, lu->etree, lu->equed, lu->R, lu->C, + &lu->L, &lu->U, lu->work, lu->lwork, &lu->B, &lu->X, &lu->rpg, &lu->rcond, &ferr, &berr, + &lu->mem_usage, &lu->stat, &info); #else dgssvx(&lu->options, &lu->A, lu->perm_c, lu->perm_r, lu->etree, lu->equed, lu->R, lu->C, &lu->L, &lu->U, lu->work, lu->lwork, &lu->B, &lu->X, &lu->rpg, &lu->rcond, &ferr, &berr, &lu->mem_usage, &lu->stat, &info); #endif +#endif } else if (A->factortype == MAT_FACTOR_ILU){ #if defined(PETSC_USE_COMPLEX) +#if defined(PETSC_USE_REAL_SINGLE) + cgsisx(&lu->options, &lu->A, lu->perm_c, lu->perm_r, lu->etree, lu->equed, lu->R, lu->C, + &lu->L, &lu->U, lu->work, lu->lwork, &lu->B, &lu->X, &lu->rpg, &lu->rcond, + &lu->mem_usage, &lu->stat, &info); +#else zgsisx(&lu->options, &lu->A, lu->perm_c, lu->perm_r, lu->etree, lu->equed, lu->R, lu->C, &lu->L, &lu->U, lu->work, lu->lwork, &lu->B, &lu->X, &lu->rpg, &lu->rcond, &lu->mem_usage, &lu->stat, &info); +#endif +#else +#if defined(PETSC_USE_REAL_SINGLE) + sgsisx(&lu->options, &lu->A, lu->perm_c, lu->perm_r, lu->etree, lu->equed, lu->R, lu->C, + &lu->L, &lu->U, lu->work, lu->lwork, &lu->B, &lu->X, &lu->rpg, &lu->rcond, + &lu->mem_usage, &lu->stat, &info); #else dgsisx(&lu->options, &lu->A, lu->perm_c, lu->perm_r, lu->etree, lu->equed, lu->R, lu->C, &lu->L, &lu->U, lu->work, lu->lwork, &lu->B, &lu->X, &lu->rpg, &lu->rcond, &lu->mem_usage, &lu->stat, &info); #endif +#endif } else { SETERRQ(PETSC_COMM_SELF,PETSC_ERR_SUP,"Factor type not supported"); } @@ -512,6 +583,7 @@ PetscErrorCode ierr; PetscInt indx,m=A->rmap->n,n=A->cmap->n; PetscBool flg; + PetscReal real_input; const char *colperm[]={"NATURAL","MMD_ATA","MMD_AT_PLUS_A","COLAMD"}; /* MY_PERMC - not supported by the petsc interface yet */ const char *iterrefine[]={"NOREFINE", "SINGLE", "DOUBLE", "EXTRA"}; const char *rowperm[]={"NOROWPERM", "LargeDiag"}; /* MY_PERMC - not supported by the petsc interface yet */ @@ -563,7 +635,8 @@ if (flg) { lu->options.IterRefine = (IterRefine_t)indx;} ierr = PetscOptionsBool("-mat_superlu_symmetricmode","SymmetricMode","None",(PetscBool)lu->options.SymmetricMode,&flg,0);CHKERRQ(ierr); if (flg) lu->options.SymmetricMode = YES; - ierr = PetscOptionsReal("-mat_superlu_diagpivotthresh","DiagPivotThresh","None",lu->options.DiagPivotThresh,&lu->options.DiagPivotThresh,PETSC_NULL);CHKERRQ(ierr); + ierr = PetscOptionsReal("-mat_superlu_diagpivotthresh","DiagPivotThresh","None",lu->options.DiagPivotThresh,&real_input,&flg);CHKERRQ(ierr); + if (flg) lu->options.DiagPivotThresh = (double) real_input; ierr = PetscOptionsBool("-mat_superlu_pivotgrowth","PivotGrowth","None",(PetscBool)lu->options.PivotGrowth,&flg,0);CHKERRQ(ierr); if (flg) lu->options.PivotGrowth = YES; ierr = PetscOptionsBool("-mat_superlu_conditionnumber","ConditionNumber","None",(PetscBool)lu->options.ConditionNumber,&flg,0);CHKERRQ(ierr); @@ -582,9 +655,12 @@ lu->lwork = 0; } /* ilu options */ - ierr = PetscOptionsReal("-mat_superlu_ilu_droptol","ILU_DropTol","None",lu->options.ILU_DropTol,&lu->options.ILU_DropTol,PETSC_NULL);CHKERRQ(ierr); - ierr = PetscOptionsReal("-mat_superlu_ilu_filltol","ILU_FillTol","None",lu->options.ILU_FillTol,&lu->options.ILU_FillTol,PETSC_NULL);CHKERRQ(ierr); - ierr = PetscOptionsReal("-mat_superlu_ilu_fillfactor","ILU_FillFactor","None",lu->options.ILU_FillFactor,&lu->options.ILU_FillFactor,PETSC_NULL);CHKERRQ(ierr); + ierr = PetscOptionsReal("-mat_superlu_ilu_droptol","ILU_DropTol","None",lu->options.ILU_DropTol,&real_input,&flg);CHKERRQ(ierr); + if (flg) lu->options.ILU_DropTol = (double) real_input; + ierr = PetscOptionsReal("-mat_superlu_ilu_filltol","ILU_FillTol","None",lu->options.ILU_FillTol,&real_input,&flg);CHKERRQ(ierr); + if (flg) lu->options.ILU_FillTol = (double) real_input; + ierr = PetscOptionsReal("-mat_superlu_ilu_fillfactor","ILU_FillFactor","None",lu->options.ILU_FillFactor,&real_input,&flg);CHKERRQ(ierr); + if (flg) lu->options.ILU_FillFactor = (double) real_input; ierr = PetscOptionsInt("-mat_superlu_ilu_droprull","ILU_DropRule","None",lu->options.ILU_DropRule,&lu->options.ILU_DropRule,PETSC_NULL);CHKERRQ(ierr); ierr = PetscOptionsInt("-mat_superlu_ilu_norm","ILU_Norm","None",lu->options.ILU_Norm,&indx,&flg);CHKERRQ(ierr); if (flg){ @@ -609,12 +685,22 @@ /* create rhs and solution x without allocate space for .Store */ #if defined(PETSC_USE_COMPLEX) +#if defined(PETSC_USE_REAL_SINGLE) + cCreate_Dense_Matrix(&lu->B, m, 1, PETSC_NULL, m, SLU_DN, SLU_C, SLU_GE); + cCreate_Dense_Matrix(&lu->X, m, 1, PETSC_NULL, m, SLU_DN, SLU_C, SLU_GE); +#else zCreate_Dense_Matrix(&lu->B, m, 1, PETSC_NULL, m, SLU_DN, SLU_Z, SLU_GE); zCreate_Dense_Matrix(&lu->X, m, 1, PETSC_NULL, m, SLU_DN, SLU_Z, SLU_GE); +#endif +#else +#if defined(PETSC_USE_REAL_SINGLE) + sCreate_Dense_Matrix(&lu->B, m, 1, PETSC_NULL, m, SLU_DN, SLU_S, SLU_GE); + sCreate_Dense_Matrix(&lu->X, m, 1, PETSC_NULL, m, SLU_DN, SLU_S, SLU_GE); #else dCreate_Dense_Matrix(&lu->B, m, 1, PETSC_NULL, m, SLU_DN, SLU_D, SLU_GE); dCreate_Dense_Matrix(&lu->X, m, 1, PETSC_NULL, m, SLU_DN, SLU_D, SLU_GE); #endif +#endif #ifdef SUPERLU2 ierr = PetscObjectComposeFunctionDynamic((PetscObject)B,"MatCreateNull","MatCreateNull_SuperLU",(void(*)(void))MatCreateNull_SuperLU);CHKERRQ(ierr);