#include <Teuchos_Comm.hpp>
Inheritance diagram for Teuchos::Comm< Ordinal >:

Public Member Functions | |
Query functions | |
| virtual int | getRank () const =0 |
| Returns the rank of this process. | |
| virtual int | getSize () const =0 |
| Returns the number of processes that make up this communicator. | |
Collective Operations | |
| virtual void | barrier () const =0 |
Pause every process in *this communicator until all the processes reach this point. | |
| virtual void | broadcast (const int rootRank, const Ordinal bytes, char buffer[]) const =0 |
| Broadcast values from the root process to the slave processes. | |
| 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 void | reduceAll (const ValueTypeReductionOp< Ordinal, char > &reductOp, const Ordinal bytes, const char sendBuffer[], char globalReducts[]) const =0 |
| Global reduction. | |
| virtual void | reduceAllAndScatter (const ValueTypeReductionOp< Ordinal, char > &reductOp, const Ordinal sendBytes, const char sendBuffer[], const Ordinal recvCounts[], const Ordinal blockSize, char myGlobalReducts[]) const =0 |
| Global reduction combined with a scatter. | |
| virtual void | scan (const ValueTypeReductionOp< Ordinal, char > &reductOp, const Ordinal bytes, const char sendBuffer[], char scanReducts[]) const =0 |
| Scan reduction. | |
Point-to-Point Operations | |
| virtual void | send (const Ordinal bytes, const char sendBuffer[], const int destRank) const =0 |
| Blocking send of data from this process to another process. | |
| virtual int | receive (const int sourceRank, const Ordinal bytes, char recvBuffer[]) const =0 |
| Blocking receive of data from this process to another process. | |
Related Functions | |
| (Note that these are not member functions.) | |
| enum | EReductionType { REDUCE_SUM, REDUCE_MIN, REDUCE_MAX, REDUCE_AND } |
| Enumeration for selecting from a set of pre-defined reduction operations. More... | |
| int | rank (const Comm< Ordinal > &comm) |
| Get the process rank. | |
| int | size (const Comm< Ordinal > &comm) |
| Get the number of processes in the communicator. | |
| void | barrier (const Comm< Ordinal > &comm) |
| Barrier. | |
| void | broadcast (const Comm< Ordinal > &comm, const int rootRank, const Ordinal count, Packet buffer[]) |
| Broadcast array of objects that use value semantics. | |
| void | broadcast (const Comm< Ordinal > &comm, const int rootRank, Packet *object) |
| Broadcast single object that use value semantics. | |
| void | broadcast (const Comm< Ordinal > &comm, const Serializer< Ordinal, Packet > &serializer, const int rootRank, const Ordinal count, Packet *const buffer[]) |
| Broadcast array of objects that use reference semantics. | |
| void | gatherAll (const Comm< Ordinal > &comm, const Ordinal sendCount, const Packet sendBuffer[], const Ordinal recvCount, Packet recvBuffer[]) |
| Gather array of objects that use value semantics from every process to every process. | |
| void | gatherAll (const Comm< Ordinal > &comm, const Serializer< Ordinal, Packet > &serializer, const Ordinal sendCount, const Packet *const sendBuffer[], const Ordinal recvCount, Packet *const recvBuffer[]) |
| Gather array of objects that use reference semantics from every process to every process. | |
| void | reduceAll (const Comm< Ordinal > &comm, const ValueTypeReductionOp< Ordinal, Packet > &reductOp, const Ordinal count, const Packet sendBuffer[], Packet globalReducts[]) |
| Collective reduce all of array of objects using value semantics using a user-defined reduction operator. | |
| void | reduceAll (const Comm< Ordinal > &comm, const EReductionType reductType, const Ordinal count, const Packet sendBuffer[], Packet globalReducts[]) |
| Collective reduce all of array of objects using value semantics using a pre-defined reduction type. | |
| void | reduceAll (const Comm< Ordinal > &comm, const EReductionType reductType, const Packet &send, Packet *globalReduct) |
| Collective reduce all for single object using value semantics using a pre-defined reduction type. | |
| void | reduceAll (const Comm< Ordinal > &comm, const Serializer< Ordinal, Packet > &serializer, const ReferenceTypeReductionOp< Ordinal, Packet > &reductOp, const Ordinal count, const Packet *const sendBuffer[], Packet *const globalReducts[]) |
| Collective reduce all for array of objects using reference semantics. | |
| void | reduceAllAndScatter (const Comm< Ordinal > &comm, const ValueTypeReductionOp< Ordinal, Packet > &reductOp, const Ordinal sendCount, const Packet sendBuffer[], const Ordinal recvCounts[], Packet myGlobalReducts[]) |
| Reduce and Scatter array of objects that use value semantics using a user-defined reduction object. | |
| void | reduceAllAndScatter (const Comm< Ordinal > &comm, const EReductionType reductType, const Ordinal sendCount, const Packet sendBuffer[], const Ordinal recvCounts[], Packet myGlobalReducts[]) |
| Reduce and Scatter array of objects that use value semantics using a a pre-defined reduction type. | |
| void | reduceAllAndScatter (const Comm< Ordinal > &comm, const Serializer< Ordinal, Packet > &serializer, const ReferenceTypeReductionOp< Ordinal, Packet > &reductOp, const Ordinal sendCount, const Packet *const sendBuffer[], const Ordinal recvCounts[], Packet *const myGlobalReducts[]) |
| Reduce and Scatter array of objects that use reference semantics using a user-defined reduction object. | |
| void | scan (const Comm< Ordinal > &comm, const ValueTypeReductionOp< Ordinal, Packet > &reductOp, const Ordinal count, const Packet sendBuffer[], Packet scanReducts[]) |
| Scan/Reduce array of objects that use value semantics using a user-defined reduction operator. | |
| void | scan (const Comm< Ordinal > &comm, const EReductionType reductType, const Ordinal count, const Packet sendBuffer[], Packet scanReducts[]) |
| Scan/Reduce array of objects using value semantics using a predefined reduction type. | |
| void | scan (const Comm< Ordinal > &comm, const EReductionType reductType, const Packet &send, Packet *scanReduct) |
| Scan/Reduce single object using value semantics using a predefined reduction type. | |
| void | scan (const Comm< Ordinal > &comm, const Serializer< Ordinal, Packet > &serializer, const ReferenceTypeReductionOp< Ordinal, Packet > &reductOp, const Ordinal count, const Packet *const sendBuffer[], Packet *const scanReducts[]) |
| Scan/Reduce array of objects that use reference semantics using a user-defined reduction operator. | |
| void | send (const Comm< Ordinal > &comm, const Ordinal count, const Packet sendBuffer[], const int destRank) |
| Send objects that use values semantics to another process. | |
| void | send (const Comm< Ordinal > &comm, const Packet &send, const int destRank) |
| Send a single object that use values semantics to another process. | |
| void | send (const Comm< Ordinal > &comm, const Serializer< Ordinal, Packet > &serializer, const Ordinal count, const Packet *const sendBuffer[], const int destRank) |
| Send objects that use reference semantics to another process. | |
| int | receive (const Comm< Ordinal > &comm, const int sourceRank, const Ordinal count, Packet recvBuffer[]) |
| Receive objects that use values semantics from another process. | |
| int | receive (const Comm< Ordinal > &comm, const int sourceRank, Packet *recv) |
| Receive a single object that use values semantics from another process. | |
| int | receive (const Comm< Ordinal > &comm, const Serializer< Ordinal, Packet > &serializer, const int sourceRank, const Ordinal count, Packet *const recvBuffer[]) |
| Receive objects that use reference semantics from another process. | |
This interface is templated on the ordinal type but only deals with buffers of untyped data represented as arrays char type. All reduction operations that are initiated by the concreate communicator object are performed by user-defined ReductOpBase objects. It is the responsibility of the ReductOpBase object to know what the currect data type is, to perform casts or serializations/unserializations to and from char[] buffers, and to know how to reduce the objects correctly. It is strictly up to the client to correctly convert data types to char[] arrays but there is a great deal of helper code to make this easy and safe.
ToDo: Finish documentation!
Definition at line 53 of file Teuchos_Comm.hpp.
| virtual int Teuchos::Comm< Ordinal >::getRank | ( | ) | const [pure virtual] |
Returns the rank of this process.
Postconditions:
0 <= return && return < this->getSize() Implemented in Teuchos::MpiComm< Ordinal >, and Teuchos::SerialComm< Ordinal >.
| virtual int Teuchos::Comm< Ordinal >::getSize | ( | ) | const [pure virtual] |
Returns the number of processes that make up this communicator.
Postconditions:
return > 0 Implemented in Teuchos::MpiComm< Ordinal >, and Teuchos::SerialComm< Ordinal >.
| virtual void Teuchos::Comm< Ordinal >::barrier | ( | ) | const [pure virtual] |
Pause every process in *this communicator until all the processes reach this point.
Implemented in Teuchos::MpiComm< Ordinal >, and Teuchos::SerialComm< Ordinal >.
| virtual void Teuchos::Comm< Ordinal >::broadcast | ( | const int | rootRank, | |
| const Ordinal | bytes, | |||
| char | buffer[] | |||
| ) | const [pure virtual] |
Broadcast values from the root process to the slave processes.
| rootRank | [in] The rank of the root process. | |
| count | [in] The number of bytes in buffer[]. | |
| buffer | [in/out] Array (length bytes) of packed data. Must be set on input on the root processes with rank root. On output, each processs, including the root process contains the data. |
0 <= rootRank && rootRank < this->getSize() Implemented in Teuchos::MpiComm< Ordinal >, and Teuchos::SerialComm< Ordinal >.
| virtual void Teuchos::Comm< Ordinal >::gatherAll | ( | const Ordinal | sendBytes, | |
| const char | sendBuffer[], | |||
| const Ordinal | recvBytes, | |||
| char | recvBuffer[] | |||
| ) | const [pure virtual] |
Gather values from each process to collect on all processes.
| sendBytes | [in] Number of entires in sendBuffer[] on input. | |
| sendBuffer | [in] Array (length sendBytes) of data being sent from each process. | |
| recvBytes | [in] Number of entires in recvBuffer[] which must be equal to sendBytes*this->getSize(). This field is just here for debug checking. | |
| recvBuffer | [out] Array (length recvBytes) of all of the entires sent from each processes. Specifically, recvBuffer[sendBytes*j+i], for j=0...this->getSize()-1 and i=0...sendBytes-1, is the entry sendBuffer[i] from process with rank j. |
recvBytes==sendBytes*this->getSize() Implemented in Teuchos::MpiComm< Ordinal >, and Teuchos::SerialComm< Ordinal >.
| virtual void Teuchos::Comm< Ordinal >::reduceAll | ( | const ValueTypeReductionOp< Ordinal, char > & | reductOp, | |
| const Ordinal | bytes, | |||
| const char | sendBuffer[], | |||
| char | globalReducts[] | |||
| ) | const [pure virtual] |
Global reduction.
| reductOp | [in] The user-defined reduction operation | |
| bytes | [in] The length of the buffers sendBuffer[] and globalReducts[]. | |
| sendBuffer | [in] Array (length bytes) of the data contributed from each process. | |
| globalReducts | [out] Array (length bytes) of the global reduction from each process. |
Implemented in Teuchos::MpiComm< Ordinal >, and Teuchos::SerialComm< Ordinal >.
| virtual void Teuchos::Comm< Ordinal >::reduceAllAndScatter | ( | const ValueTypeReductionOp< Ordinal, char > & | reductOp, | |
| const Ordinal | sendBytes, | |||
| const char | sendBuffer[], | |||
| const Ordinal | recvCounts[], | |||
| const Ordinal | blockSize, | |||
| char | myGlobalReducts[] | |||
| ) | const [pure virtual] |
Global reduction combined with a scatter.
| reductOp | [in] The user-defined reduction operation. | |
| sendBytes | [in] The number of entires in sendBuffer[]. This must be the same in each process. | |
| sendBuffer | [in] Array (length sendBytes) of the data contributed from each process. | |
| recvCounts | [in] Array (length this->getSize()) which gives the number of element blocks of block size blockSize from the global reduction that will be recieved in each process. | |
| blockSize | [in] Gives the block size for interpreting recvCount | |
| myGlobalReducts | [out] Array (length blockSize*recvBytes[rank]) of the global reductions gathered in this process. |
sendBytes == blockSize*sum(recvCounts[i],i=0...this->getSize()-1) Implemented in Teuchos::MpiComm< Ordinal >, and Teuchos::SerialComm< Ordinal >.
| virtual void Teuchos::Comm< Ordinal >::scan | ( | const ValueTypeReductionOp< Ordinal, char > & | reductOp, | |
| const Ordinal | bytes, | |||
| const char | sendBuffer[], | |||
| char | scanReducts[] | |||
| ) | const [pure virtual] |
Scan reduction.
| reductOp | [in] The user-defined reduction operation | |
| bytes | [in] The length of the buffers sendBuffer[] and scanReducts[]. | |
| sendBuffer | [in] Array (length bytes) of the data contributed from each process. | |
| scanReducts | [out] Array (length bytes) of the reduction up to and including this process. |
Implemented in Teuchos::MpiComm< Ordinal >, and Teuchos::SerialComm< Ordinal >.
| virtual void Teuchos::Comm< Ordinal >::send | ( | const Ordinal | bytes, | |
| const char | sendBuffer[], | |||
| const int | destRank | |||
| ) | const [pure virtual] |
Blocking send of data from this process to another process.
| bytes | [in] The number of bytes of data being passed between processes. | |
| sendBuffer | [in] Array (length bytes) of data being sent from this process. This buffer can be immediately destroyed or reused as soon as the function exits (that is why this function is "blocking"). | |
| destRank | [in] The rank of the process to recieve the data. |
Implemented in Teuchos::MpiComm< Ordinal >, and Teuchos::SerialComm< Ordinal >.
| virtual int Teuchos::Comm< Ordinal >::receive | ( | const int | sourceRank, | |
| const Ordinal | bytes, | |||
| char | recvBuffer[] | |||
| ) | const [pure virtual] |
Blocking receive of data from this process to another process.
| sourceRank | [in] The rank of the process to recieve the data from. If sourceRank < 0 then data will be recieved from any process. | |
| bytes | [in] The number of bytes of data being passed between processes. | |
| recvBuffer | [out] Array (length bytes) of data being received from this process. This buffer can be immediately used to access the data as soon as the function exits (that is why this function is "blocking"). |
Implemented in Teuchos::MpiComm< Ordinal >, and Teuchos::SerialComm< Ordinal >.
enum EReductionType [related] |
Enumeration for selecting from a set of pre-defined reduction operations.
Definition at line 53 of file Teuchos_CommHelpers.hpp.
| int rank | ( | const Comm< Ordinal > & | comm | ) | [related] |
| int size | ( | const Comm< Ordinal > & | comm | ) | [related] |
Get the number of processes in the communicator.
Definition at line 642 of file Teuchos_CommHelpers.hpp.
| void barrier | ( | const Comm< Ordinal > & | comm | ) | [related] |
| void broadcast | ( | const Comm< Ordinal > & | comm, | |
| const int | rootRank, | |||
| const Ordinal | count, | |||
| Packet | buffer[] | |||
| ) | [related] |
Broadcast array of objects that use value semantics.
Definition at line 659 of file Teuchos_CommHelpers.hpp.
| void broadcast | ( | const Comm< Ordinal > & | comm, | |
| const int | rootRank, | |||
| Packet * | object | |||
| ) | [related] |
Broadcast single object that use value semantics.
Definition at line 677 of file Teuchos_CommHelpers.hpp.
| void broadcast | ( | const Comm< Ordinal > & | comm, | |
| const Serializer< Ordinal, Packet > & | serializer, | |||
| const int | rootRank, | |||
| const Ordinal | count, | |||
| Packet *const | buffer[] | |||
| ) | [related] |
Broadcast array of objects that use reference semantics.
Definition at line 686 of file Teuchos_CommHelpers.hpp.
| void gatherAll | ( | const Comm< Ordinal > & | comm, | |
| const Ordinal | sendCount, | |||
| const Packet | sendBuffer[], | |||
| const Ordinal | recvCount, | |||
| Packet | recvBuffer[] | |||
| ) | [related] |
Gather array of objects that use value semantics from every process to every process.
Definition at line 704 of file Teuchos_CommHelpers.hpp.
| void gatherAll | ( | const Comm< Ordinal > & | comm, | |
| const Serializer< Ordinal, Packet > & | serializer, | |||
| const Ordinal | sendCount, | |||
| const Packet *const | sendBuffer[], | |||
| const Ordinal | recvCount, | |||
| Packet *const | recvBuffer[] | |||
| ) | [related] |
Gather array of objects that use reference semantics from every process to every process.
Definition at line 726 of file Teuchos_CommHelpers.hpp.
| void reduceAll | ( | const Comm< Ordinal > & | comm, | |
| const ValueTypeReductionOp< Ordinal, Packet > & | reductOp, | |||
| const Ordinal | count, | |||
| const Packet | sendBuffer[], | |||
| Packet | globalReducts[] | |||
| ) | [related] |
Collective reduce all of array of objects using value semantics using a user-defined reduction operator.
Definition at line 736 of file Teuchos_CommHelpers.hpp.
| void reduceAll | ( | const Comm< Ordinal > & | comm, | |
| const EReductionType | reductType, | |||
| const Ordinal | count, | |||
| const Packet | sendBuffer[], | |||
| Packet | globalReducts[] | |||
| ) | [related] |
Collective reduce all of array of objects using value semantics using a pre-defined reduction type.
Definition at line 759 of file Teuchos_CommHelpers.hpp.
| void reduceAll | ( | const Comm< Ordinal > & | comm, | |
| const EReductionType | reductType, | |||
| const Packet & | send, | |||
| Packet * | globalReduct | |||
| ) | [related] |
Collective reduce all for single object using value semantics using a pre-defined reduction type.
Definition at line 775 of file Teuchos_CommHelpers.hpp.
| void reduceAll | ( | const Comm< Ordinal > & | comm, | |
| const Serializer< Ordinal, Packet > & | serializer, | |||
| const ReferenceTypeReductionOp< Ordinal, Packet > & | reductOp, | |||
| const Ordinal | count, | |||
| const Packet *const | sendBuffer[], | |||
| Packet *const | globalReducts[] | |||
| ) | [related] |
Collective reduce all for array of objects using reference semantics.
Definition at line 784 of file Teuchos_CommHelpers.hpp.
| void reduceAllAndScatter | ( | const Comm< Ordinal > & | comm, | |
| const ValueTypeReductionOp< Ordinal, Packet > & | reductOp, | |||
| const Ordinal | sendCount, | |||
| const Packet | sendBuffer[], | |||
| const Ordinal | recvCounts[], | |||
| Packet | myGlobalReducts[] | |||
| ) | [related] |
Reduce and Scatter array of objects that use value semantics using a user-defined reduction object.
Definition at line 808 of file Teuchos_CommHelpers.hpp.
| void reduceAllAndScatter | ( | const Comm< Ordinal > & | comm, | |
| const EReductionType | reductType, | |||
| const Ordinal | sendCount, | |||
| const Packet | sendBuffer[], | |||
| const Ordinal | recvCounts[], | |||
| Packet | myGlobalReducts[] | |||
| ) | [related] |
Reduce and Scatter array of objects that use value semantics using a a pre-defined reduction type.
Definition at line 842 of file Teuchos_CommHelpers.hpp.
| void reduceAllAndScatter | ( | const Comm< Ordinal > & | comm, | |
| const Serializer< Ordinal, Packet > & | serializer, | |||
| const ReferenceTypeReductionOp< Ordinal, Packet > & | reductOp, | |||
| const Ordinal | sendCount, | |||
| const Packet *const | sendBuffer[], | |||
| const Ordinal | recvCounts[], | |||
| Packet *const | myGlobalReducts[] | |||
| ) | [related] |
Reduce and Scatter array of objects that use reference semantics using a user-defined reduction object.
Definition at line 861 of file Teuchos_CommHelpers.hpp.
| void scan | ( | const Comm< Ordinal > & | comm, | |
| const ValueTypeReductionOp< Ordinal, Packet > & | reductOp, | |||
| const Ordinal | count, | |||
| const Packet | sendBuffer[], | |||
| Packet | scanReducts[] | |||
| ) | [related] |
Scan/Reduce array of objects that use value semantics using a user-defined reduction operator.
Definition at line 872 of file Teuchos_CommHelpers.hpp.
| void scan | ( | const Comm< Ordinal > & | comm, | |
| const EReductionType | reductType, | |||
| const Ordinal | count, | |||
| const Packet | sendBuffer[], | |||
| Packet | scanReducts[] | |||
| ) | [related] |
Scan/Reduce array of objects using value semantics using a predefined reduction type.
Definition at line 895 of file Teuchos_CommHelpers.hpp.
| void scan | ( | const Comm< Ordinal > & | comm, | |
| const EReductionType | reductType, | |||
| const Packet & | send, | |||
| Packet * | scanReduct | |||
| ) | [related] |
Scan/Reduce single object using value semantics using a predefined reduction type.
Definition at line 911 of file Teuchos_CommHelpers.hpp.
| void scan | ( | const Comm< Ordinal > & | comm, | |
| const Serializer< Ordinal, Packet > & | serializer, | |||
| const ReferenceTypeReductionOp< Ordinal, Packet > & | reductOp, | |||
| const Ordinal | count, | |||
| const Packet *const | sendBuffer[], | |||
| Packet *const | scanReducts[] | |||
| ) | [related] |
Scan/Reduce array of objects that use reference semantics using a user-defined reduction operator.
Definition at line 920 of file Teuchos_CommHelpers.hpp.
| void send | ( | const Comm< Ordinal > & | comm, | |
| const Ordinal | count, | |||
| const Packet | sendBuffer[], | |||
| const int | destRank | |||
| ) | [related] |
Send objects that use values semantics to another process.
Definition at line 930 of file Teuchos_CommHelpers.hpp.
| void send | ( | const Comm< Ordinal > & | comm, | |
| const Packet & | send, | |||
| const int | destRank | |||
| ) | [related] |
Send a single object that use values semantics to another process.
Definition at line 949 of file Teuchos_CommHelpers.hpp.
| void send | ( | const Comm< Ordinal > & | comm, | |
| const Serializer< Ordinal, Packet > & | serializer, | |||
| const Ordinal | count, | |||
| const Packet *const | sendBuffer[], | |||
| const int | destRank | |||
| ) | [related] |
Send objects that use reference semantics to another process.
Definition at line 958 of file Teuchos_CommHelpers.hpp.
| int receive | ( | const Comm< Ordinal > & | comm, | |
| const int | sourceRank, | |||
| const Ordinal | count, | |||
| Packet | recvBuffer[] | |||
| ) | [related] |
Receive objects that use values semantics from another process.
Definition at line 967 of file Teuchos_CommHelpers.hpp.
| int receive | ( | const Comm< Ordinal > & | comm, | |
| const int | sourceRank, | |||
| Packet * | recv | |||
| ) | [related] |
Receive a single object that use values semantics from another process.
Definition at line 986 of file Teuchos_CommHelpers.hpp.
| int receive | ( | const Comm< Ordinal > & | comm, | |
| const Serializer< Ordinal, Packet > & | serializer, | |||
| const int | sourceRank, | |||
| const Ordinal | count, | |||
| Packet *const | recvBuffer[] | |||
| ) | [related] |
Receive objects that use reference semantics from another process.
Definition at line 995 of file Teuchos_CommHelpers.hpp.
1.4.7