Actual source code: dlregismat.c
petsc-3.9.4 2018-09-11
2: #include <petsc/private/matimpl.h>
4: const char *MatOptions_Shifted[] = {"UNUSED_NONZERO_LOCATION_ERR",
5: "ROW_ORIENTED",
6: "NOT_A_VALID_OPTION",
7: "SYMMETRIC",
8: "STRUCTURALLY_SYMMETRIC",
9: "NEW_DIAGONALS",
10: "IGNORE_OFF_PROC_ENTRIES",
11: "USE_HASH_TABLE",
12: "KEEP_NONZERO_PATTERN",
13: "IGNORE_ZERO_ENTRIES",
14: "USE_INODES",
15: "HERMITIAN",
16: "SYMMETRY_ETERNAL",
17: "NEW_NONZERO_LOCATION_ERR",
18: "IGNORE_LOWER_TRIANGULAR",
19: "ERROR_LOWER_TRIANGULAR",
20: "GETROW_UPPERTRIANGULAR",
21: "SPD",
22: "NO_OFF_PROC_ZERO_ROWS",
23: "NO_OFF_PROC_ENTRIES",
24: "NEW_NONZERO_LOCATIONS",
25: "NEW_NONZERO_ALLOCATION_ERR",
26: "MAT_SUBSET_OFF_PROC_ENTRIES",
27: "MAT_SUBMAT_SINGLEIS",
28: "MatOption","MAT_",0};
29: const char *const* MatOptions = MatOptions_Shifted+2;
30: const char *const MatFactorShiftTypes[] = {"NONE","NONZERO","POSITIVE_DEFINITE","INBLOCKS","MatFactorShiftType","PC_FACTOR_",0};
31: const char *const MatFactorShiftTypesDetail[] = {NULL,"diagonal shift to prevent zero pivot","Manteuffel shift","diagonal shift on blocks to prevent zero pivot"};
32: const char *const MPPTScotchStrategyTypes[] = {"DEFAULT","QUALITY","SPEED","BALANCE","SAFETY","SCALABILITY","MPPTScotchStrategyType","MP_PTSCOTCH_",0};
33: const char *const MPChacoGlobalTypes[] = {"","MULTILEVEL","SPECTRAL","","LINEAR","RANDOM","SCATTERED","MPChacoGlobalType","MP_CHACO_",0};
34: const char *const MPChacoLocalTypes[] = {"","KERNIGHAN","NONE","MPChacoLocalType","MP_CHACO_",0};
35: const char *const MPChacoEigenTypes[] = {"LANCZOS","RQI","MPChacoEigenType","MP_CHACO_",0};
37: extern PetscErrorCode MatMFFDInitializePackage(void);
38: extern PetscErrorCode MatSolverTypeDestroy(void);
39: static PetscBool MatPackageInitialized = PETSC_FALSE;
40: /*@C
41: MatFinalizePackage - This function destroys everything in the Petsc interface to the Mat package. It is
42: called from PetscFinalize().
44: Level: developer
46: .keywords: Petsc, destroy, package, mathematica
47: .seealso: PetscFinalize()
48: @*/
49: PetscErrorCode MatFinalizePackage(void)
50: {
51: MatBaseName nnames,names = MatBaseNameList;
55: MatSolverTypeDestroy();
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 MatSolverTypeRegister_MUMPS(void);
84: #endif
85: #if defined(PETSC_HAVE_VECCUDA)
86: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_CUSPARSE(void);
87: #endif
88: #if defined(PETSC_HAVE_VIENNACL)
89: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_ViennaCL(void);
90: #endif
91: #if defined(PETSC_HAVE_ELEMENTAL)
92: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_Elemental(void);
93: #endif
94: #if defined(PETSC_HAVE_MATLAB_ENGINE)
95: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_Matlab(void);
96: #endif
97: #if defined(PETSC_HAVE_PETSC_HAVE_ESSL)
98: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_Essl(void);
99: #endif
100: #if defined(PETSC_HAVE_SUPERLU)
101: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_SuperLU(void);
102: #endif
103: #if defined(PETSC_HAVE_STRUMPACK)
104: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_STRUMPACK(void);
105: #endif
106: #if defined(PETSC_HAVE_PASTIX)
107: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_Pastix(void);
108: #endif
109: #if defined(PETSC_HAVE_SUPERLU_DIST)
110: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_SuperLU_DIST(void);
111: #endif
112: #if defined(PETSC_HAVE_ELEMENTAL)
113: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_SparseElemental(void);
114: #endif
115: #if defined(PETSC_HAVE_MKL_PARDISO)
116: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_MKL_Pardiso(void);
117: #endif
118: #if defined(PETSC_HAVE_MKL_CPARDISO)
119: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_MKL_CPardiso(void);
120: #endif
121: #if defined(PETSC_HAVE_SUITESPARSE)
122: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_SuiteSparse(void);
123: #endif
124: #if defined(PETSC_HAVE_LUSOL)
125: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_Lusol(void);
126: #endif
128: PETSC_INTERN PetscErrorCode MatGetFactor_seqaij_petsc(Mat,MatFactorType,Mat*);
129: PETSC_INTERN PetscErrorCode MatGetFactor_seqbaij_petsc(Mat,MatFactorType,Mat*);
130: PETSC_INTERN PetscErrorCode MatGetFactor_seqsbaij_petsc(Mat,MatFactorType,Mat*);
131: PETSC_INTERN PetscErrorCode MatGetFactor_seqdense_petsc(Mat,MatFactorType,Mat*);
132: PETSC_INTERN PetscErrorCode MatGetFactor_seqaij_bas(Mat,MatFactorType,Mat*);
134: /*@C
135: MatInitializePackage - This function initializes everything in the Mat package. It is called
136: from PetscDLLibraryRegister() when using dynamic libraries, and on the first call to MatCreate()
137: when using static libraries.
139: Level: developer
141: .keywords: Mat, initialize, package
142: .seealso: PetscInitialize()
143: @*/
144: PetscErrorCode MatInitializePackage(void)
145: {
146: char logList[256];
147: PetscBool opt,pkg;
151: if (MatPackageInitialized) return(0);
152: MatPackageInitialized = PETSC_TRUE;
153: /* Inialize subpackage */
154: MatMFFDInitializePackage();
155: /* Register Classes */
156: PetscClassIdRegister("Matrix",&MAT_CLASSID);
157: PetscClassIdRegister("Matrix FD Coloring",&MAT_FDCOLORING_CLASSID);
158: PetscClassIdRegister("Matrix Coloring",&MAT_COLORING_CLASSID);
159: PetscClassIdRegister("Matrix MatTranspose Coloring",&MAT_TRANSPOSECOLORING_CLASSID);
160: PetscClassIdRegister("Matrix Partitioning",&MAT_PARTITIONING_CLASSID);
161: PetscClassIdRegister("Matrix Coarsen",&MAT_COARSEN_CLASSID);
162: PetscClassIdRegister("Matrix Null Space",&MAT_NULLSPACE_CLASSID);
163: /* Register Constructors */
164: MatRegisterAll();
165: MatOrderingRegisterAll();
166: MatColoringRegisterAll();
167: MatPartitioningRegisterAll();
168: MatCoarsenRegisterAll();
169: MatSeqAIJRegisterAll();
170: /* Register Events */
171: PetscLogEventRegister("MatMult", MAT_CLASSID,&MAT_Mult);
172: PetscLogEventRegister("MatMults", MAT_CLASSID,&MAT_Mults);
173: PetscLogEventRegister("MatMultConstr", MAT_CLASSID,&MAT_MultConstrained);
174: PetscLogEventRegister("MatMultAdd", MAT_CLASSID,&MAT_MultAdd);
175: PetscLogEventRegister("MatMultTranspose", MAT_CLASSID,&MAT_MultTranspose);
176: PetscLogEventRegister("MatMultTrConstr", MAT_CLASSID,&MAT_MultTransposeConstrained);
177: PetscLogEventRegister("MatMultTrAdd", MAT_CLASSID,&MAT_MultTransposeAdd);
178: PetscLogEventRegister("MatSolve", MAT_CLASSID,&MAT_Solve);
179: PetscLogEventRegister("MatSolves", MAT_CLASSID,&MAT_Solves);
180: PetscLogEventRegister("MatSolveAdd", MAT_CLASSID,&MAT_SolveAdd);
181: PetscLogEventRegister("MatSolveTranspos", MAT_CLASSID,&MAT_SolveTranspose);
182: PetscLogEventRegister("MatSolveTrAdd", MAT_CLASSID,&MAT_SolveTransposeAdd);
183: PetscLogEventRegister("MatSOR", MAT_CLASSID,&MAT_SOR);
184: PetscLogEventRegister("MatForwardSolve", MAT_CLASSID,&MAT_ForwardSolve);
185: PetscLogEventRegister("MatBackwardSolve", MAT_CLASSID,&MAT_BackwardSolve);
186: PetscLogEventRegister("MatLUFactor", MAT_CLASSID,&MAT_LUFactor);
187: PetscLogEventRegister("MatLUFactorSym", MAT_CLASSID,&MAT_LUFactorSymbolic);
188: PetscLogEventRegister("MatLUFactorNum", MAT_CLASSID,&MAT_LUFactorNumeric);
189: PetscLogEventRegister("MatCholeskyFctr", MAT_CLASSID,&MAT_CholeskyFactor);
190: PetscLogEventRegister("MatCholFctrSym", MAT_CLASSID,&MAT_CholeskyFactorSymbolic);
191: PetscLogEventRegister("MatCholFctrNum", MAT_CLASSID,&MAT_CholeskyFactorNumeric);
192: PetscLogEventRegister("MatILUFactor", MAT_CLASSID,&MAT_ILUFactor);
193: PetscLogEventRegister("MatILUFactorSym", MAT_CLASSID,&MAT_ILUFactorSymbolic);
194: PetscLogEventRegister("MatICCFactorSym", MAT_CLASSID,&MAT_ICCFactorSymbolic);
195: PetscLogEventRegister("MatCopy", MAT_CLASSID,&MAT_Copy);
196: PetscLogEventRegister("MatConvert", MAT_CLASSID,&MAT_Convert);
197: PetscLogEventRegister("MatScale", MAT_CLASSID,&MAT_Scale);
198: PetscLogEventRegister("MatResidual", MAT_CLASSID,&MAT_Residual);
199: PetscLogEventRegister("MatAssemblyBegin", MAT_CLASSID,&MAT_AssemblyBegin);
200: PetscLogEventRegister("MatAssemblyEnd", MAT_CLASSID,&MAT_AssemblyEnd);
201: PetscLogEventRegister("MatSetValues", MAT_CLASSID,&MAT_SetValues);
202: PetscLogEventRegister("MatGetValues", MAT_CLASSID,&MAT_GetValues);
203: PetscLogEventRegister("MatGetRow", MAT_CLASSID,&MAT_GetRow);
204: PetscLogEventRegister("MatGetRowIJ", MAT_CLASSID,&MAT_GetRowIJ);
205: PetscLogEventRegister("MatCreateSubMats", MAT_CLASSID,&MAT_CreateSubMats);
206: PetscLogEventRegister("MatCreateSubMat", MAT_CLASSID,&MAT_CreateSubMat);
207: PetscLogEventRegister("MatGetOrdering", MAT_CLASSID,&MAT_GetOrdering);
208: PetscLogEventRegister("MatIncreaseOvrlp", MAT_CLASSID,&MAT_IncreaseOverlap);
209: PetscLogEventRegister("MatPartitioning", MAT_PARTITIONING_CLASSID,&MAT_Partitioning);
210: PetscLogEventRegister("MatCoarsen", MAT_COARSEN_CLASSID,&MAT_Coarsen);
211: PetscLogEventRegister("MatZeroEntries", MAT_CLASSID,&MAT_ZeroEntries);
212: PetscLogEventRegister("MatLoad", MAT_CLASSID,&MAT_Load);
213: PetscLogEventRegister("MatView", MAT_CLASSID,&MAT_View);
214: PetscLogEventRegister("MatAXPY", MAT_CLASSID,&MAT_AXPY);
215: PetscLogEventRegister("MatFDColorCreate", MAT_FDCOLORING_CLASSID,&MAT_FDColoringCreate);
216: PetscLogEventRegister("MatFDColorSetUp", MAT_FDCOLORING_CLASSID,&MAT_FDColoringSetUp);
217: PetscLogEventRegister("MatFDColorApply", MAT_FDCOLORING_CLASSID,&MAT_FDColoringApply);
218: PetscLogEventRegister("MatFDColorFunc", MAT_FDCOLORING_CLASSID,&MAT_FDColoringFunction);
219: PetscLogEventRegister("MatTranspose", MAT_CLASSID,&MAT_Transpose);
220: PetscLogEventRegister("MatMatMult", MAT_CLASSID,&MAT_MatMult);
221: PetscLogEventRegister("MatMatSolve", MAT_CLASSID,&MAT_MatSolve);
222: PetscLogEventRegister("MatMatMultSym", MAT_CLASSID,&MAT_MatMultSymbolic);
223: PetscLogEventRegister("MatMatMultNum", MAT_CLASSID,&MAT_MatMultNumeric);
224: PetscLogEventRegister("MatMatMatMult", MAT_CLASSID,&MAT_MatMatMult);
225: PetscLogEventRegister("MatMatMatMultSym", MAT_CLASSID,&MAT_MatMatMultSymbolic);
226: PetscLogEventRegister("MatMatMatMultNum", MAT_CLASSID,&MAT_MatMatMultNumeric);
227: PetscLogEventRegister("MatPtAP", MAT_CLASSID,&MAT_PtAP);
228: PetscLogEventRegister("MatPtAPSymbolic", MAT_CLASSID,&MAT_PtAPSymbolic);
229: PetscLogEventRegister("MatPtAPNumeric", MAT_CLASSID,&MAT_PtAPNumeric);
230: PetscLogEventRegister("MatRARt", MAT_CLASSID,&MAT_RARt);
231: PetscLogEventRegister("MatRARtSym", MAT_CLASSID,&MAT_RARtSymbolic);
232: PetscLogEventRegister("MatRARtNum", MAT_CLASSID,&MAT_RARtNumeric);
233: PetscLogEventRegister("MatMatTransMult", MAT_CLASSID,&MAT_MatTransposeMult);
234: PetscLogEventRegister("MatMatTrnMultSym", MAT_CLASSID,&MAT_MatTransposeMultSymbolic);
235: PetscLogEventRegister("MatMatTrnMultNum", MAT_CLASSID,&MAT_MatTransposeMultNumeric);
236: PetscLogEventRegister("MatTrnMatMult", MAT_CLASSID,&MAT_TransposeMatMult);
237: PetscLogEventRegister("MatTrnMatMultSym", MAT_CLASSID,&MAT_TransposeMatMultSymbolic);
238: PetscLogEventRegister("MatTrnMatMultNum", MAT_CLASSID,&MAT_TransposeMatMultNumeric);
239: PetscLogEventRegister("MatTrnColorCreate", MAT_CLASSID,&MAT_TransposeColoringCreate);
240: PetscLogEventRegister("MatRedundantMat", MAT_CLASSID,&MAT_RedundantMat);
241: PetscLogEventRegister("MatGetSeqNZStrct", MAT_CLASSID,&MAT_GetSequentialNonzeroStructure);
242: PetscLogEventRegister("MatGetMultiProcB", MAT_CLASSID,&MAT_GetMultiProcBlock);
243: PetscLogEventRegister("MatSetRandom", MAT_CLASSID,&MAT_SetRandom);
245: /* these may be specific to MPIAIJ matrices */
246: PetscLogEventRegister("MatMPISumSeqNumeric",MAT_CLASSID,&MAT_Seqstompinum);
247: PetscLogEventRegister("MatMPISumSeqSymbolic",MAT_CLASSID,&MAT_Seqstompisym);
248: PetscLogEventRegister("MatMPISumSeq",MAT_CLASSID,&MAT_Seqstompi);
249: PetscLogEventRegister("MatMPIConcateSeq",MAT_CLASSID,&MAT_Merge);
250: PetscLogEventRegister("MatGetLocalMat",MAT_CLASSID,&MAT_Getlocalmat);
251: PetscLogEventRegister("MatGetLocalMatCondensed",MAT_CLASSID,&MAT_Getlocalmatcondensed);
252: PetscLogEventRegister("MatGetBrowsOfAcols",MAT_CLASSID,&MAT_GetBrowsOfAcols);
253: PetscLogEventRegister("MatGetBrAoCol",MAT_CLASSID,&MAT_GetBrowsOfAocols);
255: PetscLogEventRegister("MatApplyPAPt_Symbolic",MAT_CLASSID,&MAT_Applypapt_symbolic);
256: PetscLogEventRegister("MatApplyPAPt_Numeric",MAT_CLASSID,&MAT_Applypapt_numeric);
257: PetscLogEventRegister("MatApplyPAPt",MAT_CLASSID,&MAT_Applypapt);
259: PetscLogEventRegister("MatGetSymTrans",MAT_CLASSID,&MAT_Getsymtranspose);
260: PetscLogEventRegister("MatGetSymTransR",MAT_CLASSID,&MAT_Getsymtransreduced);
261: PetscLogEventRegister("MatTranspose_SeqAIJ_FAST",MAT_CLASSID,&MAT_Transpose_SeqAIJ);
262: PetscLogEventRegister("MatCUSPARSECopyTo",MAT_CLASSID,&MAT_CUSPARSECopyToGPU);
263: PetscLogEventRegister("MatViennaCLCopyTo",MAT_CLASSID,&MAT_ViennaCLCopyToGPU);
264: PetscLogEventRegister("MatSetValBatch",MAT_CLASSID,&MAT_SetValuesBatch);
265: PetscLogEventRegister("MatSetValBatch1",MAT_CLASSID,&MAT_SetValuesBatchI);
266: PetscLogEventRegister("MatSetValBatch2",MAT_CLASSID,&MAT_SetValuesBatchII);
267: PetscLogEventRegister("MatSetValBatch3",MAT_CLASSID,&MAT_SetValuesBatchIII);
268: PetscLogEventRegister("MatSetValBatch4",MAT_CLASSID,&MAT_SetValuesBatchIV);
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: /* Turn off high traffic events by default */
278: PetscLogEventSetActiveAll(MAT_SetValues,PETSC_FALSE);
279: /* Process info exclusions */
280: PetscOptionsGetString(NULL,NULL,"-info_exclude",logList,sizeof(logList),&opt);
281: if (opt) {
282: PetscStrInList("mat",logList,',',&pkg);
283: if (pkg) {PetscInfoDeactivateClass(MAT_CLASSID);}
284: if (pkg) {PetscInfoDeactivateClass(MAT_FDCOLORING_CLASSID);}
285: if (pkg) {PetscInfoDeactivateClass(MAT_COLORING_CLASSID);}
286: if (pkg) {PetscInfoDeactivateClass(MAT_TRANSPOSECOLORING_CLASSID);}
287: if (pkg) {PetscInfoDeactivateClass(MAT_PARTITIONING_CLASSID);}
288: if (pkg) {PetscInfoDeactivateClass(MAT_COARSEN_CLASSID);}
289: if (pkg) {PetscInfoDeactivateClass(MAT_NULLSPACE_CLASSID);}
290: }
291: /* Process summary exclusions */
292: PetscOptionsGetString(NULL,NULL,"-log_exclude",logList,sizeof(logList),&opt);
293: if (opt) {
294: PetscStrInList("mat",logList,',',&pkg);
295: if (pkg) {PetscLogEventDeactivateClass(MAT_CLASSID);}
296: if (pkg) {PetscLogEventDeactivateClass(MAT_FDCOLORING_CLASSID);}
297: if (pkg) {PetscLogEventDeactivateClass(MAT_COLORING_CLASSID);}
298: if (pkg) {PetscLogEventDeactivateClass(MAT_TRANSPOSECOLORING_CLASSID);}
299: if (pkg) {PetscLogEventDeactivateClass(MAT_PARTITIONING_CLASSID);}
300: if (pkg) {PetscLogEventDeactivateClass(MAT_COARSEN_CLASSID);}
301: if (pkg) {PetscLogEventDeactivateClass(MAT_NULLSPACE_CLASSID);}
302: }
304: /* Register the PETSc built in factorization based solvers */
305: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJ, MAT_FACTOR_LU,MatGetFactor_seqaij_petsc);
306: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJ, MAT_FACTOR_CHOLESKY,MatGetFactor_seqaij_petsc);
307: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJ, MAT_FACTOR_ILU,MatGetFactor_seqaij_petsc);
308: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJ, MAT_FACTOR_ICC,MatGetFactor_seqaij_petsc);
310: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJPERM, MAT_FACTOR_LU,MatGetFactor_seqaij_petsc);
311: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJPERM, MAT_FACTOR_CHOLESKY,MatGetFactor_seqaij_petsc);
312: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJPERM, MAT_FACTOR_ILU,MatGetFactor_seqaij_petsc);
313: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJPERM, MAT_FACTOR_ICC,MatGetFactor_seqaij_petsc);
315: #if defined(PETSC_HAVE_MKL_SPARSE)
316: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJMKL, MAT_FACTOR_LU,MatGetFactor_seqaij_petsc);
317: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJMKL, MAT_FACTOR_CHOLESKY,MatGetFactor_seqaij_petsc);
318: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJMKL, MAT_FACTOR_ILU,MatGetFactor_seqaij_petsc);
319: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJMKL, MAT_FACTOR_ICC,MatGetFactor_seqaij_petsc);
321: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQBAIJMKL, MAT_FACTOR_LU,MatGetFactor_seqbaij_petsc);
322: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQBAIJMKL, MAT_FACTOR_CHOLESKY,MatGetFactor_seqbaij_petsc);
323: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQBAIJMKL, MAT_FACTOR_ILU,MatGetFactor_seqbaij_petsc);
324: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQBAIJMKL, MAT_FACTOR_ICC,MatGetFactor_seqbaij_petsc);
325: #endif
326: /* Above, we register the PETSc built-in factorization solvers for MATSEQAIJMKL. In the future, we may want to use
327: * some of the MKL-provided ones instead. */
329: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJCRL, MAT_FACTOR_LU,MatGetFactor_seqaij_petsc);
330: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJCRL, MAT_FACTOR_CHOLESKY,MatGetFactor_seqaij_petsc);
331: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJCRL, MAT_FACTOR_ILU,MatGetFactor_seqaij_petsc);
332: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJCRL, MAT_FACTOR_ICC,MatGetFactor_seqaij_petsc);
334: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQBAIJ, MAT_FACTOR_LU,MatGetFactor_seqbaij_petsc);
335: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQBAIJ, MAT_FACTOR_CHOLESKY,MatGetFactor_seqbaij_petsc);
336: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQBAIJ, MAT_FACTOR_ILU,MatGetFactor_seqbaij_petsc);
337: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQBAIJ, MAT_FACTOR_ICC,MatGetFactor_seqbaij_petsc);
339: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQSBAIJ, MAT_FACTOR_CHOLESKY,MatGetFactor_seqsbaij_petsc);
340: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQSBAIJ, MAT_FACTOR_ICC,MatGetFactor_seqsbaij_petsc);
342: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQDENSE, MAT_FACTOR_LU,MatGetFactor_seqdense_petsc);
343: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQDENSE, MAT_FACTOR_CHOLESKY,MatGetFactor_seqdense_petsc);
345: MatSolverTypeRegister(MATSOLVERBAS, MATSEQAIJ, MAT_FACTOR_ICC,MatGetFactor_seqaij_bas);
347: /*
348: Register the external package factorization based solvers
349: Eventually we don't want to have these hardwired here at compile time of PETSc
350: */
351: #if defined(PETSC_HAVE_MUMPS)
352: MatSolverTypeRegister_MUMPS();
353: #endif
354: #if defined(PETSC_HAVE_VECCUDA)
355: MatSolverTypeRegister_CUSPARSE();
356: #endif
357: #if defined(PETSC_HAVE_VIENNACL)
358: MatSolverTypeRegister_ViennaCL();
359: #endif
360: #if defined(PETSC_HAVE_ELEMENTAL)
361: MatSolverTypeRegister_Elemental();
362: #endif
363: #if defined(PETSC_HAVE_MATLAB_ENGINE)
364: MatSolverTypeRegister_Matlab();
365: #endif
366: #if defined(PETSC_HAVE_PETSC_HAVE_ESSL)
367: MatSolverTypeRegister_Essl();
368: #endif
369: #if defined(PETSC_HAVE_SUPERLU)
370: MatSolverTypeRegister_SuperLU();
371: #endif
372: #if defined(PETSC_HAVE_STRUMPACK)
373: MatSolverTypeRegister_STRUMPACK();
374: #endif
375: #if defined(PETSC_HAVE_PASTIX)
376: MatSolverTypeRegister_Pastix();
377: #endif
378: #if defined(PETSC_HAVE_SUPERLU_DIST)
379: MatSolverTypeRegister_SuperLU_DIST();
380: #endif
381: #if defined(PETSC_HAVE_ELEMENTAL)
382: MatSolverTypeRegister_SparseElemental();
383: #endif
384: #if defined(PETSC_HAVE_MKL_PARDISO)
385: MatSolverTypeRegister_MKL_Pardiso();
386: #endif
387: #if defined(PETSC_HAVE_MKL_CPARDISO)
388: MatSolverTypeRegister_MKL_CPardiso();
389: #endif
390: #if defined(PETSC_HAVE_SUITESPARSE)
391: MatSolverTypeRegister_SuiteSparse();
392: #endif
393: #if defined(PETSC_HAVE_LUSOL)
394: MatSolverTypeRegister_Lusol();
395: #endif
396: #if defined(PETSC_HAVE_ELEMENTAL)
397: MatSolverTypeRegister_SparseElemental();
398: #endif
399: /* Register package finalizer */
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 */