Actual source code: dlregismat.c

petsc-master 2019-08-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:                                   "MAT_STRUCTURE_ONLY",
 29:                                   "MAT_SORTED_FULL",
 30:                                   "MatOption","MAT_",0};
 31: const char *const* MatOptions = MatOptions_Shifted+2;
 32: const char *const MatFactorShiftTypes[] = {"NONE","NONZERO","POSITIVE_DEFINITE","INBLOCKS","MatFactorShiftType","PC_FACTOR_",0};
 33: const char *const MatFactorShiftTypesDetail[] = {NULL,"diagonal shift to prevent zero pivot","Manteuffel shift","diagonal shift on blocks to prevent zero pivot"};
 34: const char *const MPPTScotchStrategyTypes[] = {"DEFAULT","QUALITY","SPEED","BALANCE","SAFETY","SCALABILITY","MPPTScotchStrategyType","MP_PTSCOTCH_",0};
 35: const char *const MPChacoGlobalTypes[] = {"","MULTILEVEL","SPECTRAL","","LINEAR","RANDOM","SCATTERED","MPChacoGlobalType","MP_CHACO_",0};
 36: const char *const MPChacoLocalTypes[] = {"","KERNIGHAN","NONE","MPChacoLocalType","MP_CHACO_",0};
 37: const char *const MPChacoEigenTypes[] = {"LANCZOS","RQI","MPChacoEigenType","MP_CHACO_",0};

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

 46:   Level: developer

 48: .seealso: PetscFinalize()
 49: @*/
 50: PetscErrorCode  MatFinalizePackage(void)
 51: {
 52:   MatRootName    nnames,names = MatRootNameList;

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

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

129: PETSC_INTERN PetscErrorCode MatGetFactor_seqaij_petsc(Mat,MatFactorType,Mat*);
130: PETSC_INTERN PetscErrorCode MatGetFactor_seqbaij_petsc(Mat,MatFactorType,Mat*);
131: PETSC_INTERN PetscErrorCode MatGetFactor_seqsbaij_petsc(Mat,MatFactorType,Mat*);
132: PETSC_INTERN PetscErrorCode MatGetFactor_seqdense_petsc(Mat,MatFactorType,Mat*);
133: #if defined(PETSC_HAVE_CUDA)
134: PETSC_INTERN PetscErrorCode MatGetFactor_seqdense_cuda(Mat,MatFactorType,Mat*);
135: #endif
136: PETSC_INTERN PetscErrorCode MatGetFactor_constantdiagonal_petsc(Mat,MatFactorType,Mat*);
137: PETSC_INTERN PetscErrorCode MatGetFactor_seqaij_bas(Mat,MatFactorType,Mat*);

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

144:   Level: developer

146: .seealso: PetscInitialize()
147: @*/
148: PetscErrorCode  MatInitializePackage(void)
149: {
150:   char           logList[256];
151:   PetscBool      opt,pkg;

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("MatPartitioningND",MAT_PARTITIONING_CLASSID,&MAT_PartitioningND);
215:   PetscLogEventRegister("MatCoarsen",       MAT_COARSEN_CLASSID,&MAT_Coarsen);
216:   PetscLogEventRegister("MatZeroEntries",   MAT_CLASSID,&MAT_ZeroEntries);
217:   PetscLogEventRegister("MatLoad",          MAT_CLASSID,&MAT_Load);
218:   PetscLogEventRegister("MatView",          MAT_CLASSID,&MAT_View);
219:   PetscLogEventRegister("MatAXPY",          MAT_CLASSID,&MAT_AXPY);
220:   PetscLogEventRegister("MatFDColorCreate", MAT_FDCOLORING_CLASSID,&MAT_FDColoringCreate);
221:   PetscLogEventRegister("MatFDColorSetUp",  MAT_FDCOLORING_CLASSID,&MAT_FDColoringSetUp);
222:   PetscLogEventRegister("MatFDColorApply",  MAT_FDCOLORING_CLASSID,&MAT_FDColoringApply);
223:   PetscLogEventRegister("MatFDColorFunc",   MAT_FDCOLORING_CLASSID,&MAT_FDColoringFunction);
224:   PetscLogEventRegister("MatTranspose",     MAT_CLASSID,&MAT_Transpose);
225:   PetscLogEventRegister("MatMatMult",       MAT_CLASSID,&MAT_MatMult);
226:   PetscLogEventRegister("MatMatSolve",      MAT_CLASSID,&MAT_MatSolve);
227:   PetscLogEventRegister("MatMatTrSolve",    MAT_CLASSID,&MAT_MatTrSolve);
228:   PetscLogEventRegister("MatMatMultSym",    MAT_CLASSID,&MAT_MatMultSymbolic);
229:   PetscLogEventRegister("MatMatMultNum",    MAT_CLASSID,&MAT_MatMultNumeric);
230:   PetscLogEventRegister("MatMatMatMult",    MAT_CLASSID,&MAT_MatMatMult);
231:   PetscLogEventRegister("MatMatMatMultSym", MAT_CLASSID,&MAT_MatMatMultSymbolic);
232:   PetscLogEventRegister("MatMatMatMultNum", MAT_CLASSID,&MAT_MatMatMultNumeric);
233:   PetscLogEventRegister("MatPtAP",          MAT_CLASSID,&MAT_PtAP);
234:   PetscLogEventRegister("MatPtAPSymbolic",  MAT_CLASSID,&MAT_PtAPSymbolic);
235:   PetscLogEventRegister("MatPtAPNumeric",   MAT_CLASSID,&MAT_PtAPNumeric);
236:   PetscLogEventRegister("MatRARt",          MAT_CLASSID,&MAT_RARt);
237:   PetscLogEventRegister("MatRARtSym",       MAT_CLASSID,&MAT_RARtSymbolic);
238:   PetscLogEventRegister("MatRARtNum",       MAT_CLASSID,&MAT_RARtNumeric);
239:   PetscLogEventRegister("MatMatTransMult",  MAT_CLASSID,&MAT_MatTransposeMult);
240:   PetscLogEventRegister("MatMatTrnMultSym", MAT_CLASSID,&MAT_MatTransposeMultSymbolic);
241:   PetscLogEventRegister("MatMatTrnMultNum", MAT_CLASSID,&MAT_MatTransposeMultNumeric);
242:   PetscLogEventRegister("MatTrnMatMult",    MAT_CLASSID,&MAT_TransposeMatMult);
243:   PetscLogEventRegister("MatTrnMatMultSym", MAT_CLASSID,&MAT_TransposeMatMultSymbolic);
244:   PetscLogEventRegister("MatTrnMatMultNum", MAT_CLASSID,&MAT_TransposeMatMultNumeric);
245:   PetscLogEventRegister("MatTrnColorCreate", MAT_CLASSID,&MAT_TransposeColoringCreate);
246:   PetscLogEventRegister("MatRedundantMat",  MAT_CLASSID,&MAT_RedundantMat);
247:   PetscLogEventRegister("MatGetSeqNZStrct", MAT_CLASSID,&MAT_GetSequentialNonzeroStructure);
248:   PetscLogEventRegister("MatGetMultiProcB", MAT_CLASSID,&MAT_GetMultiProcBlock);
249:   PetscLogEventRegister("MatSetRandom",     MAT_CLASSID,&MAT_SetRandom);

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

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

265:   PetscLogEventRegister("MatGetSymTrans",MAT_CLASSID,&MAT_Getsymtranspose);
266:   PetscLogEventRegister("MatGetSymTransR",MAT_CLASSID,&MAT_Getsymtransreduced);
267:   PetscLogEventRegister("MatCUSPARSCopyTo",MAT_CLASSID,&MAT_CUSPARSECopyToGPU);
268:   PetscLogEventRegister("MatVCLCopyTo",  MAT_CLASSID,&MAT_ViennaCLCopyToGPU);
269:   PetscLogEventRegister("MatDenseCopyTo",MAT_CLASSID,&MAT_DenseCopyToGPU);
270:   PetscLogEventRegister("MatDenseCopyFrom",MAT_CLASSID,&MAT_DenseCopyFromGPU);
271:   PetscLogEventRegister("MatSetValBatch",MAT_CLASSID,&MAT_SetValuesBatch);

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

280:   /* Mark non-collective events */
281:   PetscLogEventSetCollective(MAT_SetValues,      PETSC_FALSE);
282:   PetscLogEventSetCollective(MAT_SetValuesBatch, PETSC_FALSE);
283:   PetscLogEventSetCollective(MAT_GetRow,         PETSC_FALSE);
284:   /* Turn off high traffic events by default */
285:   PetscLogEventSetActiveAll(MAT_SetValues, PETSC_FALSE);
286:   PetscLogEventSetActiveAll(MAT_GetValues, PETSC_FALSE);
287:   PetscLogEventSetActiveAll(MAT_GetRow,    PETSC_FALSE);

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

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

315:   /* Register the PETSc built in factorization based solvers */
316:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJ,        MAT_FACTOR_LU,MatGetFactor_seqaij_petsc);
317:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJ,        MAT_FACTOR_CHOLESKY,MatGetFactor_seqaij_petsc);
318:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJ,        MAT_FACTOR_ILU,MatGetFactor_seqaij_petsc);
319:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJ,        MAT_FACTOR_ICC,MatGetFactor_seqaij_petsc);

321:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJPERM,    MAT_FACTOR_LU,MatGetFactor_seqaij_petsc);
322:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJPERM,    MAT_FACTOR_CHOLESKY,MatGetFactor_seqaij_petsc);
323:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJPERM,    MAT_FACTOR_ILU,MatGetFactor_seqaij_petsc);
324:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJPERM,    MAT_FACTOR_ICC,MatGetFactor_seqaij_petsc);

326:   MatSolverTypeRegister(MATSOLVERPETSC, MATCONSTANTDIAGONAL,MAT_FACTOR_LU,MatGetFactor_constantdiagonal_petsc);
327:   MatSolverTypeRegister(MATSOLVERPETSC, MATCONSTANTDIAGONAL,MAT_FACTOR_CHOLESKY,MatGetFactor_constantdiagonal_petsc);
328:   MatSolverTypeRegister(MATSOLVERPETSC, MATCONSTANTDIAGONAL,MAT_FACTOR_ILU,MatGetFactor_constantdiagonal_petsc);
329:   MatSolverTypeRegister(MATSOLVERPETSC, MATCONSTANTDIAGONAL,MAT_FACTOR_ICC,MatGetFactor_constantdiagonal_petsc);

331: #if defined(PETSC_HAVE_MKL_SPARSE)
332:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJMKL,     MAT_FACTOR_LU,MatGetFactor_seqaij_petsc);
333:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJMKL,     MAT_FACTOR_CHOLESKY,MatGetFactor_seqaij_petsc);
334:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJMKL,     MAT_FACTOR_ILU,MatGetFactor_seqaij_petsc);
335:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJMKL,     MAT_FACTOR_ICC,MatGetFactor_seqaij_petsc);

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

345:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJCRL,     MAT_FACTOR_LU,MatGetFactor_seqaij_petsc);
346:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJCRL,     MAT_FACTOR_CHOLESKY,MatGetFactor_seqaij_petsc);
347:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJCRL,     MAT_FACTOR_ILU,MatGetFactor_seqaij_petsc);
348:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJCRL,     MAT_FACTOR_ICC,MatGetFactor_seqaij_petsc);

350:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQBAIJ,       MAT_FACTOR_LU,MatGetFactor_seqbaij_petsc);
351:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQBAIJ,       MAT_FACTOR_CHOLESKY,MatGetFactor_seqbaij_petsc);
352:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQBAIJ,       MAT_FACTOR_ILU,MatGetFactor_seqbaij_petsc);
353:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQBAIJ,       MAT_FACTOR_ICC,MatGetFactor_seqbaij_petsc);

355:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQSBAIJ,      MAT_FACTOR_CHOLESKY,MatGetFactor_seqsbaij_petsc);
356:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQSBAIJ,      MAT_FACTOR_ICC,MatGetFactor_seqsbaij_petsc);

358:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQDENSE,      MAT_FACTOR_LU,MatGetFactor_seqdense_petsc);
359:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQDENSE,      MAT_FACTOR_CHOLESKY,MatGetFactor_seqdense_petsc);
360: #if defined(PETSC_HAVE_CUDA)
361:   MatSolverTypeRegister(MATSOLVERCUDA, MATSEQDENSE,       MAT_FACTOR_LU,MatGetFactor_seqdense_cuda);
362:   MatSolverTypeRegister(MATSOLVERCUDA, MATSEQDENSE,       MAT_FACTOR_CHOLESKY,MatGetFactor_seqdense_cuda);
363:   MatSolverTypeRegister(MATSOLVERCUDA, MATSEQDENSECUDA,   MAT_FACTOR_LU,MatGetFactor_seqdense_cuda);
364:   MatSolverTypeRegister(MATSOLVERCUDA, MATSEQDENSECUDA,   MAT_FACTOR_CHOLESKY,MatGetFactor_seqdense_cuda);
365: #endif

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

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

426: #if defined(PETSC_HAVE_DYNAMIC_LIBRARIES)
427: /*
428:   PetscDLLibraryRegister - This function is called when the dynamic library it is in is opened.

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

432:  */
433: PETSC_EXTERN PetscErrorCode PetscDLLibraryRegister_petscmat(void)
434: {

438:   MatInitializePackage();
439:   return(0);
440: }


443: #endif /* PETSC_HAVE_DYNAMIC_LIBRARIES */