Actual source code: dlregismat.c
1: #define PETSCMAT_DLL
3: #include src/mat/matimpl.h
7: /*@C
8: MatInitializePackage - This function initializes everything in the Mat package. It is called
9: from PetscDLLibraryRegister() when using dynamic libraries, and on the first call to MatCreate()
10: when using static libraries.
12: Input Parameter:
13: path - The dynamic library path, or PETSC_NULL
15: Level: developer
17: .keywords: Mat, initialize, package
18: .seealso: PetscInitialize()
19: @*/
20: PetscErrorCode MatInitializePackage(char *path)
21: {
22: static PetscTruth initialized = PETSC_FALSE;
23: char logList[256];
24: char *className;
25: PetscTruth opt;
26: PetscErrorCode ierr;
29: if (initialized) return(0);
30: initialized = PETSC_TRUE;
31: /* Register Classes */
32: PetscLogClassRegister(&MAT_COOKIE, "Matrix");
33: PetscLogClassRegister(&MAT_FDCOLORING_COOKIE, "Matrix FD Coloring");
34: PetscLogClassRegister(&MAT_PARTITIONING_COOKIE, "Matrix Partitioning");
35: PetscLogClassRegister(&MAT_NULLSPACE_COOKIE, "Matrix Null Space");
36: /* Register Constructors */
37: MatRegisterAll(path);
38: /* Register Events */
93: /* Turn off high traffic events by default */
95: /* Process info exclusions */
96: PetscOptionsGetString(PETSC_NULL, "-info_exclude", logList, 256, &opt);
97: if (opt) {
98: PetscStrstr(logList, "mat", &className);
99: if (className) {
100: PetscInfoDeactivateClass(MAT_COOKIE);
101: }
102: }
103: /* Process summary exclusions */
104: PetscOptionsGetString(PETSC_NULL, "-log_summary_exclude", logList, 256, &opt);
105: if (opt) {
106: PetscStrstr(logList, "mat", &className);
107: if (className) {
109: }
110: }
111: return(0);
112: }
114: #ifdef PETSC_USE_DYNAMIC_LIBRARIES
118: /*
119: PetscDLLibraryRegister - This function is called when the dynamic library it is in is opened.
121: This one registers all the matrix methods that are in the basic PETSc Matrix library.
123: Input Parameter:
124: path - library path
125: */
126: PetscErrorCode PetscDLLibraryRegister_petscmat(char *path)
127: {
130: PetscInitializeNoArguments(); if (ierr) return 1;
133: /*
134: If we got here then PETSc was properly loaded
135: */
136: MatInitializePackage(path);
137: return(0);
138: }
142: #endif /* PETSC_USE_DYNAMIC_LIBRARIES */