Date: 2013-07-02T14:41:13+00:00

Actual source code: dlregismat.c
petsc-3.4.2 2013-07-02

      2: #include <petsc-private/matimpl.h>

      4: const char       *MatOptions[] = {"ROW_ORIENTED","NEW_NONZERO_LOCATIONS",
      5:                                   "SYMMETRIC",
      6:                                   "STRUCTURALLY_SYMMETRIC",
      7:                                   "NEW_DIAGONALS",
      8:                                   "IGNORE_OFF_PROC_ENTRIES",
      9:                                   "NEW_NONZERO_LOCATION_ERR",
     10:                                   "NEW_NONZERO_ALLOCATION_ERR","USE_HASH_TABLE",
     11:                                   "KEEP_NONZERO_PATTERN","IGNORE_ZERO_ENTRIES","USE_INODES",
     12:                                   "HERMITIAN",
     13:                                   "SYMMETRY_ETERNAL",
     14:                                   "CHECK_COMPRESSED_ROW",
     15:                                   "IGNORE_LOWER_TRIANGULAR","ERROR_LOWER_TRIANGULAR","GETROW_UPPERTRIANGULAR","SPD","NO_OFF_PROC_ENTRIES","NO_OFF_PROC_ZERO_ROWS","MatOption","MAT_",0};
     16: const char *const MatFactorShiftTypes[] = {"NONE","NONZERO","POSITIVE_DEFINITE","INBLOCKS","MatFactorShiftType","PC_FACTOR_",0};
     17: const char *const MPPTScotchStrategyTypes[] = {"QUALITY","SPEED","BALANCE","SAFETY","SCALABILITY","MPPTScotchStrategyType","MP_PTSCOTCH_",0};
     18: const char *const MPChacoGlobalTypes[] = {"","MULTILEVEL","SPECTRAL","","LINEAR","RANDOM","SCATTERED","MPChacoGlobalType","MP_CHACO_",0};
     19: const char *const MPChacoLocalTypes[] = {"","KERNIGHAN","NONE","MPChacoLocalType","MP_CHACO_",0};
     20: const char *const MPChacoEigenTypes[] = {"LANCZOS","RQI","MPChacoEigenType","MP_CHACO_",0};

     22: extern PetscErrorCode  MatMFFDInitializePackage(void);
     23: static PetscBool MatPackageInitialized = PETSC_FALSE;
     26: /*@C
     27:   MatFinalizePackage - This function destroys everything in the Petsc interface to the Mat package. It is
     28:   called from PetscFinalize().

     30:   Level: developer

     32: .keywords: Petsc, destroy, package, mathematica
     33: .seealso: PetscFinalize()
     34: @*/
     35: PetscErrorCode  MatFinalizePackage(void)
     36: {
     37:   MatBaseName    nnames,names = MatBaseNameList;

     41:   while (names) {
     42:     nnames = names->next;
     43:     PetscFree(names->bname);
     44:     PetscFree(names->sname);
     45:     PetscFree(names->mname);
     46:     PetscFree(names);
     47:     names  = nnames;
     48:   }
     49:   PetscFunctionListDestroy(&MatList);
     50:   PetscFunctionListDestroy(&MatOrderingList);
     51:   PetscFunctionListDestroy(&MatColoringList);
     52:   PetscFunctionListDestroy(&MatPartitioningList);
     53:   PetscFunctionListDestroy(&MatCoarsenList);
     54:   MatBaseNameList                  = NULL;
     55:   MatPackageInitialized            = PETSC_FALSE;
     56:   MatRegisterAllCalled             = PETSC_FALSE;
     57:   MatOrderingRegisterAllCalled     = PETSC_FALSE;
     58:   MatColoringRegisterAllCalled     = PETSC_FALSE;
     59:   MatPartitioningRegisterAllCalled = PETSC_FALSE;
     60:   MatCoarsenRegisterAllCalled      = PETSC_FALSE;
     61:   return(0);
     62: }

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

     71:   Level: developer

     73: .keywords: Mat, initialize, package
     74: .seealso: PetscInitialize()
     75: @*/
     76: PetscErrorCode  MatInitializePackage(void)
     77: {
     78:   char           logList[256];
     79:   char           *className;
     80:   PetscBool      opt;

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

    174:   /* these may be specific to MPIAIJ matrices */
    175:   PetscLogEventRegister("MatMPISumSeqNumeric",MAT_CLASSID,&MAT_Seqstompinum);
    176:   PetscLogEventRegister("MatMPISumSeqSymbolic",MAT_CLASSID,&MAT_Seqstompisym);
    177:   PetscLogEventRegister("MatMPISumSeq",MAT_CLASSID,&MAT_Seqstompi);
    178:   PetscLogEventRegister("MatMPIConcateSeq",MAT_CLASSID,&MAT_Merge);
    179:   PetscLogEventRegister("MatGetLocalMat",MAT_CLASSID,&MAT_Getlocalmat);
    180:   PetscLogEventRegister("MatGetLocalMatCondensed",MAT_CLASSID,&MAT_Getlocalmatcondensed);
    181:   PetscLogEventRegister("MatGetBrowsOfAcols",MAT_CLASSID,&MAT_GetBrowsOfAcols);
    182:   PetscLogEventRegister("MatGetBrAoCol",MAT_CLASSID,&MAT_GetBrowsOfAocols);

    184:   PetscLogEventRegister("MatApplyPAPt_Symbolic",MAT_CLASSID,&MAT_Applypapt_symbolic);
    185:   PetscLogEventRegister("MatApplyPAPt_Numeric",MAT_CLASSID,&MAT_Applypapt_numeric);
    186:   PetscLogEventRegister("MatApplyPAPt",MAT_CLASSID,&MAT_Applypapt);

    188:   PetscLogEventRegister("MatGetSymTrans",MAT_CLASSID,&MAT_Getsymtranspose);
    189:   PetscLogEventRegister("MatGetSymTransR",MAT_CLASSID,&MAT_Getsymtransreduced);
    190:   PetscLogEventRegister("MatTranspose_SeqAIJ_FAST",MAT_CLASSID,&MAT_Transpose_SeqAIJ);
    191:   PetscLogEventRegister("MatCUSPCopyTo",MAT_CLASSID,&MAT_CUSPCopyToGPU);
    192:   PetscLogEventRegister("MatCUSPARSECopyTo",MAT_CLASSID,&MAT_CUSPARSECopyToGPU);
    193:   PetscLogEventRegister("MatSetValBatch",MAT_CLASSID,&MAT_SetValuesBatch);
    194:   PetscLogEventRegister("MatSetValBatch1",MAT_CLASSID,&MAT_SetValuesBatchI);
    195:   PetscLogEventRegister("MatSetValBatch2",MAT_CLASSID,&MAT_SetValuesBatchII);
    196:   PetscLogEventRegister("MatSetValBatch3",MAT_CLASSID,&MAT_SetValuesBatchIII);
    197:   PetscLogEventRegister("MatSetValBatch4",MAT_CLASSID,&MAT_SetValuesBatchIV);

    199:   /* Turn off high traffic events by default */
    200:   PetscLogEventSetActiveAll(MAT_SetValues, PETSC_FALSE);
    201:   /* Process info exclusions */
    202:   PetscOptionsGetString(NULL, "-info_exclude", logList, 256, &opt);
    203:   if (opt) {
    204:     PetscStrstr(logList, "mat", &className);
    205:     if (className) {
    206:       PetscInfoDeactivateClass(MAT_CLASSID);
    207:     }
    208:   }
    209:   /* Process summary exclusions */
    210:   PetscOptionsGetString(NULL, "-log_summary_exclude", logList, 256, &opt);
    211:   if (opt) {
    212:     PetscStrstr(logList, "mat", &className);
    213:     if (className) {
    214:       PetscLogEventDeactivateClass(MAT_CLASSID);
    215:     }
    216:   }
    217:   PetscRegisterFinalize(MatFinalizePackage);
    218:   return(0);
    219: }

    221: #if defined(PETSC_USE_DYNAMIC_LIBRARIES)
    224: /*
    225:   PetscDLLibraryRegister - This function is called when the dynamic library it is in is opened.

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

    229:  */
    230: PETSC_EXTERN PetscErrorCode PetscDLLibraryRegister_petscmat(void)
    231: {

    235:   MatInitializePackage();
    236:   return(0);
    237: }

    240: #endif /* PETSC_USE_DYNAMIC_LIBRARIES */