Actual source code: dlregismat.c

petsc-3.13.2 2020-06-02
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;


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

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

277:   /* Mark non-collective events */
278:   PetscLogEventSetCollective(MAT_SetValues,      PETSC_FALSE);
279:   PetscLogEventSetCollective(MAT_SetValuesBatch, PETSC_FALSE);
280:   PetscLogEventSetCollective(MAT_GetRow,         PETSC_FALSE);
281:   /* Turn off high traffic events by default */
282:   PetscLogEventSetActiveAll(MAT_SetValues, PETSC_FALSE);
283:   PetscLogEventSetActiveAll(MAT_GetValues, PETSC_FALSE);
284:   PetscLogEventSetActiveAll(MAT_GetRow,    PETSC_FALSE);
285:   /* Process Info */
286:   {
287:     PetscClassId  classids[7];

289:     classids[0] = MAT_CLASSID;
290:     classids[1] = MAT_FDCOLORING_CLASSID;
291:     classids[2] = MAT_COLORING_CLASSID;
292:     classids[3] = MAT_TRANSPOSECOLORING_CLASSID;
293:     classids[4] = MAT_PARTITIONING_CLASSID;
294:     classids[5] = MAT_COARSEN_CLASSID;
295:     classids[6] = MAT_NULLSPACE_CLASSID;
296:     PetscInfoProcessClass("mat", 7, classids);
297:   }

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

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

318:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJPERM,    MAT_FACTOR_LU,MatGetFactor_seqaij_petsc);
319:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJPERM,    MAT_FACTOR_CHOLESKY,MatGetFactor_seqaij_petsc);
320:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJPERM,    MAT_FACTOR_ILU,MatGetFactor_seqaij_petsc);
321:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJPERM,    MAT_FACTOR_ICC,MatGetFactor_seqaij_petsc);

323:   MatSolverTypeRegister(MATSOLVERPETSC, MATCONSTANTDIAGONAL,MAT_FACTOR_LU,MatGetFactor_constantdiagonal_petsc);
324:   MatSolverTypeRegister(MATSOLVERPETSC, MATCONSTANTDIAGONAL,MAT_FACTOR_CHOLESKY,MatGetFactor_constantdiagonal_petsc);
325:   MatSolverTypeRegister(MATSOLVERPETSC, MATCONSTANTDIAGONAL,MAT_FACTOR_ILU,MatGetFactor_constantdiagonal_petsc);
326:   MatSolverTypeRegister(MATSOLVERPETSC, MATCONSTANTDIAGONAL,MAT_FACTOR_ICC,MatGetFactor_constantdiagonal_petsc);

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

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

342:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJCRL,     MAT_FACTOR_LU,MatGetFactor_seqaij_petsc);
343:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJCRL,     MAT_FACTOR_CHOLESKY,MatGetFactor_seqaij_petsc);
344:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJCRL,     MAT_FACTOR_ILU,MatGetFactor_seqaij_petsc);
345:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJCRL,     MAT_FACTOR_ICC,MatGetFactor_seqaij_petsc);

347:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQBAIJ,       MAT_FACTOR_LU,MatGetFactor_seqbaij_petsc);
348:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQBAIJ,       MAT_FACTOR_CHOLESKY,MatGetFactor_seqbaij_petsc);
349:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQBAIJ,       MAT_FACTOR_ILU,MatGetFactor_seqbaij_petsc);
350:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQBAIJ,       MAT_FACTOR_ICC,MatGetFactor_seqbaij_petsc);

352:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQSBAIJ,      MAT_FACTOR_CHOLESKY,MatGetFactor_seqsbaij_petsc);
353:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQSBAIJ,      MAT_FACTOR_ICC,MatGetFactor_seqsbaij_petsc);

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

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

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

423: #if defined(PETSC_HAVE_DYNAMIC_LIBRARIES)
424: /*
425:   PetscDLLibraryRegister - This function is called when the dynamic library it is in is opened.

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

429:  */
430: PETSC_EXTERN PetscErrorCode PetscDLLibraryRegister_petscmat(void)
431: {

435:   MatInitializePackage();
436:   return(0);
437: }


440: #endif /* PETSC_HAVE_DYNAMIC_LIBRARIES */