Actual source code: dlregispetsc.c
1: /*$Id: dlregispetsc.c,v 1.14 2001/03/23 23:20:05 balay Exp $*/
3: #include petsc.h
4: #include petscdraw.h
5: #include petscsys.h
7: #undef __FUNCT__
9: /*@C
10: PetscInitializePackage - This function initializes everything in the main Petsc package. It is called
11: from PetscDLLibraryRegister() when using dynamic libraries, and on the call to PetscInitialize()
12: when using static libraries.
14: Input Parameter:
15: path - The dynamic library path, or PETSC_NULL
17: Level: developer
19: .keywords: Petsc, initialize, package
20: .seealso: PetscInitialize()
21: @*/
22: int PetscInitializePackage(char *path)
23: {
24: static PetscTruth initialized = PETSC_FALSE;
25: char logList[256];
26: char *className;
27: PetscTruth opt;
28: int ierr;
31: if (initialized == PETSC_TRUE) return(0);
32: initialized = PETSC_TRUE;
33: /* Register Classes */
34: PetscLogClassRegister(&PETSC_VIEWER_COOKIE, "Viewer");
35: PetscLogClassRegister(&PETSC_DRAW_COOKIE, "Draw");
36: PetscLogClassRegister(&DRAWAXIS_COOKIE, "Axis");
37: PetscLogClassRegister(&DRAWLG_COOKIE, "Line Graph");
38: PetscLogClassRegister(&DRAWHG_COOKIE, "Histogram");
39: PetscLogClassRegister(&DRAWSP_COOKIE, "Scatter Plot");
40: PetscLogClassRegister(&PETSC_RANDOM_COOKIE, "Random Number Generator");
41: PetscLogClassRegister(&DICT_COOKIE, "Parameter Dictionary");
42: /* Register Constructors and Serializers */
43: PetscDrawRegisterAll(path);
44: PetscViewerRegisterAll(path);
45: /* Register Events */
46: PetscLogEventRegister(&PETSC_Barrier, "PetscBarrier", PETSC_COOKIE);
47: /* Process info exclusions */
48: PetscOptionsGetString(PETSC_NULL, "-log_info_exclude", logList, 256, &opt);
49: if (opt == PETSC_TRUE) {
50: PetscStrstr(logList, "null", &className);
51: if (className) {
52: PetscLogInfoDeactivateClass(0);
53: }
54: }
55: /* Process summary exclusions */
56: PetscOptionsGetString(PETSC_NULL, "-log_summary_exclude", logList, 256, &opt);
57: if (opt == PETSC_TRUE) {
58: PetscStrstr(logList, "null", &className);
59: if (className) {
60: PetscLogEventDeactivateClass(0);
61: }
62: }
63: /* Setup auxiliary packages */
64: PetscViewerMathematicaInitializePackage(PETSC_NULL);
65: PetscPLAPACKInitializePackage(PETSC_NULL);
66: return(0);
67: }
69: EXTERN_C_BEGIN
70: #undef __FUNCT__
72: /*
73: PetscDLLibraryRegister - This function is called when the dynamic library it is in is opened.
75: This one registers all the draw and PetscViewer objects.
77: Input Parameter:
78: path - library path
79: */
80: int PetscDLLibraryRegister(char *path)
81: {
84: PetscInitializeNoArguments(); if (ierr) return 1;
86: /*
87: If we got here then PETSc was properly loaded
88: */
89: PetscInitializePackage(path);
90: return(0);
91: }
92: EXTERN_C_END
94: /* --------------------------------------------------------------------------*/
95: static char *contents = "PETSc Graphics and PetscViewer libraries. n
96: ASCII, Binary, Sockets, X-windows, ...n";
97: static char *authors = PETSC_AUTHOR_INFO;
99: #include src/sys/src/utils/dlregis.h