Actual source code: dlregisdm.c
1: #define PETSCDM_DLL
4: #include src/dm/ao/aoimpl.h
5: #include src/dm/da/daimpl.h
6: #ifdef PETSC_HAVE_SIEVE
7: #include src/dm/mesh/meshimpl.h
8: #endif
12: /*@C
13: DMInitializePackage - This function initializes everything in the DM package. It is called
14: from PetscDLLibraryRegister() when using dynamic libraries, and on the first call to AOCreate()
15: or DACreate() when using static libraries.
17: Input Parameter:
18: path - The dynamic library path, or PETSC_NULL
20: Level: developer
22: .keywords: AO, DA, initialize, package
23: .seealso: PetscInitialize()
24: @*/
25: PetscErrorCode DMInitializePackage(const char path[]) {
26: static PetscTruth initialized = PETSC_FALSE;
27: char logList[256];
28: char *className;
29: PetscTruth opt;
33: if (initialized) return(0);
34: initialized = PETSC_TRUE;
35: /* Register Classes */
36: PetscLogClassRegister(&AO_COOKIE, "Application Order");
37: PetscLogClassRegister(&AODATA_COOKIE, "Application Data");
38: PetscLogClassRegister(&DA_COOKIE, "Distributed array");
39: #ifdef PETSC_HAVE_SIEVE
40: PetscLogClassRegister(&MESH_COOKIE, "Distributed array");
41: #endif
42: /* Register Events */
48: #ifdef PETSC_HAVE_SIEVE
56: #endif
57: /* Process info exclusions */
58: PetscOptionsGetString(PETSC_NULL, "-info_exclude", logList, 256, &opt);
59: if (opt) {
60: PetscStrstr(logList, "ao", &className);
61: if (className) {
62: PetscInfoDeactivateClass(AO_COOKIE);
63: }
64: PetscStrstr(logList, "da", &className);
65: if (className) {
66: PetscInfoDeactivateClass(DA_COOKIE);
67: }
68: }
69: /* Process summary exclusions */
70: PetscOptionsGetString(PETSC_NULL, "-log_summary_exclude", logList, 256, &opt);
71: if (opt) {
72: PetscStrstr(logList, "ao", &className);
73: if (className) {
75: }
76: PetscStrstr(logList, "da", &className);
77: if (className) {
79: }
80: }
81: return(0);
82: }
84: #ifdef PETSC_USE_DYNAMIC_LIBRARIES
88: /*
89: PetscDLLibraryRegister - This function is called when the dynamic library it is in is opened.
91: This one registers all the mesh generators and partitioners that are in
92: the basic DM library.
94: Input Parameter:
95: path - library path
96: */
97: PetscErrorCode PetscDLLibraryRegister_petscdm(char *path)
98: {
101: PetscInitializeNoArguments();
102: if (ierr) return(1);
104: /*
105: If we got here then PETSc was properly loaded
106: */
107: DMInitializePackage(path);
108: return(0);
109: }
112: #endif /* PETSC_USE_DYNAMIC_LIBRARIES */