Actual source code: dlregismat.c

petsc-3.14.6 2021-03-30
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_",NULL};
 31: const char *const* MatOptions = MatOptions_Shifted+2;
 32: const char *const MatFactorShiftTypes[] = {"NONE","NONZERO","POSITIVE_DEFINITE","INBLOCKS","MatFactorShiftType","PC_FACTOR_",NULL};
 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_",NULL};
 35: const char *const MPChacoGlobalTypes[] = {"","MULTILEVEL","SPECTRAL","","LINEAR","RANDOM","SCATTERED","MPChacoGlobalType","MP_CHACO_",NULL};
 36: const char *const MPChacoLocalTypes[] = {"","KERNIGHAN","NONE","MPChacoLocalType","MP_CHACO_",NULL};
 37: const char *const MPChacoEigenTypes[] = {"LANCZOS","RQI","MPChacoEigenType","MP_CHACO_",NULL};

 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(), MatInitializePackage()
 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_SCALAPACK)
 96: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_ScaLAPACK(void);
 97: #endif
 98: #if defined(PETSC_HAVE_MATLAB_ENGINE)
 99: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_Matlab(void);
100: #endif
101: #if defined(PETSC_HAVE_PETSC_HAVE_ESSL)
102: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_Essl(void);
103: #endif
104: #if defined(PETSC_HAVE_SUPERLU)
105: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_SuperLU(void);
106: #endif
107: #if defined(PETSC_HAVE_STRUMPACK)
108: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_STRUMPACK(void);
109: #endif
110: #if defined(PETSC_HAVE_PASTIX)
111: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_Pastix(void);
112: #endif
113: #if defined(PETSC_HAVE_SUPERLU_DIST)
114: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_SuperLU_DIST(void);
115: #endif
116: #if defined(PETSC_HAVE_ELEMENTAL)
117: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_SparseElemental(void);
118: #endif
119: #if defined(PETSC_HAVE_MKL_PARDISO)
120: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_MKL_Pardiso(void);
121: #endif
122: #if defined(PETSC_HAVE_MKL_CPARDISO)
123: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_MKL_CPardiso(void);
124: #endif
125: #if defined(PETSC_HAVE_SUITESPARSE)
126: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_SuiteSparse(void);
127: #endif
128: #if defined(PETSC_HAVE_LUSOL)
129: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_Lusol(void);
130: #endif

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

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

147:   Level: developer

149: .seealso: PetscInitialize(), MatFinalizePackage()
150: @*/
151: PetscErrorCode  MatInitializePackage(void)
152: {
153:   char           logList[256];
154:   PetscBool      opt,pkg;


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

359:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQDENSE,      MAT_FACTOR_LU,MatGetFactor_seqdense_petsc);
360:   MatSolverTypeRegister(MATSOLVERPETSC, MATSEQDENSE,      MAT_FACTOR_ILU,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_SCALAPACK)
388:   MatSolverTypeRegister_ScaLAPACK();
389: #endif
390: #if defined(PETSC_HAVE_MATLAB_ENGINE)
391:   MatSolverTypeRegister_Matlab();
392: #endif
393: #if defined(PETSC_HAVE_PETSC_HAVE_ESSL)
394:   MatSolverTypeRegister_Essl();
395: #endif
396: #if defined(PETSC_HAVE_SUPERLU)
397:   MatSolverTypeRegister_SuperLU();
398: #endif
399: #if defined(PETSC_HAVE_STRUMPACK)
400:   MatSolverTypeRegister_STRUMPACK();
401: #endif
402: #if defined(PETSC_HAVE_PASTIX)
403:   MatSolverTypeRegister_Pastix();
404: #endif
405: #if defined(PETSC_HAVE_SUPERLU_DIST)
406:   MatSolverTypeRegister_SuperLU_DIST();
407: #endif
408: #if defined(PETSC_HAVE_ELEMENTAL)
409:   MatSolverTypeRegister_SparseElemental();
410: #endif
411: #if defined(PETSC_HAVE_MKL_PARDISO)
412:   MatSolverTypeRegister_MKL_Pardiso();
413: #endif
414: #if defined(PETSC_HAVE_MKL_CPARDISO)
415:   MatSolverTypeRegister_MKL_CPardiso();
416: #endif
417: #if defined(PETSC_HAVE_SUITESPARSE)
418:   MatSolverTypeRegister_SuiteSparse();
419: #endif
420: #if defined(PETSC_HAVE_LUSOL)
421:   MatSolverTypeRegister_Lusol();
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 */