Actual source code: dlregismat.c
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: "FORCE_DIAGONAL_ENTRIES",
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: "SUBSET_OFF_PROC_ENTRIES",
27: "SUBMAT_SINGLEIS",
28: "STRUCTURE_ONLY",
29: "SORTED_FULL",
30: "FORM_EXPLICIT_TRANSPOSE",
31: "MatOption","MAT_",NULL};
32: const char *const* MatOptions = MatOptions_Shifted+2;
33: const char *const MatFactorShiftTypes[] = {"NONE","NONZERO","POSITIVE_DEFINITE","INBLOCKS","MatFactorShiftType","PC_FACTOR_",NULL};
34: const char *const MatStructures[] = {"different nonzero pattern","subset nonzero pattern","same nonzero pattern","unknown nonzero pattern","MatStructure","MAT_STRUCTURE_",NULL};
35: const char *const MatFactorShiftTypesDetail[] = {NULL,"diagonal shift to prevent zero pivot","Manteuffel shift","diagonal shift on blocks to prevent zero pivot"};
36: const char *const MPPTScotchStrategyTypes[] = {"DEFAULT","QUALITY","SPEED","BALANCE","SAFETY","SCALABILITY","MPPTScotchStrategyType","MP_PTSCOTCH_",NULL};
37: const char *const MPChacoGlobalTypes[] = {"","MULTILEVEL","SPECTRAL","","LINEAR","RANDOM","SCATTERED","MPChacoGlobalType","MP_CHACO_",NULL};
38: const char *const MPChacoLocalTypes[] = {"","KERNIGHAN","NONE","MPChacoLocalType","MP_CHACO_",NULL};
39: const char *const MPChacoEigenTypes[] = {"LANCZOS","RQI","MPChacoEigenType","MP_CHACO_",NULL};
41: extern PetscErrorCode MatMFFDInitializePackage(void);
42: extern PetscErrorCode MatSolverTypeDestroy(void);
43: static PetscBool MatPackageInitialized = PETSC_FALSE;
44: /*@C
45: MatFinalizePackage - This function destroys everything in the Petsc interface to the Mat package. It is
46: called from PetscFinalize().
48: Level: developer
50: .seealso: PetscFinalize(), MatInitializePackage()
51: @*/
52: PetscErrorCode MatFinalizePackage(void)
53: {
54: MatRootName nnames,names = MatRootNameList;
58: MatSolverTypeDestroy();
59: while (names) {
60: nnames = names->next;
61: PetscFree(names->rname);
62: PetscFree(names->sname);
63: PetscFree(names->mname);
64: PetscFree(names);
65: names = nnames;
66: }
67: PetscFunctionListDestroy(&MatList);
68: PetscFunctionListDestroy(&MatOrderingList);
69: PetscFunctionListDestroy(&MatColoringList);
70: PetscFunctionListDestroy(&MatPartitioningList);
71: PetscFunctionListDestroy(&MatCoarsenList);
72: MatRootNameList = NULL;
73: MatPackageInitialized = PETSC_FALSE;
74: MatRegisterAllCalled = PETSC_FALSE;
75: MatOrderingRegisterAllCalled = PETSC_FALSE;
76: MatColoringRegisterAllCalled = PETSC_FALSE;
77: MatPartitioningRegisterAllCalled = PETSC_FALSE;
78: MatCoarsenRegisterAllCalled = PETSC_FALSE;
79: /* this is not ideal because it exposes SeqAIJ implementation details directly into the base Mat code */
80: PetscFunctionListDestroy(&MatSeqAIJList);
81: MatSeqAIJRegisterAllCalled = PETSC_FALSE;
82: return(0);
83: }
85: #if defined(PETSC_HAVE_MUMPS)
86: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_MUMPS(void);
87: #endif
88: #if defined(PETSC_HAVE_CUDA)
89: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_CUSPARSE(void);
90: #endif
91: #if defined(PETSC_HAVE_KOKKOS_KERNELS)
92: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_KOKKOS(void);
93: #endif
94: #if defined(PETSC_HAVE_VIENNACL)
95: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_ViennaCL(void);
96: #endif
97: #if defined(PETSC_HAVE_ELEMENTAL)
98: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_Elemental(void);
99: #endif
100: #if defined(PETSC_HAVE_SCALAPACK)
101: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_ScaLAPACK(void);
102: #endif
103: #if defined(PETSC_HAVE_MATLAB_ENGINE)
104: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_Matlab(void);
105: #endif
106: #if defined(PETSC_HAVE_PETSC_HAVE_ESSL)
107: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_Essl(void);
108: #endif
109: #if defined(PETSC_HAVE_SUPERLU)
110: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_SuperLU(void);
111: #endif
112: #if defined(PETSC_HAVE_STRUMPACK)
113: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_STRUMPACK(void);
114: #endif
115: #if defined(PETSC_HAVE_PASTIX)
116: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_Pastix(void);
117: #endif
118: #if defined(PETSC_HAVE_SUPERLU_DIST)
119: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_SuperLU_DIST(void);
120: #endif
121: #if defined(PETSC_HAVE_ELEMENTAL)
122: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_SparseElemental(void);
123: #endif
124: #if defined(PETSC_HAVE_MKL_PARDISO)
125: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_MKL_Pardiso(void);
126: #endif
127: #if defined(PETSC_HAVE_MKL_CPARDISO)
128: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_MKL_CPardiso(void);
129: #endif
130: #if defined(PETSC_HAVE_SUITESPARSE)
131: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_SuiteSparse(void);
132: #endif
133: #if defined(PETSC_HAVE_LUSOL)
134: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_Lusol(void);
135: #endif
137: PETSC_INTERN PetscErrorCode MatGetFactor_seqaij_petsc(Mat,MatFactorType,Mat*);
138: PETSC_INTERN PetscErrorCode MatGetFactor_seqbaij_petsc(Mat,MatFactorType,Mat*);
139: PETSC_INTERN PetscErrorCode MatGetFactor_seqsbaij_petsc(Mat,MatFactorType,Mat*);
140: PETSC_INTERN PetscErrorCode MatGetFactor_seqdense_petsc(Mat,MatFactorType,Mat*);
141: #if defined(PETSC_HAVE_CUDA)
142: PETSC_INTERN PetscErrorCode MatGetFactor_seqdense_cuda(Mat,MatFactorType,Mat*);
143: #endif
144: PETSC_INTERN PetscErrorCode MatGetFactor_constantdiagonal_petsc(Mat,MatFactorType,Mat*);
145: PETSC_INTERN PetscErrorCode MatGetFactor_seqaij_bas(Mat,MatFactorType,Mat*);
147: /*@C
148: MatInitializePackage - This function initializes everything in the Mat package. It is called
149: from PetscDLLibraryRegister_petscmat() when using dynamic libraries, and on the first call to MatCreate()
150: when using shared or static libraries.
152: Level: developer
154: .seealso: PetscInitialize(), MatFinalizePackage()
155: @*/
156: PetscErrorCode MatInitializePackage(void)
157: {
158: char logList[256];
159: PetscBool opt,pkg;
164: if (MatPackageInitialized) return(0);
165: MatPackageInitialized = PETSC_TRUE;
166: /* Initialize subpackage */
167: MatMFFDInitializePackage();
168: /* Register Classes */
169: PetscClassIdRegister("Matrix",&MAT_CLASSID);
170: PetscClassIdRegister("Matrix FD Coloring",&MAT_FDCOLORING_CLASSID);
171: PetscClassIdRegister("Matrix Coloring",&MAT_COLORING_CLASSID);
172: PetscClassIdRegister("Matrix MatTranspose Coloring",&MAT_TRANSPOSECOLORING_CLASSID);
173: PetscClassIdRegister("Matrix Partitioning",&MAT_PARTITIONING_CLASSID);
174: PetscClassIdRegister("Matrix Coarsen",&MAT_COARSEN_CLASSID);
175: PetscClassIdRegister("Matrix Null Space",&MAT_NULLSPACE_CLASSID);
176: /* Register Constructors */
177: MatRegisterAll();
178: MatOrderingRegisterAll();
179: MatColoringRegisterAll();
180: MatPartitioningRegisterAll();
181: MatCoarsenRegisterAll();
182: MatSeqAIJRegisterAll();
183: /* Register Events */
184: PetscLogEventRegister("MatMult", MAT_CLASSID,&MAT_Mult);
185: PetscLogEventRegister("MatMults", MAT_CLASSID,&MAT_Mults);
186: PetscLogEventRegister("MatMultConstr", MAT_CLASSID,&MAT_MultConstrained);
187: PetscLogEventRegister("MatMultAdd", MAT_CLASSID,&MAT_MultAdd);
188: PetscLogEventRegister("MatMultTranspose", MAT_CLASSID,&MAT_MultTranspose);
189: PetscLogEventRegister("MatMultTrConstr", MAT_CLASSID,&MAT_MultTransposeConstrained);
190: PetscLogEventRegister("MatMultTrAdd", MAT_CLASSID,&MAT_MultTransposeAdd);
191: PetscLogEventRegister("MatSolve", MAT_CLASSID,&MAT_Solve);
192: PetscLogEventRegister("MatSolves", MAT_CLASSID,&MAT_Solves);
193: PetscLogEventRegister("MatSolveAdd", MAT_CLASSID,&MAT_SolveAdd);
194: PetscLogEventRegister("MatSolveTranspos", MAT_CLASSID,&MAT_SolveTranspose);
195: PetscLogEventRegister("MatSolveTrAdd", MAT_CLASSID,&MAT_SolveTransposeAdd);
196: PetscLogEventRegister("MatSOR", MAT_CLASSID,&MAT_SOR);
197: PetscLogEventRegister("MatForwardSolve", MAT_CLASSID,&MAT_ForwardSolve);
198: PetscLogEventRegister("MatBackwardSolve", MAT_CLASSID,&MAT_BackwardSolve);
199: PetscLogEventRegister("MatLUFactor", MAT_CLASSID,&MAT_LUFactor);
200: PetscLogEventRegister("MatLUFactorSym", MAT_CLASSID,&MAT_LUFactorSymbolic);
201: PetscLogEventRegister("MatLUFactorNum", MAT_CLASSID,&MAT_LUFactorNumeric);
202: PetscLogEventRegister("MatQRFactor", MAT_CLASSID,&MAT_QRFactor);
203: PetscLogEventRegister("MatQRFactorSym", MAT_CLASSID,&MAT_QRFactorSymbolic);
204: PetscLogEventRegister("MatQRFactorNum", MAT_CLASSID,&MAT_QRFactorNumeric);
205: PetscLogEventRegister("MatCholeskyFctr", MAT_CLASSID,&MAT_CholeskyFactor);
206: PetscLogEventRegister("MatCholFctrSym", MAT_CLASSID,&MAT_CholeskyFactorSymbolic);
207: PetscLogEventRegister("MatCholFctrNum", MAT_CLASSID,&MAT_CholeskyFactorNumeric);
208: PetscLogEventRegister("MatFctrFactSchur", MAT_CLASSID,&MAT_FactorFactS);
209: PetscLogEventRegister("MatFctrInvSchur", MAT_CLASSID,&MAT_FactorInvS);
210: PetscLogEventRegister("MatILUFactor", MAT_CLASSID,&MAT_ILUFactor);
211: PetscLogEventRegister("MatILUFactorSym", MAT_CLASSID,&MAT_ILUFactorSymbolic);
212: PetscLogEventRegister("MatICCFactorSym", MAT_CLASSID,&MAT_ICCFactorSymbolic);
213: PetscLogEventRegister("MatCopy", MAT_CLASSID,&MAT_Copy);
214: PetscLogEventRegister("MatConvert", MAT_CLASSID,&MAT_Convert);
215: PetscLogEventRegister("MatScale", MAT_CLASSID,&MAT_Scale);
216: PetscLogEventRegister("MatResidual", MAT_CLASSID,&MAT_Residual);
217: PetscLogEventRegister("MatAssemblyBegin", MAT_CLASSID,&MAT_AssemblyBegin);
218: PetscLogEventRegister("MatAssemblyEnd", MAT_CLASSID,&MAT_AssemblyEnd);
219: PetscLogEventRegister("MatSetValues", MAT_CLASSID,&MAT_SetValues);
220: PetscLogEventRegister("MatGetValues", MAT_CLASSID,&MAT_GetValues);
221: PetscLogEventRegister("MatGetRow", MAT_CLASSID,&MAT_GetRow);
222: PetscLogEventRegister("MatGetRowIJ", MAT_CLASSID,&MAT_GetRowIJ);
223: PetscLogEventRegister("MatCreateSubMats", MAT_CLASSID,&MAT_CreateSubMats);
224: PetscLogEventRegister("MatCreateSubMat", MAT_CLASSID,&MAT_CreateSubMat);
225: PetscLogEventRegister("MatGetOrdering", MAT_CLASSID,&MAT_GetOrdering);
226: PetscLogEventRegister("MatIncreaseOvrlp", MAT_CLASSID,&MAT_IncreaseOverlap);
227: PetscLogEventRegister("MatPartitioning", MAT_PARTITIONING_CLASSID,&MAT_Partitioning);
228: PetscLogEventRegister("MatPartitioningND",MAT_PARTITIONING_CLASSID,&MAT_PartitioningND);
229: PetscLogEventRegister("MatCoarsen", MAT_COARSEN_CLASSID,&MAT_Coarsen);
230: PetscLogEventRegister("MatZeroEntries", MAT_CLASSID,&MAT_ZeroEntries);
231: PetscLogEventRegister("MatLoad", MAT_CLASSID,&MAT_Load);
232: PetscLogEventRegister("MatView", MAT_CLASSID,&MAT_View);
233: PetscLogEventRegister("MatAXPY", MAT_CLASSID,&MAT_AXPY);
234: PetscLogEventRegister("MatFDColorCreate", MAT_FDCOLORING_CLASSID,&MAT_FDColoringCreate);
235: PetscLogEventRegister("MatFDColorSetUp", MAT_FDCOLORING_CLASSID,&MAT_FDColoringSetUp);
236: PetscLogEventRegister("MatFDColorApply", MAT_FDCOLORING_CLASSID,&MAT_FDColoringApply);
237: PetscLogEventRegister("MatFDColorFunc", MAT_FDCOLORING_CLASSID,&MAT_FDColoringFunction);
238: PetscLogEventRegister("MatTranspose", MAT_CLASSID,&MAT_Transpose);
239: PetscLogEventRegister("MatMatSolve", MAT_CLASSID,&MAT_MatSolve);
240: PetscLogEventRegister("MatMatTrSolve", MAT_CLASSID,&MAT_MatTrSolve);
241: PetscLogEventRegister("MatMatMultSym", MAT_CLASSID,&MAT_MatMultSymbolic);
242: PetscLogEventRegister("MatMatMultNum", MAT_CLASSID,&MAT_MatMultNumeric);
243: PetscLogEventRegister("MatMatMatMultSym", MAT_CLASSID,&MAT_MatMatMultSymbolic);
244: PetscLogEventRegister("MatMatMatMultNum", MAT_CLASSID,&MAT_MatMatMultNumeric);
245: PetscLogEventRegister("MatPtAPSymbolic", MAT_CLASSID,&MAT_PtAPSymbolic);
246: PetscLogEventRegister("MatPtAPNumeric", MAT_CLASSID,&MAT_PtAPNumeric);
247: PetscLogEventRegister("MatRARtSym", MAT_CLASSID,&MAT_RARtSymbolic);
248: PetscLogEventRegister("MatRARtNum", MAT_CLASSID,&MAT_RARtNumeric);
249: PetscLogEventRegister("MatMatTrnMultSym", MAT_CLASSID,&MAT_MatTransposeMultSymbolic);
250: PetscLogEventRegister("MatMatTrnMultNum", MAT_CLASSID,&MAT_MatTransposeMultNumeric);
251: PetscLogEventRegister("MatTrnMatMultSym", MAT_CLASSID,&MAT_TransposeMatMultSymbolic);
252: PetscLogEventRegister("MatTrnMatMultNum", MAT_CLASSID,&MAT_TransposeMatMultNumeric);
253: PetscLogEventRegister("MatTrnColorCreate",MAT_CLASSID,&MAT_TransposeColoringCreate);
254: PetscLogEventRegister("MatRedundantMat", MAT_CLASSID,&MAT_RedundantMat);
255: PetscLogEventRegister("MatGetSeqNZStrct", MAT_CLASSID,&MAT_GetSequentialNonzeroStructure);
256: PetscLogEventRegister("MatGetMultiProcB", MAT_CLASSID,&MAT_GetMultiProcBlock);
257: PetscLogEventRegister("MatSetRandom", MAT_CLASSID,&MAT_SetRandom);
259: /* these may be specific to MPIAIJ matrices */
260: PetscLogEventRegister("MatMPISumSeqNumeric",MAT_CLASSID,&MAT_Seqstompinum);
261: PetscLogEventRegister("MatMPISumSeqSymbolic",MAT_CLASSID,&MAT_Seqstompisym);
262: PetscLogEventRegister("MatMPISumSeq",MAT_CLASSID,&MAT_Seqstompi);
263: PetscLogEventRegister("MatMPIConcateSeq",MAT_CLASSID,&MAT_Merge);
264: PetscLogEventRegister("MatGetLocalMat",MAT_CLASSID,&MAT_Getlocalmat);
265: PetscLogEventRegister("MatGetLocalMatCondensed",MAT_CLASSID,&MAT_Getlocalmatcondensed);
266: PetscLogEventRegister("MatGetBrowsOfAcols",MAT_CLASSID,&MAT_GetBrowsOfAcols);
267: PetscLogEventRegister("MatGetBrAoCol",MAT_CLASSID,&MAT_GetBrowsOfAocols);
269: PetscLogEventRegister("MatApplyPAPt_Symbolic",MAT_CLASSID,&MAT_Applypapt_symbolic);
270: PetscLogEventRegister("MatApplyPAPt_Numeric",MAT_CLASSID,&MAT_Applypapt_numeric);
271: PetscLogEventRegister("MatApplyPAPt",MAT_CLASSID,&MAT_Applypapt);
273: PetscLogEventRegister("MatGetSymTrans",MAT_CLASSID,&MAT_Getsymtranspose);
274: PetscLogEventRegister("MatGetSymTransR",MAT_CLASSID,&MAT_Getsymtransreduced);
275: PetscLogEventRegister("MatCUSPARSCopyTo",MAT_CLASSID,&MAT_CUSPARSECopyToGPU);
276: PetscLogEventRegister("MatCUSPARSCopyFr",MAT_CLASSID,&MAT_CUSPARSECopyFromGPU);
277: PetscLogEventRegister("MatCUSPARSSolAnl",MAT_CLASSID,&MAT_CUSPARSESolveAnalysis);
278: PetscLogEventRegister("MatCUSPARSGenT",MAT_CLASSID,&MAT_CUSPARSEGenerateTranspose);
279: PetscLogEventRegister("MatVCLCopyTo", MAT_CLASSID,&MAT_ViennaCLCopyToGPU);
280: PetscLogEventRegister("MatDenseCopyTo",MAT_CLASSID,&MAT_DenseCopyToGPU);
281: PetscLogEventRegister("MatDenseCopyFrom",MAT_CLASSID,&MAT_DenseCopyFromGPU);
282: PetscLogEventRegister("MatSetValBatch",MAT_CLASSID,&MAT_SetValuesBatch);
284: PetscLogEventRegister("MatColoringApply",MAT_COLORING_CLASSID,&MATCOLORING_Apply);
285: PetscLogEventRegister("MatColoringComm",MAT_COLORING_CLASSID,&MATCOLORING_Comm);
286: PetscLogEventRegister("MatColoringLocal",MAT_COLORING_CLASSID,&MATCOLORING_Local);
287: PetscLogEventRegister("MatColoringIS",MAT_COLORING_CLASSID,&MATCOLORING_ISCreate);
288: PetscLogEventRegister("MatColoringSetUp",MAT_COLORING_CLASSID,&MATCOLORING_SetUp);
289: PetscLogEventRegister("MatColoringWeights",MAT_COLORING_CLASSID,&MATCOLORING_Weights);
291: PetscLogEventRegister("MatSetPreallCOO",MAT_CLASSID,&MAT_PreallCOO);
292: PetscLogEventRegister("MatSetValuesCOO",MAT_CLASSID,&MAT_SetVCOO);
294: /* Mark non-collective events */
295: PetscLogEventSetCollective(MAT_SetValues, PETSC_FALSE);
296: PetscLogEventSetCollective(MAT_SetValuesBatch, PETSC_FALSE);
297: PetscLogEventSetCollective(MAT_GetRow, PETSC_FALSE);
298: /* Turn off high traffic events by default */
299: PetscLogEventSetActiveAll(MAT_SetValues, PETSC_FALSE);
300: PetscLogEventSetActiveAll(MAT_GetValues, PETSC_FALSE);
301: PetscLogEventSetActiveAll(MAT_GetRow, PETSC_FALSE);
302: /* Process Info */
303: {
304: PetscClassId classids[7];
306: classids[0] = MAT_CLASSID;
307: classids[1] = MAT_FDCOLORING_CLASSID;
308: classids[2] = MAT_COLORING_CLASSID;
309: classids[3] = MAT_TRANSPOSECOLORING_CLASSID;
310: classids[4] = MAT_PARTITIONING_CLASSID;
311: classids[5] = MAT_COARSEN_CLASSID;
312: classids[6] = MAT_NULLSPACE_CLASSID;
313: PetscInfoProcessClass("mat", 7, classids);
314: }
316: /* Process summary exclusions */
317: PetscOptionsGetString(NULL,NULL,"-log_exclude",logList,sizeof(logList),&opt);
318: if (opt) {
319: PetscStrInList("mat",logList,',',&pkg);
320: if (pkg) {PetscLogEventExcludeClass(MAT_CLASSID);}
321: if (pkg) {PetscLogEventExcludeClass(MAT_FDCOLORING_CLASSID);}
322: if (pkg) {PetscLogEventExcludeClass(MAT_COLORING_CLASSID);}
323: if (pkg) {PetscLogEventExcludeClass(MAT_TRANSPOSECOLORING_CLASSID);}
324: if (pkg) {PetscLogEventExcludeClass(MAT_PARTITIONING_CLASSID);}
325: if (pkg) {PetscLogEventExcludeClass(MAT_COARSEN_CLASSID);}
326: if (pkg) {PetscLogEventExcludeClass(MAT_NULLSPACE_CLASSID);}
327: }
329: /* Register the PETSc built in factorization based solvers */
330: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJ, MAT_FACTOR_LU,MatGetFactor_seqaij_petsc);
331: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJ, MAT_FACTOR_CHOLESKY,MatGetFactor_seqaij_petsc);
332: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJ, MAT_FACTOR_ILU,MatGetFactor_seqaij_petsc);
333: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJ, MAT_FACTOR_ICC,MatGetFactor_seqaij_petsc);
335: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJPERM, MAT_FACTOR_LU,MatGetFactor_seqaij_petsc);
336: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJPERM, MAT_FACTOR_CHOLESKY,MatGetFactor_seqaij_petsc);
337: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJPERM, MAT_FACTOR_ILU,MatGetFactor_seqaij_petsc);
338: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJPERM, MAT_FACTOR_ICC,MatGetFactor_seqaij_petsc);
340: MatSolverTypeRegister(MATSOLVERPETSC, MATCONSTANTDIAGONAL,MAT_FACTOR_LU,MatGetFactor_constantdiagonal_petsc);
341: MatSolverTypeRegister(MATSOLVERPETSC, MATCONSTANTDIAGONAL,MAT_FACTOR_CHOLESKY,MatGetFactor_constantdiagonal_petsc);
342: MatSolverTypeRegister(MATSOLVERPETSC, MATCONSTANTDIAGONAL,MAT_FACTOR_ILU,MatGetFactor_constantdiagonal_petsc);
343: MatSolverTypeRegister(MATSOLVERPETSC, MATCONSTANTDIAGONAL,MAT_FACTOR_ICC,MatGetFactor_constantdiagonal_petsc);
345: #if defined(PETSC_HAVE_MKL_SPARSE)
346: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJMKL, MAT_FACTOR_LU,MatGetFactor_seqaij_petsc);
347: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJMKL, MAT_FACTOR_CHOLESKY,MatGetFactor_seqaij_petsc);
348: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJMKL, MAT_FACTOR_ILU,MatGetFactor_seqaij_petsc);
349: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJMKL, MAT_FACTOR_ICC,MatGetFactor_seqaij_petsc);
351: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQBAIJMKL, MAT_FACTOR_LU,MatGetFactor_seqbaij_petsc);
352: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQBAIJMKL, MAT_FACTOR_CHOLESKY,MatGetFactor_seqbaij_petsc);
353: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQBAIJMKL, MAT_FACTOR_ILU,MatGetFactor_seqbaij_petsc);
354: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQBAIJMKL, MAT_FACTOR_ICC,MatGetFactor_seqbaij_petsc);
355: #endif
356: /* Above, we register the PETSc built-in factorization solvers for MATSEQAIJMKL. In the future, we may want to use
357: * some of the MKL-provided ones instead. */
359: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJCRL, MAT_FACTOR_LU,MatGetFactor_seqaij_petsc);
360: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJCRL, MAT_FACTOR_CHOLESKY,MatGetFactor_seqaij_petsc);
361: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJCRL, MAT_FACTOR_ILU,MatGetFactor_seqaij_petsc);
362: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQAIJCRL, MAT_FACTOR_ICC,MatGetFactor_seqaij_petsc);
364: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQBAIJ, MAT_FACTOR_LU,MatGetFactor_seqbaij_petsc);
365: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQBAIJ, MAT_FACTOR_CHOLESKY,MatGetFactor_seqbaij_petsc);
366: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQBAIJ, MAT_FACTOR_ILU,MatGetFactor_seqbaij_petsc);
367: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQBAIJ, MAT_FACTOR_ICC,MatGetFactor_seqbaij_petsc);
369: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQSBAIJ, MAT_FACTOR_CHOLESKY,MatGetFactor_seqsbaij_petsc);
370: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQSBAIJ, MAT_FACTOR_ICC,MatGetFactor_seqsbaij_petsc);
372: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQDENSE, MAT_FACTOR_LU,MatGetFactor_seqdense_petsc);
373: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQDENSE, MAT_FACTOR_ILU,MatGetFactor_seqdense_petsc);
374: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQDENSE, MAT_FACTOR_CHOLESKY,MatGetFactor_seqdense_petsc);
375: MatSolverTypeRegister(MATSOLVERPETSC, MATSEQDENSE, MAT_FACTOR_QR,MatGetFactor_seqdense_petsc);
376: #if defined(PETSC_HAVE_CUDA)
377: MatSolverTypeRegister(MATSOLVERCUDA, MATSEQDENSE, MAT_FACTOR_LU,MatGetFactor_seqdense_cuda);
378: MatSolverTypeRegister(MATSOLVERCUDA, MATSEQDENSE, MAT_FACTOR_CHOLESKY,MatGetFactor_seqdense_cuda);
379: MatSolverTypeRegister(MATSOLVERCUDA, MATSEQDENSECUDA, MAT_FACTOR_LU,MatGetFactor_seqdense_cuda);
380: MatSolverTypeRegister(MATSOLVERCUDA, MATSEQDENSECUDA, MAT_FACTOR_CHOLESKY,MatGetFactor_seqdense_cuda);
381: #endif
383: MatSolverTypeRegister(MATSOLVERBAS, MATSEQAIJ, MAT_FACTOR_ICC,MatGetFactor_seqaij_bas);
385: /*
386: Register the external package factorization based solvers
387: Eventually we don't want to have these hardwired here at compile time of PETSc
388: */
389: #if defined(PETSC_HAVE_MUMPS)
390: MatSolverTypeRegister_MUMPS();
391: #endif
392: #if defined(PETSC_HAVE_CUDA)
393: MatSolverTypeRegister_CUSPARSE();
394: #endif
395: #if defined(PETSC_HAVE_KOKKOS_KERNELS)
396: MatSolverTypeRegister_KOKKOS();
397: #endif
398: #if defined(PETSC_HAVE_VIENNACL)
399: MatSolverTypeRegister_ViennaCL();
400: #endif
401: #if defined(PETSC_HAVE_ELEMENTAL)
402: MatSolverTypeRegister_Elemental();
403: #endif
404: #if defined(PETSC_HAVE_SCALAPACK)
405: MatSolverTypeRegister_ScaLAPACK();
406: #endif
407: #if defined(PETSC_HAVE_MATLAB_ENGINE)
408: MatSolverTypeRegister_Matlab();
409: #endif
410: #if defined(PETSC_HAVE_PETSC_HAVE_ESSL)
411: MatSolverTypeRegister_Essl();
412: #endif
413: #if defined(PETSC_HAVE_SUPERLU)
414: MatSolverTypeRegister_SuperLU();
415: #endif
416: #if defined(PETSC_HAVE_STRUMPACK)
417: MatSolverTypeRegister_STRUMPACK();
418: #endif
419: #if defined(PETSC_HAVE_PASTIX)
420: MatSolverTypeRegister_Pastix();
421: #endif
422: #if defined(PETSC_HAVE_SUPERLU_DIST)
423: MatSolverTypeRegister_SuperLU_DIST();
424: #endif
425: #if defined(PETSC_HAVE_ELEMENTAL)
426: MatSolverTypeRegister_SparseElemental();
427: #endif
428: #if defined(PETSC_HAVE_MKL_PARDISO)
429: MatSolverTypeRegister_MKL_Pardiso();
430: #endif
431: #if defined(PETSC_HAVE_MKL_CPARDISO)
432: MatSolverTypeRegister_MKL_CPardiso();
433: #endif
434: #if defined(PETSC_HAVE_SUITESPARSE)
435: MatSolverTypeRegister_SuiteSparse();
436: #endif
437: #if defined(PETSC_HAVE_LUSOL)
438: MatSolverTypeRegister_Lusol();
439: #endif
440: /* Register package finalizer */
441: PetscRegisterFinalize(MatFinalizePackage);
442: return(0);
443: }
445: #if defined(PETSC_HAVE_DYNAMIC_LIBRARIES)
446: /*
447: PetscDLLibraryRegister - This function is called when the dynamic library it is in is opened.
449: This one registers all the matrix methods that are in the basic PETSc Matrix library.
451: */
452: PETSC_EXTERN PetscErrorCode PetscDLLibraryRegister_petscmat(void)
453: {
457: MatInitializePackage();
458: return(0);
459: }
462: #endif /* PETSC_HAVE_DYNAMIC_LIBRARIES */