10#ifndef TEUCHOS_DEFAULTMPICOMM_DECL_HPP
11#define TEUCHOS_DEFAULTMPICOMM_DECL_HPP
13#include "Teuchos_Comm.hpp"
28template<
class OrdinalType>
56template<
class OrdinalType>
75template<
class OrdinalType>
135template<
class OrdinalType>
168template<
class OrdinalType>
188template<
typename Ordinal>
363 const int root)
const;
388 const int tag)
const;
398 const int tag)
const;
413 const int tag)
const;
423 const int tag)
const;
433 const int tag)
const;
464 static int const minTag_ = 26000;
465 static int const maxTag_ = 26099;
496 void setupMembersFromComm();
497 static int tagCounter_;
533 void assertRank(
const int rank,
const std::string &
rankName)
const;
538#ifdef TEUCHOS_MPI_COMM_DUMP
559template<
typename Ordinal>
560RCP<MpiComm<Ordinal> >
579template<
typename Ordinal>
614template<
typename Ordinal>
Ordinal size_type
Type representing the number of elements in an ArrayRCP or view thereof.
Abstract interface for distributed-memory communication.
int rank(const Comm< Ordinal > &comm)
Get the process rank.
Encapsulation of a pending nonblocking communication operation.
Encapsulation of the result of a receive (blocking or nonblocking).
Implementation of Comm that uses MPI for communication.
virtual void reduceAll(const ValueTypeReductionOp< Ordinal, char > &reductOp, const Ordinal bytes, const char sendBuffer[], char globalReducts[]) const
MpiComm(const RCP< const OpaqueWrapper< MPI_Comm > > &rawMpiComm, const int defaultTag)
Construct an MpiComm with a wrapped MPI_Comm and a default tag.
virtual RCP< Comm< Ordinal > > createSubcommunicator(const ArrayView< const int > &ranks) const
MpiComm(const RCP< const OpaqueWrapper< MPI_Comm > > &rawMpiComm)
Construct an MpiComm with the given wrapped MPI_Comm.
RCP< MpiComm< Ordinal > > createMpiComm(const RCP< const OpaqueWrapper< MPI_Comm > > &rawMpiComm)
Helper function that creates a dynamically allocated MpiComm object or returns Teuchos::null to corre...
virtual RCP< CommRequest< Ordinal > > isend(const ArrayView< const char > &sendBuffer, const int destRank) const
int incrementTag()
Increments the tag and then returns it.
std::string description() const
int getTag() const
The current tag.
virtual void send(const Ordinal bytes, const char sendBuffer[], const int destRank, const int tag) const
virtual int getSize() const
The number of processes in the communicator.
virtual void readySend(const ArrayView< const char > &sendBuffer, const int destRank) const
virtual int receive(const int sourceRank, const Ordinal bytes, char recvBuffer[]) const
MPI_Comm getRawMpiComm(const Comm< Ordinal > &comm)
Helper function that extracts a raw MPI_Comm object out of a Teuchos::MpiComm wrapper object.
virtual void waitAll(const ArrayView< RCP< CommRequest< Ordinal > > > &requests) const
virtual RCP< CommRequest< Ordinal > > ireceive(const ArrayView< char > &Buffer, const int sourceRank) const
virtual void gatherAll(const Ordinal sendBytes, const char sendBuffer[], const Ordinal recvBytes, char recvBuffer[]) const
virtual void ssend(const Ordinal bytes, const char sendBuffer[], const int destRank, const int tag) const
Variant of ssend() that takes a message tag.
virtual RCP< Comm< Ordinal > > split(const int color, const int key) const
RCP< const OpaqueWrapper< MPI_Comm > > getRawMpiComm() const
Return the embedded wrapped opaque MPI_Comm object.
virtual RCP< Comm< Ordinal > > duplicate() const
virtual void gather(const Ordinal sendBytes, const char sendBuffer[], const Ordinal recvBytes, char recvBuffer[], const int root) const
Gather values from all processes to the root process.
virtual int getRank() const
The calling process' rank.
MpiComm(MPI_Comm rawMpiComm)
Construct an MpiComm with an MPI_Comm.
virtual void waitAll(const ArrayView< RCP< CommRequest< Ordinal > > > &requests, const ArrayView< RCP< CommStatus< Ordinal > > > &statuses) const
virtual void send(const Ordinal bytes, const char sendBuffer[], const int destRank) const
virtual RCP< CommRequest< Ordinal > > ireceive(const ArrayView< char > &Buffer, const int sourceRank, const int tag) const
MpiComm(const MpiComm< Ordinal > &other)
Construct a communicator with a new context with the same properties as the original.
RCP< MpiComm< Ordinal > > createMpiComm(const RCP< const OpaqueWrapper< MPI_Comm > > &rawMpiComm, const int defaultTag)
Helper function that creates a dynamically allocated MpiComm object or returns Teuchos::null to corre...
virtual RCP< CommStatus< Ordinal > > wait(const Ptr< RCP< CommRequest< Ordinal > > > &request) const
virtual void scan(const ValueTypeReductionOp< Ordinal, char > &reductOp, const Ordinal bytes, const char sendBuffer[], char scanReducts[]) const
virtual void ssend(const Ordinal bytes, const char sendBuffer[], const int destRank) const
void setErrorHandler(const RCP< const OpaqueWrapper< MPI_Errhandler > > &errHandler)
Set the MPI error handler for this communicator.
virtual void barrier() const
Execute a barrier; must be called collectively.
virtual void broadcast(const int rootRank, const Ordinal bytes, char buffer[]) const
virtual RCP< CommRequest< Ordinal > > isend(const ArrayView< const char > &sendBuffer, const int destRank, const int tag) const
Variant of isend() that takes a tag.
virtual void readySend(const Ordinal bytes, const char sendBuffer[], const int destRank, const int tag) const
Variant of readySend() that accepts a message tag.
Base class MPI implementation of CommRequest.
RCP< CommStatus< OrdinalType > > wait()
Wait on this communication request to complete.
bool isNull() const
Whether the raw MPI_Request is MPI_REQUEST_NULL.
RCP< CommStatus< OrdinalType > > cancel()
Cancel the communication request, and return its status.
virtual ~MpiCommRequestBase()
Destructor; cancels the request if it is still pending.
MpiCommRequestBase()
Default constructor.
MPI_Request releaseRawMpiRequest()
Return and relinquish ownership of the raw MPI_Request.
MpiCommRequestBase(MPI_Request rawMpiRequest)
Constructor (from a raw MPI_Request).
MPI implementation of CommRequest.
MpiCommRequest(MPI_Request rawMpiRequest, const ArrayView< char >::size_type numBytesInMessage)
Constructor (from a raw MPI_Request).
virtual ~MpiCommRequest()
Destructor; cancels the request if it is still pending.
MpiCommRequest()
Default constructor.
ArrayView< char >::size_type numBytes() const
Number of bytes in the nonblocking send or receive request.
MPI-specific implementation of CommStatus.
OrdinalType getSourceRank()
The source rank that sent the message.
virtual ~MpiCommStatus()
Destructor (declared virtual for memory safety)
OrdinalType getTag()
The tag of the received message.
OrdinalType getError()
The error code of the received message.
Simple wrapper class for raw pointers to single objects where no persisting relationship exists.
Smart reference counting pointer class for automatic garbage collection.
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...