Actual source code: dlregismat.c

petsc-3.8.3 2017-12-09
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[] = {"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  MatSolverPackageDestroy(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:   MatSolverPackageDestroy();
 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 MatSolverPackageRegister_MUMPS(void);
 84: #endif
 85: #if defined(PETSC_HAVE_CUSP)
 86: PETSC_EXTERN PetscErrorCode MatSolverPackageRegister_CUSP(void);
 87: #endif
 88: #if defined(PETSC_HAVE_VECCUDA)
 89: PETSC_EXTERN PetscErrorCode MatSolverPackageRegister_CUSPARSE(void);
 90: #endif
 91: #if defined(PETSC_HAVE_VIENNACL)
 92: PETSC_EXTERN PetscErrorCode MatSolverPackageRegister_ViennaCL(void);
 93: #endif
 94: #if defined(PETSC_HAVE_ELEMENTAL)
 95: PETSC_EXTERN PetscErrorCode MatSolverPackageRegister_Elemental(void);
 96: #endif
 97: #if defined(PETSC_HAVE_MATLAB_ENGINE)
 98: PETSC_EXTERN PetscErrorCode MatSolverPackageRegister_Matlab(void);
 99: #endif
100: #if defined(PETSC_HAVE_PETSC_HAVE_ESSL)
101: PETSC_EXTERN PetscErrorCode MatSolverPackageRegister_Essl(void);
102: #endif
103: #if defined(PETSC_HAVE_SUPERLU)
104: PETSC_EXTERN PetscErrorCode MatSolverPackageRegister_SuperLU(void);
105: #endif
106: #if defined(PETSC_HAVE_STRUMPACK)
107: PETSC_EXTERN PetscErrorCode MatSolverPackageRegister_STRUMPACK(void);
108: #endif
109: #if defined(PETSC_HAVE_PASTIX)
110: PETSC_EXTERN PetscErrorCode MatSolverPackageRegister_Pastix(void);
111: #endif
112: #if defined(PETSC_HAVE_SUPERLU_DIST)
113: PETSC_EXTERN PetscErrorCode MatSolverPackageRegister_SuperLU_DIST(void);
114: #endif
115: #if defined(PETSC_HAVE_ELEMENTAL)
116: PETSC_EXTERN PetscErrorCode MatSolverPackageRegister_SparseElemental(void);
117: #endif
118: #if defined(PETSC_HAVE_MKL_PARDISO)
119: PETSC_EXTERN PetscErrorCode MatSolverPackageRegister_MKL_Pardiso(void);
120: #endif
121: #if defined(PETSC_HAVE_MKL_CPARDISO)
122: PETSC_EXTERN PetscErrorCode MatSolverPackageRegister_MKL_CPardiso(void);
123: #endif
124: #if defined(PETSC_HAVE_SUITESPARSE)
125: PETSC_EXTERN PetscErrorCode MatSolverPackageRegister_SuiteSparse(void);
126: #endif
127: #if defined(PETSC_HAVE_LUSOL)
128: PETSC_EXTERN PetscErrorCode MatSolverPackageRegister_Lusol(void);
129: #endif

131: PETSC_INTERN PetscErrorCode MatGetFactor_seqaij_petsc(Mat,MatFactorType,Mat*);
132: PETSC_INTERN PetscErrorCode MatGetFactor_seqbaij_petsc(Mat,MatFactorType,Mat*);
133: PETSC_INTERN PetscErrorCode MatGetFactor_seqsbaij_petsc(Mat,MatFactorType,Mat*);
134: PETSC_INTERN PetscErrorCode MatGetFactor_seqdense_petsc(Mat,MatFactorType,Mat*);
135: PETSC_INTERN PetscErrorCode MatGetFactor_seqaij_bas(Mat,MatFactorType,Mat*);

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

142:   Level: developer

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

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

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

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

263:   PetscLogEventRegister("MatGetSymTrans",MAT_CLASSID,&MAT_Getsymtranspose);
264:   PetscLogEventRegister("MatGetSymTransR",MAT_CLASSID,&MAT_Getsymtransreduced);
265:   PetscLogEventRegister("MatTranspose_SeqAIJ_FAST",MAT_CLASSID,&MAT_Transpose_SeqAIJ);
266:   PetscLogEventRegister("MatCUSPCopyTo",MAT_CLASSID,&MAT_CUSPCopyToGPU);
267:   PetscLogEventRegister("MatCUSPARSECopyTo",MAT_CLASSID,&MAT_CUSPARSECopyToGPU);
268:   PetscLogEventRegister("MatViennaCLCopyTo",MAT_CLASSID,&MAT_ViennaCLCopyToGPU);
269:   PetscLogEventRegister("MatSetValBatch",MAT_CLASSID,&MAT_SetValuesBatch);
270:   PetscLogEventRegister("MatSetValBatch1",MAT_CLASSID,&MAT_SetValuesBatchI);
271:   PetscLogEventRegister("MatSetValBatch2",MAT_CLASSID,&MAT_SetValuesBatchII);
272:   PetscLogEventRegister("MatSetValBatch3",MAT_CLASSID,&MAT_SetValuesBatchIII);
273:   PetscLogEventRegister("MatSetValBatch4",MAT_CLASSID,&MAT_SetValuesBatchIV);

275:   PetscLogEventRegister("MatColoringApply",MAT_COLORING_CLASSID,&MATCOLORING_Apply);
276:   PetscLogEventRegister("MatColoringComm",MAT_COLORING_CLASSID,&MATCOLORING_Comm);
277:   PetscLogEventRegister("MatColoringLocal",MAT_COLORING_CLASSID,&MATCOLORING_Local);
278:   PetscLogEventRegister("MatColoringIS",MAT_COLORING_CLASSID,&MATCOLORING_ISCreate);
279:   PetscLogEventRegister("MatColoringSetUp",MAT_COLORING_CLASSID,&MATCOLORING_SetUp);
280:   PetscLogEventRegister("MatColoringWeights",MAT_COLORING_CLASSID,&MATCOLORING_Weights);

282:   /* Turn off high traffic events by default */
283:   PetscLogEventSetActiveAll(MAT_SetValues, PETSC_FALSE);
284:   /* Process info exclusions */
285:   PetscOptionsGetString(NULL,NULL, "-info_exclude", logList, 256, &opt);
286:   if (opt) {
287:     PetscStrstr(logList, "mat", &className);
288:     if (className) {
289:       PetscInfoDeactivateClass(MAT_CLASSID);
290:     }
291:   }
292:   /* Process summary exclusions */
293:   PetscOptionsGetString(NULL,NULL, "-log_exclude", logList, 256, &opt);
294:   if (opt) {
295:     PetscStrstr(logList, "mat", &className);
296:     if (className) {
297:       PetscLogEventDeactivateClass(MAT_CLASSID);
298:     }
299:   }

301:   /* Register the PETSc built in factorization based solvers */
302:   MatSolverPackageRegister(MATSOLVERPETSC, MATSEQAIJ,        MAT_FACTOR_LU,MatGetFactor_seqaij_petsc);
303:   MatSolverPackageRegister(MATSOLVERPETSC, MATSEQAIJ,        MAT_FACTOR_CHOLESKY,MatGetFactor_seqaij_petsc);
304:   MatSolverPackageRegister(MATSOLVERPETSC, MATSEQAIJ,        MAT_FACTOR_ILU,MatGetFactor_seqaij_petsc);
305:   MatSolverPackageRegister(MATSOLVERPETSC, MATSEQAIJ,        MAT_FACTOR_ICC,MatGetFactor_seqaij_petsc);

307:   MatSolverPackageRegister(MATSOLVERPETSC, MATSEQAIJPERM,    MAT_FACTOR_LU,MatGetFactor_seqaij_petsc);
308:   MatSolverPackageRegister(MATSOLVERPETSC, MATSEQAIJPERM,    MAT_FACTOR_CHOLESKY,MatGetFactor_seqaij_petsc);
309:   MatSolverPackageRegister(MATSOLVERPETSC, MATSEQAIJPERM,    MAT_FACTOR_ILU,MatGetFactor_seqaij_petsc);
310:   MatSolverPackageRegister(MATSOLVERPETSC, MATSEQAIJPERM,    MAT_FACTOR_ICC,MatGetFactor_seqaij_petsc);

312: #if defined(PETSC_HAVE_MKL_SPARSE)
313:   MatSolverPackageRegister(MATSOLVERPETSC, MATSEQAIJMKL,     MAT_FACTOR_LU,MatGetFactor_seqaij_petsc);
314:   MatSolverPackageRegister(MATSOLVERPETSC, MATSEQAIJMKL,     MAT_FACTOR_CHOLESKY,MatGetFactor_seqaij_petsc);
315:   MatSolverPackageRegister(MATSOLVERPETSC, MATSEQAIJMKL,     MAT_FACTOR_ILU,MatGetFactor_seqaij_petsc);
316:   MatSolverPackageRegister(MATSOLVERPETSC, MATSEQAIJMKL,     MAT_FACTOR_ICC,MatGetFactor_seqaij_petsc);

318:   MatSolverPackageRegister(MATSOLVERPETSC, MATSEQBAIJMKL,    MAT_FACTOR_LU,MatGetFactor_seqbaij_petsc);
319:   MatSolverPackageRegister(MATSOLVERPETSC, MATSEQBAIJMKL,    MAT_FACTOR_CHOLESKY,MatGetFactor_seqbaij_petsc);
320:   MatSolverPackageRegister(MATSOLVERPETSC, MATSEQBAIJMKL,    MAT_FACTOR_ILU,MatGetFactor_seqbaij_petsc);
321:   MatSolverPackageRegister(MATSOLVERPETSC, MATSEQBAIJMKL,    MAT_FACTOR_ICC,MatGetFactor_seqbaij_petsc);
322: #endif
323:     /* Above, we register the PETSc built-in factorization solvers for MATSEQAIJMKL.  In the future, we may want to use 
324:      * some of the MKL-provided ones instead. */

326:   MatSolverPackageRegister(MATSOLVERPETSC, MATSEQAIJCRL,     MAT_FACTOR_LU,MatGetFactor_seqaij_petsc);
327:   MatSolverPackageRegister(MATSOLVERPETSC, MATSEQAIJCRL,     MAT_FACTOR_CHOLESKY,MatGetFactor_seqaij_petsc);
328:   MatSolverPackageRegister(MATSOLVERPETSC, MATSEQAIJCRL,     MAT_FACTOR_ILU,MatGetFactor_seqaij_petsc);
329:   MatSolverPackageRegister(MATSOLVERPETSC, MATSEQAIJCRL,     MAT_FACTOR_ICC,MatGetFactor_seqaij_petsc);

331:   MatSolverPackageRegister(MATSOLVERPETSC, MATSEQBAIJ,       MAT_FACTOR_LU,MatGetFactor_seqbaij_petsc);
332:   MatSolverPackageRegister(MATSOLVERPETSC, MATSEQBAIJ,       MAT_FACTOR_CHOLESKY,MatGetFactor_seqbaij_petsc);
333:   MatSolverPackageRegister(MATSOLVERPETSC, MATSEQBAIJ,       MAT_FACTOR_ILU,MatGetFactor_seqbaij_petsc);
334:   MatSolverPackageRegister(MATSOLVERPETSC, MATSEQBAIJ,       MAT_FACTOR_ICC,MatGetFactor_seqbaij_petsc);

336:   MatSolverPackageRegister(MATSOLVERPETSC, MATSEQSBAIJ,      MAT_FACTOR_CHOLESKY,MatGetFactor_seqsbaij_petsc);
337:   MatSolverPackageRegister(MATSOLVERPETSC, MATSEQSBAIJ,      MAT_FACTOR_ICC,MatGetFactor_seqsbaij_petsc);

339:   MatSolverPackageRegister(MATSOLVERPETSC, MATSEQDENSE,      MAT_FACTOR_LU,MatGetFactor_seqdense_petsc);
340:   MatSolverPackageRegister(MATSOLVERPETSC, MATSEQDENSE,      MAT_FACTOR_CHOLESKY,MatGetFactor_seqdense_petsc);

342:   MatSolverPackageRegister(MATSOLVERBAS,   MATSEQAIJ,        MAT_FACTOR_ICC,MatGetFactor_seqaij_bas);

344:   /*
345:      Register the external package factorization based solvers
346:         Eventually we don't want to have these hardwired here at compile time of PETSc
347:   */
348: #if defined(PETSC_HAVE_MUMPS)
349:   MatSolverPackageRegister_MUMPS();
350: #endif
351: #if defined(PETSC_HAVE_CUSP)
352:   MatSolverPackageRegister_CUSP();
353: #endif
354: #if defined(PETSC_HAVE_VECCUDA)
355:   MatSolverPackageRegister_CUSPARSE();
356: #endif
357: #if defined(PETSC_HAVE_VIENNACL)
358:   MatSolverPackageRegister_ViennaCL();
359: #endif
360: #if defined(PETSC_HAVE_ELEMENTAL)
361:   MatSolverPackageRegister_Elemental();
362: #endif
363: #if defined(PETSC_HAVE_MATLAB_ENGINE)
364:   MatSolverPackageRegister_Matlab();
365: #endif
366: #if defined(PETSC_HAVE_PETSC_HAVE_ESSL)
367:   MatSolverPackageRegister_Essl();
368: #endif
369: #if defined(PETSC_HAVE_SUPERLU)
370:   MatSolverPackageRegister_SuperLU();
371: #endif
372: #if defined(PETSC_HAVE_STRUMPACK)
373:   MatSolverPackageRegister_STRUMPACK();
374: #endif
375: #if defined(PETSC_HAVE_PASTIX)
376:   MatSolverPackageRegister_Pastix();
377: #endif
378: #if defined(PETSC_HAVE_SUPERLU_DIST)
379:   MatSolverPackageRegister_SuperLU_DIST();
380: #endif
381: #if defined(PETSC_HAVE_ELEMENTAL)
382:   MatSolverPackageRegister_SparseElemental();
383: #endif
384: #if defined(PETSC_HAVE_MKL_PARDISO)
385:   MatSolverPackageRegister_MKL_Pardiso();
386: #endif
387: #if defined(PETSC_HAVE_MKL_CPARDISO)
388:   MatSolverPackageRegister_MKL_CPardiso();
389: #endif
390: #if defined(PETSC_HAVE_SUITESPARSE)
391:   MatSolverPackageRegister_SuiteSparse();
392: #endif
393: #if defined(PETSC_HAVE_LUSOL)
394:   MatSolverPackageRegister_Lusol();
395: #endif
396: #if defined(PETSC_HAVE_ELEMENTAL)
397:   MatSolverPackageRegister_SparseElemental();
398: #endif

400:   PetscRegisterFinalize(MatFinalizePackage);
401:   return(0);
402: }

404: #if defined(PETSC_HAVE_DYNAMIC_LIBRARIES)
405: /*
406:   PetscDLLibraryRegister - This function is called when the dynamic library it is in is opened.

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

410:  */
411: PETSC_EXTERN PetscErrorCode PetscDLLibraryRegister_petscmat(void)
412: {

416:   MatInitializePackage();
417:   return(0);
418: }


421: #endif /* PETSC_HAVE_DYNAMIC_LIBRARIES */