Actual source code: dlregismat.c

petsc-3.5.2 2014-09-08
Report Typos and Errors
  2: #include <petsc-private/matimpl.h>

  4: const char       *MatOptions[] = {"NEW_NONZERO_LOCATION_ERR",
  5:                                   "UNUSED_NONZERO_LOCATION_ERR",
  6:                                   "NEW_NONZERO_ALLOCATION_ERR",
  7:                                   "ROW_ORIENTED",
  8:                                   "NEW_NONZERO_LOCATIONS",
  9:                                   "SYMMETRIC",
 10:                                   "STRUCTURALLY_SYMMETRIC",
 11:                                   "NEW_DIAGONALS",
 12:                                   "IGNORE_OFF_PROC_ENTRIES",
 13:                                   "USE_HASH_TABLE",
 14:                                   "KEEP_NONZERO_PATTERN",
 15:                                   "IGNORE_ZERO_ENTRIES",
 16:                                   "USE_INODES",
 17:                                   "HERMITIAN",
 18:                                   "SYMMETRY_ETERNAL",
 19:                                   "DUMMY",
 20:                                   "IGNORE_LOWER_TRIANGULAR",
 21:                                   "ERROR_LOWER_TRIANGULAR",
 22:                                   "GETROW_UPPERTRIANGULAR",
 23:                                   "SPD",
 24:                                   "NO_OFF_PROC_ZERO_ROWS",
 25:                                   "NO_OFF_PROC_ENTRIES",
 26:                                   "NEW_NONZERO_LOCATIONS",
 27:                                   "MatOption","MAT_",0};
 28: const char *const MatFactorShiftTypes[] = {"NONE","NONZERO","POSITIVE_DEFINITE","INBLOCKS","MatFactorShiftType","PC_FACTOR_",0};
 29: const char *const MatFactorShiftTypesDetail[] = {NULL,"diagonal shift to prevent zero pivot","Manteuffel shift","diagonal shift on blocks to prevent zero pivot"};
 30: const char *const MPPTScotchStrategyTypes[] = {"QUALITY","SPEED","BALANCE","SAFETY","SCALABILITY","MPPTScotchStrategyType","MP_PTSCOTCH_",0};
 31: const char *const MPChacoGlobalTypes[] = {"","MULTILEVEL","SPECTRAL","","LINEAR","RANDOM","SCATTERED","MPChacoGlobalType","MP_CHACO_",0};
 32: const char *const MPChacoLocalTypes[] = {"","KERNIGHAN","NONE","MPChacoLocalType","MP_CHACO_",0};
 33: const char *const MPChacoEigenTypes[] = {"LANCZOS","RQI","MPChacoEigenType","MP_CHACO_",0};

 35: extern PetscErrorCode  MatMFFDInitializePackage(void);
 36: static PetscBool MatPackageInitialized = PETSC_FALSE;
 39: /*@C
 40:   MatFinalizePackage - This function destroys everything in the Petsc interface to the Mat package. It is
 41:   called from PetscFinalize().

 43:   Level: developer

 45: .keywords: Petsc, destroy, package, mathematica
 46: .seealso: PetscFinalize()
 47: @*/
 48: PetscErrorCode  MatFinalizePackage(void)
 49: {
 50:   MatBaseName    nnames,names = MatBaseNameList;

 54:   while (names) {
 55:     nnames = names->next;
 56:     PetscFree(names->bname);
 57:     PetscFree(names->sname);
 58:     PetscFree(names->mname);
 59:     PetscFree(names);
 60:     names  = nnames;
 61:   }
 62:   PetscFunctionListDestroy(&MatList);
 63:   PetscFunctionListDestroy(&MatOrderingList);
 64:   PetscFunctionListDestroy(&MatColoringList);
 65:   PetscFunctionListDestroy(&MatPartitioningList);
 66:   PetscFunctionListDestroy(&MatCoarsenList);
 67:   MatBaseNameList                  = NULL;
 68:   MatPackageInitialized            = PETSC_FALSE;
 69:   MatRegisterAllCalled             = PETSC_FALSE;
 70:   MatOrderingRegisterAllCalled     = PETSC_FALSE;
 71:   MatColoringRegisterAllCalled     = PETSC_FALSE;
 72:   MatPartitioningRegisterAllCalled = PETSC_FALSE;
 73:   MatCoarsenRegisterAllCalled      = PETSC_FALSE;
 74:   return(0);
 75: }

 79: /*@C
 80:   MatInitializePackage - This function initializes everything in the Mat package. It is called
 81:   from PetscDLLibraryRegister() when using dynamic libraries, and on the first call to MatCreate()
 82:   when using static libraries.

 84:   Level: developer

 86: .keywords: Mat, initialize, package
 87: .seealso: PetscInitialize()
 88: @*/
 89: PetscErrorCode  MatInitializePackage(void)
 90: {
 91:   char           logList[256];
 92:   char           *className;
 93:   PetscBool      opt;

 97:   if (MatPackageInitialized) return(0);
 98:   MatPackageInitialized = PETSC_TRUE;
 99:   /* Inialize subpackage */
100:   MatMFFDInitializePackage();
101:   /* Register Classes */
102:   PetscClassIdRegister("Matrix",&MAT_CLASSID);
103:   PetscClassIdRegister("Matrix FD Coloring",&MAT_FDCOLORING_CLASSID);
104:   PetscClassIdRegister("Matrix Coloring",&MAT_COLORING_CLASSID);
105:   PetscClassIdRegister("Matrix MatTranspose Coloring",&MAT_TRANSPOSECOLORING_CLASSID);
106:   PetscClassIdRegister("Matrix Partitioning",&MAT_PARTITIONING_CLASSID);
107:   PetscClassIdRegister("Matrix Coarsen",&MAT_COARSEN_CLASSID);
108:   PetscClassIdRegister("Matrix Null Space",&MAT_NULLSPACE_CLASSID);
109:   /* Register Constructors */
110:   MatRegisterAll();
111:   MatOrderingRegisterAll();
112:   MatColoringRegisterAll();
113:   MatPartitioningRegisterAll();
114:   MatCoarsenRegisterAll();
115:   /* Register Events */
116:   PetscLogEventRegister("MatMult",          MAT_CLASSID,&MAT_Mult);
117:   PetscLogEventRegister("MatMults",         MAT_CLASSID,&MAT_Mults);
118:   PetscLogEventRegister("MatMultConstr",    MAT_CLASSID,&MAT_MultConstrained);
119:   PetscLogEventRegister("MatMultAdd",       MAT_CLASSID,&MAT_MultAdd);
120:   PetscLogEventRegister("MatMultTranspose", MAT_CLASSID,&MAT_MultTranspose);
121:   PetscLogEventRegister("MatMultTrConstr",  MAT_CLASSID,&MAT_MultTransposeConstrained);
122:   PetscLogEventRegister("MatMultTrAdd",     MAT_CLASSID,&MAT_MultTransposeAdd);
123:   PetscLogEventRegister("MatSolve",         MAT_CLASSID,&MAT_Solve);
124:   PetscLogEventRegister("MatSolves",        MAT_CLASSID,&MAT_Solves);
125:   PetscLogEventRegister("MatSolveAdd",      MAT_CLASSID,&MAT_SolveAdd);
126:   PetscLogEventRegister("MatSolveTranspos", MAT_CLASSID,&MAT_SolveTranspose);
127:   PetscLogEventRegister("MatSolveTrAdd",    MAT_CLASSID,&MAT_SolveTransposeAdd);
128:   PetscLogEventRegister("MatSOR",           MAT_CLASSID,&MAT_SOR);
129:   PetscLogEventRegister("MatForwardSolve",  MAT_CLASSID,&MAT_ForwardSolve);
130:   PetscLogEventRegister("MatBackwardSolve", MAT_CLASSID,&MAT_BackwardSolve);
131:   PetscLogEventRegister("MatLUFactor",      MAT_CLASSID,&MAT_LUFactor);
132:   PetscLogEventRegister("MatLUFactorSym",   MAT_CLASSID,&MAT_LUFactorSymbolic);
133:   PetscLogEventRegister("MatLUFactorNum",   MAT_CLASSID,&MAT_LUFactorNumeric);
134:   PetscLogEventRegister("MatCholeskyFctr",  MAT_CLASSID,&MAT_CholeskyFactor);
135:   PetscLogEventRegister("MatCholFctrSym",   MAT_CLASSID,&MAT_CholeskyFactorSymbolic);
136:   PetscLogEventRegister("MatCholFctrNum",   MAT_CLASSID,&MAT_CholeskyFactorNumeric);
137:   PetscLogEventRegister("MatILUFactor",     MAT_CLASSID,&MAT_ILUFactor);
138:   PetscLogEventRegister("MatILUFactorSym",  MAT_CLASSID,&MAT_ILUFactorSymbolic);
139:   PetscLogEventRegister("MatICCFactorSym",  MAT_CLASSID,&MAT_ICCFactorSymbolic);
140:   PetscLogEventRegister("MatCopy",          MAT_CLASSID,&MAT_Copy);
141:   PetscLogEventRegister("MatConvert",       MAT_CLASSID,&MAT_Convert);
142:   PetscLogEventRegister("MatScale",         MAT_CLASSID,&MAT_Scale);
143:   PetscLogEventRegister("MatResidual",      MAT_CLASSID,&MAT_Residual);
144:   PetscLogEventRegister("MatAssemblyBegin", MAT_CLASSID,&MAT_AssemblyBegin);
145:   PetscLogEventRegister("MatAssemblyEnd",   MAT_CLASSID,&MAT_AssemblyEnd);
146:   PetscLogEventRegister("MatSetValues",     MAT_CLASSID,&MAT_SetValues);
147:   PetscLogEventRegister("MatGetValues",     MAT_CLASSID,&MAT_GetValues);
148:   PetscLogEventRegister("MatGetRow",        MAT_CLASSID,&MAT_GetRow);
149:   PetscLogEventRegister("MatGetRowIJ",      MAT_CLASSID,&MAT_GetRowIJ);
150:   PetscLogEventRegister("MatGetSubMatrice", MAT_CLASSID,&MAT_GetSubMatrices);
151:   PetscLogEventRegister("MatGetOrdering",   MAT_CLASSID,&MAT_GetOrdering);
152:   PetscLogEventRegister("MatIncreaseOvrlp", MAT_CLASSID,&MAT_IncreaseOverlap);
153:   PetscLogEventRegister("MatPartitioning",  MAT_PARTITIONING_CLASSID,&MAT_Partitioning);
154:   PetscLogEventRegister("MatCoarsen",  MAT_COARSEN_CLASSID,&MAT_Coarsen);
155:   PetscLogEventRegister("MatZeroEntries",   MAT_CLASSID,&MAT_ZeroEntries);
156:   PetscLogEventRegister("MatLoad",          MAT_CLASSID,&MAT_Load);
157:   PetscLogEventRegister("MatView",          MAT_CLASSID,&MAT_View);
158:   PetscLogEventRegister("MatAXPY",          MAT_CLASSID,&MAT_AXPY);
159:   PetscLogEventRegister("MatFDColorCreate", MAT_FDCOLORING_CLASSID,&MAT_FDColoringCreate);
160:   PetscLogEventRegister("MatFDColorSetUp",  MAT_FDCOLORING_CLASSID,&MAT_FDColoringSetUp);
161:   PetscLogEventRegister("MatFDColorApply",  MAT_FDCOLORING_CLASSID,&MAT_FDColoringApply);
162:   PetscLogEventRegister("MatFDColorFunc",   MAT_FDCOLORING_CLASSID,&MAT_FDColoringFunction);
163:   PetscLogEventRegister("MatTranspose",     MAT_CLASSID,&MAT_Transpose);
164:   PetscLogEventRegister("MatMatMult",       MAT_CLASSID,&MAT_MatMult);
165:   PetscLogEventRegister("MatMatSolve",      MAT_CLASSID,&MAT_MatSolve);
166:   PetscLogEventRegister("MatMatMultSym",    MAT_CLASSID,&MAT_MatMultSymbolic);
167:   PetscLogEventRegister("MatMatMultNum",    MAT_CLASSID,&MAT_MatMultNumeric);
168:   PetscLogEventRegister("MatMatMatMult",    MAT_CLASSID,&MAT_MatMatMult);
169:   PetscLogEventRegister("MatMatMatMultSym", MAT_CLASSID,&MAT_MatMatMultSymbolic);
170:   PetscLogEventRegister("MatMatMatMultNum", MAT_CLASSID,&MAT_MatMatMultNumeric);
171:   PetscLogEventRegister("MatPtAP",          MAT_CLASSID,&MAT_PtAP);
172:   PetscLogEventRegister("MatPtAPSymbolic",  MAT_CLASSID,&MAT_PtAPSymbolic);
173:   PetscLogEventRegister("MatPtAPNumeric",   MAT_CLASSID,&MAT_PtAPNumeric);
174:   PetscLogEventRegister("MatRARt",          MAT_CLASSID,&MAT_RARt);
175:   PetscLogEventRegister("MatRARtSym",       MAT_CLASSID,&MAT_RARtSymbolic);
176:   PetscLogEventRegister("MatRARtNum",       MAT_CLASSID,&MAT_RARtNumeric);
177:   PetscLogEventRegister("MatMatTransMult",  MAT_CLASSID,&MAT_MatTransposeMult);
178:   PetscLogEventRegister("MatMatTrnMultSym", MAT_CLASSID,&MAT_MatTransposeMultSymbolic);
179:   PetscLogEventRegister("MatMatTrnMultNum", MAT_CLASSID,&MAT_MatTransposeMultNumeric);
180:   PetscLogEventRegister("MatTrnMatMult",    MAT_CLASSID,&MAT_TransposeMatMult);
181:   PetscLogEventRegister("MatTrnMatMultSym", MAT_CLASSID,&MAT_TransposeMatMultSymbolic);
182:   PetscLogEventRegister("MatTrnMatMultNum", MAT_CLASSID,&MAT_TransposeMatMultNumeric);
183:   PetscLogEventRegister("MatTrnColorCreate", MAT_CLASSID,&MAT_TransposeColoringCreate);
184:   PetscLogEventRegister("MatGetRedundant",  MAT_CLASSID,&MAT_GetRedundantMatrix);
185:   PetscLogEventRegister("MatGetSeqNZStrct", MAT_CLASSID,&MAT_GetSequentialNonzeroStructure);
186:   PetscLogEventRegister("MatGetMultiProcBlock", MAT_CLASSID,&MAT_GetMultiProcBlock);


189:   /* these may be specific to MPIAIJ matrices */
190:   PetscLogEventRegister("MatMPISumSeqNumeric",MAT_CLASSID,&MAT_Seqstompinum);
191:   PetscLogEventRegister("MatMPISumSeqSymbolic",MAT_CLASSID,&MAT_Seqstompisym);
192:   PetscLogEventRegister("MatMPISumSeq",MAT_CLASSID,&MAT_Seqstompi);
193:   PetscLogEventRegister("MatMPIConcateSeq",MAT_CLASSID,&MAT_Merge);
194:   PetscLogEventRegister("MatGetLocalMat",MAT_CLASSID,&MAT_Getlocalmat);
195:   PetscLogEventRegister("MatGetLocalMatCondensed",MAT_CLASSID,&MAT_Getlocalmatcondensed);
196:   PetscLogEventRegister("MatGetBrowsOfAcols",MAT_CLASSID,&MAT_GetBrowsOfAcols);
197:   PetscLogEventRegister("MatGetBrAoCol",MAT_CLASSID,&MAT_GetBrowsOfAocols);

199:   PetscLogEventRegister("MatApplyPAPt_Symbolic",MAT_CLASSID,&MAT_Applypapt_symbolic);
200:   PetscLogEventRegister("MatApplyPAPt_Numeric",MAT_CLASSID,&MAT_Applypapt_numeric);
201:   PetscLogEventRegister("MatApplyPAPt",MAT_CLASSID,&MAT_Applypapt);

203:   PetscLogEventRegister("MatGetSymTrans",MAT_CLASSID,&MAT_Getsymtranspose);
204:   PetscLogEventRegister("MatGetSymTransR",MAT_CLASSID,&MAT_Getsymtransreduced);
205:   PetscLogEventRegister("MatTranspose_SeqAIJ_FAST",MAT_CLASSID,&MAT_Transpose_SeqAIJ);
206:   PetscLogEventRegister("MatCUSPCopyTo",MAT_CLASSID,&MAT_CUSPCopyToGPU);
207:   PetscLogEventRegister("MatCUSPARSECopyTo",MAT_CLASSID,&MAT_CUSPARSECopyToGPU);
208:   PetscLogEventRegister("MatViennaCLCopyTo",MAT_CLASSID,&MAT_ViennaCLCopyToGPU);
209:   PetscLogEventRegister("MatSetValBatch",MAT_CLASSID,&MAT_SetValuesBatch);
210:   PetscLogEventRegister("MatSetValBatch1",MAT_CLASSID,&MAT_SetValuesBatchI);
211:   PetscLogEventRegister("MatSetValBatch2",MAT_CLASSID,&MAT_SetValuesBatchII);
212:   PetscLogEventRegister("MatSetValBatch3",MAT_CLASSID,&MAT_SetValuesBatchIII);
213:   PetscLogEventRegister("MatSetValBatch4",MAT_CLASSID,&MAT_SetValuesBatchIV);

215:   PetscLogEventRegister("MatColoringApply",MAT_COLORING_CLASSID,&Mat_Coloring_Apply);
216:   PetscLogEventRegister("MatColoringComm",MAT_COLORING_CLASSID,&Mat_Coloring_Comm);
217:   PetscLogEventRegister("MatColoringLocal",MAT_COLORING_CLASSID,&Mat_Coloring_Local);
218:   PetscLogEventRegister("MatColoringIS",MAT_COLORING_CLASSID,&Mat_Coloring_ISCreate);
219:   PetscLogEventRegister("MatColoringSetUp",MAT_COLORING_CLASSID,&Mat_Coloring_SetUp);
220:   PetscLogEventRegister("MatColoringWeights",MAT_COLORING_CLASSID,&Mat_Coloring_Weights);

222:   /* Turn off high traffic events by default */
223:   PetscLogEventSetActiveAll(MAT_SetValues, PETSC_FALSE);
224:   /* Process info exclusions */
225:   PetscOptionsGetString(NULL, "-info_exclude", logList, 256, &opt);
226:   if (opt) {
227:     PetscStrstr(logList, "mat", &className);
228:     if (className) {
229:       PetscInfoDeactivateClass(MAT_CLASSID);
230:     }
231:   }
232:   /* Process summary exclusions */
233:   PetscOptionsGetString(NULL, "-log_summary_exclude", logList, 256, &opt);
234:   if (opt) {
235:     PetscStrstr(logList, "mat", &className);
236:     if (className) {
237:       PetscLogEventDeactivateClass(MAT_CLASSID);
238:     }
239:   }
240:   PetscRegisterFinalize(MatFinalizePackage);
241:   return(0);
242: }

244: #if defined(PETSC_HAVE_DYNAMIC_LIBRARIES)
247: /*
248:   PetscDLLibraryRegister - This function is called when the dynamic library it is in is opened.

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

252:  */
253: PETSC_EXTERN PetscErrorCode PetscDLLibraryRegister_petscmat(void)
254: {

258:   MatInitializePackage();
259:   return(0);
260: }


263: #endif /* PETSC_HAVE_DYNAMIC_LIBRARIES */