Actual source code: dlregisvecscat.c

petsc-3.12.5 2020-03-29
Report Typos and Errors

  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 exclusions */
 50:   PetscOptionsGetString(NULL,NULL,"-info_exclude",logList,sizeof(logList),&opt);
 51:   if (opt) {
 52:     PetscStrInList("vecscatter",logList,',',&pkg);
 53:     if (pkg) {PetscInfoDeactivateClass(VEC_SCATTER_CLASSID);}
 54:   }
 55:   /* Process summary exclusions */
 56:   PetscOptionsGetString(NULL,NULL,"-log_exclude",logList,sizeof(logList),&opt);
 57:   if (opt) {
 58:     PetscStrInList("vecscatter",logList,',',&pkg);
 59:     if (pkg) {PetscLogEventExcludeClass(VEC_SCATTER_CLASSID);}
 60:   }
 61:   /* Register package finalizer */
 62:   PetscRegisterFinalize(VecScatterFinalizePackage);
 63:   return(0);
 64: }

 66: /* ----------------------------------------------------- */
 67: /*@C
 68:   VecScatterRegisterAll - Registers all of the vector components in the Vec package.

 70:   Not Collective

 72:   Level: advanced

 74: .seealso:  VecScatterRegister(), VecScatterRegisterDestroy(), VecScatterRegister()
 75: @*/
 76: PetscErrorCode VecScatterRegisterAll(void)
 77: {

 81:   if (VecScatterRegisterAllCalled) return(0);
 82:   VecScatterRegisterAllCalled = PETSC_TRUE;

 84:   VecScatterRegister(VECSCATTERSEQ,        VecScatterCreate_Seq);
 85:   VecScatterRegister(VECSCATTERMPI1,       VecScatterCreate_MPI1);
 86:   VecScatterRegister(VECSCATTERSF,         VecScatterCreate_SF);
 87: #if defined(PETSC_HAVE_MPI_PROCESS_SHARED_MEMORY)
 88:   VecScatterRegister(VECSCATTERMPI3,       VecScatterCreate_MPI3);
 89:   VecScatterRegister(VECSCATTERMPI3NODE,   VecScatterCreate_MPI3Node);
 90: #endif
 91:   return(0);
 92: }