42 #ifndef TEUCHOS_COMM_HPP
43 #define TEUCHOS_COMM_HPP
45 #include "Teuchos_ReductionOp.hpp"
46 #include "Teuchos_ArrayRCP.hpp"
70 template<
class OrdinalType>
80 virtual OrdinalType
getTag () = 0;
84 template<
class OrdinalType>
136 template<
class OrdinalType>
311 template<
typename Ordinal>
312 class Comm :
virtual public Describable {
319 virtual int getTag ()
const = 0;
337 virtual int getRank()
const = 0;
345 virtual int getSize()
const = 0;
355 virtual void barrier()
const = 0;
372 const int rootRank,
const Ordinal bytes,
char buffer[]
377 gather (
const Ordinal sendBytes,
const char sendBuffer[],
378 const Ordinal recvBytes,
char recvBuffer[],
379 const int root)
const = 0;
404 const Ordinal sendBytes,
const char sendBuffer[]
405 ,
const Ordinal recvBytes,
char recvBuffer[]
423 ,
const Ordinal bytes,
const char sendBuffer[],
char globalReducts[]
441 ,
const Ordinal bytes,
const char sendBuffer[],
char scanReducts[]
468 const Ordinal bytes,
const char sendBuffer[],
const int destRank
473 send (
const Ordinal bytes,
474 const char sendBuffer[],
476 const int tag)
const = 0;
498 const Ordinal bytes,
const char sendBuffer[],
const int destRank
503 ssend (
const Ordinal bytes,
504 const char sendBuffer[],
506 const int tag)
const = 0;
529 const int sourceRank,
const Ordinal bytes,
char recvBuffer[]
552 const char sendBuffer[],
554 const int tag)
const = 0;
580 const int tag)
const = 0;
604 const int sourceRank,
605 const int tag)
const = 0;
778 virtual RCP<Comm> split (
const int color,
const int key)
const = 0;
810 #endif // TEUCHOS_COMM_HPP
virtual void waitAll(const ArrayView< RCP< CommRequest< Ordinal > > > &requests) const =0
Wait on a set of communication requests.
virtual void gatherAll(const Ordinal sendBytes, const char sendBuffer[], const Ordinal recvBytes, char recvBuffer[]) const =0
Gather values from each process to collect on all processes.
virtual int getSize() const =0
Returns the number of processes that make up this communicator.
virtual int getRank() const =0
Returns the rank of this process.
virtual ~CommRequest()
Destructor; cancels the request if it is still pending.
virtual RCP< Comm > createSubcommunicator(const ArrayView< const int > &ranks) const =0
Create a subcommunicator containing the specified processes.
virtual RCP< Comm > split(const int color, const int key) const =0
Split a communicator into subcommunicators based on color and key.
virtual RCP< CommStatus< Ordinal > > wait(const Ptr< RCP< CommRequest< Ordinal > > > &request) const =0
Wait on a single communication request, and return its status.
virtual int receive(const int sourceRank, const Ordinal bytes, char recvBuffer[]) const =0
Blocking receive of data from this process to another process.
virtual void barrier() const =0
Pause every process in *this communicator until all the processes reach this point.
virtual ~Comm()
Destructor, declared virtual for safety of derived classes.
virtual RCP< CommRequest< Ordinal > > ireceive(const ArrayView< char > &recvBuffer, const int sourceRank) const =0
Non-blocking receive.
virtual void reduceAll(const ValueTypeReductionOp< Ordinal, char > &reductOp, const Ordinal bytes, const char sendBuffer[], char globalReducts[]) const =0
Global reduction.
virtual void gather(const Ordinal sendBytes, const char sendBuffer[], const Ordinal recvBytes, char recvBuffer[], const int root) const =0
Gather values from all processes to the root process.
virtual RCP< Comm > duplicate() const =0
Duplicate this communicator.
Encapsulation of the result of a receive (blocking or nonblocking).
virtual void readySend(const ArrayView< const char > &sendBuffer, const int destRank) const =0
Ready send of data from this process to another process.
virtual ~CommStatus()
Destructor (declared virtual for memory safety)
virtual void broadcast(const int rootRank, const Ordinal bytes, char buffer[]) const =0
Broadcast values from the root process to the slave processes.
Abstract interface for distributed-memory communication.
virtual OrdinalType getTag()=0
The tag of the received message.
virtual void send(const Ordinal bytes, const char sendBuffer[], const int destRank) const =0
Possibly blocking send of data from this process to another process.
virtual void ssend(const Ordinal bytes, const char sendBuffer[], const int destRank) const =0
Always blocking send of data from this process to another process.
Base class for all objects that can describe themselves.
virtual OrdinalType getSourceRank()=0
The source rank that sent the message.
Smart reference counting pointer class for automatic garbage collection.
Encapsulation of a pending nonblocking communication operation.
virtual RCP< CommRequest< Ordinal > > isend(const ArrayView< const char > &sendBuffer, const int destRank) const =0
Non-blocking send.
virtual void scan(const ValueTypeReductionOp< Ordinal, char > &reductOp, const Ordinal bytes, const char sendBuffer[], char scanReducts[]) const =0
Scan reduction.
virtual int getTag() const =0
The current tag.
Simple wrapper class for raw pointers to single objects where no persisting relationship exists...
virtual RCP< CommStatus< OrdinalType > > wait()=0
Wait on this request (a blocking operation).