Actual source code: threadcommregi.c

petsc-3.3-p7 2013-05-11
  1: 
  2: #include <petsc-private/threadcommimpl.h>     /*I    "petscthreadcomm.h"  I*/

  4: EXTERN_C_BEGIN
  5: extern PetscErrorCode PetscThreadCommCreate_NoThread(PetscThreadComm);
  6: #if defined(PETSC_HAVE_PTHREADCLASSES)
  7: extern PetscErrorCode PetscThreadCommCreate_PThread(PetscThreadComm);
  8: #endif
  9: #if defined(PETSC_HAVE_OPENMP)
 10: extern PetscErrorCode PetscThreadCommCreate_OpenMP(PetscThreadComm);
 11: #endif
 12: EXTERN_C_END

 14: extern PetscBool PetscThreadCommRegisterAllCalled;

 18: /*@C
 19:    PetscThreadCommRegisterAll - Registers of all the thread communicator models

 21:    Not Collective

 23:    Level: advanced

 25: .keywords: PetscThreadComm, register, all

 27: .seealso: PetscThreadCommRegisterDestroy()
 28: @*/
 29: PetscErrorCode PetscThreadCommRegisterAll(const char path[])
 30: {

 34:   PetscThreadCommRegisterAllCalled = PETSC_TRUE;
 35:   PetscThreadCommRegisterDynamic(NOTHREAD,         path,"PetscThreadCommCreate_NoThread",         PetscThreadCommCreate_NoThread);
 36: #if defined(PETSC_HAVE_PTHREADCLASSES)
 37:   PetscThreadCommRegisterDynamic(PTHREAD,          path,"PetscThreadCommCreate_PThread",          PetscThreadCommCreate_PThread);
 38: #endif
 39: #if defined(PETSC_HAVE_OPENMP)
 40:   PetscThreadCommRegisterDynamic(OPENMP,         path,"PetscThreadCommCreate_OpenMP",         PetscThreadCommCreate_OpenMP);
 41: #endif

 43:   return(0);
 44: }