10#ifndef TEUCHOS_SERIAL_COMM_HPP
11#define TEUCHOS_SERIAL_COMM_HPP
13#include "Teuchos_Comm.hpp"
25template<
class OrdinalType>
43template<
typename Ordinal>
81 const int root)
const;
106 const int tag)
const;
116 const int tag)
const;
131 const int tag)
const;
141 const int tag)
const;
151 const int tag)
const;
188template<
typename Ordinal>
202template<
typename Ordinal>
206template<
typename Ordinal>
214template<
typename Ordinal>
221template<
typename Ordinal>
228template<
typename Ordinal>
235template<
typename Ordinal>
237 const int ,
const Ordinal ,
char []
244template<
typename Ordinal>
261template<
typename Ordinal>
267 const int root)
const
281template<
typename Ordinal>
292template<
typename Ordinal>
303template<
typename Ordinal>
305 const Ordinal ,
const char [],
const int
309 true, std::logic_error
310 ,
"SerialComm<Ordinal>::send(...): Error, you can not call send(...) when you"
311 " only have one process!"
315template<
typename Ordinal>
323 true, std::logic_error
324 ,
"SerialComm<Ordinal>::send(...): Error, you can not call send(...) when you"
325 " only have one process!"
329template<
typename Ordinal>
331 const Ordinal ,
const char [],
const int
335 true, std::logic_error
336 ,
"SerialComm<Ordinal>::send(...): Error, you can not call ssend(...) when you"
337 " only have one process!"
341template<
typename Ordinal>
349 true, std::logic_error
350 ,
"SerialComm<Ordinal>::send(...): Error, you can not call ssend(...) when you"
351 " only have one process!"
355template<
typename Ordinal>
357 const int ,
const Ordinal ,
char []
361 true, std::logic_error
362 ,
"SerialComm<Ordinal>::receive(...): Error, you can not call receive(...) when you"
363 " only have one process!"
368template<
typename Ordinal>
375 true, std::logic_error
376 ,
"SerialComm<Ordinal>::readySend(...): Error, you can not call readySend(...) when you"
377 " only have one process!"
381template<
typename Ordinal>
394 true, std::logic_error
395 ,
"SerialComm<Ordinal>::readySend(...): Error, you can not call readySend(...) when you"
396 " only have one process!"
400template<
typename Ordinal>
406 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
"SerialComm<Ordinal>::isend: You cannot call isend when you only have one process." );
410template<
typename Ordinal>
417 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
"SerialComm<Ordinal>::isend: You cannot call isend when you only have one process." );
421template<
typename Ordinal>
427 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
"SerialComm<Ordinal>::ireceive: You cannot call isend when you only have one process." );
431template<
typename Ordinal>
438 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
"SerialComm<Ordinal>::ireceive: You cannot call isend when you only have one process." );
442template<
typename Ordinal>
450template<
typename Ordinal>
457 std::invalid_argument,
"Teuchos::SerialComm::waitAll: There are not enough "
458 "entries in the statuses array to hold all the results of the communication"
459 " requests. requests.size() = " <<
requests.size() <<
" > statuses.size() "
468template<
typename Ordinal>
474 "Teuchos::SerialComm::wait: On input, the request pointer is null.");
483template<
typename Ordinal>
490template<
typename Ordinal>
501template<
typename Ordinal>
515template<
typename Ordinal>
518 std::ostringstream
oss;
Defines basic traits for the ordinal field type.
Encapsulation of the result of a receive (blocking or nonblocking).
Abstract interface for distributed-memory communication.
Simple wrapper class for raw pointers to single objects where no persisting relationship exists.
Smart reference counting pointer class for automatic garbage collection.
RCP< T > rcp(const boost::shared_ptr< T > &sptr)
Conversion function that takes in a boost::shared_ptr object and spits out a Teuchos::RCP object.
bool is_null() const
Returns true if the underlying pointer is null.
T * getRawPtr() const
Get the raw C++ pointer to the underlying object.
Implementation of CommStatus for a serial communicator.
OrdinalType getSourceRank()
The source rank that sent the message (must be zero).
OrdinalType getTag()
The tag of the received message.
SerialCommStatus()
Default constructor.
Concrete serial communicator subclass.
virtual void barrier() const
virtual RCP< CommRequest< Ordinal > > ireceive(const ArrayView< char > &Buffer, const int sourceRank) const
virtual RCP< CommRequest< Ordinal > > isend(const ArrayView< const char > &sendBuffer, const int destRank) const
virtual void broadcast(const int rootRank, const Ordinal bytes, char buffer[]) const
virtual RCP< Comm< Ordinal > > createSubcommunicator(const ArrayView< const int > &ranks) const
virtual void reduceAll(const ValueTypeReductionOp< Ordinal, char > &reductOp, const Ordinal bytes, const char sendBuffer[], char globalReducts[]) 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 receive(const int sourceRank, const Ordinal bytes, char recvBuffer[]) const
int getTag() const
The current tag.
virtual void readySend(const ArrayView< const char > &sendBuffer, const int destRank) const
virtual int getSize() const
RCP< SerialComm< Ordinal > > createSerialComm()
Nonmember constructor.
virtual RCP< Comm< Ordinal > > duplicate() const
virtual void ssend(const Ordinal bytes, const char sendBuffer[], const int destRank, const int tag) const
virtual void scan(const ValueTypeReductionOp< Ordinal, char > &reductOp, const Ordinal bytes, const char sendBuffer[], char scanReducts[]) const
virtual void send(const Ordinal bytes, const char sendBuffer[], const int destRank) const
virtual RCP< CommStatus< Ordinal > > wait(const Ptr< RCP< CommRequest< Ordinal > > > &request) const
virtual void waitAll(const ArrayView< RCP< CommRequest< Ordinal > > > &requests) const
virtual RCP< Comm< Ordinal > > split(const int color, const int key) 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
std::string description() const
virtual int getRank() const
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
This macro is designed to be a short version of TEUCHOS_TEST_FOR_EXCEPTION() that is easier to call.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Macro for throwing an exception with breakpointing to ease debugging.
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Deprecated.
static std::string name()
Returns name of this ordinal type.