28 #include <queso/Defines.h> 
   30 #ifdef QUESO_HAS_TRILINOS 
   31 #include <Epetra_MpiComm.h> 
   44 typedef MPI_Datatype data_type ;
 
   47 #define RawValue_MPI_COMM_SELF  MPI_COMM_SELF 
   48 #define RawValue_MPI_ANY_SOURCE MPI_ANY_SOURCE 
   49 #define RawValue_MPI_CHAR       MPI_CHAR 
   50 #define RawValue_MPI_INT        MPI_INT 
   51 #define RawValue_MPI_DOUBLE     MPI_DOUBLE 
   52 #define RawValue_MPI_UNSIGNED   MPI_UNSIGNED 
   53 #define RawValue_MPI_MIN        MPI_MIN 
   54 #define RawValue_MPI_MAX        MPI_MAX 
   55 #define RawValue_MPI_SUM        MPI_SUM 
   63 #define RawValue_MPI_COMM_SELF   0 
   64 #define RawValue_MPI_ANY_SOURCE -1 
   65 #define RawValue_MPI_CHAR        0 
   66 #define RawValue_MPI_INT         1 
   67 #define RawValue_MPI_DOUBLE      2 
   68 #define RawValue_MPI_UNSIGNED    3 
   69 #define RawValue_MPI_MIN         0 
   70 #define RawValue_MPI_MAX         1 
   71 #define RawValue_MPI_SUM         2 
  141 template <
typename T>
 
  144 #ifdef QUESO_HAS_CXX11  // This macro isn't defined (yet) 
  146   static_assert(dependent_false<T>::value,
 
  147                 "Only specializations of StandardType may be used, did you forget to include a header file (e.g. parallel_algebra.h)?");
 
  162 #define QUESO_STANDARD_TYPE(cxxtype,mpitype)                                  \ 
  164   class StandardType<cxxtype> : public DataType                         \ 
  168       StandardType(const cxxtype* = NULL) : DataType(mpitype) {}        \ 
  173 #define QUESO_STANDARD_TYPE(cxxtype,mpitype)                          \ 
  175   class StandardType<cxxtype> : public DataType                 \ 
  179       StandardType(const cxxtype* = NULL) : DataType() {}       \ 
  189 class BaseEnvironment;
 
  267                                RawType_MPI_Op op, 
const char* whereMsg, 
const char* whatMsg) 
const;
 
  276   template <
typename T>
 
  278                  const char* whereMsg, 
const char* whatMsg) 
const;
 
  292                                const char* whereMsg, 
const char* whatMsg) 
const;
 
  308                                const char* whereMsg, 
const char* whatMsg) 
const;
 
  318   template <
typename T>
 
  319   void Gather(
const T * sendbuf, 
int sendcnt, T * recvbuf, 
int recvcount, 
int root,
 
  320               const char * whereMsg, 
const char * whatMsg) 
const;
 
  335                                const char* whereMsg, 
const char* whatMsg) 
const;
 
  348   template <
typename T>
 
  349   void Gatherv(
const T * sendbuf, 
int sendcnt, T * recvbuf, 
int * recvcnts,
 
  350                int * displs, 
int root, 
const char * whereMsg,
 
  351                const char * whatMsg) 
const;
 
  361                                const char* whereMsg, 
const char* whatMsg) 
const;
 
  370                                const char* whereMsg, 
const char* whatMsg) 
const;
 
  375   void               syncPrintDebugMsg(
const char* msg, 
unsigned int msgVerbosity, 
unsigned int numUSecs) 
const;
 
  378 #ifdef QUESO_HAS_TRILINOS 
  379   const Epetra_MpiComm& epetraMpiComm() 
const;
 
  394 #ifdef QUESO_HAS_TRILINOS 
  397   Epetra_MpiComm*               m_epetraMpiComm;
 
  414 #endif // UQ_MPI_COMM_H 
int NumProc() const 
Returns total number of processes. 
 
RawType_MPI_Comm Comm() const 
Extract MPI Communicator from a MpiComm object. 
 
void Barrier() const 
Pause every process in *this communicator until all the processes reach this point. 
 
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
 
int MyPID() const 
Return my process ID. 
 
void Send(void *buf, int count, RawType_MPI_Datatype datatype, int dest, int tag, const char *whereMsg, const char *whatMsg) const 
Possibly blocking send of data from this process to another process. 
 
DataType(const RawType_MPI_Datatype &type)
 
void Gatherv(void *sendbuf, int sendcnt, RawType_MPI_Datatype sendtype, void *recvbuf, int *recvcnts, int *displs, RawType_MPI_Datatype recvtype, int root, const char *whereMsg, const char *whatMsg) const 
Gathers into specified locations from all processes in a group. 
 
and that you are informed that you can do these things To protect your we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it For example
 
MpiComm()
Default Constructor. 
 
StandardType(const T *example=NULL)
 
int m_worldRank
World rank. 
 
int m_myPid
Process ID of this process. 
 
QUESO_STANDARD_TYPE(char, MPI_CHAR)
 
DataType(const DataType &, unsigned int)
 
RawType_MPI_Comm m_rawComm
Embedded wrapped opaque MPI_Comm object. 
 
void syncPrintDebugMsg(const char *msg, unsigned int msgVerbosity, unsigned int numUSecs) const 
Synchronizes all the processes and print debug message. 
 
The QUESO MPI Communicator Class. 
 
void Recv(void *buf, int count, RawType_MPI_Datatype datatype, int source, int tag, RawType_MPI_Status *status, const char *whereMsg, const char *whatMsg) const 
Blocking receive of data from this process to another process. 
 
MpiComm & operator=(const MpiComm &rhs)
Assignment operator. 
 
void Gather(void *sendbuf, int sendcnt, RawType_MPI_Datatype sendtype, void *recvbuf, int recvcount, RawType_MPI_Datatype recvtype, int root, const char *whereMsg, const char *whatMsg) const 
Gather values from each process to collect on all processes. 
 
RawType_MPI_Datatype _datatype
 
void Allreduce(void *sendbuf, void *recvbuf, int count, RawType_MPI_Datatype datatype, RawType_MPI_Op op, const char *whereMsg, const char *whatMsg) const 
Combines values from all processes and distributes the result back to all processes. 
 
void copy(const MpiComm &src)
Copies from an existing MpiComm instance. 
 
const BaseEnvironment & m_env
 
DataType & operator=(const DataType &other)
 
DataType(const DataType &other)
 
void Bcast(void *buffer, int count, RawType_MPI_Datatype datatype, int root, const char *whereMsg, const char *whatMsg) const 
Broadcast values from the root process to the slave processes.