Actual source code: dlregismat.c
petsc-3.12.5 2020-03-29
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: /* Initialize 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("MatFctrFactSchur", MAT_CLASSID,&MAT_FactorFactS);
197: PetscLogEventRegister("MatFctrInvSchur", MAT_CLASSID,&MAT_FactorInvS);
198: PetscLogEventRegister("MatILUFactor", MAT_CLASSID,&MAT_ILUFactor);
199: PetscLogEventRegister("MatILUFactorSym", MAT_CLASSID,&MAT_ILUFactorSymbolic);
200: PetscLogEventRegister("MatICCFactorSym", MAT_CLASSID,&MAT_ICCFactorSymbolic);
201: PetscLogEventRegister("MatCopy", MAT_CLASSID,&MAT_Copy);
202: PetscLogEventRegister("MatConvert", MAT_CLASSID,&MAT_Convert);
203: PetscLogEventRegister("MatScale", MAT_CLASSID,&MAT_Scale);
204: PetscLogEventRegister("MatResidual", MAT_CLASSID,&MAT_Residual);
205: PetscLogEventRegister("MatAssemblyBegin", MAT_CLASSID,&MAT_AssemblyBegin);
206: PetscLogEventRegister("MatAssemblyEnd", MAT_CLASSID,&MAT_AssemblyEnd);
207: PetscLogEventRegister("MatSetValues", MAT_CLASSID,&MAT_SetValues);
208: PetscLogEventRegister("MatGetValues", MAT_CLASSID,&MAT_GetValues);
209: PetscLogEventRegister("MatGetRow", MAT_CLASSID,&MAT_GetRow);
210: PetscLogEventRegister("MatGetRowIJ", MAT_CLASSID,&MAT_GetRowIJ);
211: PetscLogEventRegister("MatCreateSubMats", MAT_CLASSID,&MAT_CreateSubMats);
212: PetscLogEventRegister("MatCreateSubMat", MAT_CLASSID,&MAT_CreateSubMat);
213: PetscLogEventRegister("MatGetOrdering", MAT_CLASSID,&MAT_GetOrdering);
214: PetscLogEventRegister("MatIncreaseOvrlp", MAT_CLASSID,&MAT_IncreaseOverlap);
215: PetscLogEventRegister("MatPartitioning", MAT_PARTITIONING_CLASSID,&MAT_Partitioning);
216: PetscLogEventRegister("MatPartitioningND",MAT_PARTITIONING_CLASSID,&MAT_PartitioningND);
217: PetscLogEventRegister("MatCoarsen", MAT_COARSEN_CLASSID,&MAT_Coarsen);
218: PetscLogEventRegister("MatZeroEntries", MAT_CLASSID,&MAT_ZeroEntries);
219: PetscLogEventRegister("MatLoad", MAT_CLASSID,&MAT_Load);
220: PetscLogEventRegister("MatView", MAT_CLASSID,&MAT_View);
221: PetscLogEventRegister("MatAXPY", MAT_CLASSID,&MAT_AXPY);
222: PetscLogEventRegister("MatFDColorCreate", MAT_FDCOLORING_CLASSID,&MAT_FDColoringCreate);
223: PetscLogEventRegister("MatFDColorSetUp", MAT_FDCOLORING_CLASSID,&MAT_FDColoringSetUp);
224: PetscLogEventRegister("MatFDColorApply", MAT_FDCOLORING_CLASSID,&MAT_FDColoringApply);
225: PetscLogEventRegister("MatFDColorFunc", MAT_FDCOLORING_CLASSID,&MAT_FDColoringFunction);
226: PetscLogEventRegister("MatTranspose", MAT_CLASSID,&MAT_Transpose);
227: PetscLogEventRegister("MatMatMult", MAT_CLASSID,&MAT_MatMult);
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("MatMatMatMult", MAT_CLASSID,&MAT_MatMatMult);
233: PetscLogEventRegister("MatMatMatMultSym", MAT_CLASSID,&MAT_MatMatMultSymbolic);
234: PetscLogEventRegister("MatMatMatMultNum", MAT_CLASSID,&MAT_MatMatMultNumeric);
235: PetscLogEventRegister("MatPtAP", MAT_CLASSID,&MAT_PtAP);
236: PetscLogEventRegister("MatPtAPSymbolic", MAT_CLASSID,&MAT_PtAPSymbolic);
237: PetscLogEventRegister("MatPtAPNumeric", MAT_CLASSID,&MAT_PtAPNumeric);
238: PetscLogEventRegister("MatRARt", MAT_CLASSID,&MAT_RARt);
239: PetscLogEventRegister("MatRARtSym", MAT_CLASSID,&MAT_RARtSymbolic);
240: PetscLogEventRegister("MatRARtNum", MAT_CLASSID,&MAT_RARtNumeric);
241: PetscLogEventRegister("MatMatTransMult", MAT_CLASSID,&MAT_MatTransposeMult);
242: PetscLogEventRegister("MatMatTrnMultSym", MAT_CLASSID,&MAT_MatTransposeMultSymbolic);
243: PetscLogEventRegister("MatMatTrnMultNum", MAT_CLASSID,&MAT_MatTransposeMultNumeric);
244: PetscLogEventRegister("MatTrnMatMult", MAT_CLASSID,&MAT_TransposeMatMult);
245: PetscLogEventRegister("MatTrnMatMultSym", MAT_CLASSID,&MAT_TransposeMatMultSymbolic);
246: PetscLogEventRegister("MatTrnMatMultNum", MAT_CLASSID,&MAT_TransposeMatMultNumeric);
247: PetscLogEventRegister("MatTrnColorCreate",MAT_CLASSID,&MAT_TransposeColoringCreate);
248: PetscLogEventRegister("MatRedundantMat", MAT_CLASSID,&MAT_RedundantMat);
249: PetscLogEventRegister("MatGetSeqNZStrct", MAT_CLASSID,&MAT_GetSequentialNonzeroStructure);
250: PetscLogEventRegister("MatGetMultiProcB", MAT_CLASSID,&MAT_GetMultiProcBlock);
251: PetscLogEventRegister("MatSetRandom", MAT_CLASSID,&MAT_SetRandom);
253: /* these may be specific to MPIAIJ matrices */
254: PetscLogEventRegister("MatMPISumSeqNumeric",MAT_CLASSID,&MAT_Seqstompinum);
255: PetscLogEventRegister("MatMPISumSeqSymbolic",MAT_CLASSID,&MAT_Seqstompisym);
256: PetscLogEventRegister("MatMPISumSeq",MAT_CLASSID,&MAT_Seqstompi);
257: PetscLogEventRegister("MatMPIConcateSeq",MAT_CLASSID,&MAT_Merge);
258: PetscLogEventRegister("MatGetLocalMat",MAT_CLASSID,&MAT_Getlocalmat);
259: PetscLogEventRegister("MatGetLocalMatCondensed",MAT_CLASSID,&MAT_Getlocalmatcondensed);
260: PetscLogEventRegister("MatGetBrowsOfAcols",MAT_CLASSID,&MAT_GetBrowsOfAcols);
261: PetscLogEventRegister("MatGetBrAoCol",MAT_CLASSID,&MAT_GetBrowsOfAocols);
263: PetscLogEventRegister("MatApplyPAPt_Symbolic",MAT_CLASSID,&MAT_Applypapt_symbolic);
264: PetscLogEventRegister("MatApplyPAPt_Numeric",MAT_CLASSID,&MAT_Applypapt_numeric);
265: PetscLogEventRegister("MatApplyPAPt",MAT_CLASSID,&MAT_Applypapt);
267: PetscLogEventRegister("MatGetSymTrans",MAT_CLASSID,&MAT_Getsymtranspose);
268: PetscLogEventRegister("MatGetSymTransR",MAT_CLASSID,&MAT_Getsymtransreduced);
269: PetscLogEventRegister("MatCUSPARSCopyTo",MAT_CLASSID,&MAT_CUSPARSECopyToGPU);
270: PetscLogEventRegister("MatVCLCopyTo", MAT_CLASSID,&MAT_ViennaCLCopyToGPU);
271: PetscLogEventRegister("MatDenseCopyTo",MAT_CLASSID,&MAT_DenseCopyToGPU);
272: PetscLogEventRegister("MatDenseCopyFrom",MAT_CLASSID,&MAT_DenseCopyFromGPU);
273: PetscLogEventRegister("MatSetValBatch",MAT_CLASSID,&MAT_SetValuesBatch);
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: /* Mark non-collective events */
283: PetscLogEventSetCollective(MAT_SetValues, PETSC_FALSE);
284: PetscLogEventSetCollective(MAT_SetValuesBatch, PETSC_FALSE);
285: PetscLogEventSetCollective(MAT_GetRow, PETSC_FALSE);
286: /* Turn off high traffic events by default */
287: PetscLogEventSetActiveAll(MAT_SetValues, PETSC_FALSE);
288: PetscLogEventSetActiveAll(MAT_GetValues, PETSC_FALSE);
289: PetscLogEventSetActiveAll(MAT_GetRow, PETSC_FALSE);
291: /* Process info exclusions */
292: PetscOptionsGetString(NULL,NULL,"-info_exclude",logList,sizeof(logList),&opt);
293: if (opt) {
294: PetscStrInList("mat",logList,',',&pkg);
295: if (pkg) {PetscInfoDeactivateClass(MAT_CLASSID);}
296: if (pkg) {PetscInfoDeactivateClass(MAT_FDCOLORING_CLASSID);}
297: if (pkg) {PetscInfoDeactivateClass(MAT_COLORING_CLASSID);}
298: if (pkg) {PetscInfoDeactivateClass(MAT_TRANSPOSECOLORING_CLASSID);}
299: if (pkg) {PetscInfoDeactivateClass(MAT_PARTITIONING_CLASSID);}
300: if (pkg) {PetscInfoDeactivateClass(MAT_COARSEN_CLASSID);}
301: if (pkg) {PetscInfoDeactivateClass(MAT_NULLSPACE_CLASSID);}
302: }
304: /* Process summary exclusions */
305: PetscOptionsGetString(NULL,NULL,"-log_exclude",logList,sizeof(logList),&opt);
306: if (opt) {
307: PetscStrInList("mat",logList,',',&pkg);
308: if (pkg) {PetscLogEventExcludeClass(MAT_CLASSID);}
309: if (pkg) {PetscLogEventExcludeClass(MAT_FDCOLORING_CLASSID);}
310: if (pkg) {PetscLogEventExcludeClass(MAT_COLORING_CLASSID);}
311: if (pkg) {PetscLogEventExcludeClass(MAT_TRANSPOSECOLORING_CLASSID);}
312: if (pkg) {PetscLogEventExcludeClass(MAT_PARTITIONING_CLASSID);}
313: if (pkg) {PetscLogEventExcludeClass(MAT_COARSEN_CLASSID);}
314: if (pkg) {PetscLogEventExcludeClass(MAT_NULLSPACE_CLASSID);}
315: }
317: /* Register the PETSc built in factorization based solvers */
318: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJ, MAT_FACTOR_LU,MatGetFactor_seqaij_petsc);
319: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJ, MAT_FACTOR_CHOLESKY,MatGetFactor_seqaij_petsc);
320: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJ, MAT_FACTOR_ILU,MatGetFactor_seqaij_petsc);
321: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJ, MAT_FACTOR_ICC,MatGetFactor_seqaij_petsc);
323: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJPERM, MAT_FACTOR_LU,MatGetFactor_seqaij_petsc);
324: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJPERM, MAT_FACTOR_CHOLESKY,MatGetFactor_seqaij_petsc);
325: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJPERM, MAT_FACTOR_ILU,MatGetFactor_seqaij_petsc);
326: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJPERM, MAT_FACTOR_ICC,MatGetFactor_seqaij_petsc);
328: MatSolverTypeRegister(MATSOLVERPETSC, MATCONSTANTDIAGONAL,MAT_FACTOR_LU,MatGetFactor_constantdiagonal_petsc);
329: MatSolverTypeRegister(MATSOLVERPETSC, MATCONSTANTDIAGONAL,MAT_FACTOR_CHOLESKY,MatGetFactor_constantdiagonal_petsc);
330: MatSolverTypeRegister(MATSOLVERPETSC, MATCONSTANTDIAGONAL,MAT_FACTOR_ILU,MatGetFactor_constantdiagonal_petsc);
331: MatSolverTypeRegister(MATSOLVERPETSC, MATCONSTANTDIAGONAL,MAT_FACTOR_ICC,MatGetFactor_constantdiagonal_petsc);
333: #if defined(PETSC_HAVE_MKL_SPARSE)
334: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJMKL, MAT_FACTOR_LU,MatGetFactor_seqaij_petsc);
335: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJMKL, MAT_FACTOR_CHOLESKY,MatGetFactor_seqaij_petsc);
336: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJMKL, MAT_FACTOR_ILU,MatGetFactor_seqaij_petsc);
337: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJMKL, MAT_FACTOR_ICC,MatGetFactor_seqaij_petsc);
339: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQBAIJMKL, MAT_FACTOR_LU,MatGetFactor_seqbaij_petsc);
340: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQBAIJMKL, MAT_FACTOR_CHOLESKY,MatGetFactor_seqbaij_petsc);
341: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQBAIJMKL, MAT_FACTOR_ILU,MatGetFactor_seqbaij_petsc);
342: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQBAIJMKL, MAT_FACTOR_ICC,MatGetFactor_seqbaij_petsc);
343: #endif
344: /* Above, we register the PETSc built-in factorization solvers for MATSEQAIJMKL. In the future, we may want to use
345: * some of the MKL-provided ones instead. */
347: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJCRL, MAT_FACTOR_LU,MatGetFactor_seqaij_petsc);
348: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJCRL, MAT_FACTOR_CHOLESKY,MatGetFactor_seqaij_petsc);
349: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJCRL, MAT_FACTOR_ILU,MatGetFactor_seqaij_petsc);
350: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJCRL, MAT_FACTOR_ICC,MatGetFactor_seqaij_petsc);
352: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQBAIJ, MAT_FACTOR_LU,MatGetFactor_seqbaij_petsc);
353: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQBAIJ, MAT_FACTOR_CHOLESKY,MatGetFactor_seqbaij_petsc);
354: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQBAIJ, MAT_FACTOR_ILU,MatGetFactor_seqbaij_petsc);
355: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQBAIJ, MAT_FACTOR_ICC,MatGetFactor_seqbaij_petsc);
357: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQSBAIJ, MAT_FACTOR_CHOLESKY,MatGetFactor_seqsbaij_petsc);
358: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQSBAIJ, MAT_FACTOR_ICC,MatGetFactor_seqsbaij_petsc);
360: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQDENSE, MAT_FACTOR_LU,MatGetFactor_seqdense_petsc);
361: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQDENSE, MAT_FACTOR_CHOLESKY,MatGetFactor_seqdense_petsc);
362: #if defined(PETSC_HAVE_CUDA)
363: MatSolverTypeRegister(MATSOLVERCUDA, MATSEQDENSE, MAT_FACTOR_LU,MatGetFactor_seqdense_cuda);
364: MatSolverTypeRegister(MATSOLVERCUDA, MATSEQDENSE, MAT_FACTOR_CHOLESKY,MatGetFactor_seqdense_cuda);
365: MatSolverTypeRegister(MATSOLVERCUDA, MATSEQDENSECUDA, MAT_FACTOR_LU,MatGetFactor_seqdense_cuda);
366: MatSolverTypeRegister(MATSOLVERCUDA, MATSEQDENSECUDA, MAT_FACTOR_CHOLESKY,MatGetFactor_seqdense_cuda);
367: #endif
369: MatSolverTypeRegister(MATSOLVERBAS, MATSEQAIJ, MAT_FACTOR_ICC,MatGetFactor_seqaij_bas);
371: /*
372: Register the external package factorization based solvers
373: Eventually we don't want to have these hardwired here at compile time of PETSc
374: */
375: #if defined(PETSC_HAVE_MUMPS)
376: MatSolverTypeRegister_MUMPS();
377: #endif
378: #if defined(PETSC_HAVE_CUDA)
379: MatSolverTypeRegister_CUSPARSE();
380: #endif
381: #if defined(PETSC_HAVE_VIENNACL)
382: MatSolverTypeRegister_ViennaCL();
383: #endif
384: #if defined(PETSC_HAVE_ELEMENTAL)
385: MatSolverTypeRegister_Elemental();
386: #endif
387: #if defined(PETSC_HAVE_MATLAB_ENGINE)
388: MatSolverTypeRegister_Matlab();
389: #endif
390: #if defined(PETSC_HAVE_PETSC_HAVE_ESSL)
391: MatSolverTypeRegister_Essl();
392: #endif
393: #if defined(PETSC_HAVE_SUPERLU)
394: MatSolverTypeRegister_SuperLU();
395: #endif
396: #if defined(PETSC_HAVE_STRUMPACK)
397: MatSolverTypeRegister_STRUMPACK();
398: #endif
399: #if defined(PETSC_HAVE_PASTIX)
400: MatSolverTypeRegister_Pastix();
401: #endif
402: #if defined(PETSC_HAVE_SUPERLU_DIST)
403: MatSolverTypeRegister_SuperLU_DIST();
404: #endif
405: #if defined(PETSC_HAVE_ELEMENTAL)
406: MatSolverTypeRegister_SparseElemental();
407: #endif
408: #if defined(PETSC_HAVE_MKL_PARDISO)
409: MatSolverTypeRegister_MKL_Pardiso();
410: #endif
411: #if defined(PETSC_HAVE_MKL_CPARDISO)
412: MatSolverTypeRegister_MKL_CPardiso();
413: #endif
414: #if defined(PETSC_HAVE_SUITESPARSE)
415: MatSolverTypeRegister_SuiteSparse();
416: #endif
417: #if defined(PETSC_HAVE_LUSOL)
418: MatSolverTypeRegister_Lusol();
419: #endif
420: #if defined(PETSC_HAVE_ELEMENTAL)
421: MatSolverTypeRegister_SparseElemental();
422: #endif
423: /* Register package finalizer */
424: PetscRegisterFinalize(MatFinalizePackage);
425: return(0);
426: }
428: #if defined(PETSC_HAVE_DYNAMIC_LIBRARIES)
429: /*
430: PetscDLLibraryRegister - This function is called when the dynamic library it is in is opened.
432: This one registers all the matrix methods that are in the basic PETSc Matrix library.
434: */
435: PETSC_EXTERN PetscErrorCode PetscDLLibraryRegister_petscmat(void)
436: {
440: MatInitializePackage();
441: return(0);
442: }
445: #endif /* PETSC_HAVE_DYNAMIC_LIBRARIES */