Actual source code: dlregisvecscat.c

petsc-3.11.4 2019-09-28
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: .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:   on the first call to VecScatterCreateXXXX().

 31:   Level: developer

 33:   Developers Note: this does not seem to get called directly when useing dynamic libraries.

 35: .keywords: Vec, initialize, package
 36: .seealso: PetscInitialize()
 37: @*/
 38: PetscErrorCode VecScatterInitializePackage(void)
 39: {
 40:   char           logList[256];
 41:   PetscBool      opt,pkg;

 45:   if (VecScatterPackageInitialized) return(0);
 46:   VecScatterPackageInitialized = PETSC_TRUE;
 47:   /* Register Classes */
 48:   PetscClassIdRegister("Vec Scatter",&VEC_SCATTER_CLASSID);
 49:   /* Register Constructors */
 50:   VecScatterRegisterAll();
 51:   /* Process info exclusions */
 52:   PetscOptionsGetString(NULL,NULL,"-info_exclude",logList,sizeof(logList),&opt);
 53:   if (opt) {
 54:     PetscStrInList("vecscatter",logList,',',&pkg);
 55:     if (pkg) {PetscInfoDeactivateClass(VEC_SCATTER_CLASSID);}
 56:   }
 57:   /* Process summary exclusions */
 58:   PetscOptionsGetString(NULL,NULL,"-log_exclude",logList,sizeof(logList),&opt);
 59:   if (opt) {
 60:     PetscStrInList("vecscatter",logList,',',&pkg);
 61:     if (pkg) {PetscLogEventExcludeClass(VEC_SCATTER_CLASSID);}
 62:   }
 63:   /* Register package finalizer */
 64:   PetscRegisterFinalize(VecScatterFinalizePackage);
 65:   return(0);
 66: }

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

 72:   Not Collective

 74:   Level: advanced

 76: .keywords: Vec, register, all
 77: .seealso:  VecScatterRegister(), VecScatterRegisterDestroy(), VecScatterRegister()
 78: @*/
 79: PetscErrorCode VecScatterRegisterAll(void)
 80: {

 84:   if (VecScatterRegisterAllCalled) return(0);
 85:   VecScatterRegisterAllCalled = PETSC_TRUE;

 87:   VecScatterRegister(VECSCATTERSEQ,        VecScatterCreate_Seq);
 88:   VecScatterRegister(VECSCATTERMPI1,       VecScatterCreate_MPI1);
 89:   VecScatterRegister(VECSCATTERSF,         VecScatterCreate_SF);
 90: #if defined(PETSC_HAVE_MPI_WIN_CREATE_FEATURE)
 91:   VecScatterRegister(VECSCATTERMPI3,       VecScatterCreate_MPI3);
 92:   VecScatterRegister(VECSCATTERMPI3NODE,   VecScatterCreate_MPI3Node);
 93: #endif
 94:   return(0);
 95: }