Actual source code: dlregisvecscat.c
petsc-3.9.4 2018-09-11
2: #include <petscvec.h>
3: #include <petsc/private/vecimpl.h>
5: static PetscBool VecScatterPackageInitialized = PETSC_FALSE;
7: /*@C
8: VecScatterFinalizePackage - This function destroys everything in the VecScatter package. It is
9: called from PetscFinalize().
11: Level: developer
13: .keywords: Petsc, destroy, package
14: .seealso: PetscFinalize()
15: @*/
16: PetscErrorCode VecScatterFinalizePackage(void)
17: {
21: PetscFunctionListDestroy(&VecScatterList);
22: VecScatterPackageInitialized = PETSC_FALSE;
23: VecScatterRegisterAllCalled = PETSC_FALSE;
24: return(0);
25: }
27: /*@C
28: VecScatterInitializePackage - This function initializes everything in the VecScatter package. It is called
29: from PetscDLLibraryRegister() when using dynamic libraries, and on the first call to VecScatterCreateXXXX()
30: when using static libraries.
32: Level: developer
34: .keywords: Vec, initialize, package
35: .seealso: PetscInitialize()
36: @*/
37: PetscErrorCode VecScatterInitializePackage(void)
38: {
39: char logList[256];
40: PetscBool opt,pkg;
44: if (VecScatterPackageInitialized) return(0);
45: VecScatterPackageInitialized = PETSC_TRUE;
46: /* Register Classes */
47: PetscClassIdRegister("Vec Scatter",&VEC_SCATTER_CLASSID);
48: /* Register Constructors */
49: VecScatterRegisterAll();
50: /* Process info exclusions */
51: PetscOptionsGetString(NULL,NULL,"-info_exclude",logList,sizeof(logList),&opt);
52: if (opt) {
53: PetscStrInList("vecscatter",logList,',',&pkg);
54: if (pkg) {PetscInfoDeactivateClass(VEC_SCATTER_CLASSID);}
55: }
56: /* Process summary exclusions */
57: PetscOptionsGetString(NULL,NULL,"-log_exclude",logList,sizeof(logList),&opt);
58: if (opt) {
59: PetscStrInList("vecscatter",logList,',',&pkg);
60: if (pkg) {PetscLogEventDeactivateClass(VEC_SCATTER_CLASSID);}
61: }
62: /* Register package finalizer */
63: PetscRegisterFinalize(VecScatterFinalizePackage);
64: return(0);
65: }
67: /* ----------------------------------------------------- */
68: /*@C
69: VecScatterRegisterAll - Registers all of the vector components in the Vec package.
71: Not Collective
73: Level: advanced
75: .keywords: Vec, register, all
76: .seealso: VecScatterRegister(), VecScatterRegisterDestroy(), VecScatterRegister()
77: @*/
78: PetscErrorCode VecScatterRegisterAll(void)
79: {
83: if (VecScatterRegisterAllCalled) return(0);
84: VecScatterRegisterAllCalled = PETSC_TRUE;
86: VecScatterRegister(VECSCATTERSEQ, VecScatterCreate_Seq);
87: VecScatterRegister(VECSCATTERMPI1, VecScatterCreate_MPI1);
88: VecScatterRegister(VECSCATTERMPI3, VecScatterCreate_MPI3);
89: VecScatterRegister(VECSCATTERMPI3NODE, VecScatterCreate_MPI3Node);
90: return(0);
91: }