Actual source code: dlregisvecscat.c
petsc-3.14.6 2021-03-30
2: #include <petscvec.h>
3: #include <petsc/private/vecscatterimpl.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: .seealso: PetscFinalize()
14: @*/
15: PetscErrorCode VecScatterFinalizePackage(void)
16: {
20: PetscFunctionListDestroy(&VecScatterList);
21: VecScatterPackageInitialized = PETSC_FALSE;
22: VecScatterRegisterAllCalled = PETSC_FALSE;
23: return(0);
24: }
26: /*@C
27: VecScatterInitializePackage - This function initializes everything in the VecScatter package. It is called
28: on the first call to VecScatterCreateXXXX().
30: Level: developer
32: Developers Note: this does not seem to get called directly when using dynamic libraries.
34: .seealso: PetscInitialize()
35: @*/
36: PetscErrorCode VecScatterInitializePackage(void)
37: {
38: char logList[256];
39: PetscBool opt,pkg;
43: if (VecScatterPackageInitialized) return(0);
44: VecScatterPackageInitialized = PETSC_TRUE;
45: /* Register Classes */
46: PetscClassIdRegister("Vec Scatter",&VEC_SCATTER_CLASSID);
47: /* Register Constructors */
48: VecScatterRegisterAll();
49: /* Process Info */
50: {
51: PetscClassId classids[1];
53: classids[0] = VEC_SCATTER_CLASSID;
54: PetscInfoProcessClass("vecscatter", 1, classids);
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) {PetscLogEventExcludeClass(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: .seealso: VecScatterRegister(), VecScatterRegisterDestroy(), VecScatterRegister()
76: @*/
77: PetscErrorCode VecScatterRegisterAll(void)
78: {
82: if (VecScatterRegisterAllCalled) return(0);
83: VecScatterRegisterAllCalled = PETSC_TRUE;
85: VecScatterRegister(VECSCATTERSEQ, VecScatterCreate_Seq);
86: VecScatterRegister(VECSCATTERMPI1, VecScatterCreate_MPI1);
87: VecScatterRegister(VECSCATTERSF, VecScatterCreate_SF);
88: #if defined(PETSC_HAVE_MPI_PROCESS_SHARED_MEMORY)
89: VecScatterRegister(VECSCATTERMPI3, VecScatterCreate_MPI3);
90: VecScatterRegister(VECSCATTERMPI3NODE, VecScatterCreate_MPI3Node);
91: #endif
92: return(0);
93: }