Actual source code: dlregismat.c

petsc-master 2019-05-22
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:   MatRootName    nnames,names = MatRootNameList;

 55:   MatSolverTypeDestroy();
 56:   while (names) {
 57:     nnames = names->next;
 58:     PetscFree(names->rname);
 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:   MatRootNameList                  = 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_CUDA)
 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_constantdiagonal_petsc(Mat,MatFactorType,Mat*);
133: PETSC_INTERN PetscErrorCode MatGetFactor_seqaij_bas(Mat,MatFactorType,Mat*);

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

140:   Level: developer

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

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

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

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

262:   PetscLogEventRegister("MatGetSymTrans",MAT_CLASSID,&MAT_Getsymtranspose);
263:   PetscLogEventRegister("MatGetSymTransR",MAT_CLASSID,&MAT_Getsymtransreduced);
264:   PetscLogEventRegister("MatCUSPARSCopyTo",MAT_CLASSID,&MAT_CUSPARSECopyToGPU);
265:   PetscLogEventRegister("MatVCLCopyTo",  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:   MatSolverTypeRegister(MATSOLVERPETSC, MATCONSTANTDIAGONAL,MAT_FACTOR_LU,MatGetFactor_constantdiagonal_petsc);
322:   MatSolverTypeRegister(MATSOLVERPETSC, MATCONSTANTDIAGONAL,MAT_FACTOR_CHOLESKY,MatGetFactor_constantdiagonal_petsc);
323:   MatSolverTypeRegister(MATSOLVERPETSC, MATCONSTANTDIAGONAL,MAT_FACTOR_ILU,MatGetFactor_constantdiagonal_petsc);
324:   MatSolverTypeRegister(MATSOLVERPETSC, MATCONSTANTDIAGONAL,MAT_FACTOR_ICC,MatGetFactor_constantdiagonal_petsc);

326: #if defined(PETSC_HAVE_MKL_SPARSE)
327:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJMKL,     MAT_FACTOR_LU,MatGetFactor_seqaij_petsc);
328:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJMKL,     MAT_FACTOR_CHOLESKY,MatGetFactor_seqaij_petsc);
329:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJMKL,     MAT_FACTOR_ILU,MatGetFactor_seqaij_petsc);
330:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJMKL,     MAT_FACTOR_ICC,MatGetFactor_seqaij_petsc);

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

340:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJCRL,     MAT_FACTOR_LU,MatGetFactor_seqaij_petsc);
341:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJCRL,     MAT_FACTOR_CHOLESKY,MatGetFactor_seqaij_petsc);
342:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJCRL,     MAT_FACTOR_ILU,MatGetFactor_seqaij_petsc);
343:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJCRL,     MAT_FACTOR_ICC,MatGetFactor_seqaij_petsc);

345:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQBAIJ,       MAT_FACTOR_LU,MatGetFactor_seqbaij_petsc);
346:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQBAIJ,       MAT_FACTOR_CHOLESKY,MatGetFactor_seqbaij_petsc);
347:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQBAIJ,       MAT_FACTOR_ILU,MatGetFactor_seqbaij_petsc);
348:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQBAIJ,       MAT_FACTOR_ICC,MatGetFactor_seqbaij_petsc);

350:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQSBAIJ,      MAT_FACTOR_CHOLESKY,MatGetFactor_seqsbaij_petsc);
351:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQSBAIJ,      MAT_FACTOR_ICC,MatGetFactor_seqsbaij_petsc);

353:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQDENSE,      MAT_FACTOR_LU,MatGetFactor_seqdense_petsc);
354:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQDENSE,      MAT_FACTOR_CHOLESKY,MatGetFactor_seqdense_petsc);

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

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

415: #if defined(PETSC_HAVE_DYNAMIC_LIBRARIES)
416: /*
417:   PetscDLLibraryRegister - This function is called when the dynamic library it is in is opened.

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

421:  */
422: PETSC_EXTERN PetscErrorCode PetscDLLibraryRegister_petscmat(void)
423: {

427:   MatInitializePackage();
428:   return(0);
429: }


432: #endif /* PETSC_HAVE_DYNAMIC_LIBRARIES */