Actual source code: dlregis.c

 2:  #include petscao.h
 3:  #include petscda.h

  7: /*@C
  8:   DMInitializePackage - This function initializes everything in the DM package. It is called
  9:   from PetscDLLibraryRegister() when using dynamic libraries, and on the first call to AOCreate()
 10:   or DACreate() when using static libraries.

 12:   Input Parameter:
 13:   path - The dynamic library path, or PETSC_NULL

 15:   Level: developer

 17: .keywords: AO, DA, initialize, package
 18: .seealso: PetscInitialize()
 19: @*/
 20: PetscErrorCode DMInitializePackage(const char path[]) {
 21:   static PetscTruth initialized = PETSC_FALSE;
 22:   char              logList[256];
 23:   char             *className;
 24:   PetscTruth        opt;

 28:   if (initialized) return(0);
 29:   initialized = PETSC_TRUE;
 30:   /* Register Classes */
 31:   PetscLogClassRegister(&AO_COOKIE,     "Application Order");
 32:   PetscLogClassRegister(&AODATA_COOKIE, "Application Data");
 33:   PetscLogClassRegister(&DA_COOKIE,     "Distributed array");
 34:   /* Register Events */
 35:   PetscLogEventRegister(&AO_PetscToApplication, "AOPetscToApplication", AO_COOKIE);
 36:   PetscLogEventRegister(&AO_ApplicationToPetsc, "AOApplicationToPetsc", AO_COOKIE);
 37:   PetscLogEventRegister(&DA_GlobalToLocal,      "DAGlobalToLocal",      DA_COOKIE);
 38:   PetscLogEventRegister(&DA_LocalToGlobal,      "DALocalToGlobal",      DA_COOKIE);
 39:   PetscLogEventRegister(&DA_LocalADFunction,    "DALocalADFunc",        DA_COOKIE);
 40:   /* Process info exclusions */
 41:   PetscOptionsGetString(PETSC_NULL, "-log_info_exclude", logList, 256, &opt);
 42:   if (opt == PETSC_TRUE) {
 43:     PetscStrstr(logList, "ao", &className);
 44:     if (className) {
 45:       PetscLogInfoDeactivateClass(AO_COOKIE);
 46:     }
 47:     PetscStrstr(logList, "da", &className);
 48:     if (className) {
 49:       PetscLogInfoDeactivateClass(DA_COOKIE);
 50:     }
 51:   }
 52:   /* Process summary exclusions */
 53:   PetscOptionsGetString(PETSC_NULL, "-log_summary_exclude", logList, 256, &opt);
 54:   if (opt == PETSC_TRUE) {
 55:     PetscStrstr(logList, "ao", &className);
 56:     if (className) {
 57:       PetscLogEventDeactivateClass(AO_COOKIE);
 58:     }
 59:     PetscStrstr(logList, "da", &className);
 60:     if (className) {
 61:       PetscLogEventDeactivateClass(DA_COOKIE);
 62:     }
 63:   }
 64:   return(0);
 65: }

 67: #ifdef PETSC_USE_DYNAMIC_LIBRARIES
 71: /*
 72:   PetscDLLibraryRegister - This function is called when the dynamic library it is in is opened.

 74:   This one registers all the mesh generators and partitioners that are in
 75:   the basic DM library.

 77:   Input Parameter:
 78:   path - library path
 79: */
 80: PetscErrorCode PetscDLLibraryRegister(char *path)
 81: {

 84:   PetscInitializeNoArguments();
 85:   if (ierr) return(1);

 87:   /*
 88:       If we got here then PETSc was properly loaded
 89:   */
 90:   DMInitializePackage(path);
 91:   return(0);
 92: }

 95: /* --------------------------------------------------------------------------*/
 96: static const char *contents = "PETSc Distributed Structures library, includes\n\
 97: Application Orderings, Application Data, and Distributed Arrays";
 98: static const char *authors  = PETSC_AUTHOR_INFO;

100:  #include src/sys/src/utils/dlregis.h

102: /* --------------------------------------------------------------------------*/

104: #endif /* PETSC_USE_DYNAMIC_LIBRARIES */