42 #ifndef TEUCHOS_COMM_HELPERS_HPP 43 #define TEUCHOS_COMM_HELPERS_HPP 45 #include "Teuchos_Comm.hpp" 46 #include "Teuchos_CommUtilities.hpp" 47 #include "Teuchos_SerializationTraitsHelpers.hpp" 48 #include "Teuchos_ReductionOpHelpers.hpp" 49 #include "Teuchos_SerializerHelpers.hpp" 54 #include "Teuchos_Workspace.hpp" 57 #ifdef HAVE_TEUCHOS_MPI 59 #endif // HAVE_TEUCHOS_MPI 60 #include "Teuchos_DefaultSerialComm.hpp" 69 #ifdef HAVE_TEUCHOS_MPI 78 std::string getMpiErrorString (
const int errCode);
81 #endif // HAVE_TEUCHOS_MPI 87 template<
typename Ordinal>
88 int rank(
const Comm<Ordinal>& comm);
94 template<
typename Ordinal>
95 int size(
const Comm<Ordinal>& comm);
101 template<
typename Ordinal>
102 void barrier(
const Comm<Ordinal>& comm);
108 template<
typename Ordinal,
typename Packet>
110 const Comm<Ordinal>& comm,
112 const Ordinal count, Packet buffer[]
119 template<
typename Ordinal,
typename Packet>
121 const Comm<Ordinal>& comm,
123 const ArrayView<Packet> &buffer
130 template<
typename Ordinal,
typename Packet>
132 const Comm<Ordinal>& comm,
133 const int rootRank, Packet *
object 140 template<
typename Ordinal,
typename Packet>
142 const Comm<Ordinal>& comm,
143 const int rootRank,
const Ptr<Packet> &
object 150 template<
typename Ordinal,
typename Packet>
152 const Comm<Ordinal>& comm,
const Serializer<Ordinal,Packet> &serializer,
153 const int rootRank,
const Ordinal count, Packet*
const buffer[]
160 template<
typename Ordinal,
typename Packet>
162 const Comm<Ordinal>& comm,
const Serializer<Ordinal,Packet> &serializer,
163 const int rootRank,
const ArrayView<
const Ptr<Packet> > &buffer
171 template<
typename Ordinal,
typename Packet,
typename Serializer>
173 const Comm<Ordinal>& comm,
174 const Serializer& serializer,
176 const Ordinal count, Packet buffer[]
183 template<
typename Ordinal,
typename Packet>
185 gather (
const Packet sendBuf[],
186 const Ordinal sendCount,
188 const Ordinal recvCount,
190 const Comm<Ordinal>& comm);
196 template<
typename Ordinal,
typename Packet>
198 gatherv (
const Packet sendBuf[],
199 const Ordinal sendCount,
201 const Ordinal recvCounts[],
202 const Ordinal displs[],
204 const Comm<Ordinal>& comm);
211 template<
typename Ordinal,
typename Packet>
213 const Comm<Ordinal>& comm,
214 const Ordinal sendCount,
const Packet sendBuffer[],
215 const Ordinal recvCount, Packet recvBuffer[]
223 template<
typename Ordinal,
typename Packet>
225 const Comm<Ordinal>& comm,
const Serializer<Ordinal,Packet> &serializer,
226 const Ordinal sendCount,
const Packet*
const sendBuffer[],
227 const Ordinal recvCount, Packet*
const recvBuffer[]
235 template<
typename Ordinal,
typename Packet,
typename Serializer>
237 const Comm<Ordinal>& comm,
238 const Serializer& serializer,
239 const Ordinal sendCount,
const Packet sendBuffer[],
240 const Ordinal recvCount, Packet recvBuffer[]
269 template<
typename Ordinal,
typename Packet>
272 const Ordinal sendCount,
274 const Ordinal recvCount,
282 (
true, std::logic_error,
"Teuchos::scatter<" <<
284 <<
">: Generic version is not yet implemented. This function currently " 285 "only has an implementtion for Ordinal = int and Packet = int. " 286 "See Bug 6375 and Bug 6336.");
316 template<
typename Ordinal,
typename Packet>
318 reduce (
const Packet sendBuf[],
347 template<
typename Ordinal,
typename Packet>
350 const Ordinal count,
const Packet sendBuffer[], Packet globalReducts[]
358 template<
typename Ordinal,
typename Packet>
361 const Ordinal count,
const Packet sendBuffer[], Packet globalReducts[]
369 template<
typename Ordinal,
typename Packet>
376 template<
typename Ordinal,
typename Packet>
379 const Packet &send, Packet *globalReduct
382 reduceAll<Ordinal,Packet>(comm, reductType,
send, ptr(globalReduct));
390 template<
typename Ordinal,
typename Packet>
394 const Ordinal count,
const Packet*
const sendBuffer[], Packet*
const globalReducts[]
402 template<
typename Ordinal,
typename Packet,
typename Serializer>
407 const Ordinal count,
const Packet sendBuffer[], Packet globalReducts[]
415 template<
typename Ordinal,
typename Packet,
typename Serializer>
419 const EReductionType reductType,
420 const Ordinal count,
const Packet sendBuffer[], Packet globalReducts[]
428 template<
typename Ordinal,
typename Packet>
431 const Ordinal count,
const Packet sendBuffer[], Packet scanReducts[]
439 template<
typename Ordinal,
typename Packet>
442 const Ordinal count,
const Packet sendBuffer[], Packet scanReducts[]
450 template<
typename Ordinal,
typename Packet>
457 template<
typename Ordinal,
typename Packet>
460 const Packet &send, Packet *scanReduct
463 scan(comm, reductType, send, ptr(scanReduct));
471 template<
typename Ordinal,
typename Packet>
475 const Ordinal count,
const Packet*
const sendBuffer[], Packet*
const scanReducts[]
483 template<
typename Ordinal,
typename Packet,
typename Serializer>
488 const Ordinal count,
const Packet sendBuffer[], Packet scanReducts[]
496 template<
typename Ordinal,
typename Packet,
typename Serializer>
500 const EReductionType reductType,
501 const Ordinal count,
const Packet sendBuffer[], Packet scanReducts[]
508 template<
typename Ordinal,
typename Packet>
511 const Ordinal count,
const Packet sendBuffer[],
const int destRank
515 template<
typename Ordinal,
typename Packet>
517 send (
const Packet sendBuffer[],
527 template<
typename Ordinal,
typename Packet>
530 const Ordinal count,
const Packet sendBuffer[],
const int destRank
534 template<
typename Ordinal,
typename Packet>
536 ssend (
const Packet sendBuffer[],
546 template<
typename Ordinal,
typename Packet>
549 const Packet &send,
const int destRank
556 template<
typename Ordinal,
typename Packet>
559 const Packet &send,
const int destRank
568 template<
typename Ordinal,
typename Packet>
571 const Ordinal count,
const Packet*
const sendBuffer[],
const int destRank
579 template<
typename Ordinal,
typename Packet,
typename Serializer>
583 const Ordinal count,
const Packet sendBuffer[],
const int destRank
590 template<
typename Ordinal,
typename Packet>
593 const int sourceRank,
const Ordinal count, Packet recvBuffer[]
600 template<
typename Ordinal,
typename Packet>
603 const int sourceRank, Packet *recv
610 template<
typename Ordinal,
typename Packet>
613 const int sourceRank,
const Ordinal count, Packet*
const recvBuffer[]
621 template<
typename Ordinal,
typename Packet,
typename Serializer>
625 const int sourceRank,
const Ordinal count, Packet recvBuffer[]
633 template<
typename Ordinal,
typename Packet>
641 template<
typename Ordinal,
typename Packet>
653 template<
typename Ordinal,
typename Packet>
665 template<
typename Ordinal,
typename Packet,
typename Serializer>
677 template<
typename Ordinal,
typename Packet>
685 template<
typename Ordinal,
typename Packet>
696 template<
typename Ordinal,
typename Packet>
708 template<
typename Ordinal,
typename Packet,
typename Serializer>
729 template<
typename Ordinal,
typename Packet>
737 template<
typename Ordinal,
typename Packet>
740 const int sourceRank,
755 template<
typename Ordinal,
typename Packet>
767 template<
typename Ordinal,
typename Packet,
typename Serializer>
786 template<
typename Ordinal>
821 template<
typename Ordinal>
850 template<
typename Ordinal>
863 template<
typename Ordinal,
typename Packet>
870 const Packet inBuffer[],
884 template<
typename Ordinal,
typename Packet>
891 const Packet inBuffer[],
905 template<
typename Ordinal,
typename Packet>
912 const Packet inBuffer[],
922 template<
typename Ordinal,
typename Packet>
929 const Packet inBuffer[],
944 namespace MixMaxUtilities {
947 template<
bool isComparable,
typename Ordinal,
typename Packet>
951 template<
typename Ordinal,
typename Packet>
952 class Min<true,Ordinal,Packet> {
956 const Packet inBuffer[],
960 for(
int i = 0; i < count; ++i )
961 inoutBuffer[i] = TEUCHOS_MIN(inoutBuffer[i],inBuffer[i]);
966 template<
typename Ordinal,
typename Packet>
967 class Min<false,Ordinal,Packet> {
976 true,std::logic_error,
978 <<
" does not support comparison operations!" 984 template<
bool isComparable,
typename Ordinal,
typename Packet>
988 template<
typename Ordinal,
typename Packet>
989 class Max<true,Ordinal,Packet> {
993 const Packet inBuffer[],
997 for(
int i = 0; i < count; ++i )
998 inoutBuffer[i] = TEUCHOS_MAX(inoutBuffer[i],inBuffer[i]);
1003 template<
typename Ordinal,
typename Packet>
1004 class Max<false,Ordinal,Packet> {
1013 true,std::logic_error,
1015 <<
" does not support comparison operations!" 1021 template<
bool isComparable,
typename Ordinal,
typename Packet>
1025 template<
typename Ordinal,
typename Packet>
1026 class AND<true,Ordinal,Packet> {
1029 const Ordinal count,
1030 const Packet inBuffer[],
1031 Packet inoutBuffer[]
1034 for(
int i = 0; i < count; ++i )
1035 inoutBuffer[i] = inoutBuffer[i] && inBuffer[i];
1040 template<
typename Ordinal,
typename Packet>
1041 class AND<false,Ordinal,Packet> {
1050 true,std::logic_error,
1052 <<
" does not support logical AND operations!" 1061 template<
typename Ordinal,
typename Packet>
1063 const Ordinal count,
1064 const Packet inBuffer[],
1065 Packet inoutBuffer[]
1068 for(
int i = 0; i < count; ++i )
1069 inoutBuffer[i] += inBuffer[i];
1073 template<
typename Ordinal,
typename Packet>
1075 const Ordinal count,
1076 const Packet inBuffer[],
1077 Packet inoutBuffer[]
1080 typedef MixMaxUtilities::Min<ScalarTraits<Packet>::isComparable, Ordinal, Packet> min_type;
1081 min_type::min (count, inBuffer, inoutBuffer);
1085 template<
typename Ordinal,
typename Packet>
1087 const Ordinal count,
1088 const Packet inBuffer[],
1089 Packet inoutBuffer[]
1092 typedef MixMaxUtilities::Max<ScalarTraits<Packet>::isComparable, Ordinal, Packet> max_type;
1093 max_type::max (count,inBuffer,inoutBuffer);
1097 template<
typename Ordinal,
typename Packet>
1099 const Ordinal count,
1100 const Packet inBuffer[],
1101 Packet inoutBuffer[]
1104 typedef MixMaxUtilities::AND<ScalarTraits<Packet>::isComparable, Ordinal, Packet> and_type;
1105 and_type::andOp (count, inBuffer, inoutBuffer);
1135 template<
typename Ordinal,
typename Packet>
1137 createOp (
const EReductionType reductType)
1140 switch (reductType) {
1145 if (ST::isComparable) {
1150 (! ST::isComparable, std::invalid_argument,
"Teuchos::createOp" 1152 <<
" is not less-than comparable, so it does not make sense to do a " 1153 "MIN reduction with it.");
1157 if (ST::isComparable) {
1162 (! ST::isComparable, std::invalid_argument,
"Teuchos::createOp" 1164 <<
" is not less-than comparable, so it does not make sense to do a " 1165 "MAX reduction with it.");
1173 true, std::invalid_argument,
"Teuchos::createOp(EReductionType): " 1174 "Invalid EReductionType value " << reductType <<
". Valid values " 1175 "include REDUCE_SUM, REDUCE_MIN, REDUCE_MAX, and REDUCE_AND.");
1188 template<
typename Ordinal>
1195 template<
typename Ordinal>
1202 template<
typename Ordinal>
1205 TEUCHOS_COMM_TIME_MONITOR(
1206 "Teuchos::CommHelpers: barrier<" 1214 template<
typename Ordinal,
typename Packet>
1215 void Teuchos::broadcast(
1217 const int rootRank,
const Ordinal count, Packet buffer[]
1220 TEUCHOS_COMM_TIME_MONITOR(
1221 "Teuchos::CommHelpers: broadcast<" 1226 charBuffer(count,buffer);
1228 rootRank,charBuffer.getBytes(),charBuffer.getCharBuffer()
1233 template<
typename Ordinal,
typename Packet>
1234 void Teuchos::broadcast(
1240 broadcast<Ordinal, Packet>(comm, rootRank, buffer.
size(), buffer.
getRawPtr() );
1244 template<
typename Ordinal,
typename Packet>
1245 void Teuchos::broadcast(
1247 const int rootRank, Packet *
object 1250 broadcast<Ordinal,Packet>(comm,rootRank,1,object);
1254 template<
typename Ordinal,
typename Packet>
1255 void Teuchos::broadcast(
1260 broadcast<Ordinal,Packet>(comm,rootRank,1,
object.getRawPtr());
1264 template<
typename Ordinal,
typename Packet>
1265 void Teuchos::broadcast(
1267 const int rootRank,
const Ordinal count, Packet*
const buffer[]
1270 TEUCHOS_COMM_TIME_MONITOR(
1271 "Teuchos::CommHelpers: broadcast<" 1273 <<
">( reference type )" 1276 charBuffer(serializer, count, buffer);
1283 template<
typename Ordinal,
typename Packet>
1284 void Teuchos::broadcast(
1290 for (
int i = 0; i < buffer.
size(); ++i) {
1291 bufferPtrArray.
push_back(buffer[i].getRawPtr());
1293 broadcast<Ordinal,Packet>(comm, serializer, rootRank,
1297 template<
typename Ordinal,
typename Packet,
typename Serializer>
1298 void Teuchos::broadcast(
1301 const int rootRank,
const Ordinal count, Packet buffer[]
1304 TEUCHOS_COMM_TIME_MONITOR(
1305 "Teuchos::CommHelpers: broadcast<" 1310 charBuffer(count,buffer,
rcp(&serializer,
false));
1312 rootRank,charBuffer.getBytes(),charBuffer.getCharBuffer()
1317 template<
typename Ordinal,
typename Packet>
1318 void Teuchos::gatherAll(
1320 const Ordinal sendCount,
const Packet sendBuffer[],
1321 const Ordinal recvCount, Packet recvBuffer[]
1324 TEUCHOS_COMM_TIME_MONITOR(
1325 "Teuchos::CommHelpers: gatherAll<" 1330 charSendBuffer(sendCount,sendBuffer);
1332 charRecvBuffer(recvCount,recvBuffer);
1334 charSendBuffer.getBytes(),charSendBuffer.getCharBuffer()
1335 ,charRecvBuffer.getBytes(),charRecvBuffer.getCharBuffer()
1339 template<
typename Ordinal,
typename Packet>
1341 Teuchos::gather (
const Packet sendBuf[],
1342 const Ordinal sendCount,
1344 const Ordinal recvCount,
1348 TEUCHOS_COMM_TIME_MONITOR(
1349 "Teuchos::CommHelpers: gather<" 1354 charSendBuffer (sendCount, sendBuf);
1356 charRecvBuffer (recvCount, recvBuf);
1357 comm.
gather (charSendBuffer.getBytes (),
1358 charSendBuffer.getCharBuffer (),
1359 charRecvBuffer.getBytes (),
1360 charRecvBuffer.getCharBuffer (),
1364 template<
typename Ordinal,
typename Packet>
1366 Teuchos::gatherv (
const Packet sendBuf[],
1367 const Ordinal sendCount,
1369 const Ordinal recvCounts[],
1370 const Ordinal displs[],
1395 "Teuchos::gatherv: The general case is not implemented.");
1398 template<
typename Ordinal,
typename Packet>
1399 void Teuchos::gatherAll(
1401 const Ordinal sendCount,
const Packet*
const sendBuffer[],
1402 const Ordinal recvCount, Packet*
const recvBuffer[]
1408 template<
typename Ordinal,
typename Packet,
typename Serializer>
1409 void Teuchos::gatherAll(
1412 const Ordinal sendCount,
const Packet sendBuffer[],
1413 const Ordinal recvCount, Packet recvBuffer[]
1416 TEUCHOS_COMM_TIME_MONITOR(
1417 "Teuchos::CommHelpers: gatherAll<" 1422 charSendBuffer(sendCount,sendBuffer,
rcp(&serializer,
false));
1424 charRecvBuffer(recvCount,recvBuffer,
rcp(&serializer,
false));
1426 charSendBuffer.getBytes(),charSendBuffer.getCharBuffer()
1427 ,charRecvBuffer.getBytes(),charRecvBuffer.getCharBuffer()
1432 template<
typename Ordinal,
typename Packet>
1434 Teuchos::reduce (
const Packet sendBuf[],
1436 const Ordinal count,
1437 const EReductionType reductType,
1445 (
true, std::logic_error,
"Teuchos::reduce<" <<
1447 <<
">: Generic version not implemented. We only implement this function " 1448 "for Ordinal = int and Packet = specific types.");
1452 template<
typename Ordinal,
typename Packet>
1455 ,
const Ordinal count,
const Packet sendBuffer[], Packet globalReducts[]
1458 TEUCHOS_COMM_TIME_MONITOR(
1459 "Teuchos::CommHelpers: reduceAll<" 1461 <<
">( value type, user-defined op )" 1464 charSendBuffer(count,sendBuffer);
1466 charGlobalReducts(count,globalReducts);
1468 charReductOp(
rcp(&reductOp,
false));
1470 charReductOp,charSendBuffer.getBytes(),charSendBuffer.getCharBuffer()
1471 ,charGlobalReducts.getCharBuffer()
1476 template<
typename Ordinal,
typename Packet>
1479 const Ordinal count,
const Packet sendBuffer[], Packet globalReducts[]
1482 TEUCHOS_COMM_TIME_MONITOR(
1483 "Teuchos::CommHelpers: reduceAll<" 1485 <<
">( value type, "<<toString(reductType)<<
" )" 1489 createOp<Ordinal, Packet> (reductType);
1491 reduceAll(comm,*reductOp,count,sendBuffer,globalReducts);
1493 catch (std::exception& e) {
1509 #ifdef HAVE_TEUCHOS_COMPLEX 1512 TEUCHOSCOMM_LIB_DLL_EXPORT
void 1513 reduceAll<int, std::complex<double> > (
const Comm<int>& comm,
1514 const EReductionType reductType,
1516 const std::complex<double> sendBuffer[],
1517 std::complex<double> globalReducts[]);
1520 ireceive<int, std::complex<double> > (
const Comm<int>& comm,
1522 const int sourceRank);
1526 const int sourceRank,
1530 TEUCHOSCOMM_LIB_DLL_EXPORT
void 1531 send<int, std::complex<double> > (
const Comm<int>& comm,
1533 const std::complex<double> sendBuffer[],
1534 const int destRank);
1536 TEUCHOSCOMM_LIB_DLL_EXPORT
void 1537 send<int, std::complex<double> > (
const std::complex<double> sendBuffer[],
1551 TEUCHOSCOMM_LIB_DLL_EXPORT
void 1552 reduceAll<int, std::complex<float> > (
const Comm<int>& comm,
1553 const EReductionType reductType,
1555 const std::complex<float> sendBuffer[],
1556 std::complex<float> globalReducts[]);
1559 ireceive<int, std::complex<float> > (
const Comm<int>& comm,
1561 const int sourceRank);
1565 const int sourceRank,
1569 TEUCHOSCOMM_LIB_DLL_EXPORT
void 1570 send<int, std::complex<float> > (
const Comm<int>& comm,
1572 const std::complex<float> sendBuffer[],
1573 const int destRank);
1575 TEUCHOSCOMM_LIB_DLL_EXPORT
void 1576 send<int, std::complex<float> > (
const std::complex<float> sendBuffer[],
1587 #endif // HAVE_TEUCHOS_COMPLEX 1592 TEUCHOSCOMM_LIB_DLL_EXPORT
void 1593 reduceAll<int, double> (
const Comm<int>& comm,
1594 const EReductionType reductType,
1596 const double sendBuffer[],
1597 double globalReducts[]);
1600 ireceive<int, double> (
const Comm<int>& comm,
1602 const int sourceRank);
1606 const int sourceRank,
1610 TEUCHOSCOMM_LIB_DLL_EXPORT
void 1611 send<int, double> (
const Comm<int>& comm,
1613 const double sendBuffer[],
1614 const int destRank);
1616 TEUCHOSCOMM_LIB_DLL_EXPORT
void 1617 send<int, double> (
const double sendBuffer[],
1631 TEUCHOSCOMM_LIB_DLL_EXPORT
void 1632 reduceAll<int, float> (
const Comm<int>& comm,
1633 const EReductionType reductType,
1635 const float sendBuffer[],
1636 float globalReducts[]);
1639 ireceive<int, float> (
const Comm<int>& comm,
1641 const int sourceRank);
1645 const int sourceRank,
1649 TEUCHOSCOMM_LIB_DLL_EXPORT
void 1650 send<int, float> (
const Comm<int>& comm,
1652 const float sendBuffer[],
1653 const int destRank);
1655 TEUCHOSCOMM_LIB_DLL_EXPORT
void 1656 send<int, float> (
const float sendBuffer[],
1670 TEUCHOSCOMM_LIB_DLL_EXPORT
void 1671 gather<int, long long> (
const long long sendBuf[],
1672 const int sendCount,
1673 long long recvBuf[],
1674 const int recvCount,
1678 TEUCHOSCOMM_LIB_DLL_EXPORT
void 1679 gatherv<int, long long> (
const long long sendBuf[],
1680 const int sendCount,
1681 long long recvBuf[],
1682 const int recvCounts[],
1687 TEUCHOSCOMM_LIB_DLL_EXPORT
void 1688 reduceAll<int, long long> (
const Comm<int>& comm,
1689 const EReductionType reductType,
1691 const long long sendBuffer[],
1692 long long globalReducts[]);
1695 ireceive<int, long long> (
const Comm<int>& comm,
1697 const int sourceRank);
1701 const int sourceRank,
1705 TEUCHOSCOMM_LIB_DLL_EXPORT
void 1706 send<int, long long> (
const Comm<int>& comm,
1708 const long long sendBuffer[],
1709 const int destRank);
1711 TEUCHOSCOMM_LIB_DLL_EXPORT
void 1712 send<int, long long> (
const long long sendBuffer[],
1726 TEUCHOSCOMM_LIB_DLL_EXPORT
void 1727 gather<int, unsigned long long> (
const unsigned long long sendBuf[],
1728 const int sendCount,
1729 unsigned long long recvBuf[],
1730 const int recvCount,
1734 TEUCHOSCOMM_LIB_DLL_EXPORT
void 1735 gatherv<int, unsigned long long> (
const unsigned long long sendBuf[],
1736 const int sendCount,
1737 unsigned long long recvBuf[],
1738 const int recvCounts[],
1743 TEUCHOSCOMM_LIB_DLL_EXPORT
void 1744 reduceAll<int, unsigned long long> (
const Comm<int>& comm,
1745 const EReductionType reductType,
1747 const unsigned long long sendBuffer[],
1748 unsigned long long globalReducts[]);
1751 ireceive<int, unsigned long long> (
const Comm<int>& comm,
1753 const int sourceRank);
1757 const int sourceRank,
1761 TEUCHOSCOMM_LIB_DLL_EXPORT
void 1762 send<int, unsigned long long> (
const Comm<int>& comm,
1764 const unsigned long long sendBuffer[],
1765 const int destRank);
1767 TEUCHOSCOMM_LIB_DLL_EXPORT
void 1768 send<int, unsigned long long> (
const unsigned long long sendBuffer[],
1782 TEUCHOSCOMM_LIB_DLL_EXPORT
void 1783 gather<int, long> (
const long sendBuf[],
1784 const int sendCount,
1786 const int recvCount,
1790 TEUCHOSCOMM_LIB_DLL_EXPORT
void 1791 gatherv<int, long> (
const long sendBuf[],
1792 const int sendCount,
1794 const int recvCounts[],
1799 TEUCHOSCOMM_LIB_DLL_EXPORT
void 1800 reduceAll<int, long> (
const Comm<int>& comm,
1801 const EReductionType reductType,
1803 const long sendBuffer[],
1804 long globalReducts[]);
1807 ireceive<int, long> (
const Comm<int>& comm,
1809 const int sourceRank);
1813 const int sourceRank,
1817 TEUCHOSCOMM_LIB_DLL_EXPORT
void 1820 const long sendBuffer[],
1821 const int destRank);
1823 TEUCHOSCOMM_LIB_DLL_EXPORT
void 1824 send<int, long> (
const long sendBuffer[],
1838 TEUCHOSCOMM_LIB_DLL_EXPORT
void 1839 gather<int, unsigned long> (
const unsigned long sendBuf[],
1840 const int sendCount,
1841 unsigned long recvBuf[],
1842 const int recvCount,
1846 TEUCHOSCOMM_LIB_DLL_EXPORT
void 1847 gatherv<int, unsigned long> (
const unsigned long sendBuf[],
1848 const int sendCount,
1849 unsigned long recvBuf[],
1850 const int recvCounts[],
1855 TEUCHOSCOMM_LIB_DLL_EXPORT
void 1856 reduceAll<int, unsigned long> (
const Comm<int>& comm,
1857 const EReductionType reductType,
1859 const unsigned long sendBuffer[],
1860 unsigned long globalReducts[]);
1863 ireceive<int, unsigned long> (
const Comm<int>& comm,
1865 const int sourceRank);
1869 const int sourceRank,
1873 TEUCHOSCOMM_LIB_DLL_EXPORT
void 1874 send<int, unsigned long> (
const Comm<int>& comm,
1876 const unsigned long sendBuffer[],
1877 const int destRank);
1879 TEUCHOSCOMM_LIB_DLL_EXPORT
void 1880 send<int, unsigned long> (
const unsigned long sendBuffer[],
1894 TEUCHOSCOMM_LIB_DLL_EXPORT
void 1895 gather<int, int> (
const int sendBuf[],
1896 const int sendCount,
1898 const int recvCount,
1902 TEUCHOSCOMM_LIB_DLL_EXPORT
void 1903 gatherv<int, int> (
const int sendBuf[],
1904 const int sendCount,
1906 const int recvCounts[],
1911 TEUCHOSCOMM_LIB_DLL_EXPORT
void 1912 scatter (
const int sendBuf[],
1913 const int sendCount,
1915 const int recvCount,
1919 TEUCHOSCOMM_LIB_DLL_EXPORT
void 1920 reduce<int, int> (
const int sendBuf[],
1923 const EReductionType reductType,
1927 TEUCHOSCOMM_LIB_DLL_EXPORT
void 1928 reduce<int, long> (
const long sendBuf[],
1931 const EReductionType reductType,
1935 TEUCHOSCOMM_LIB_DLL_EXPORT
void 1936 reduce<int, unsigned long> (
const unsigned long sendBuf[],
1937 unsigned long recvBuf[],
1939 const EReductionType reductType,
1943 TEUCHOSCOMM_LIB_DLL_EXPORT
void 1944 reduce<int, unsigned long long > (
const unsigned long long sendBuf[],
1945 unsigned long long recvBuf[],
1947 const EReductionType reductType,
1951 TEUCHOSCOMM_LIB_DLL_EXPORT
void 1952 reduce<int, double> (
const double sendBuf[],
1955 const EReductionType reductType,
1959 TEUCHOSCOMM_LIB_DLL_EXPORT
void 1960 reduceAll<int, int> (
const Comm<int>& comm,
1961 const EReductionType reductType,
1963 const int sendBuffer[],
1964 int globalReducts[]);
1968 ireceive<int, int> (
const Comm<int>& comm,
1970 const int sourceRank);
1974 const int sourceRank,
1978 TEUCHOSCOMM_LIB_DLL_EXPORT
void 1981 const int sendBuffer[],
1982 const int destRank);
1984 TEUCHOSCOMM_LIB_DLL_EXPORT
void 1985 send<int, int> (
const int sendBuffer[],
1999 TEUCHOSCOMM_LIB_DLL_EXPORT
void 2000 gather<int, unsigned int> (
const unsigned int sendBuf[],
2001 const int sendCount,
2002 unsigned int recvBuf[],
2003 const int recvCount,
2007 TEUCHOSCOMM_LIB_DLL_EXPORT
void 2008 gatherv<int, unsigned int> (
const unsigned int sendBuf[],
2009 const int sendCount,
2010 unsigned int recvBuf[],
2011 const int recvCounts[],
2016 TEUCHOSCOMM_LIB_DLL_EXPORT
void 2017 reduceAll<int, unsigned int> (
const Comm<int>& comm,
2018 const EReductionType reductType,
2020 const unsigned int sendBuffer[],
2021 unsigned int globalReducts[]);
2024 ireceive<int, unsigned int> (
const Comm<int>& comm,
2026 const int sourceRank);
2030 const int sourceRank,
2034 TEUCHOSCOMM_LIB_DLL_EXPORT
void 2035 send<int, unsigned int> (
const Comm<int>& comm,
2037 const unsigned int sendBuffer[],
2038 const int destRank);
2040 TEUCHOSCOMM_LIB_DLL_EXPORT
void 2041 send<int, unsigned int> (
const unsigned int sendBuffer[],
2055 TEUCHOSCOMM_LIB_DLL_EXPORT
void 2056 gather<int, short> (
const short sendBuf[],
2057 const int sendCount,
2059 const int recvCount,
2063 TEUCHOSCOMM_LIB_DLL_EXPORT
void 2064 gatherv<int, short> (
const short sendBuf[],
2065 const int sendCount,
2067 const int recvCounts[],
2072 TEUCHOSCOMM_LIB_DLL_EXPORT
void 2073 reduceAll<int, short> (
const Comm<int>& comm,
2074 const EReductionType reductType,
2076 const short sendBuffer[],
2077 short globalReducts[]);
2080 ireceive<int, short> (
const Comm<int>& comm,
2082 const int sourceRank);
2086 const int sourceRank,
2090 TEUCHOSCOMM_LIB_DLL_EXPORT
void 2091 send<int, short> (
const Comm<int>& comm,
2093 const short sendBuffer[],
2094 const int destRank);
2096 TEUCHOSCOMM_LIB_DLL_EXPORT
void 2097 send<int, short> (
const short sendBuffer[],
2120 TEUCHOSCOMM_LIB_DLL_EXPORT
void 2121 reduceAll<int, char> (
const Comm<int>& comm,
2122 const EReductionType reductType,
2124 const char sendBuffer[],
2125 char globalReducts[]);
2130 template<
typename Ordinal,
typename Packet>
2138 reduceAll<Ordinal,Packet>(comm, reductType, 1, &
send, &*globalReduct);
2142 template<
typename Ordinal,
typename Packet>
2146 const Ordinal count,
const Packet*
const sendBuffer[], Packet*
const globalReducts[]
2149 TEUCHOS_COMM_TIME_MONITOR(
2150 "Teuchos::CommHelpers: reduceAll<" 2152 <<
">( reference type )" 2155 charSendBuffer(serializer,count,sendBuffer);
2157 charGlobalReducts(serializer,count,globalReducts);
2159 charReductOp(
rcp(&serializer,
false),
rcp(&reductOp,
false));
2166 template<
typename Ordinal,
typename Packet,
typename Serializer>
2171 const Ordinal count,
const Packet sendBuffer[], Packet globalReducts[]
2174 TEUCHOS_COMM_TIME_MONITOR(
2175 "Teuchos::CommHelpers: reduceAll<" 2177 <<
">( value type, user-defined op )" 2180 charSendBuffer(count,sendBuffer,
rcp(&serializer,
false));
2182 charGlobalReducts(count,globalReducts,
rcp(&serializer,
false));
2184 charReductOp(
rcp(&reductOp,
false),
rcp(&serializer,
false));
2186 charReductOp,charSendBuffer.getBytes(),charSendBuffer.getCharBuffer()
2187 ,charGlobalReducts.getCharBuffer()
2192 template<
typename Ordinal,
typename Packet,
typename Serializer>
2196 const EReductionType reductType,
2197 const Ordinal count,
const Packet sendBuffer[], Packet globalReducts[]
2200 TEUCHOS_COMM_TIME_MONITOR(
2201 "Teuchos::CommHelpers: reduceAll<" 2203 <<
">( value type, "<<toString(reductType)<<
" )" 2207 createOp<Ordinal, Packet> (reductType);
2209 reduceAll(comm,serializer,*reductOp,count,sendBuffer,globalReducts);
2211 catch (std::exception& e) {
2219 template<
typename Ordinal,
typename Packet>
2222 const Ordinal count,
const Packet sendBuffer[], Packet scanReducts[]
2225 TEUCHOS_COMM_TIME_MONITOR(
2226 "Teuchos::CommHelpers: scan<" 2228 <<
">( value type, user-defined op )" 2231 charSendBuffer(count,sendBuffer);
2233 charScanReducts(count,scanReducts);
2235 charReductOp(
rcp(&reductOp,
false));
2237 charReductOp,charSendBuffer.getBytes(),charSendBuffer.getCharBuffer()
2238 ,charScanReducts.getCharBuffer()
2243 template<
typename Ordinal,
typename Packet>
2246 const Ordinal count,
const Packet sendBuffer[], Packet scanReducts[]
2249 TEUCHOS_COMM_TIME_MONITOR(
2250 "Teuchos::CommHelpers: scan<" 2252 <<
">( value type, "<<toString(reductType)<<
" )" 2256 createOp<Ordinal, Packet> (reductType);
2258 scan(comm,*reductOp,count,sendBuffer,scanReducts);
2260 catch (std::exception& e) {
2268 template<
typename Ordinal,
typename Packet>
2274 scan<Ordinal,Packet>(comm, reductType, 1, &
send, &*scanReduct);
2278 template<
typename Ordinal,
typename Packet>
2282 const Ordinal count,
const Packet*
const sendBuffer[], Packet*
const scanReducts[]
2288 template<
typename Ordinal,
typename Packet,
typename Serializer>
2293 const Ordinal count,
const Packet sendBuffer[], Packet scanReducts[]
2296 TEUCHOS_COMM_TIME_MONITOR(
2297 "Teuchos::CommHelpers: scan<" 2299 <<
">( value type, user-defined op )" 2302 charSendBuffer(count,sendBuffer,
rcp(&serializer,
false));
2304 charScanReducts(count,scanReducts,
rcp(&serializer,
false));
2306 charReductOp(
rcp(&reductOp,
false),
rcp(&serializer,
false));
2308 charReductOp,charSendBuffer.getBytes(),charSendBuffer.getCharBuffer()
2309 ,charScanReducts.getCharBuffer()
2314 template<
typename Ordinal,
typename Packet,
typename Serializer>
2318 const EReductionType reductType,
2319 const Ordinal count,
const Packet sendBuffer[], Packet scanReducts[]
2322 TEUCHOS_COMM_TIME_MONITOR(
2323 "Teuchos::CommHelpers: scan<" 2325 <<
">( value type, "<<toString(reductType)<<
" )" 2329 createOp<Ordinal, Packet> (reductType);
2331 scan(comm,serializer,*reductOp,count,sendBuffer,scanReducts);
2333 catch (std::exception& e) {
2340 template<
typename Ordinal,
typename Packet>
2343 const Ordinal count,
const Packet sendBuffer[],
const int destRank
2346 TEUCHOS_COMM_TIME_MONITOR(
2347 "Teuchos::CommHelpers: send<" 2352 charSendBuffer(count,sendBuffer);
2354 charSendBuffer.getBytes(),charSendBuffer.getCharBuffer()
2359 template<
typename Ordinal,
typename Packet>
2362 const Ordinal count,
2367 TEUCHOS_COMM_TIME_MONITOR(
2368 "Teuchos::CommHelpers: send<" 2373 comm.
send (charSendBuffer.getBytes (), charSendBuffer.getCharBuffer (), destRank, tag);
2376 template<
typename Ordinal,
typename Packet>
2379 const Ordinal count,
const Packet sendBuffer[],
const int destRank
2382 TEUCHOS_COMM_TIME_MONITOR(
2383 "Teuchos::CommHelpers: ssend<" 2388 charSendBuffer(count,sendBuffer);
2390 charSendBuffer.getBytes(),charSendBuffer.getCharBuffer()
2395 template<
typename Ordinal,
typename Packet>
2398 const Ordinal count,
2403 TEUCHOS_COMM_TIME_MONITOR(
2404 "Teuchos::CommHelpers: ssend<" 2409 buf_type charSendBuffer (count, sendBuffer);
2410 comm.
ssend (charSendBuffer.getBytes (),
2411 charSendBuffer.getCharBuffer (),
2415 template<
typename Ordinal,
typename Packet>
2418 const Packet &
send,
const int destRank
2421 Teuchos::send<Ordinal,Packet>(comm,1,&
send,destRank);
2424 template<
typename Ordinal,
typename Packet>
2427 const Packet &
send,
const int destRank
2430 Teuchos::ssend<Ordinal,Packet>(comm,1,&
send,destRank);
2433 template<
typename Ordinal,
typename Packet>
2436 const Ordinal count,
const Packet*
const sendBuffer[],
const int destRank
2442 template<
typename Ordinal,
typename Packet,
typename Serializer>
2446 const Ordinal count,
const Packet sendBuffer[],
const int destRank
2449 TEUCHOS_COMM_TIME_MONITOR(
2450 "Teuchos::CommHelpers: send<" 2455 charSendBuffer(count,sendBuffer,
rcp(&serializer,
false));
2457 charSendBuffer.getBytes(),charSendBuffer.getCharBuffer()
2462 template<
typename Ordinal,
typename Packet>
2463 int Teuchos::receive(
2465 const int sourceRank,
const Ordinal count, Packet recvBuffer[]
2468 TEUCHOS_COMM_TIME_MONITOR(
2469 "Teuchos::CommHelpers: receive<" 2474 charRecvBuffer(count,recvBuffer);
2477 ,charRecvBuffer.getBytes(),charRecvBuffer.getCharBuffer()
2482 template<
typename Ordinal,
typename Packet>
2483 int Teuchos::receive(
2485 const int sourceRank, Packet *recv
2488 return Teuchos::receive<Ordinal,Packet>(comm,sourceRank,1,recv);
2492 template<
typename Ordinal,
typename Packet>
2493 int Teuchos::receive(
2495 const int sourceRank,
const Ordinal count, Packet*
const recvBuffer[]
2501 template<
typename Ordinal,
typename Packet,
typename Serializer>
2502 int Teuchos::receive(
2505 const int sourceRank,
const Ordinal count, Packet recvBuffer[]
2508 TEUCHOS_COMM_TIME_MONITOR(
2509 "Teuchos::CommHelpers: receive<" 2514 charRecvBuffer(count,recvBuffer,
rcp(&serializer,
false));
2517 ,charRecvBuffer.getBytes(),charRecvBuffer.getCharBuffer()
2521 template<
typename Ordinal,
typename Packet>
2528 TEUCHOS_COMM_TIME_MONITOR(
2529 "Teuchos::CommHelpers: readySend<" 2535 comm.
readySend( charSendBuffer.getCharBufferView(), destRank );
2538 template<
typename Ordinal,
typename Packet>
2541 const Ordinal count,
2546 TEUCHOS_COMM_TIME_MONITOR(
2547 "Teuchos::CommHelpers: readySend<" 2552 buf_type charSendBuffer (count, sendBuffer);
2553 comm.
readySend (charSendBuffer.getBytes (),
2554 charSendBuffer.getCharBuffer (),
2558 template<
typename Ordinal,
typename Packet>
2565 readySend<Ordinal, Packet>( comm, arrayView(&
send,1), destRank );
2568 template<
typename Ordinal,
typename Packet,
typename Serializer>
2576 TEUCHOS_COMM_TIME_MONITOR(
2577 "Teuchos::CommHelpers: readySend<" 2582 charSendBuffer(sendBuffer.
size(), sendBuffer.
getRawPtr(), serializer);
2583 comm.
readySend( charSendBuffer.getCharBufferView(), destRank );
2586 template<
typename Ordinal,
typename Packet>
2594 TEUCHOS_COMM_TIME_MONITOR(
2595 "Teuchos::CommHelpers: isend<" 2602 charSendBuffer.getCharBufferView(), destRank );
2603 set_extra_data( sendBuffer,
"buffer", inOutArg(commRequest) );
2607 template<
typename Ordinal,
typename Packet>
2614 TEUCHOS_COMM_TIME_MONITOR(
2618 charSendBuffer (sendBuffer.
size (), sendBuffer.
getRawPtr ());
2620 comm.
isend (charSendBuffer.getCharBufferView (), destRank, tag);
2621 set_extra_data (sendBuffer,
"buffer", inOutArg (commRequest));
2625 template<
typename Ordinal,
typename Packet>
2634 arcpWithEmbeddedObj( send.
get(), 0, 1,
send, false );
2637 return isend<Ordinal, Packet>( comm, sendBuffer, destRank );
2640 template<
typename Ordinal,
typename Packet,
typename Serializer>
2649 TEUCHOS_COMM_TIME_MONITOR(
2650 "Teuchos::CommHelpers: isend<" 2655 charSendBuffer(sendBuffer.
size(), sendBuffer.
getRawPtr(), serializer);
2657 charSendBuffer.getCharBufferView(), destRank );
2658 set_extra_data( sendBuffer,
"buffer", inOutArg(commRequest) );
2662 template<
typename Ordinal,
typename Packet>
2667 const int sourceRank
2670 TEUCHOS_COMM_TIME_MONITOR(
2675 charRecvBuffer.getCharBufferView(), sourceRank );
2676 set_extra_data( recvBuffer,
"buffer", inOutArg(commRequest) );
2680 template<
typename Ordinal,
typename Packet>
2683 const int sourceRank,
2687 TEUCHOS_COMM_TIME_MONITOR(
2690 charRecvBuffer (recvBuffer.
size (), recvBuffer.
getRawPtr ());
2692 comm.
ireceive (charRecvBuffer.getCharBufferView (), sourceRank, tag);
2693 set_extra_data (recvBuffer,
"buffer", inOutArg (commRequest));
2697 template<
typename Ordinal,
typename Packet>
2702 const int sourceRank
2706 arcpWithEmbeddedObj( recv.
get(), 0, 1, recv, false );
2709 return ireceive<Ordinal, Packet>( comm, recvBuffer, sourceRank );
2712 template<
typename Ordinal,
typename Packet,
typename Serializer>
2718 const int sourceRank
2721 TEUCHOS_COMM_TIME_MONITOR(
2722 "Teuchos::CommHelpers: ireceive<" 2727 charRecvBuffer(recvBuffer.
size(), recvBuffer.
getRawPtr(), serializer);
2729 charRecvBuffer.getCharBufferView(), sourceRank );
2730 set_extra_data( recvBuffer,
"buffer", inOutArg(commRequest) );
2734 template<
typename Ordinal>
2735 void Teuchos::waitAll(
2744 template<
typename Ordinal>
2750 comm.
waitAll (requests, statuses);
2754 template<
typename Ordinal>
2759 return comm.
wait (request);
2763 #endif // TEUCHOS_COMM_HELPERS_HPP virtual void reduceAll(const ValueTypeReductionOp< Ordinal, char > &reductOp, const Ordinal bytes, const char sendBuffer[], char globalReducts[]) const =0
Global reduction.
Strategy interface for the indirect serializing and deserializing objects of a given type handled usi...
char * getCharBuffer() const
Encapsulate how an array of non-const objects with reference sematics is serialized into a char[] arr...
virtual void readySend(const ArrayView< const char > &sendBuffer, const int destRank) const =0
Ready send of data from this process to another process.
EReductionType
Predefined reduction operations that Teuchos::Comm understands.
virtual RCP< CommStatus< Ordinal > > wait(const Ptr< RCP< CommRequest< Ordinal > > > &request) const =0
Wait on a single communication request, and return its status.
virtual void scan(const ValueTypeReductionOp< Ordinal, char > &reductOp, const Ordinal bytes, const char sendBuffer[], char scanReducts[]) const =0
Scan reduction.
size_type size() const
The total number of entries in the array.
virtual RCP< CommRequest< Ordinal > > ireceive(const ArrayView< char > &recvBuffer, const int sourceRank) const =0
Non-blocking receive.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Macro for throwing an exception with breakpointing to ease debugging.
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.
size_type size() const
The total number of items in the managed array.
T * getRawPtr()
Return a raw pointer to beginning of array or NULL if unsized.
Standard logical AND operator for booleans.
Standard min operator for types with value semantics.
T * get() const
Get the raw C++ pointer to the underlying object.
This structure defines some basic traits for a scalar field type.
Decorator class that uses traits to convert to and from char[] to typed buffers for objects that use ...
virtual void waitAll(const ArrayView< RCP< CommRequest< Ordinal > > > &requests) const =0
Wait on a set of communication requests.
void scatter(const Packet sendBuf[], const Ordinal sendCount, Packet recvBuf[], const Ordinal recvCount, const Ordinal root, const Comm< Ordinal > &comm)
Wrapper for MPI_Scatter; scatter collective.
Namespace of implementation details.
void reduce(const Ordinal count, const Packet inBuffer[], Packet inoutBuffer[]) const
Standard summation operator for types with value semantics.
const char * getCharBuffer() const
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Deprecated.
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 void ssend(const Ordinal bytes, const char sendBuffer[], const int destRank) const =0
Always blocking send of data from this process to another process.
TEUCHOS_DEPRECATED void scan(const Comm< Ordinal > &comm, const EReductionType reductType, const Packet &send, Packet *scanReduct)
Deprecated.
Encapsulate how an array of const objects with reference sematics is serialized into a char[] array...
virtual int getRank() const =0
Returns the rank of this process.
Standard Max operator for types with value semantics.
Decorator class that uses a strategy object to convert to and from char[] to typed buffers for object...
Implementation of Teuchos wrappers for MPI.
Declaration of Teuchos::EReductionType enum, and related functions.
virtual RCP< CommRequest< Ordinal > > isend(const ArrayView< const char > &sendBuffer, const int destRank) const =0
Non-blocking send.
This structure defines some basic traits for the ordinal field type.
TEUCHOS_DEPRECATED void reduceAll(const Comm< Ordinal > &comm, const EReductionType reductType, const Packet &send, Packet *globalReduct)
Deprecated .
Encapsulation of the result of a receive (blocking or nonblocking).
void send(const Packet sendBuffer[], const Ordinal count, const int destRank, const int tag, const Comm< Ordinal > &comm)
Variant of send() that takes a tag (and restores the correct order of arguments). ...
virtual void barrier() const =0
Pause every process in *this communicator until all the processes reach this point.
Encapsulate how an array of non-const objects with value sematics is serialized into a char[] array...
RCP< CommRequest< Ordinal > > ireceive(const ArrayRCP< Packet > &recvBuffer, const int sourceRank, const int tag, const Comm< Ordinal > &comm)
Variant of ireceive that takes a tag argument (and restores the correct order of arguments).
Templated array class derived from the STL std::vector.
Abstract interface for distributed-memory communication.
void push_back(const value_type &x)
T * getRawPtr() const
Return a raw pointer to beginning of array or NULL if unsized.
Defines basic traits for the ordinal field type.
Default traits class that just returns typeid(T).name().
virtual void broadcast(const int rootRank, const Ordinal bytes, char buffer[]) const =0
Broadcast values from the root process to the slave processes.
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos, as well as a number of utility routines.
Base interface class for user-defined reduction operations for objects that use reference semantics...
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.
void ssend(const Packet sendBuffer[], const Ordinal count, const int destRank, const int tag, const Comm< Ordinal > &comm)
Variant of ssend() that takes a tag (and restores the correct order of arguments).
Defines basic traits for the scalar field type.
Smart reference counting pointer class for automatic garbage collection.
RCP< CommRequest< Ordinal > > isend(const ArrayRCP< const Packet > &sendBuffer, const int destRank, const int tag, const Comm< Ordinal > &comm)
Variant of isend() that takes a tag (and restores the correct order of arguments).
virtual int receive(const int sourceRank, const Ordinal bytes, char recvBuffer[]) const =0
Blocking receive of data from this process to another process.
T * getRawPtr() const
Get the raw C++ pointer to the underlying object.
Encapsulation of a pending nonblocking communication operation.
void reduce(const Ordinal count, const Packet inBuffer[], Packet inoutBuffer[]) const
void reduce(const Ordinal count, const Packet inBuffer[], Packet inoutBuffer[]) const
Defines basic traits returning the name of a type in a portable and readable way. ...
Definition of Teuchos::as, for conversions between types.
void reduce(const Ordinal count, const Packet inBuffer[], Packet inoutBuffer[]) const
void readySend(const Packet sendBuffer[], const Ordinal count, const int destRank, const int tag, const Comm< Ordinal > &comm)
Variant of readySend() that accepts a message tag.
#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...
Simple wrapper class for raw pointers to single objects where no persisting relationship exists...
virtual int getSize() const =0
Returns the number of processes that make up this communicator.
Encapsulate how an array of const objects with value sematics is serialized into a const char[] array...
Reference-counted smart pointer for managing arrays.
Replacement for std::vector that is compatible with the Teuchos Memory Management classes...