Actual source code: dlregismat.c

petsc-3.10.5 2019-03-28
Report Typos and Errors

  2:  #include <petsc/private/matimpl.h>

  4: const char       *MatOptions_Shifted[] = {"UNUSED_NONZERO_LOCATION_ERR",
  5:                                   "ROW_ORIENTED",
  6:                                   "NOT_A_VALID_OPTION",
  7:                                   "SYMMETRIC",
  8:                                   "STRUCTURALLY_SYMMETRIC",
  9:                                   "NEW_DIAGONALS",
 10:                                   "IGNORE_OFF_PROC_ENTRIES",
 11:                                   "USE_HASH_TABLE",
 12:                                   "KEEP_NONZERO_PATTERN",
 13:                                   "IGNORE_ZERO_ENTRIES",
 14:                                   "USE_INODES",
 15:                                   "HERMITIAN",
 16:                                   "SYMMETRY_ETERNAL",
 17:                                   "NEW_NONZERO_LOCATION_ERR",
 18:                                   "IGNORE_LOWER_TRIANGULAR",
 19:                                   "ERROR_LOWER_TRIANGULAR",
 20:                                   "GETROW_UPPERTRIANGULAR",
 21:                                   "SPD",
 22:                                   "NO_OFF_PROC_ZERO_ROWS",
 23:                                   "NO_OFF_PROC_ENTRIES",
 24:                                   "NEW_NONZERO_LOCATIONS",
 25:                                   "NEW_NONZERO_ALLOCATION_ERR",
 26:                                   "MAT_SUBSET_OFF_PROC_ENTRIES",
 27:                                   "MAT_SUBMAT_SINGLEIS",
 28:                                   "MatOption","MAT_",0};
 29: const char *const* MatOptions = MatOptions_Shifted+2;
 30: const char *const MatFactorShiftTypes[] = {"NONE","NONZERO","POSITIVE_DEFINITE","INBLOCKS","MatFactorShiftType","PC_FACTOR_",0};
 31: const char *const MatFactorShiftTypesDetail[] = {NULL,"diagonal shift to prevent zero pivot","Manteuffel shift","diagonal shift on blocks to prevent zero pivot"};
 32: const char *const MPPTScotchStrategyTypes[] = {"DEFAULT","QUALITY","SPEED","BALANCE","SAFETY","SCALABILITY","MPPTScotchStrategyType","MP_PTSCOTCH_",0};
 33: const char *const MPChacoGlobalTypes[] = {"","MULTILEVEL","SPECTRAL","","LINEAR","RANDOM","SCATTERED","MPChacoGlobalType","MP_CHACO_",0};
 34: const char *const MPChacoLocalTypes[] = {"","KERNIGHAN","NONE","MPChacoLocalType","MP_CHACO_",0};
 35: const char *const MPChacoEigenTypes[] = {"LANCZOS","RQI","MPChacoEigenType","MP_CHACO_",0};

 37: extern PetscErrorCode  MatMFFDInitializePackage(void);
 38: extern PetscErrorCode  MatSolverTypeDestroy(void);
 39: static PetscBool MatPackageInitialized = PETSC_FALSE;
 40: /*@C
 41:   MatFinalizePackage - This function destroys everything in the Petsc interface to the Mat package. It is
 42:   called from PetscFinalize().

 44:   Level: developer

 46: .keywords: Petsc, destroy, package, mathematica
 47: .seealso: PetscFinalize()
 48: @*/
 49: PetscErrorCode  MatFinalizePackage(void)
 50: {
 51:   MatBaseName    nnames,names = MatBaseNameList;

 55:   MatSolverTypeDestroy();
 56:   while (names) {
 57:     nnames = names->next;
 58:     PetscFree(names->bname);
 59:     PetscFree(names->sname);
 60:     PetscFree(names->mname);
 61:     PetscFree(names);
 62:     names  = nnames;
 63:   }
 64:   PetscFunctionListDestroy(&MatList);
 65:   PetscFunctionListDestroy(&MatOrderingList);
 66:   PetscFunctionListDestroy(&MatColoringList);
 67:   PetscFunctionListDestroy(&MatPartitioningList);
 68:   PetscFunctionListDestroy(&MatCoarsenList);
 69:   MatBaseNameList                  = NULL;
 70:   MatPackageInitialized            = PETSC_FALSE;
 71:   MatRegisterAllCalled             = PETSC_FALSE;
 72:   MatOrderingRegisterAllCalled     = PETSC_FALSE;
 73:   MatColoringRegisterAllCalled     = PETSC_FALSE;
 74:   MatPartitioningRegisterAllCalled = PETSC_FALSE;
 75:   MatCoarsenRegisterAllCalled      = PETSC_FALSE;
 76:   /* this is not ideal because it exposes SeqAIJ implementation details directly into the base Mat code */
 77:   PetscFunctionListDestroy(&MatSeqAIJList);
 78:   MatSeqAIJRegisterAllCalled       = PETSC_FALSE;
 79:   return(0);
 80: }

 82: #if defined(PETSC_HAVE_MUMPS)
 83: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_MUMPS(void);
 84: #endif
 85: #if defined(PETSC_HAVE_VECCUDA)
 86: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_CUSPARSE(void);
 87: #endif
 88: #if defined(PETSC_HAVE_VIENNACL)
 89: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_ViennaCL(void);
 90: #endif
 91: #if defined(PETSC_HAVE_ELEMENTAL)
 92: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_Elemental(void);
 93: #endif
 94: #if defined(PETSC_HAVE_MATLAB_ENGINE)
 95: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_Matlab(void);
 96: #endif
 97: #if defined(PETSC_HAVE_PETSC_HAVE_ESSL)
 98: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_Essl(void);
 99: #endif
100: #if defined(PETSC_HAVE_SUPERLU)
101: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_SuperLU(void);
102: #endif
103: #if defined(PETSC_HAVE_STRUMPACK)
104: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_STRUMPACK(void);
105: #endif
106: #if defined(PETSC_HAVE_PASTIX)
107: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_Pastix(void);
108: #endif
109: #if defined(PETSC_HAVE_SUPERLU_DIST)
110: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_SuperLU_DIST(void);
111: #endif
112: #if defined(PETSC_HAVE_ELEMENTAL)
113: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_SparseElemental(void);
114: #endif
115: #if defined(PETSC_HAVE_MKL_PARDISO)
116: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_MKL_Pardiso(void);
117: #endif
118: #if defined(PETSC_HAVE_MKL_CPARDISO)
119: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_MKL_CPardiso(void);
120: #endif
121: #if defined(PETSC_HAVE_SUITESPARSE)
122: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_SuiteSparse(void);
123: #endif
124: #if defined(PETSC_HAVE_LUSOL)
125: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_Lusol(void);
126: #endif

128: PETSC_INTERN PetscErrorCode MatGetFactor_seqaij_petsc(Mat,MatFactorType,Mat*);
129: PETSC_INTERN PetscErrorCode MatGetFactor_seqbaij_petsc(Mat,MatFactorType,Mat*);
130: PETSC_INTERN PetscErrorCode MatGetFactor_seqsbaij_petsc(Mat,MatFactorType,Mat*);
131: PETSC_INTERN PetscErrorCode MatGetFactor_seqdense_petsc(Mat,MatFactorType,Mat*);
132: PETSC_INTERN PetscErrorCode MatGetFactor_seqaij_bas(Mat,MatFactorType,Mat*);

134: /*@C
135:   MatInitializePackage - This function initializes everything in the Mat package. It is called
136:   from PetscDLLibraryRegister() when using dynamic libraries, and on the first call to MatCreate()
137:   when using static libraries.

139:   Level: developer

141: .keywords: Mat, initialize, package
142: .seealso: PetscInitialize()
143: @*/
144: PetscErrorCode  MatInitializePackage(void)
145: {
146:   char           logList[256];
147:   PetscBool      opt,pkg;

151:   if (MatPackageInitialized) return(0);
152:   MatPackageInitialized = PETSC_TRUE;
153:   /* Inialize subpackage */
154:   MatMFFDInitializePackage();
155:   /* Register Classes */
156:   PetscClassIdRegister("Matrix",&MAT_CLASSID);
157:   PetscClassIdRegister("Matrix FD Coloring",&MAT_FDCOLORING_CLASSID);
158:   PetscClassIdRegister("Matrix Coloring",&MAT_COLORING_CLASSID);
159:   PetscClassIdRegister("Matrix MatTranspose Coloring",&MAT_TRANSPOSECOLORING_CLASSID);
160:   PetscClassIdRegister("Matrix Partitioning",&MAT_PARTITIONING_CLASSID);
161:   PetscClassIdRegister("Matrix Coarsen",&MAT_COARSEN_CLASSID);
162:   PetscClassIdRegister("Matrix Null Space",&MAT_NULLSPACE_CLASSID);
163:   /* Register Constructors */
164:   MatRegisterAll();
165:   MatOrderingRegisterAll();
166:   MatColoringRegisterAll();
167:   MatPartitioningRegisterAll();
168:   MatCoarsenRegisterAll();
169:   MatSeqAIJRegisterAll();
170:   /* Register Events */
171:   PetscLogEventRegister("MatMult",          MAT_CLASSID,&MAT_Mult);
172:   PetscLogEventRegister("MatMults",         MAT_CLASSID,&MAT_Mults);
173:   PetscLogEventRegister("MatMultConstr",    MAT_CLASSID,&MAT_MultConstrained);
174:   PetscLogEventRegister("MatMultAdd",       MAT_CLASSID,&MAT_MultAdd);
175:   PetscLogEventRegister("MatMultTranspose", MAT_CLASSID,&MAT_MultTranspose);
176:   PetscLogEventRegister("MatMultTrConstr",  MAT_CLASSID,&MAT_MultTransposeConstrained);
177:   PetscLogEventRegister("MatMultTrAdd",     MAT_CLASSID,&MAT_MultTransposeAdd);
178:   PetscLogEventRegister("MatSolve",         MAT_CLASSID,&MAT_Solve);
179:   PetscLogEventRegister("MatSolves",        MAT_CLASSID,&MAT_Solves);
180:   PetscLogEventRegister("MatSolveAdd",      MAT_CLASSID,&MAT_SolveAdd);
181:   PetscLogEventRegister("MatSolveTranspos", MAT_CLASSID,&MAT_SolveTranspose);
182:   PetscLogEventRegister("MatSolveTrAdd",    MAT_CLASSID,&MAT_SolveTransposeAdd);
183:   PetscLogEventRegister("MatSOR",           MAT_CLASSID,&MAT_SOR);
184:   PetscLogEventRegister("MatForwardSolve",  MAT_CLASSID,&MAT_ForwardSolve);
185:   PetscLogEventRegister("MatBackwardSolve", MAT_CLASSID,&MAT_BackwardSolve);
186:   PetscLogEventRegister("MatLUFactor",      MAT_CLASSID,&MAT_LUFactor);
187:   PetscLogEventRegister("MatLUFactorSym",   MAT_CLASSID,&MAT_LUFactorSymbolic);
188:   PetscLogEventRegister("MatLUFactorNum",   MAT_CLASSID,&MAT_LUFactorNumeric);
189:   PetscLogEventRegister("MatCholeskyFctr",  MAT_CLASSID,&MAT_CholeskyFactor);
190:   PetscLogEventRegister("MatCholFctrSym",   MAT_CLASSID,&MAT_CholeskyFactorSymbolic);
191:   PetscLogEventRegister("MatCholFctrNum",   MAT_CLASSID,&MAT_CholeskyFactorNumeric);
192:   PetscLogEventRegister("MatILUFactor",     MAT_CLASSID,&MAT_ILUFactor);
193:   PetscLogEventRegister("MatILUFactorSym",  MAT_CLASSID,&MAT_ILUFactorSymbolic);
194:   PetscLogEventRegister("MatICCFactorSym",  MAT_CLASSID,&MAT_ICCFactorSymbolic);
195:   PetscLogEventRegister("MatCopy",          MAT_CLASSID,&MAT_Copy);
196:   PetscLogEventRegister("MatConvert",       MAT_CLASSID,&MAT_Convert);
197:   PetscLogEventRegister("MatScale",         MAT_CLASSID,&MAT_Scale);
198:   PetscLogEventRegister("MatResidual",      MAT_CLASSID,&MAT_Residual);
199:   PetscLogEventRegister("MatAssemblyBegin", MAT_CLASSID,&MAT_AssemblyBegin);
200:   PetscLogEventRegister("MatAssemblyEnd",   MAT_CLASSID,&MAT_AssemblyEnd);
201:   PetscLogEventRegister("MatSetValues",     MAT_CLASSID,&MAT_SetValues);
202:   PetscLogEventRegister("MatGetValues",     MAT_CLASSID,&MAT_GetValues);
203:   PetscLogEventRegister("MatGetRow",        MAT_CLASSID,&MAT_GetRow);
204:   PetscLogEventRegister("MatGetRowIJ",      MAT_CLASSID,&MAT_GetRowIJ);
205:   PetscLogEventRegister("MatCreateSubMats", MAT_CLASSID,&MAT_CreateSubMats);
206:   PetscLogEventRegister("MatCreateSubMat",  MAT_CLASSID,&MAT_CreateSubMat);
207:   PetscLogEventRegister("MatGetOrdering",   MAT_CLASSID,&MAT_GetOrdering);
208:   PetscLogEventRegister("MatIncreaseOvrlp", MAT_CLASSID,&MAT_IncreaseOverlap);
209:   PetscLogEventRegister("MatPartitioning",  MAT_PARTITIONING_CLASSID,&MAT_Partitioning);
210:   PetscLogEventRegister("MatPartitioningND",MAT_PARTITIONING_CLASSID,&MAT_PartitioningND);
211:   PetscLogEventRegister("MatCoarsen",       MAT_COARSEN_CLASSID,&MAT_Coarsen);
212:   PetscLogEventRegister("MatZeroEntries",   MAT_CLASSID,&MAT_ZeroEntries);
213:   PetscLogEventRegister("MatLoad",          MAT_CLASSID,&MAT_Load);
214:   PetscLogEventRegister("MatView",          MAT_CLASSID,&MAT_View);
215:   PetscLogEventRegister("MatAXPY",          MAT_CLASSID,&MAT_AXPY);
216:   PetscLogEventRegister("MatFDColorCreate", MAT_FDCOLORING_CLASSID,&MAT_FDColoringCreate);
217:   PetscLogEventRegister("MatFDColorSetUp",  MAT_FDCOLORING_CLASSID,&MAT_FDColoringSetUp);
218:   PetscLogEventRegister("MatFDColorApply",  MAT_FDCOLORING_CLASSID,&MAT_FDColoringApply);
219:   PetscLogEventRegister("MatFDColorFunc",   MAT_FDCOLORING_CLASSID,&MAT_FDColoringFunction);
220:   PetscLogEventRegister("MatTranspose",     MAT_CLASSID,&MAT_Transpose);
221:   PetscLogEventRegister("MatMatMult",       MAT_CLASSID,&MAT_MatMult);
222:   PetscLogEventRegister("MatMatSolve",      MAT_CLASSID,&MAT_MatSolve);
223:   PetscLogEventRegister("MatMatTrSolve",    MAT_CLASSID,&MAT_MatTrSolve);
224:   PetscLogEventRegister("MatMatMultSym",    MAT_CLASSID,&MAT_MatMultSymbolic);
225:   PetscLogEventRegister("MatMatMultNum",    MAT_CLASSID,&MAT_MatMultNumeric);
226:   PetscLogEventRegister("MatMatMatMult",    MAT_CLASSID,&MAT_MatMatMult);
227:   PetscLogEventRegister("MatMatMatMultSym", MAT_CLASSID,&MAT_MatMatMultSymbolic);
228:   PetscLogEventRegister("MatMatMatMultNum", MAT_CLASSID,&MAT_MatMatMultNumeric);
229:   PetscLogEventRegister("MatPtAP",          MAT_CLASSID,&MAT_PtAP);
230:   PetscLogEventRegister("MatPtAPSymbolic",  MAT_CLASSID,&MAT_PtAPSymbolic);
231:   PetscLogEventRegister("MatPtAPNumeric",   MAT_CLASSID,&MAT_PtAPNumeric);
232:   PetscLogEventRegister("MatRARt",          MAT_CLASSID,&MAT_RARt);
233:   PetscLogEventRegister("MatRARtSym",       MAT_CLASSID,&MAT_RARtSymbolic);
234:   PetscLogEventRegister("MatRARtNum",       MAT_CLASSID,&MAT_RARtNumeric);
235:   PetscLogEventRegister("MatMatTransMult",  MAT_CLASSID,&MAT_MatTransposeMult);
236:   PetscLogEventRegister("MatMatTrnMultSym", MAT_CLASSID,&MAT_MatTransposeMultSymbolic);
237:   PetscLogEventRegister("MatMatTrnMultNum", MAT_CLASSID,&MAT_MatTransposeMultNumeric);
238:   PetscLogEventRegister("MatTrnMatMult",    MAT_CLASSID,&MAT_TransposeMatMult);
239:   PetscLogEventRegister("MatTrnMatMultSym", MAT_CLASSID,&MAT_TransposeMatMultSymbolic);
240:   PetscLogEventRegister("MatTrnMatMultNum", MAT_CLASSID,&MAT_TransposeMatMultNumeric);
241:   PetscLogEventRegister("MatTrnColorCreate", MAT_CLASSID,&MAT_TransposeColoringCreate);
242:   PetscLogEventRegister("MatRedundantMat",  MAT_CLASSID,&MAT_RedundantMat);
243:   PetscLogEventRegister("MatGetSeqNZStrct", MAT_CLASSID,&MAT_GetSequentialNonzeroStructure);
244:   PetscLogEventRegister("MatGetMultiProcB", MAT_CLASSID,&MAT_GetMultiProcBlock);
245:   PetscLogEventRegister("MatSetRandom",     MAT_CLASSID,&MAT_SetRandom);

247:   /* these may be specific to MPIAIJ matrices */
248:   PetscLogEventRegister("MatMPISumSeqNumeric",MAT_CLASSID,&MAT_Seqstompinum);
249:   PetscLogEventRegister("MatMPISumSeqSymbolic",MAT_CLASSID,&MAT_Seqstompisym);
250:   PetscLogEventRegister("MatMPISumSeq",MAT_CLASSID,&MAT_Seqstompi);
251:   PetscLogEventRegister("MatMPIConcateSeq",MAT_CLASSID,&MAT_Merge);
252:   PetscLogEventRegister("MatGetLocalMat",MAT_CLASSID,&MAT_Getlocalmat);
253:   PetscLogEventRegister("MatGetLocalMatCondensed",MAT_CLASSID,&MAT_Getlocalmatcondensed);
254:   PetscLogEventRegister("MatGetBrowsOfAcols",MAT_CLASSID,&MAT_GetBrowsOfAcols);
255:   PetscLogEventRegister("MatGetBrAoCol",MAT_CLASSID,&MAT_GetBrowsOfAocols);

257:   PetscLogEventRegister("MatApplyPAPt_Symbolic",MAT_CLASSID,&MAT_Applypapt_symbolic);
258:   PetscLogEventRegister("MatApplyPAPt_Numeric",MAT_CLASSID,&MAT_Applypapt_numeric);
259:   PetscLogEventRegister("MatApplyPAPt",MAT_CLASSID,&MAT_Applypapt);

261:   PetscLogEventRegister("MatGetSymTrans",MAT_CLASSID,&MAT_Getsymtranspose);
262:   PetscLogEventRegister("MatGetSymTransR",MAT_CLASSID,&MAT_Getsymtransreduced);
263:   PetscLogEventRegister("MatTranspose_SeqAIJ_FAST",MAT_CLASSID,&MAT_Transpose_SeqAIJ);
264:   PetscLogEventRegister("MatCUSPARSECopyTo",MAT_CLASSID,&MAT_CUSPARSECopyToGPU);
265:   PetscLogEventRegister("MatViennaCLCopyTo",MAT_CLASSID,&MAT_ViennaCLCopyToGPU);
266:   PetscLogEventRegister("MatSetValBatch",MAT_CLASSID,&MAT_SetValuesBatch);

268:   PetscLogEventRegister("MatColoringApply",MAT_COLORING_CLASSID,&MATCOLORING_Apply);
269:   PetscLogEventRegister("MatColoringComm",MAT_COLORING_CLASSID,&MATCOLORING_Comm);
270:   PetscLogEventRegister("MatColoringLocal",MAT_COLORING_CLASSID,&MATCOLORING_Local);
271:   PetscLogEventRegister("MatColoringIS",MAT_COLORING_CLASSID,&MATCOLORING_ISCreate);
272:   PetscLogEventRegister("MatColoringSetUp",MAT_COLORING_CLASSID,&MATCOLORING_SetUp);
273:   PetscLogEventRegister("MatColoringWeights",MAT_COLORING_CLASSID,&MATCOLORING_Weights);

275:   /* Mark non-collective events */
276:   PetscLogEventSetCollective(MAT_SetValues,      PETSC_FALSE);
277:   PetscLogEventSetCollective(MAT_SetValuesBatch, PETSC_FALSE);
278:   PetscLogEventSetCollective(MAT_GetRow,         PETSC_FALSE);
279:   /* Turn off high traffic events by default */
280:   PetscLogEventSetActiveAll(MAT_SetValues, PETSC_FALSE);
281:   PetscLogEventSetActiveAll(MAT_GetValues, PETSC_FALSE);
282:   PetscLogEventSetActiveAll(MAT_GetRow,    PETSC_FALSE);

284:   /* Process info exclusions */
285:   PetscOptionsGetString(NULL,NULL,"-info_exclude",logList,sizeof(logList),&opt);
286:   if (opt) {
287:     PetscStrInList("mat",logList,',',&pkg);
288:     if (pkg) {PetscInfoDeactivateClass(MAT_CLASSID);}
289:     if (pkg) {PetscInfoDeactivateClass(MAT_FDCOLORING_CLASSID);}
290:     if (pkg) {PetscInfoDeactivateClass(MAT_COLORING_CLASSID);}
291:     if (pkg) {PetscInfoDeactivateClass(MAT_TRANSPOSECOLORING_CLASSID);}
292:     if (pkg) {PetscInfoDeactivateClass(MAT_PARTITIONING_CLASSID);}
293:     if (pkg) {PetscInfoDeactivateClass(MAT_COARSEN_CLASSID);}
294:     if (pkg) {PetscInfoDeactivateClass(MAT_NULLSPACE_CLASSID);}
295:   }

297:   /* Process summary exclusions */
298:   PetscOptionsGetString(NULL,NULL,"-log_exclude",logList,sizeof(logList),&opt);
299:   if (opt) {
300:     PetscStrInList("mat",logList,',',&pkg);
301:     if (pkg) {PetscLogEventExcludeClass(MAT_CLASSID);}
302:     if (pkg) {PetscLogEventExcludeClass(MAT_FDCOLORING_CLASSID);}
303:     if (pkg) {PetscLogEventExcludeClass(MAT_COLORING_CLASSID);}
304:     if (pkg) {PetscLogEventExcludeClass(MAT_TRANSPOSECOLORING_CLASSID);}
305:     if (pkg) {PetscLogEventExcludeClass(MAT_PARTITIONING_CLASSID);}
306:     if (pkg) {PetscLogEventExcludeClass(MAT_COARSEN_CLASSID);}
307:     if (pkg) {PetscLogEventExcludeClass(MAT_NULLSPACE_CLASSID);}
308:   }

310:   /* Register the PETSc built in factorization based solvers */
311:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJ,        MAT_FACTOR_LU,MatGetFactor_seqaij_petsc);
312:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJ,        MAT_FACTOR_CHOLESKY,MatGetFactor_seqaij_petsc);
313:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJ,        MAT_FACTOR_ILU,MatGetFactor_seqaij_petsc);
314:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJ,        MAT_FACTOR_ICC,MatGetFactor_seqaij_petsc);

316:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJPERM,    MAT_FACTOR_LU,MatGetFactor_seqaij_petsc);
317:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJPERM,    MAT_FACTOR_CHOLESKY,MatGetFactor_seqaij_petsc);
318:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJPERM,    MAT_FACTOR_ILU,MatGetFactor_seqaij_petsc);
319:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJPERM,    MAT_FACTOR_ICC,MatGetFactor_seqaij_petsc);

321: #if defined(PETSC_HAVE_MKL_SPARSE)
322:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJMKL,     MAT_FACTOR_LU,MatGetFactor_seqaij_petsc);
323:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJMKL,     MAT_FACTOR_CHOLESKY,MatGetFactor_seqaij_petsc);
324:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJMKL,     MAT_FACTOR_ILU,MatGetFactor_seqaij_petsc);
325:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJMKL,     MAT_FACTOR_ICC,MatGetFactor_seqaij_petsc);

327:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQBAIJMKL,    MAT_FACTOR_LU,MatGetFactor_seqbaij_petsc);
328:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQBAIJMKL,    MAT_FACTOR_CHOLESKY,MatGetFactor_seqbaij_petsc);
329:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQBAIJMKL,    MAT_FACTOR_ILU,MatGetFactor_seqbaij_petsc);
330:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQBAIJMKL,    MAT_FACTOR_ICC,MatGetFactor_seqbaij_petsc);
331: #endif
332:     /* Above, we register the PETSc built-in factorization solvers for MATSEQAIJMKL.  In the future, we may want to use
333:      * some of the MKL-provided ones instead. */

335:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJCRL,     MAT_FACTOR_LU,MatGetFactor_seqaij_petsc);
336:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJCRL,     MAT_FACTOR_CHOLESKY,MatGetFactor_seqaij_petsc);
337:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJCRL,     MAT_FACTOR_ILU,MatGetFactor_seqaij_petsc);
338:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJCRL,     MAT_FACTOR_ICC,MatGetFactor_seqaij_petsc);

340:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQBAIJ,       MAT_FACTOR_LU,MatGetFactor_seqbaij_petsc);
341:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQBAIJ,       MAT_FACTOR_CHOLESKY,MatGetFactor_seqbaij_petsc);
342:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQBAIJ,       MAT_FACTOR_ILU,MatGetFactor_seqbaij_petsc);
343:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQBAIJ,       MAT_FACTOR_ICC,MatGetFactor_seqbaij_petsc);

345:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQSBAIJ,      MAT_FACTOR_CHOLESKY,MatGetFactor_seqsbaij_petsc);
346:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQSBAIJ,      MAT_FACTOR_ICC,MatGetFactor_seqsbaij_petsc);

348:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQDENSE,      MAT_FACTOR_LU,MatGetFactor_seqdense_petsc);
349:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQDENSE,      MAT_FACTOR_CHOLESKY,MatGetFactor_seqdense_petsc);

351:   MatSolverTypeRegister(MATSOLVERBAS,   MATSEQAIJ,        MAT_FACTOR_ICC,MatGetFactor_seqaij_bas);

353:   /*
354:      Register the external package factorization based solvers
355:         Eventually we don't want to have these hardwired here at compile time of PETSc
356:   */
357: #if defined(PETSC_HAVE_MUMPS)
358:   MatSolverTypeRegister_MUMPS();
359: #endif
360: #if defined(PETSC_HAVE_VECCUDA)
361:   MatSolverTypeRegister_CUSPARSE();
362: #endif
363: #if defined(PETSC_HAVE_VIENNACL)
364:   MatSolverTypeRegister_ViennaCL();
365: #endif
366: #if defined(PETSC_HAVE_ELEMENTAL)
367:   MatSolverTypeRegister_Elemental();
368: #endif
369: #if defined(PETSC_HAVE_MATLAB_ENGINE)
370:   MatSolverTypeRegister_Matlab();
371: #endif
372: #if defined(PETSC_HAVE_PETSC_HAVE_ESSL)
373:   MatSolverTypeRegister_Essl();
374: #endif
375: #if defined(PETSC_HAVE_SUPERLU)
376:   MatSolverTypeRegister_SuperLU();
377: #endif
378: #if defined(PETSC_HAVE_STRUMPACK)
379:   MatSolverTypeRegister_STRUMPACK();
380: #endif
381: #if defined(PETSC_HAVE_PASTIX)
382:   MatSolverTypeRegister_Pastix();
383: #endif
384: #if defined(PETSC_HAVE_SUPERLU_DIST)
385:   MatSolverTypeRegister_SuperLU_DIST();
386: #endif
387: #if defined(PETSC_HAVE_ELEMENTAL)
388:   MatSolverTypeRegister_SparseElemental();
389: #endif
390: #if defined(PETSC_HAVE_MKL_PARDISO)
391:   MatSolverTypeRegister_MKL_Pardiso();
392: #endif
393: #if defined(PETSC_HAVE_MKL_CPARDISO)
394:   MatSolverTypeRegister_MKL_CPardiso();
395: #endif
396: #if defined(PETSC_HAVE_SUITESPARSE)
397:   MatSolverTypeRegister_SuiteSparse();
398: #endif
399: #if defined(PETSC_HAVE_LUSOL)
400:   MatSolverTypeRegister_Lusol();
401: #endif
402: #if defined(PETSC_HAVE_ELEMENTAL)
403:   MatSolverTypeRegister_SparseElemental();
404: #endif
405:   /* Register package finalizer */
406:   PetscRegisterFinalize(MatFinalizePackage);
407:   return(0);
408: }

410: #if defined(PETSC_HAVE_DYNAMIC_LIBRARIES)
411: /*
412:   PetscDLLibraryRegister - This function is called when the dynamic library it is in is opened.

414:   This one registers all the matrix methods that are in the basic PETSc Matrix library.

416:  */
417: PETSC_EXTERN PetscErrorCode PetscDLLibraryRegister_petscmat(void)
418: {

422:   MatInitializePackage();
423:   return(0);
424: }


427: #endif /* PETSC_HAVE_DYNAMIC_LIBRARIES */