Actual source code: dlregissf.c
petsc-3.6.1 2015-08-06
1: #include <petsc/private/sfimpl.h>
3: PetscClassId PETSCSF_CLASSID;
5: static PetscBool PetscSFPackageInitialized = PETSC_FALSE;
7: PetscBool PetscSFRegisterAllCalled;
11: /*@C
12: PetscSFInitializePackage - Initialize SF package
14: Logically Collective
16: Level: developer
18: .seealso: PetscSFFinalizePackage()
19: @*/
20: PetscErrorCode PetscSFInitializePackage(void)
21: {
25: if (PetscSFPackageInitialized) return(0);
26: PetscSFPackageInitialized = PETSC_TRUE;
28: PetscClassIdRegister("Star Forest Bipartite Graph",&PETSCSF_CLASSID);
29: PetscSFRegisterAll();
30: PetscLogEventRegister("SFSetGraph" , PETSCSF_CLASSID, &PETSCSF_SetGraph);
31: PetscLogEventRegister("SFBcastBegin" , PETSCSF_CLASSID, &PETSCSF_BcastBegin);
32: PetscLogEventRegister("SFBcastEnd" , PETSCSF_CLASSID, &PETSCSF_BcastEnd);
33: PetscLogEventRegister("SFReduceBegin" , PETSCSF_CLASSID, &PETSCSF_ReduceBegin);
34: PetscLogEventRegister("SFReduceEnd" , PETSCSF_CLASSID, &PETSCSF_ReduceEnd);
35: PetscLogEventRegister("SFFetchOpBegin" , PETSCSF_CLASSID, &PETSCSF_FetchAndOpBegin);
36: PetscLogEventRegister("SFFetchOpEnd" , PETSCSF_CLASSID, &PETSCSF_FetchAndOpEnd);
37: PetscRegisterFinalize(PetscSFFinalizePackage);
38: return(0);
39: }
43: /*@C
44: PetscSFFinalizePackage - Finalize PetscSF package, it is called from PetscFinalize()
46: Logically Collective
48: Level: developer
50: .seealso: PetscSFInitializePackage()
51: @*/
52: PetscErrorCode PetscSFFinalizePackage(void)
53: {
57: PetscFunctionListDestroy(&PetscSFList);
58: PetscSFPackageInitialized = PETSC_FALSE;
59: PetscSFRegisterAllCalled = PETSC_FALSE;
60: return(0);
61: }