10 #ifndef TEUCHOS_COMM_HELPERS_HPP
11 #define TEUCHOS_COMM_HELPERS_HPP
25 #ifdef HAVE_TEUCHOS_MPI
27 #endif // HAVE_TEUCHOS_MPI
37 #ifdef HAVE_TEUCHOS_MPI
46 std::string getMpiErrorString (
const int errCode);
49 #endif // HAVE_TEUCHOS_MPI
55 template<
typename Ordinal>
56 int rank(
const Comm<Ordinal>& comm);
62 template<
typename Ordinal>
63 int size(
const Comm<Ordinal>& comm);
69 template<
typename Ordinal>
70 void barrier(
const Comm<Ordinal>& comm);
76 template<
typename Ordinal,
typename Packet>
78 const Comm<Ordinal>& comm,
80 const Ordinal count, Packet buffer[]
87 template<
typename Ordinal,
typename Packet>
89 const Comm<Ordinal>& comm,
91 const ArrayView<Packet> &buffer
98 template<
typename Ordinal,
typename Packet>
100 const Comm<Ordinal>& comm,
101 const int rootRank, Packet *
object
108 template<
typename Ordinal,
typename Packet>
110 const Comm<Ordinal>& comm,
111 const int rootRank,
const Ptr<Packet> &
object
118 template<
typename Ordinal,
typename Packet>
120 const Comm<Ordinal>& comm,
const Serializer<Ordinal,Packet> &serializer,
121 const int rootRank,
const Ordinal count, Packet*
const buffer[]
128 template<
typename Ordinal,
typename Packet>
130 const Comm<Ordinal>& comm,
const Serializer<Ordinal,Packet> &serializer,
131 const int rootRank,
const ArrayView<
const Ptr<Packet> > &buffer
139 template<
typename Ordinal,
typename Packet,
typename Serializer>
141 const Comm<Ordinal>& comm,
142 const Serializer& serializer,
144 const Ordinal count, Packet buffer[]
151 template<
typename Ordinal,
typename Packet>
153 gather (
const Packet sendBuf[],
154 const Ordinal sendCount,
156 const Ordinal recvCount,
158 const Comm<Ordinal>& comm);
164 template<
typename Ordinal,
typename Packet>
166 gatherv (
const Packet sendBuf[],
167 const Ordinal sendCount,
169 const Ordinal recvCounts[],
170 const Ordinal displs[],
172 const Comm<Ordinal>& comm);
179 template<
typename Ordinal,
typename Packet>
181 const Comm<Ordinal>& comm,
182 const Ordinal sendCount,
const Packet sendBuffer[],
183 const Ordinal recvCount, Packet recvBuffer[]
191 template<
typename Ordinal,
typename Packet>
193 const Comm<Ordinal>& comm,
const Serializer<Ordinal,Packet> &serializer,
194 const Ordinal sendCount,
const Packet*
const sendBuffer[],
195 const Ordinal recvCount, Packet*
const recvBuffer[]
203 template<
typename Ordinal,
typename Packet,
typename Serializer>
205 const Comm<Ordinal>& comm,
206 const Serializer& serializer,
207 const Ordinal sendCount,
const Packet sendBuffer[],
208 const Ordinal recvCount, Packet recvBuffer[]
237 template<
typename Ordinal,
typename Packet>
240 const Ordinal sendCount,
242 const Ordinal recvCount,
250 (
true, std::logic_error,
"Teuchos::scatter<" <<
252 <<
">: Generic version is not yet implemented. This function currently "
253 "only has an implementtion for Ordinal = int and Packet = int. "
254 "See Bug 6375 and Bug 6336.");
284 template<
typename Ordinal,
typename Packet>
286 reduce (
const Packet sendBuf[],
315 template<
typename Ordinal,
typename Packet>
318 const Ordinal count,
const Packet sendBuffer[], Packet globalReducts[]
326 template<
typename Ordinal,
typename Packet>
329 const Ordinal count,
const Packet sendBuffer[], Packet globalReducts[]
337 template<
typename Ordinal,
typename Packet>
348 template<
typename Ordinal,
typename Packet>
352 const Ordinal count,
const Packet*
const sendBuffer[], Packet*
const globalReducts[]
360 template<
typename Ordinal,
typename Packet,
typename Serializer>
365 const Ordinal count,
const Packet sendBuffer[], Packet globalReducts[]
373 template<
typename Ordinal,
typename Packet,
typename Serializer>
378 const Ordinal count,
const Packet sendBuffer[], Packet globalReducts[]
386 template<
typename Ordinal,
typename Packet>
389 const Ordinal count,
const Packet sendBuffer[], Packet scanReducts[]
397 template<
typename Ordinal,
typename Packet>
400 const Ordinal count,
const Packet sendBuffer[], Packet scanReducts[]
408 template<
typename Ordinal,
typename Packet>
419 template<
typename Ordinal,
typename Packet>
423 const Ordinal count,
const Packet*
const sendBuffer[], Packet*
const scanReducts[]
431 template<
typename Ordinal,
typename Packet,
typename Serializer>
436 const Ordinal count,
const Packet sendBuffer[], Packet scanReducts[]
444 template<
typename Ordinal,
typename Packet,
typename Serializer>
449 const Ordinal count,
const Packet sendBuffer[], Packet scanReducts[]
456 template<
typename Ordinal,
typename Packet>
459 const Ordinal count,
const Packet sendBuffer[],
const int destRank
463 template<
typename Ordinal,
typename Packet>
465 send (
const Packet sendBuffer[],
475 template<
typename Ordinal,
typename Packet>
478 const Ordinal count,
const Packet sendBuffer[],
const int destRank
482 template<
typename Ordinal,
typename Packet>
484 ssend (
const Packet sendBuffer[],
494 template<
typename Ordinal,
typename Packet>
497 const Packet &
send,
const int destRank
504 template<
typename Ordinal,
typename Packet>
507 const Packet &
send,
const int destRank
516 template<
typename Ordinal,
typename Packet>
519 const Ordinal count,
const Packet*
const sendBuffer[],
const int destRank
527 template<
typename Ordinal,
typename Packet,
typename Serializer>
531 const Ordinal count,
const Packet sendBuffer[],
const int destRank
538 template<
typename Ordinal,
typename Packet>
541 const int sourceRank,
const Ordinal count, Packet recvBuffer[]
548 template<
typename Ordinal,
typename Packet>
551 const int sourceRank, Packet *recv
558 template<
typename Ordinal,
typename Packet>
561 const int sourceRank,
const Ordinal count, Packet*
const recvBuffer[]
569 template<
typename Ordinal,
typename Packet,
typename Serializer>
573 const int sourceRank,
const Ordinal count, Packet recvBuffer[]
581 template<
typename Ordinal,
typename Packet>
589 template<
typename Ordinal,
typename Packet>
601 template<
typename Ordinal,
typename Packet>
613 template<
typename Ordinal,
typename Packet,
typename Serializer>
625 template<
typename Ordinal,
typename Packet>
633 template<
typename Ordinal,
typename Packet>
644 template<
typename Ordinal,
typename Packet>
656 template<
typename Ordinal,
typename Packet,
typename Serializer>
677 template<
typename Ordinal,
typename Packet>
685 template<
typename Ordinal,
typename Packet>
688 const int sourceRank,
703 template<
typename Ordinal,
typename Packet>
715 template<
typename Ordinal,
typename Packet,
typename Serializer>
734 template<
typename Ordinal>
769 template<
typename Ordinal>
798 template<
typename Ordinal>
811 template<
typename Ordinal,
typename Packet>
818 const Packet inBuffer[],
832 template<
typename Ordinal,
typename Packet>
839 const Packet inBuffer[],
853 template<
typename Ordinal,
typename Packet>
860 const Packet inBuffer[],
870 template<
typename Ordinal,
typename Packet>
877 const Packet inBuffer[],
892 namespace MixMaxUtilities {
895 template<
bool isComparable,
typename Ordinal,
typename Packet>
899 template<
typename Ordinal,
typename Packet>
900 class Min<true,Ordinal,Packet> {
904 const Packet inBuffer[],
908 for(
int i = 0; i < count; ++i )
909 inoutBuffer[i] =
TEUCHOS_MIN(inoutBuffer[i],inBuffer[i]);
914 template<
typename Ordinal,
typename Packet>
915 class Min<false,Ordinal,Packet> {
924 true,std::logic_error,
926 <<
" does not support comparison operations!"
932 template<
bool isComparable,
typename Ordinal,
typename Packet>
936 template<
typename Ordinal,
typename Packet>
937 class Max<true,Ordinal,Packet> {
941 const Packet inBuffer[],
945 for(
int i = 0; i < count; ++i )
946 inoutBuffer[i] =
TEUCHOS_MAX(inoutBuffer[i],inBuffer[i]);
951 template<
typename Ordinal,
typename Packet>
952 class Max<false,Ordinal,Packet> {
961 true,std::logic_error,
963 <<
" does not support comparison operations!"
969 template<
bool isComparable,
typename Ordinal,
typename Packet>
973 template<
typename Ordinal,
typename Packet>
974 class AND<true,Ordinal,Packet> {
978 const Packet inBuffer[],
982 for(
int i = 0; i < count; ++i )
983 inoutBuffer[i] = inoutBuffer[i] && inBuffer[i];
988 template<
typename Ordinal,
typename Packet>
989 class AND<false,Ordinal,Packet> {
998 true,std::logic_error,
1000 <<
" does not support logical AND operations!"
1009 template<
typename Ordinal,
typename Packet>
1011 const Ordinal count,
1012 const Packet inBuffer[],
1013 Packet inoutBuffer[]
1016 for(
int i = 0; i < count; ++i )
1017 inoutBuffer[i] += inBuffer[i];
1021 template<
typename Ordinal,
typename Packet>
1023 const Ordinal count,
1024 const Packet inBuffer[],
1025 Packet inoutBuffer[]
1029 min_type::min (count, inBuffer, inoutBuffer);
1033 template<
typename Ordinal,
typename Packet>
1035 const Ordinal count,
1036 const Packet inBuffer[],
1037 Packet inoutBuffer[]
1041 max_type::max (count,inBuffer,inoutBuffer);
1045 template<
typename Ordinal,
typename Packet>
1047 const Ordinal count,
1048 const Packet inBuffer[],
1049 Packet inoutBuffer[]
1053 and_type::andOp (count, inBuffer, inoutBuffer);
1083 template<
typename Ordinal,
typename Packet>
1084 ValueTypeReductionOp<Ordinal,Packet>*
1088 switch (reductType) {
1093 if (ST::isComparable) {
1098 (! ST::isComparable, std::invalid_argument,
"Teuchos::createOp"
1100 <<
" is not less-than comparable, so it does not make sense to do a "
1101 "MIN reduction with it.");
1105 if (ST::isComparable) {
1110 (! ST::isComparable, std::invalid_argument,
"Teuchos::createOp"
1112 <<
" is not less-than comparable, so it does not make sense to do a "
1113 "MAX reduction with it.");
1121 true, std::invalid_argument,
"Teuchos::createOp(EReductionType): "
1122 "Invalid EReductionType value " << reductType <<
". Valid values "
1123 "include REDUCE_SUM, REDUCE_MIN, REDUCE_MAX, and REDUCE_AND.");
1136 template<
typename Ordinal>
1137 int Teuchos::rank(
const Comm<Ordinal>& comm)
1139 return comm.getRank();
1143 template<
typename Ordinal>
1144 int Teuchos::size(
const Comm<Ordinal>& comm)
1146 return comm.getSize();
1150 template<
typename Ordinal>
1151 void Teuchos::barrier(
const Comm<Ordinal>& comm)
1154 "Teuchos::CommHelpers: barrier<"
1155 <<OrdinalTraits<Ordinal>::name()
1162 template<
typename Ordinal,
typename Packet>
1163 void Teuchos::broadcast(
1164 const Comm<Ordinal>& comm,
1165 const int rootRank,
const Ordinal count, Packet buffer[]
1169 "Teuchos::CommHelpers: broadcast<"
1170 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
1173 ValueTypeSerializationBuffer<Ordinal,Packet>
1174 charBuffer(count,buffer);
1176 rootRank,charBuffer.getBytes(),charBuffer.getCharBuffer()
1181 template<
typename Ordinal,
typename Packet>
1182 void Teuchos::broadcast(
1183 const Comm<Ordinal>& comm,
1185 const ArrayView<Packet> &buffer
1188 broadcast<Ordinal, Packet>(comm, rootRank, buffer.size(), buffer.getRawPtr() );
1192 template<
typename Ordinal,
typename Packet>
1193 void Teuchos::broadcast(
1194 const Comm<Ordinal>& comm,
1195 const int rootRank, Packet *
object
1198 broadcast<Ordinal,Packet>(comm,rootRank,1,object);
1202 template<
typename Ordinal,
typename Packet>
1203 void Teuchos::broadcast(
1204 const Comm<Ordinal>& comm,
1205 const int rootRank,
const Ptr<Packet> &
object
1208 broadcast<Ordinal,Packet>(comm,rootRank,1,
object.getRawPtr());
1212 template<
typename Ordinal,
typename Packet>
1213 void Teuchos::broadcast(
1214 const Comm<Ordinal>& comm,
const Serializer<Ordinal,Packet> &serializer,
1215 const int rootRank,
const Ordinal count, Packet*
const buffer[]
1219 "Teuchos::CommHelpers: broadcast<"
1220 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
1221 <<
">( reference type )"
1223 ReferenceTypeSerializationBuffer<Ordinal,Packet>
1224 charBuffer(serializer, count, buffer);
1226 rootRank,charBuffer.getBytes(),charBuffer.getCharBuffer()
1231 template<
typename Ordinal,
typename Packet>
1232 void Teuchos::broadcast(
1233 const Comm<Ordinal>& comm,
const Serializer<Ordinal,Packet> &serializer,
1234 const int rootRank,
const ArrayView<
const Ptr<Packet> > &buffer
1237 Array<Packet*> bufferPtrArray;
1238 for (
int i = 0; i < buffer.size(); ++i) {
1239 bufferPtrArray.push_back(buffer[i].
getRawPtr());
1241 broadcast<Ordinal,Packet>(comm, serializer, rootRank,
1242 buffer.size(), bufferPtrArray.getRawPtr());
1245 template<
typename Ordinal,
typename Packet,
typename Serializer>
1246 void Teuchos::broadcast(
1247 const Comm<Ordinal>& comm,
1248 const Serializer& serializer,
1249 const int rootRank,
const Ordinal count, Packet buffer[]
1253 "Teuchos::CommHelpers: broadcast<"
1254 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
1257 ValueTypeSerializationBuffer<Ordinal,Packet,Serializer>
1258 charBuffer(count,buffer,
rcp(&serializer,
false));
1260 rootRank,charBuffer.getBytes(),charBuffer.getCharBuffer()
1265 template<
typename Ordinal,
typename Packet>
1266 void Teuchos::gatherAll(
1267 const Comm<Ordinal>& comm,
1268 const Ordinal sendCount,
const Packet sendBuffer[],
1269 const Ordinal recvCount, Packet recvBuffer[]
1273 "Teuchos::CommHelpers: gatherAll<"
1274 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
1277 ConstValueTypeSerializationBuffer<Ordinal,Packet>
1278 charSendBuffer(sendCount,sendBuffer);
1279 ValueTypeSerializationBuffer<Ordinal,Packet>
1280 charRecvBuffer(recvCount,recvBuffer);
1282 charSendBuffer.getBytes(),charSendBuffer.getCharBuffer()
1283 ,charRecvBuffer.getBytes(),charRecvBuffer.getCharBuffer()
1287 template<
typename Ordinal,
typename Packet>
1289 Teuchos::gather (
const Packet sendBuf[],
1290 const Ordinal sendCount,
1292 const Ordinal recvCount,
1294 const Comm<Ordinal>& comm)
1297 "Teuchos::CommHelpers: gather<"
1298 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
1301 ConstValueTypeSerializationBuffer<Ordinal,Packet>
1302 charSendBuffer (sendCount, sendBuf);
1303 ValueTypeSerializationBuffer<Ordinal,Packet>
1304 charRecvBuffer (recvCount, recvBuf);
1305 comm.gather (charSendBuffer.getBytes (),
1306 charSendBuffer.getCharBuffer (),
1307 charRecvBuffer.getBytes (),
1308 charRecvBuffer.getCharBuffer (),
1312 template<
typename Ordinal,
typename Packet>
1314 Teuchos::gatherv (
const Packet sendBuf[],
1315 const Ordinal sendCount,
1317 const Ordinal recvCounts[],
1318 const Ordinal displs[],
1320 const Comm<Ordinal>& comm)
1343 "Teuchos::gatherv: The general case is not implemented.");
1346 template<
typename Ordinal,
typename Packet>
1347 void Teuchos::gatherAll(
1348 const Comm<Ordinal>& comm,
const Serializer<Ordinal,Packet> &serializer,
1349 const Ordinal sendCount,
const Packet*
const sendBuffer[],
1350 const Ordinal recvCount, Packet*
const recvBuffer[]
1356 template<
typename Ordinal,
typename Packet,
typename Serializer>
1357 void Teuchos::gatherAll(
1358 const Comm<Ordinal>& comm,
1359 const Serializer& serializer,
1360 const Ordinal sendCount,
const Packet sendBuffer[],
1361 const Ordinal recvCount, Packet recvBuffer[]
1365 "Teuchos::CommHelpers: gatherAll<"
1366 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
1369 ConstValueTypeSerializationBuffer<Ordinal,Packet,Serializer>
1370 charSendBuffer(sendCount,sendBuffer,
rcp(&serializer,
false));
1371 ValueTypeSerializationBuffer<Ordinal,Packet,Serializer>
1372 charRecvBuffer(recvCount,recvBuffer,
rcp(&serializer,
false));
1374 charSendBuffer.getBytes(),charSendBuffer.getCharBuffer()
1375 ,charRecvBuffer.getBytes(),charRecvBuffer.getCharBuffer()
1380 template<
typename Ordinal,
typename Packet>
1382 Teuchos::reduce (
const Packet sendBuf[],
1384 const Ordinal count,
1387 const Comm<Ordinal>& comm)
1393 (
true, std::logic_error,
"Teuchos::reduce<" <<
1394 TypeNameTraits<Ordinal>::name () <<
"," << TypeNameTraits<Packet>::name ()
1395 <<
">: Generic version not implemented. We only implement this function "
1396 "for Ordinal = int and Packet = specific types.");
1400 template<
typename Ordinal,
typename Packet>
1401 void Teuchos::reduceAll(
1402 const Comm<Ordinal>& comm,
const ValueTypeReductionOp<Ordinal,Packet> &reductOp
1403 ,
const Ordinal count,
const Packet sendBuffer[], Packet globalReducts[]
1407 "Teuchos::CommHelpers: reduceAll<"
1408 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
1409 <<
">( value type, user-defined op )"
1411 ConstValueTypeSerializationBuffer<Ordinal,Packet>
1412 charSendBuffer(count,sendBuffer);
1413 ValueTypeSerializationBuffer<Ordinal,Packet>
1414 charGlobalReducts(count,globalReducts);
1415 CharToValueTypeReductionOp<Ordinal,Packet>
1416 charReductOp(
rcp(&reductOp,
false));
1418 charReductOp,charSendBuffer.getBytes(),charSendBuffer.getCharBuffer()
1419 ,charGlobalReducts.getCharBuffer()
1424 template<
typename Ordinal,
typename Packet>
1425 void Teuchos::reduceAll(
1427 const Ordinal count,
const Packet sendBuffer[], Packet globalReducts[]
1431 "Teuchos::CommHelpers: reduceAll<"
1432 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
1433 <<
">( value type, "<<
toString(reductType)<<
" )"
1436 ValueTypeReductionOp<Ordinal,Packet>* reductOp =
1437 createOp<Ordinal, Packet> (reductType);
1439 reduceAll(comm,*reductOp,count,sendBuffer,globalReducts);
1441 catch (std::exception& e) {
1457 #ifdef HAVE_TEUCHOS_COMPLEX
1461 reduceAll<int, std::complex<double> > (
const Comm<int>& comm,
1462 const EReductionType reductType,
1464 const std::complex<double> sendBuffer[],
1465 std::complex<double> globalReducts[]);
1468 ireceive<int, std::complex<double> > (
const Comm<int>& comm,
1469 const ArrayRCP<std::complex<double> >& recvBuffer,
1470 const int sourceRank);
1473 ireceive<int, std::complex<double> > (
const ArrayRCP<std::complex<double> > &recvBuffer,
1474 const int sourceRank,
1476 const Comm<int>& comm);
1479 send<int, std::complex<double> > (
const Comm<int>& comm,
1481 const std::complex<double> sendBuffer[],
1482 const int destRank);
1485 send<int, std::complex<double> > (
const std::complex<double> sendBuffer[],
1489 const Comm<int>& comm);
1492 isend<int, std::complex<double> > (
const ArrayRCP<const std::complex<double> >& sendBuffer,
1495 const Comm<int>& comm);
1500 reduceAll<int, std::complex<float> > (
const Comm<int>& comm,
1501 const EReductionType reductType,
1503 const std::complex<float> sendBuffer[],
1504 std::complex<float> globalReducts[]);
1507 ireceive<int, std::complex<float> > (
const Comm<int>& comm,
1508 const ArrayRCP<std::complex<float> >& recvBuffer,
1509 const int sourceRank);
1512 ireceive<int, std::complex<float> > (
const ArrayRCP<std::complex<float> > &recvBuffer,
1513 const int sourceRank,
1515 const Comm<int>& comm);
1518 send<int, std::complex<float> > (
const Comm<int>& comm,
1520 const std::complex<float> sendBuffer[],
1521 const int destRank);
1524 send<int, std::complex<float> > (
const std::complex<float> sendBuffer[],
1528 const Comm<int>& comm);
1531 isend<int, std::complex<float> > (
const ArrayRCP<const std::complex<float> >& sendBuffer,
1534 const Comm<int>& comm);
1535 #endif // HAVE_TEUCHOS_COMPLEX
1542 const EReductionType reductType,
1544 const double sendBuffer[],
1545 double globalReducts[]);
1549 const ArrayRCP<double>& recvBuffer,
1550 const int sourceRank);
1554 const int sourceRank,
1556 const Comm<int>& comm);
1561 const double sendBuffer[],
1562 const int destRank);
1569 const Comm<int>& comm);
1575 const Comm<int>& comm);
1581 const EReductionType reductType,
1583 const float sendBuffer[],
1584 float globalReducts[]);
1588 const ArrayRCP<float>& recvBuffer,
1589 const int sourceRank);
1593 const int sourceRank,
1595 const Comm<int>& comm);
1600 const float sendBuffer[],
1601 const int destRank);
1608 const Comm<int>& comm);
1614 const Comm<int>& comm);
1620 const int sendCount,
1621 long long recvBuf[],
1622 const int recvCount,
1624 const Comm<int>& comm);
1628 const int sendCount,
1629 long long recvBuf[],
1630 const int recvCounts[],
1633 const Comm<int>& comm);
1637 const EReductionType reductType,
1639 const long long sendBuffer[],
1640 long long globalReducts[]);
1644 const ArrayRCP<long long>& recvBuffer,
1645 const int sourceRank);
1649 const int sourceRank,
1651 const Comm<int>& comm);
1656 const long long sendBuffer[],
1657 const int destRank);
1664 const Comm<int>& comm);
1670 const Comm<int>& comm);
1676 const int sendCount,
1677 unsigned long long recvBuf[],
1678 const int recvCount,
1680 const Comm<int>& comm);
1684 const int sendCount,
1685 unsigned long long recvBuf[],
1686 const int recvCounts[],
1689 const Comm<int>& comm);
1693 const EReductionType reductType,
1695 const unsigned long long sendBuffer[],
1696 unsigned long long globalReducts[]);
1700 const ArrayRCP<unsigned long long>& recvBuffer,
1701 const int sourceRank);
1705 const int sourceRank,
1707 const Comm<int>& comm);
1712 const unsigned long long sendBuffer[],
1713 const int destRank);
1720 const Comm<int>& comm);
1726 const Comm<int>& comm);
1732 const int sendCount,
1734 const int recvCount,
1736 const Comm<int>& comm);
1740 const int sendCount,
1742 const int recvCounts[],
1745 const Comm<int>& comm);
1749 const EReductionType reductType,
1751 const long sendBuffer[],
1752 long globalReducts[]);
1756 const ArrayRCP<long>& recvBuffer,
1757 const int sourceRank);
1761 const int sourceRank,
1763 const Comm<int>& comm);
1768 const long sendBuffer[],
1769 const int destRank);
1776 const Comm<int>& comm);
1782 const Comm<int>& comm);
1788 const int sendCount,
1789 unsigned long recvBuf[],
1790 const int recvCount,
1792 const Comm<int>& comm);
1796 const int sendCount,
1797 unsigned long recvBuf[],
1798 const int recvCounts[],
1801 const Comm<int>& comm);
1805 const EReductionType reductType,
1807 const unsigned long sendBuffer[],
1808 unsigned long globalReducts[]);
1812 const ArrayRCP<unsigned long>& recvBuffer,
1813 const int sourceRank);
1817 const int sourceRank,
1819 const Comm<int>& comm);
1824 const unsigned long sendBuffer[],
1825 const int destRank);
1832 const Comm<int>& comm);
1838 const Comm<int>& comm);
1844 const int sendCount,
1846 const int recvCount,
1848 const Comm<int>& comm);
1852 const int sendCount,
1854 const int recvCounts[],
1857 const Comm<int>& comm);
1861 const int sendCount,
1863 const int recvCount,
1865 const Comm<int>& comm);
1871 const EReductionType reductType,
1873 const Comm<int>& comm);
1879 const EReductionType reductType,
1881 const Comm<int>& comm);
1885 unsigned long recvBuf[],
1887 const EReductionType reductType,
1889 const Comm<int>& comm);
1893 unsigned long long recvBuf[],
1895 const EReductionType reductType,
1897 const Comm<int>& comm);
1903 const EReductionType reductType,
1905 const Comm<int>& comm);
1909 const EReductionType reductType,
1911 const int sendBuffer[],
1912 int globalReducts[]);
1917 const ArrayRCP<int>& recvBuffer,
1918 const int sourceRank);
1922 const int sourceRank,
1924 const Comm<int>& comm);
1929 const int sendBuffer[],
1930 const int destRank);
1937 const Comm<int>& comm);
1943 const Comm<int>& comm);
1949 const int sendCount,
1950 unsigned int recvBuf[],
1951 const int recvCount,
1953 const Comm<int>& comm);
1957 const int sendCount,
1958 unsigned int recvBuf[],
1959 const int recvCounts[],
1962 const Comm<int>& comm);
1966 const EReductionType reductType,
1968 const unsigned int sendBuffer[],
1969 unsigned int globalReducts[]);
1973 const ArrayRCP<unsigned int>& recvBuffer,
1974 const int sourceRank);
1978 const int sourceRank,
1980 const Comm<int>& comm);
1985 const unsigned int sendBuffer[],
1986 const int destRank);
1993 const Comm<int>& comm);
1999 const Comm<int>& comm);
2005 const int sendCount,
2007 const int recvCount,
2009 const Comm<int>& comm);
2013 const int sendCount,
2015 const int recvCounts[],
2018 const Comm<int>& comm);
2022 const EReductionType reductType,
2024 const short sendBuffer[],
2025 short globalReducts[]);
2029 const ArrayRCP<short>& recvBuffer,
2030 const int sourceRank);
2034 const int sourceRank,
2036 const Comm<int>& comm);
2041 const short sendBuffer[],
2042 const int destRank);
2049 const Comm<int>& comm);
2055 const Comm<int>& comm);
2069 reduceAll<int, char> (
const Comm<int>& comm,
2070 const EReductionType reductType,
2072 const char sendBuffer[],
2073 char globalReducts[]);
2078 template<
typename Ordinal,
typename Packet>
2079 void Teuchos::reduceAll(
2081 ,
const Packet &
send,
const Ptr<Packet> &globalReduct
2086 reduceAll<Ordinal,Packet>(comm, reductType, 1, &
send, &*globalReduct);
2090 template<
typename Ordinal,
typename Packet>
2091 void Teuchos::reduceAll(
2092 const Comm<Ordinal>& comm,
const Serializer<Ordinal,Packet> &serializer,
2093 const ReferenceTypeReductionOp<Ordinal,Packet> &reductOp,
2094 const Ordinal count,
const Packet*
const sendBuffer[], Packet*
const globalReducts[]
2098 "Teuchos::CommHelpers: reduceAll<"
2099 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
2100 <<
">( reference type )"
2102 ConstReferenceTypeSerializationBuffer<Ordinal,Packet>
2103 charSendBuffer(serializer,count,sendBuffer);
2104 ReferenceTypeSerializationBuffer<Ordinal,Packet>
2105 charGlobalReducts(serializer,count,globalReducts);
2106 CharToReferenceTypeReductionOp<Ordinal,Packet>
2107 charReductOp(
rcp(&serializer,
false),
rcp(&reductOp,
false));
2109 charReductOp,charSendBuffer.getBytes(),charSendBuffer.getCharBuffer()
2110 ,charGlobalReducts.getCharBuffer()
2114 template<
typename Ordinal,
typename Packet,
typename Serializer>
2115 void Teuchos::reduceAll(
2116 const Comm<Ordinal>& comm,
2117 const Serializer& serializer,
2118 const ValueTypeReductionOp<Ordinal,Packet> &reductOp,
2119 const Ordinal count,
const Packet sendBuffer[], Packet globalReducts[]
2123 "Teuchos::CommHelpers: reduceAll<"
2124 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
2125 <<
">( value type, user-defined op )"
2127 ConstValueTypeSerializationBuffer<Ordinal,Packet,Serializer>
2128 charSendBuffer(count,sendBuffer,
rcp(&serializer,
false));
2129 ValueTypeSerializationBuffer<Ordinal,Packet,Serializer>
2130 charGlobalReducts(count,globalReducts,
rcp(&serializer,
false));
2131 CharToValueTypeReductionOp<Ordinal,Packet,Serializer>
2132 charReductOp(
rcp(&reductOp,
false),
rcp(&serializer,
false));
2134 charReductOp,charSendBuffer.getBytes(),charSendBuffer.getCharBuffer()
2135 ,charGlobalReducts.getCharBuffer()
2140 template<
typename Ordinal,
typename Packet,
typename Serializer>
2141 void Teuchos::reduceAll(
2142 const Comm<Ordinal>& comm,
2143 const Serializer& serializer,
2145 const Ordinal count,
const Packet sendBuffer[], Packet globalReducts[]
2149 "Teuchos::CommHelpers: reduceAll<"
2150 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
2151 <<
">( value type, "<<
toString(reductType)<<
" )"
2154 ValueTypeReductionOp<Ordinal,Packet>* reductOp =
2155 createOp<Ordinal, Packet> (reductType);
2157 reduceAll(comm,serializer,*reductOp,count,sendBuffer,globalReducts);
2159 catch (std::exception& e) {
2167 template<
typename Ordinal,
typename Packet>
2169 const Comm<Ordinal>& comm,
const ValueTypeReductionOp<Ordinal,Packet> &reductOp,
2170 const Ordinal count,
const Packet sendBuffer[], Packet scanReducts[]
2174 "Teuchos::CommHelpers: scan<"
2175 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
2176 <<
">( value type, user-defined op )"
2178 ConstValueTypeSerializationBuffer<Ordinal,Packet>
2179 charSendBuffer(count,sendBuffer);
2180 ValueTypeSerializationBuffer<Ordinal,Packet>
2181 charScanReducts(count,scanReducts);
2182 CharToValueTypeReductionOp<Ordinal,Packet>
2183 charReductOp(
rcp(&reductOp,
false));
2185 charReductOp,charSendBuffer.getBytes(),charSendBuffer.getCharBuffer()
2186 ,charScanReducts.getCharBuffer()
2191 template<
typename Ordinal,
typename Packet>
2194 const Ordinal count,
const Packet sendBuffer[], Packet scanReducts[]
2198 "Teuchos::CommHelpers: scan<"
2199 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
2200 <<
">( value type, "<<
toString(reductType)<<
" )"
2203 ValueTypeReductionOp<Ordinal,Packet>* reductOp =
2204 createOp<Ordinal, Packet> (reductType);
2206 scan(comm,*reductOp,count,sendBuffer,scanReducts);
2208 catch (std::exception& e) {
2216 template<
typename Ordinal,
typename Packet>
2219 const Packet &
send,
const Ptr<Packet> &scanReduct
2222 scan<Ordinal,Packet>(comm, reductType, 1, &
send, &*scanReduct);
2226 template<
typename Ordinal,
typename Packet>
2228 const Comm<Ordinal>& comm,
const Serializer<Ordinal,Packet> &serializer,
2229 const ReferenceTypeReductionOp<Ordinal,Packet> &reductOp,
2230 const Ordinal count,
const Packet*
const sendBuffer[], Packet*
const scanReducts[]
2236 template<
typename Ordinal,
typename Packet,
typename Serializer>
2238 const Comm<Ordinal>& comm,
2239 const Serializer& serializer,
2240 const ValueTypeReductionOp<Ordinal,Packet> &reductOp,
2241 const Ordinal count,
const Packet sendBuffer[], Packet scanReducts[]
2245 "Teuchos::CommHelpers: scan<"
2246 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
2247 <<
">( value type, user-defined op )"
2249 ConstValueTypeSerializationBuffer<Ordinal,Packet,Serializer>
2250 charSendBuffer(count,sendBuffer,
rcp(&serializer,
false));
2251 ValueTypeSerializationBuffer<Ordinal,Packet,Serializer>
2252 charScanReducts(count,scanReducts,
rcp(&serializer,
false));
2253 CharToValueTypeReductionOp<Ordinal,Packet,Serializer>
2254 charReductOp(
rcp(&reductOp,
false),
rcp(&serializer,
false));
2256 charReductOp,charSendBuffer.getBytes(),charSendBuffer.getCharBuffer()
2257 ,charScanReducts.getCharBuffer()
2262 template<
typename Ordinal,
typename Packet,
typename Serializer>
2264 const Comm<Ordinal>& comm,
2265 const Serializer& serializer,
2267 const Ordinal count,
const Packet sendBuffer[], Packet scanReducts[]
2271 "Teuchos::CommHelpers: scan<"
2272 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
2273 <<
">( value type, "<<
toString(reductType)<<
" )"
2276 ValueTypeReductionOp<Ordinal,Packet>* reductOp =
2277 createOp<Ordinal, Packet> (reductType);
2279 scan(comm,serializer,*reductOp,count,sendBuffer,scanReducts);
2281 catch (std::exception& e) {
2288 template<
typename Ordinal,
typename Packet>
2290 const Comm<Ordinal>& comm,
2291 const Ordinal count,
const Packet sendBuffer[],
const int destRank
2295 "Teuchos::CommHelpers: send<"
2296 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
2299 ConstValueTypeSerializationBuffer<Ordinal,Packet>
2300 charSendBuffer(count,sendBuffer);
2302 charSendBuffer.getBytes(),charSendBuffer.getCharBuffer()
2307 template<
typename Ordinal,
typename Packet>
2310 const Ordinal count,
2316 "Teuchos::CommHelpers: send<"
2321 comm.
send (charSendBuffer.getBytes (), charSendBuffer.getCharBuffer (), destRank, tag);
2324 template<
typename Ordinal,
typename Packet>
2326 const Comm<Ordinal>& comm,
2327 const Ordinal count,
const Packet sendBuffer[],
const int destRank
2331 "Teuchos::CommHelpers: ssend<"
2332 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
2335 ConstValueTypeSerializationBuffer<Ordinal,Packet>
2336 charSendBuffer(count,sendBuffer);
2338 charSendBuffer.getBytes(),charSendBuffer.getCharBuffer()
2343 template<
typename Ordinal,
typename Packet>
2346 const Ordinal count,
2352 "Teuchos::CommHelpers: ssend<"
2357 buf_type charSendBuffer (count, sendBuffer);
2358 comm.
ssend (charSendBuffer.getBytes (),
2359 charSendBuffer.getCharBuffer (),
2363 template<
typename Ordinal,
typename Packet>
2365 const Comm<Ordinal>& comm,
2366 const Packet &
send,
const int destRank
2369 Teuchos::send<Ordinal,Packet>(comm,1,&
send,destRank);
2372 template<
typename Ordinal,
typename Packet>
2374 const Comm<Ordinal>& comm,
2375 const Packet &
send,
const int destRank
2378 Teuchos::ssend<Ordinal,Packet>(comm,1,&
send,destRank);
2381 template<
typename Ordinal,
typename Packet>
2383 const Comm<Ordinal>& comm,
const Serializer<Ordinal,Packet> &serializer,
2384 const Ordinal count,
const Packet*
const sendBuffer[],
const int destRank
2390 template<
typename Ordinal,
typename Packet,
typename Serializer>
2392 const Comm<Ordinal>& comm,
2393 const Serializer& serializer,
2394 const Ordinal count,
const Packet sendBuffer[],
const int destRank
2398 "Teuchos::CommHelpers: send<"
2399 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
2402 ConstValueTypeSerializationBuffer<Ordinal,Packet,Serializer>
2403 charSendBuffer(count,sendBuffer,
rcp(&serializer,
false));
2405 charSendBuffer.getBytes(),charSendBuffer.getCharBuffer()
2410 template<
typename Ordinal,
typename Packet>
2411 int Teuchos::receive(
2412 const Comm<Ordinal>& comm,
2413 const int sourceRank,
const Ordinal count, Packet recvBuffer[]
2417 "Teuchos::CommHelpers: receive<"
2418 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
2421 ValueTypeSerializationBuffer<Ordinal,Packet>
2422 charRecvBuffer(count,recvBuffer);
2423 return comm.receive(
2425 ,charRecvBuffer.getBytes(),charRecvBuffer.getCharBuffer()
2430 template<
typename Ordinal,
typename Packet>
2431 int Teuchos::receive(
2432 const Comm<Ordinal>& comm,
2433 const int sourceRank, Packet *recv
2436 return Teuchos::receive<Ordinal,Packet>(comm,sourceRank,1,recv);
2440 template<
typename Ordinal,
typename Packet>
2441 int Teuchos::receive(
2442 const Comm<Ordinal>& comm,
const Serializer<Ordinal,Packet> &serializer,
2443 const int sourceRank,
const Ordinal count, Packet*
const recvBuffer[]
2449 template<
typename Ordinal,
typename Packet,
typename Serializer>
2450 int Teuchos::receive(
2451 const Comm<Ordinal>& comm,
2452 const Serializer& serializer,
2453 const int sourceRank,
const Ordinal count, Packet recvBuffer[]
2457 "Teuchos::CommHelpers: receive<"
2458 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
2461 ValueTypeSerializationBuffer<Ordinal,Packet,Serializer>
2462 charRecvBuffer(count,recvBuffer,
rcp(&serializer,
false));
2463 return comm.receive(
2465 ,charRecvBuffer.getBytes(),charRecvBuffer.getCharBuffer()
2469 template<
typename Ordinal,
typename Packet>
2471 const Comm<Ordinal>& comm,
2472 const ArrayView<const Packet> &sendBuffer,
2477 "Teuchos::CommHelpers: readySend<"
2478 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
2481 ConstValueTypeSerializationBuffer<Ordinal,Packet>
2482 charSendBuffer(sendBuffer.size(), sendBuffer.getRawPtr());
2483 comm.readySend( charSendBuffer.getCharBufferView(), destRank );
2486 template<
typename Ordinal,
typename Packet>
2489 const Ordinal count,
2495 "Teuchos::CommHelpers: readySend<"
2500 buf_type charSendBuffer (count, sendBuffer);
2501 comm.
readySend (charSendBuffer.getBytes (),
2502 charSendBuffer.getCharBuffer (),
2506 template<
typename Ordinal,
typename Packet>
2508 const Comm<Ordinal>& comm,
2513 readySend<Ordinal, Packet>( comm,
arrayView(&send,1), destRank );
2516 template<
typename Ordinal,
typename Packet,
typename Serializer>
2518 const Comm<Ordinal>& comm,
2519 const Serializer& serializer,
2520 const ArrayView<const Packet> &sendBuffer,
2525 "Teuchos::CommHelpers: readySend<"
2526 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
2529 ConstValueTypeSerializationBuffer<Ordinal,Packet,Serializer>
2530 charSendBuffer(sendBuffer.size(), sendBuffer.getRawPtr(), serializer);
2531 comm.readySend( charSendBuffer.getCharBufferView(), destRank );
2534 template<
typename Ordinal,
typename Packet>
2537 const Comm<Ordinal>& comm,
2538 const ArrayRCP<const Packet> &sendBuffer,
2543 "Teuchos::CommHelpers: isend<"
2544 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
2547 ConstValueTypeSerializationBuffer<Ordinal,Packet>
2548 charSendBuffer(sendBuffer.size(), sendBuffer.getRawPtr());
2549 RCP<CommRequest<Ordinal> > commRequest = comm.isend(
2550 charSendBuffer.getCharBufferView(), destRank );
2555 template<
typename Ordinal,
typename Packet>
2560 const Comm<Ordinal>& comm)
2563 "Teuchos::isend<" << OrdinalTraits<Ordinal>::name () <<
","
2564 << TypeNameTraits<Packet>::name () <<
">");
2565 ConstValueTypeSerializationBuffer<Ordinal,Packet>
2566 charSendBuffer (sendBuffer.size (), sendBuffer.getRawPtr ());
2567 RCP<CommRequest<Ordinal> > commRequest =
2568 comm.isend (charSendBuffer.getCharBufferView (), destRank, tag);
2573 template<
typename Ordinal,
typename Packet>
2576 const Comm<Ordinal>& comm,
2577 const RCP<const Packet> &
send,
2581 const ArrayRCP<const Packet> sendBuffer =
2585 return isend<Ordinal, Packet>( comm, sendBuffer, destRank );
2588 template<
typename Ordinal,
typename Packet,
typename Serializer>
2591 const Comm<Ordinal>& comm,
2592 const Serializer& serializer,
2593 const ArrayRCP<const Packet> &sendBuffer,
2598 "Teuchos::CommHelpers: isend<"
2599 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
2602 ConstValueTypeSerializationBuffer<Ordinal,Packet,Serializer>
2603 charSendBuffer(sendBuffer.size(), sendBuffer.getRawPtr(), serializer);
2604 RCP<CommRequest<Ordinal> > commRequest = comm.isend(
2605 charSendBuffer.getCharBufferView(), destRank );
2610 template<
typename Ordinal,
typename Packet>
2613 const Comm<Ordinal>& comm,
2614 const ArrayRCP<Packet> &recvBuffer,
2615 const int sourceRank
2619 "Teuchos::ireceive<int, " <<
"," << TypeNameTraits<Packet>::name () <<
">");
2620 ValueTypeSerializationBuffer<Ordinal,Packet>
2621 charRecvBuffer(recvBuffer.size(), recvBuffer.getRawPtr());
2622 RCP<CommRequest<Ordinal> > commRequest = comm.ireceive(
2623 charRecvBuffer.getCharBufferView(), sourceRank );
2628 template<
typename Ordinal,
typename Packet>
2631 const int sourceRank,
2636 "Teuchos::ireceive<int, " <<
"," << TypeNameTraits<Packet>::name () <<
">");
2637 ValueTypeSerializationBuffer<int, Packet>
2638 charRecvBuffer (recvBuffer.
size (), recvBuffer.
getRawPtr ());
2639 RCP<CommRequest<int> > commRequest =
2640 comm.
ireceive (charRecvBuffer.getCharBufferView (), sourceRank, tag);
2645 template<
typename Ordinal,
typename Packet>
2648 const Comm<Ordinal>& comm,
2649 const RCP<Packet> &recv,
2650 const int sourceRank
2653 const ArrayRCP<Packet> recvBuffer =
2657 return ireceive<Ordinal, Packet>( comm, recvBuffer, sourceRank );
2660 template<
typename Ordinal,
typename Packet,
typename Serializer>
2663 const Comm<Ordinal>& comm,
2664 const Serializer& serializer,
2665 const ArrayRCP<Packet> &recvBuffer,
2666 const int sourceRank
2670 "Teuchos::CommHelpers: ireceive<"
2671 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
2674 ValueTypeSerializationBuffer<Ordinal,Packet,Serializer>
2675 charRecvBuffer(recvBuffer.size(), recvBuffer.getRawPtr(), serializer);
2676 RCP<CommRequest<Ordinal> > commRequest = comm.ireceive(
2677 charRecvBuffer.getCharBufferView(), sourceRank );
2682 template<
typename Ordinal>
2683 void Teuchos::waitAll(
2684 const Comm<Ordinal>& comm,
2685 const ArrayView<RCP<CommRequest<Ordinal> > > &requests
2688 comm.waitAll(requests);
2692 template<
typename Ordinal>
2694 Teuchos::waitAll (
const Comm<Ordinal>& comm,
2695 const ArrayView<RCP<CommRequest<Ordinal> > >& requests,
2696 const ArrayView<RCP<CommStatus<Ordinal> > >& statuses)
2698 comm.waitAll (requests, statuses);
2702 template<
typename Ordinal>
2704 Teuchos::wait (
const Comm<Ordinal>& comm,
2705 const Ptr<RCP<CommRequest<Ordinal> > > &request)
2707 return comm.wait (request);
2711 #endif // TEUCHOS_COMM_HELPERS_HPP
void reduce< int, unsigned long >(const unsigned long sendBuf[], unsigned long recvBuf[], const int count, const EReductionType reductType, const int root, const Comm< int > &comm)
void reduce< int, long >(const long sendBuf[], long recvBuf[], const int count, const EReductionType reductType, const int root, const Comm< int > &comm)
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...
Strategy interface for the indirect serializing and deserializing objects of a given type handled usi...
ArrayView< T > arrayView(T *p, typename ArrayView< T >::size_type size)
Construct a const or non-const view to const or non-const data.
RCP< Teuchos::CommRequest< int > > ireceive< int, unsigned long long >(const Comm< int > &comm, const ArrayRCP< unsigned long long > &recvBuffer, const int sourceRank)
void set_extra_data(const T1 &extra_data, const std::string &name, const Ptr< ArrayRCP< T2 > > &p, EPrePostDestruction destroy_when=POST_DESTROY, bool force_unique=true)
Set extra data associated with a ArrayRCP object.
Ptr< T > inOutArg(T &arg)
create a non-persisting (required or optional) input/output argument for a function call...
void reduce(const Ordinal count, const Packet inBuffer[], Packet inoutBuffer[]) const
TEUCHOSCOMM_LIB_DLL_EXPORT RCP< CommRequest< int > > isend< int, unsigned long >(const ArrayRCP< const unsigned long > &sendBuffer, const int destRank, const int tag, const Comm< int > &comm)
void send< int, float >(const Comm< int > &comm, const int count, const float sendBuffer[], const int destRank)
EReductionType
Predefined reduction operations that Teuchos::Comm understands.
TEUCHOSCOMM_LIB_DLL_EXPORT RCP< CommRequest< int > > isend< int, float >(const ArrayRCP< const float > &sendBuffer, const int destRank, const int tag, const Comm< int > &comm)
RCP< Teuchos::CommRequest< int > > ireceive< int, float >(const Comm< int > &comm, const ArrayRCP< float > &recvBuffer, const int sourceRank)
static void max(const Ordinal count, const Packet inBuffer[], Packet inoutBuffer[])
TEUCHOSCOMM_LIB_DLL_EXPORT RCP< CommRequest< int > > isend< int, long long >(const ArrayRCP< const long long > &sendBuffer, const int destRank, const int tag, const Comm< int > &comm)
void gatherv< int, short >(const short sendBuf[], const int sendCount, short recvBuf[], const int recvCounts[], const int displs[], const int root, const Comm< int > &comm)
void gather< int, unsigned long long >(const unsigned long long sendBuf[], const int sendCount, unsigned long long recvBuf[], const int recvCount, const int root, const Comm< int > &comm)
TEUCHOSCOMM_LIB_DLL_EXPORT RCP< CommRequest< int > > isend< int, short >(const ArrayRCP< const short > &sendBuffer, const int destRank, const int tag, const Comm< int > &comm)
void reduceAll< int, long >(const Comm< int > &comm, const EReductionType reductType, const int count, const long sendBuffer[], long globalReducts[])
void send< int, unsigned long long >(const Comm< int > &comm, const int count, const unsigned long long sendBuffer[], const int destRank)
RCP< Teuchos::CommRequest< int > > ireceive< int, double >(const Comm< int > &comm, const ArrayRCP< double > &recvBuffer, const int sourceRank)
RCP< Teuchos::CommRequest< int > > ireceive< int, short >(const Comm< int > &comm, const ArrayRCP< short > &recvBuffer, const int sourceRank)
void send< int, long >(const Comm< int > &comm, const int count, const long sendBuffer[], const int destRank)
void gather< int, unsigned int >(const unsigned int sendBuf[], const int sendCount, unsigned int recvBuf[], const int recvCount, const int root, const Comm< int > &comm)
static void andOp(const Ordinal, const Packet[], Packet[])
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Macro for throwing an exception with breakpointing to ease debugging.
void reduce< int, double >(const double sendBuf[], double recvBuf[], const int count, const EReductionType reductType, const int root, const Comm< int > &comm)
T * getRawPtr() const
Get the raw C++ pointer to the underlying object.
RawPointerConversionTraits< Container >::Ptr_t getRawPtr(const Container &c)
void gatherv< int, int >(const int sendBuf[], const int sendCount, int recvBuf[], const int recvCounts[], const int displs[], const int root, const Comm< int > &comm)
TEUCHOSCOMM_LIB_DLL_EXPORT RCP< CommRequest< int > > isend< int, double >(const ArrayRCP< const double > &sendBuffer, const int destRank, const int tag, const Comm< int > &comm)
void gatherv< int, long long >(const long long sendBuf[], const int sendCount, long long recvBuf[], const int recvCounts[], const int displs[], const int root, const Comm< int > &comm)
void gather< int, long >(const long sendBuf[], const int sendCount, long recvBuf[], const int recvCount, const int root, const Comm< int > &comm)
RCP< Teuchos::CommRequest< int > > ireceive< int, long long >(const Comm< int > &comm, const ArrayRCP< long long > &recvBuffer, const int sourceRank)
void send< int, int >(const Comm< int > &comm, const int count, const int sendBuffer[], const int destRank)
void reduce(const Ordinal count, const Packet inBuffer[], Packet inoutBuffer[]) const
TEUCHOSCOMM_LIB_DLL_EXPORT RCP< CommRequest< int > > isend< int, unsigned int >(const ArrayRCP< const unsigned int > &sendBuffer, const int destRank, const int tag, const Comm< int > &comm)
void send< int, double >(const Comm< int > &comm, const int count, const double sendBuffer[], const int destRank)
void gather< int, int >(const int sendBuf[], const int sendCount, int recvBuf[], const int recvCount, const int root, const Comm< int > &comm)
size_type size() const
The total number of entries in the array.
void gather< int, long long >(const long long sendBuf[], const int sendCount, long long recvBuf[], const int recvCount, const int root, const Comm< int > &comm)
Standard logical AND operator for booleans.
#define TEUCHOS_COMM_TIME_MONITOR(FUNCNAME)
void reduceAll(const Comm< Ordinal > &comm, const ValueTypeReductionOp< Ordinal, Packet > &reductOp, const Ordinal count, const Packet sendBuffer[], Packet globalReducts[])
Wrapper for MPI_Allreduce that takes a custom reduction operator.
Standard min operator for types with value semantics.
This structure defines some basic traits for a scalar field type.
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.
std::string toString(const any &rhs)
Converts the value in any to a std::string.
Standard summation operator for types with value semantics.
void gatherv< int, unsigned long >(const unsigned long sendBuf[], const int sendCount, unsigned long recvBuf[], const int recvCounts[], const int displs[], const int root, const Comm< int > &comm)
static void andOp(const Ordinal count, const Packet inBuffer[], Packet inoutBuffer[])
void reduce(const Ordinal count, const Packet inBuffer[], Packet inoutBuffer[]) const
void reduceAll< int, unsigned int >(const Comm< int > &comm, const EReductionType reductType, const int count, const unsigned int sendBuffer[], unsigned int globalReducts[])
void send< int, long long >(const Comm< int > &comm, const int count, const long long sendBuffer[], const int destRank)
void reduceAll< int, short >(const Comm< int > &comm, const EReductionType reductType, const int count, const short sendBuffer[], short globalReducts[])
void reduce< int, unsigned long long >(const unsigned long long sendBuf[], unsigned long long recvBuf[], const int count, const EReductionType reductType, const int root, const Comm< int > &comm)
static void min(const Ordinal, const Packet[], Packet[])
void reduce< int, int >(const int sendBuf[], int recvBuf[], const int count, const EReductionType reductType, const int root, const Comm< int > &comm)
virtual RCP< CommRequest< Ordinal > > ireceive(const ArrayView< char > &recvBuffer, const int sourceRank) const =0
Non-blocking receive.
void send(const Comm< Ordinal > &comm, const Ordinal count, const Packet sendBuffer[], const int destRank)
Send objects that use values semantics to another process.
TEUCHOSCOMM_LIB_DLL_EXPORT RCP< CommRequest< int > > isend< int, unsigned long long >(const ArrayRCP< const unsigned long long > &sendBuffer, const int destRank, const int tag, const Comm< int > &comm)
void reduceAll< int, double >(const Comm< int > &comm, const EReductionType reductType, const int count, const double sendBuffer[], double globalReducts[])
TEUCHOSCOMM_LIB_DLL_EXPORT RCP< CommRequest< int > > isend< int, long >(const ArrayRCP< const long > &sendBuffer, const int destRank, const int tag, const Comm< int > &comm)
void gatherv< int, unsigned long long >(const unsigned long long sendBuf[], const int sendCount, unsigned long long recvBuf[], const int recvCounts[], const int displs[], const int root, const Comm< int > &comm)
Standard Max operator for types with value semantics.
void gatherv< int, long >(const long sendBuf[], const int sendCount, long recvBuf[], const int recvCounts[], const int displs[], const int root, const Comm< int > &comm)
Implementation of Teuchos wrappers for MPI.
Declaration of Teuchos::EReductionType enum, and related functions.
This structure defines some basic traits for the ordinal field type.
Encapsulation of the result of a receive (blocking or nonblocking).
#define TEUCHOS_MAX(x, y)
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). ...
void reduceAll< int, int >(const Comm< int > &comm, const EReductionType reductType, const int count, const int sendBuffer[], int globalReducts[])
void reduceAll< int, unsigned long long >(const Comm< int > &comm, const EReductionType reductType, const int count, const unsigned long long sendBuffer[], unsigned long long globalReducts[])
void gatherv< int, unsigned int >(const unsigned int sendBuf[], const int sendCount, unsigned int recvBuf[], const int recvCounts[], const int displs[], const int root, const Comm< int > &comm)
virtual void readySend(const ArrayView< const char > &sendBuffer, const int destRank) const =0
Ready send of data from this process to another process.
RCP< Teuchos::CommRequest< int > > ireceive< int, unsigned int >(const Comm< int > &comm, const ArrayRCP< unsigned int > &recvBuffer, const int sourceRank)
TEUCHOSCOMM_LIB_DLL_EXPORT RCP< CommRequest< int > > isend< int, int >(const ArrayRCP< const int > &sendBuffer, const int destRank, const int tag, const Comm< int > &comm)
void reduceAll< int, unsigned long >(const Comm< int > &comm, const EReductionType reductType, const int count, const unsigned long sendBuffer[], unsigned long globalReducts[])
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).
RCP< Teuchos::CommRequest< int > > ireceive< int, int >(const Comm< int > &comm, const ArrayRCP< int > &recvBuffer, const int sourceRank)
Templated array class derived from the STL std::vector.
RCP< Teuchos::CommRequest< int > > ireceive< int, unsigned long >(const Comm< int > &comm, const ArrayRCP< unsigned long > &recvBuffer, const int sourceRank)
Defines basic traits for the ordinal field type.
Default traits class that just returns typeid(T).name().
RCP< Teuchos::CommRequest< int > > isend(const ArrayRCP< const double > &sendBuffer, const int destRank, const int tag, const Comm< int > &comm)
void reduceAll< int, float >(const Comm< int > &comm, const EReductionType reductType, const int count, const float sendBuffer[], float globalReducts[])
void reduce(const Ordinal count, const Packet inBuffer[], Packet inoutBuffer[]) const
Base interface class for user-defined reduction operations for objects that use reference semantics...
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.
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.
#define TEUCHOSCOMM_LIB_DLL_EXPORT
TEUCHOSCOMM_LIB_DLL_EXPORT void scatter(const int sendBuf[], const int sendCount, int recvBuf[], const int recvCount, const int root, const Comm< int > &comm)
ArrayRCP< T > arcpWithEmbeddedObj(T *p, typename ArrayRCP< T >::size_type lowerOffset, typename ArrayRCP< T >::size_type size, const Embedded &embedded, bool owns_mem=true)
Create an ArrayRCP with and also put in an embedded object.
static void max(const Ordinal, const Packet[], Packet[])
Smart reference counting pointer class for automatic garbage collection.
RCP< Teuchos::CommRequest< int > > ireceive< int, long >(const Comm< int > &comm, const ArrayRCP< long > &recvBuffer, const int sourceRank)
Encapsulation of a pending nonblocking communication operation.
void gather< int, short >(const short sendBuf[], const int sendCount, short recvBuf[], const int recvCount, const int root, const Comm< int > &comm)
#define TEUCHOS_MIN(x, y)
void send< int, short >(const Comm< int > &comm, const int count, const short sendBuffer[], const int destRank)
Defines basic traits returning the name of a type in a portable and readable way. ...
Definition of Teuchos::as, for conversions between types.
ValueTypeReductionOp< Ordinal, Packet > * createOp(const EReductionType reductType)
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...
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 gather< int, unsigned long >(const unsigned long sendBuf[], const int sendCount, unsigned long recvBuf[], const int recvCount, const int root, const Comm< int > &comm)
void reduceAll< int, long long >(const Comm< int > &comm, const EReductionType reductType, const int count, const long long sendBuffer[], long long globalReducts[])
Encapsulate how an array of const objects with value sematics is serialized into a const char[] array...
void send< int, unsigned long >(const Comm< int > &comm, const int count, const unsigned long sendBuffer[], const int destRank)
static void min(const Ordinal count, const Packet inBuffer[], Packet inoutBuffer[])
Reference-counted smart pointer for managing arrays.
void send< int, unsigned int >(const Comm< int > &comm, const int count, const unsigned int sendBuffer[], const int destRank)