Actual source code: dlregissf.c

petsc-3.8.2 2017-11-09
Report Typos and Errors
  1:  #include <petsc/private/sfimpl.h>

  3: PetscClassId PETSCSF_CLASSID;

  5: static PetscBool PetscSFPackageInitialized = PETSC_FALSE;

  7: PetscBool PetscSFRegisterAllCalled;

  9: /*@C
 10:    PetscSFInitializePackage - Initialize SF package

 12:    Logically Collective

 14:    Level: developer

 16: .seealso: PetscSFFinalizePackage()
 17: @*/
 18: PetscErrorCode PetscSFInitializePackage(void)
 19: {

 23:   if (PetscSFPackageInitialized) return(0);
 24:   PetscSFPackageInitialized = PETSC_TRUE;

 26:   PetscClassIdRegister("Star Forest Graph",&PETSCSF_CLASSID);
 27:   PetscSFRegisterAll();
 28:   PetscLogEventRegister("SFSetGraph"     , PETSCSF_CLASSID, &PETSCSF_SetGraph);
 29:   PetscLogEventRegister("SFBcastBegin"   , PETSCSF_CLASSID, &PETSCSF_BcastBegin);
 30:   PetscLogEventRegister("SFBcastEnd"     , PETSCSF_CLASSID, &PETSCSF_BcastEnd);
 31:   PetscLogEventRegister("SFReduceBegin"  , PETSCSF_CLASSID, &PETSCSF_ReduceBegin);
 32:   PetscLogEventRegister("SFReduceEnd"    , PETSCSF_CLASSID, &PETSCSF_ReduceEnd);
 33:   PetscLogEventRegister("SFFetchOpBegin" , PETSCSF_CLASSID, &PETSCSF_FetchAndOpBegin);
 34:   PetscLogEventRegister("SFFetchOpEnd"   , PETSCSF_CLASSID, &PETSCSF_FetchAndOpEnd);
 35:   PetscRegisterFinalize(PetscSFFinalizePackage);
 36:   return(0);
 37: }

 39: /*@C
 40:    PetscSFFinalizePackage - Finalize PetscSF package, it is called from PetscFinalize()

 42:    Logically Collective

 44:    Level: developer

 46: .seealso: PetscSFInitializePackage()
 47: @*/
 48: PetscErrorCode PetscSFFinalizePackage(void)
 49: {

 53:   PetscFunctionListDestroy(&PetscSFList);
 54:   PetscSFPackageInitialized = PETSC_FALSE;
 55:   PetscSFRegisterAllCalled  = PETSC_FALSE;
 56:   return(0);
 57: }