10 #ifndef TEUCHOS_COMM_HELPERS_HPP
11 #define TEUCHOS_COMM_HELPERS_HPP
13 #include "Teuchos_Comm.hpp"
14 #include "Teuchos_CommUtilities.hpp"
15 #include "Teuchos_SerializationTraitsHelpers.hpp"
16 #include "Teuchos_ReductionOpHelpers.hpp"
17 #include "Teuchos_SerializerHelpers.hpp"
22 #include "Teuchos_Workspace.hpp"
25 #ifdef HAVE_TEUCHOS_MPI
27 #endif // HAVE_TEUCHOS_MPI
28 #include "Teuchos_DefaultSerialComm.hpp"
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.");
257 template<
typename Ordinal,
typename Packet>
259 scatterv (
const Packet sendBuf[],
260 const Ordinal sendCounts[],
261 const Ordinal displs[],
263 const Ordinal recvCount,
271 (
true, std::logic_error,
"Teuchos::scatterv<" <<
273 <<
">: Generic version is not yet implemented. This function currently "
274 "only has an implementtion for Ordinal = int and Packet = int. "
275 "See Bug 6375 and Bug 6336.");
305 template<
typename Ordinal,
typename Packet>
307 reduce (
const Packet sendBuf[],
310 const EReductionType reductType,
312 const Comm<Ordinal>& comm);
336 template<
typename Ordinal,
typename Packet>
338 const Comm<Ordinal>& comm,
const ValueTypeReductionOp<Ordinal,Packet> &reductOp,
339 const Ordinal count,
const Packet sendBuffer[], Packet globalReducts[]
347 template<
typename Ordinal,
typename Packet>
349 const Comm<Ordinal>& comm,
const EReductionType reductType,
350 const Ordinal count,
const Packet sendBuffer[], Packet globalReducts[]
358 template<
typename Ordinal,
typename Packet>
360 const Comm<Ordinal>& comm,
const EReductionType reductType,
361 const Packet &
send,
const Ptr<Packet> &globalReduct
369 template<
typename Ordinal,
typename Packet>
371 const Comm<Ordinal>& comm,
const Serializer<Ordinal,Packet> &serializer,
372 const ReferenceTypeReductionOp<Ordinal,Packet> &reductOp,
373 const Ordinal count,
const Packet*
const sendBuffer[], Packet*
const globalReducts[]
381 template<
typename Ordinal,
typename Packet,
typename Serializer>
383 const Comm<Ordinal>& comm,
384 const Serializer& serializer,
385 const ValueTypeReductionOp<Ordinal,Packet> &reductOp,
386 const Ordinal count,
const Packet sendBuffer[], Packet globalReducts[]
394 template<
typename Ordinal,
typename Packet,
typename Serializer>
396 const Comm<Ordinal>& comm,
397 const Serializer& serializer,
398 const EReductionType reductType,
399 const Ordinal count,
const Packet sendBuffer[], Packet globalReducts[]
407 template<
typename Ordinal,
typename Packet>
409 const Comm<Ordinal>& comm,
const ValueTypeReductionOp<Ordinal,Packet> &reductOp,
410 const Ordinal count,
const Packet sendBuffer[], Packet scanReducts[]
418 template<
typename Ordinal,
typename Packet>
420 const Comm<Ordinal>& comm,
const EReductionType reductType,
421 const Ordinal count,
const Packet sendBuffer[], Packet scanReducts[]
429 template<
typename Ordinal,
typename Packet>
431 const Comm<Ordinal>& comm,
const EReductionType reductType,
432 const Packet &
send,
const Ptr<Packet> &scanReduct
440 template<
typename Ordinal,
typename Packet>
442 const Comm<Ordinal>& comm,
const Serializer<Ordinal,Packet> &serializer,
443 const ReferenceTypeReductionOp<Ordinal,Packet> &reductOp,
444 const Ordinal count,
const Packet*
const sendBuffer[], Packet*
const scanReducts[]
452 template<
typename Ordinal,
typename Packet,
typename Serializer>
454 const Comm<Ordinal>& comm,
455 const Serializer& serializer,
456 const ValueTypeReductionOp<Ordinal,Packet> &reductOp,
457 const Ordinal count,
const Packet sendBuffer[], Packet scanReducts[]
465 template<
typename Ordinal,
typename Packet,
typename Serializer>
467 const Comm<Ordinal>& comm,
468 const Serializer& serializer,
469 const EReductionType reductType,
470 const Ordinal count,
const Packet sendBuffer[], Packet scanReducts[]
477 template<
typename Ordinal,
typename Packet>
479 const Comm<Ordinal>& comm,
480 const Ordinal count,
const Packet sendBuffer[],
const int destRank
484 template<
typename Ordinal,
typename Packet>
486 send (
const Packet sendBuffer[],
490 const Comm<Ordinal>& comm);
496 template<
typename Ordinal,
typename Packet>
498 const Comm<Ordinal>& comm,
499 const Ordinal count,
const Packet sendBuffer[],
const int destRank
503 template<
typename Ordinal,
typename Packet>
505 ssend (
const Packet sendBuffer[],
509 const Comm<Ordinal>& comm);
515 template<
typename Ordinal,
typename Packet>
517 const Comm<Ordinal>& comm,
518 const Packet &
send,
const int destRank
525 template<
typename Ordinal,
typename Packet>
527 const Comm<Ordinal>& comm,
528 const Packet &
send,
const int destRank
537 template<
typename Ordinal,
typename Packet>
539 const Comm<Ordinal>& comm,
const Serializer<Ordinal,Packet> &serializer,
540 const Ordinal count,
const Packet*
const sendBuffer[],
const int destRank
548 template<
typename Ordinal,
typename Packet,
typename Serializer>
550 const Comm<Ordinal>& comm,
551 const Serializer& serializer,
552 const Ordinal count,
const Packet sendBuffer[],
const int destRank
559 template<
typename Ordinal,
typename Packet>
561 const Comm<Ordinal>& comm,
562 const int sourceRank,
const Ordinal count, Packet recvBuffer[]
569 template<
typename Ordinal,
typename Packet>
571 const Comm<Ordinal>& comm,
572 const int sourceRank, Packet *recv
579 template<
typename Ordinal,
typename Packet>
581 const Comm<Ordinal>& comm,
const Serializer<Ordinal,Packet> &serializer,
582 const int sourceRank,
const Ordinal count, Packet*
const recvBuffer[]
590 template<
typename Ordinal,
typename Packet,
typename Serializer>
592 const Comm<Ordinal>& comm,
593 const Serializer& serializer,
594 const int sourceRank,
const Ordinal count, Packet recvBuffer[]
602 template<
typename Ordinal,
typename Packet>
604 const Comm<Ordinal>& comm,
605 const ArrayView<const Packet> &sendBuffer,
610 template<
typename Ordinal,
typename Packet>
616 const Comm<Ordinal>& comm);
622 template<
typename Ordinal,
typename Packet>
624 const Comm<Ordinal>& comm,
634 template<
typename Ordinal,
typename Packet,
typename Serializer>
636 const Comm<Ordinal>& comm,
637 const Serializer& serializer,
638 const ArrayView<const Packet> &sendBuffer,
646 template<
typename Ordinal,
typename Packet>
647 RCP<CommRequest<Ordinal> > isend(
648 const Comm<Ordinal>& comm,
649 const ArrayRCP<const Packet> &sendBuffer,
654 template<
typename Ordinal,
typename Packet>
655 RCP<CommRequest<Ordinal> >
656 isend (
const ArrayRCP<const Packet>& sendBuffer,
659 const Comm<Ordinal>& comm);
665 template<
typename Ordinal,
typename Packet>
666 RCP<CommRequest<Ordinal> > isend(
667 const Comm<Ordinal>& comm,
668 const RCP<const Packet> &
send,
677 template<
typename Ordinal,
typename Packet,
typename Serializer>
678 RCP<CommRequest<Ordinal> > isend(
679 const Comm<Ordinal>& comm,
680 const Serializer& serializer,
681 const ArrayRCP<const Packet> &sendBuffer,
698 template<
typename Ordinal,
typename Packet>
699 RCP<CommRequest<Ordinal> >
ireceive(
700 const Comm<Ordinal>& comm,
701 const ArrayRCP<Packet> &recvBuffer,
706 template<
typename Ordinal,
typename Packet>
707 RCP<CommRequest<Ordinal> >
708 ireceive (
const ArrayRCP<Packet> &recvBuffer,
709 const int sourceRank,
711 const Comm<Ordinal>& comm);
724 template<
typename Ordinal,
typename Packet>
725 RCP<CommRequest<Ordinal> >
ireceive(
726 const Comm<Ordinal>& comm,
727 const RCP<Packet> &recv,
736 template<
typename Ordinal,
typename Packet,
typename Serializer>
737 RCP<CommRequest<Ordinal> >
ireceive(
738 const Comm<Ordinal>& comm,
739 const Serializer& serializer,
740 const ArrayRCP<Packet> &recvBuffer,
755 template<
typename Ordinal>
757 const Comm<Ordinal>& comm,
758 const ArrayView<RCP<CommRequest<Ordinal> > > &requests
790 template<
typename Ordinal>
792 waitAll (
const Comm<Ordinal>& comm,
793 const ArrayView<RCP<CommRequest<Ordinal> > >& requests,
794 const ArrayView<RCP<CommStatus<Ordinal> > >& statuses);
819 template<
typename Ordinal>
820 RCP<CommStatus<Ordinal> >
821 wait (
const Comm<Ordinal>& comm,
const Ptr<RCP<CommRequest<Ordinal> > >& request);
832 template<
typename Ordinal,
typename Packet>
839 const Packet inBuffer[],
853 template<
typename Ordinal,
typename Packet>
860 const Packet inBuffer[],
874 template<
typename Ordinal,
typename Packet>
881 const Packet inBuffer[],
891 template<
typename Ordinal,
typename Packet>
898 const Packet inBuffer[],
913 namespace MixMaxUtilities {
916 template<
bool isComparable,
typename Ordinal,
typename Packet>
920 template<
typename Ordinal,
typename Packet>
921 class Min<true,Ordinal,Packet> {
925 const Packet inBuffer[],
929 for(
int i = 0; i < count; ++i )
930 inoutBuffer[i] = TEUCHOS_MIN(inoutBuffer[i],inBuffer[i]);
935 template<
typename Ordinal,
typename Packet>
936 class Min<false,Ordinal,Packet> {
945 true,std::logic_error,
946 "Error, the type "<<TypeNameTraits<Packet>::name()
947 <<
" does not support comparison operations!"
953 template<
bool isComparable,
typename Ordinal,
typename Packet>
957 template<
typename Ordinal,
typename Packet>
958 class Max<true,Ordinal,Packet> {
962 const Packet inBuffer[],
966 for(
int i = 0; i < count; ++i )
967 inoutBuffer[i] = TEUCHOS_MAX(inoutBuffer[i],inBuffer[i]);
972 template<
typename Ordinal,
typename Packet>
973 class Max<false,Ordinal,Packet> {
982 true,std::logic_error,
983 "Error, the type "<<TypeNameTraits<Packet>::name()
984 <<
" does not support comparison operations!"
990 template<
bool isComparable,
typename Ordinal,
typename Packet>
994 template<
typename Ordinal,
typename Packet>
995 class AND<true,Ordinal,Packet> {
999 const Packet inBuffer[],
1000 Packet inoutBuffer[]
1003 for(
int i = 0; i < count; ++i )
1004 inoutBuffer[i] = inoutBuffer[i] && inBuffer[i];
1009 template<
typename Ordinal,
typename Packet>
1010 class AND<false,Ordinal,Packet> {
1019 true,std::logic_error,
1020 "Error, the type "<<TypeNameTraits<Packet>::name()
1021 <<
" does not support logical AND operations!"
1030 template<
typename Ordinal,
typename Packet>
1032 const Ordinal count,
1033 const Packet inBuffer[],
1034 Packet inoutBuffer[]
1037 for(
int i = 0; i < count; ++i )
1038 inoutBuffer[i] += inBuffer[i];
1042 template<
typename Ordinal,
typename Packet>
1044 const Ordinal count,
1045 const Packet inBuffer[],
1046 Packet inoutBuffer[]
1049 typedef MixMaxUtilities::Min<ScalarTraits<Packet>::isComparable, Ordinal, Packet> min_type;
1050 min_type::min (count, inBuffer, inoutBuffer);
1054 template<
typename Ordinal,
typename Packet>
1056 const Ordinal count,
1057 const Packet inBuffer[],
1058 Packet inoutBuffer[]
1061 typedef MixMaxUtilities::Max<ScalarTraits<Packet>::isComparable, Ordinal, Packet> max_type;
1062 max_type::max (count,inBuffer,inoutBuffer);
1066 template<
typename Ordinal,
typename Packet>
1068 const Ordinal count,
1069 const Packet inBuffer[],
1070 Packet inoutBuffer[]
1073 typedef MixMaxUtilities::AND<ScalarTraits<Packet>::isComparable, Ordinal, Packet> and_type;
1074 and_type::andOp (count, inBuffer, inoutBuffer);
1104 template<
typename Ordinal,
typename Packet>
1105 ValueTypeReductionOp<Ordinal,Packet>*
1106 createOp (
const EReductionType reductType)
1108 typedef ScalarTraits<Packet> ST;
1109 switch (reductType) {
1111 return new SumValueReductionOp<Ordinal,Packet> ();
1114 if (ST::isComparable) {
1115 return new MinValueReductionOp<Ordinal,Packet> ();
1119 (! ST::isComparable, std::invalid_argument,
"Teuchos::createOp"
1120 "(EReductionType): The Packet type " << TypeNameTraits<Packet>::name ()
1121 <<
" is not less-than comparable, so it does not make sense to do a "
1122 "MIN reduction with it.");
1126 if (ST::isComparable) {
1127 return new MaxValueReductionOp<Ordinal,Packet> ();
1131 (! ST::isComparable, std::invalid_argument,
"Teuchos::createOp"
1132 "(EReductionType): The Packet type " << TypeNameTraits<Packet>::name ()
1133 <<
" is not less-than comparable, so it does not make sense to do a "
1134 "MAX reduction with it.");
1138 return new ANDValueReductionOp<Ordinal, Packet> ();
1142 true, std::invalid_argument,
"Teuchos::createOp(EReductionType): "
1143 "Invalid EReductionType value " << reductType <<
". Valid values "
1144 "include REDUCE_SUM, REDUCE_MIN, REDUCE_MAX, and REDUCE_AND.");
1157 template<
typename Ordinal>
1158 int Teuchos::rank(
const Comm<Ordinal>& comm)
1160 return comm.getRank();
1164 template<
typename Ordinal>
1165 int Teuchos::size(
const Comm<Ordinal>& comm)
1167 return comm.getSize();
1171 template<
typename Ordinal>
1172 void Teuchos::barrier(
const Comm<Ordinal>& comm)
1174 TEUCHOS_COMM_TIME_MONITOR(
1175 "Teuchos::CommHelpers: barrier<"
1176 <<OrdinalTraits<Ordinal>::name()
1183 template<
typename Ordinal,
typename Packet>
1184 void Teuchos::broadcast(
1185 const Comm<Ordinal>& comm,
1186 const int rootRank,
const Ordinal count, Packet buffer[]
1189 TEUCHOS_COMM_TIME_MONITOR(
1190 "Teuchos::CommHelpers: broadcast<"
1191 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
1194 ValueTypeSerializationBuffer<Ordinal,Packet>
1195 charBuffer(count,buffer);
1197 rootRank,charBuffer.getBytes(),charBuffer.getCharBuffer()
1202 template<
typename Ordinal,
typename Packet>
1203 void Teuchos::broadcast(
1204 const Comm<Ordinal>& comm,
1206 const ArrayView<Packet> &buffer
1209 broadcast<Ordinal, Packet>(comm, rootRank, buffer.size(), buffer.getRawPtr() );
1213 template<
typename Ordinal,
typename Packet>
1214 void Teuchos::broadcast(
1215 const Comm<Ordinal>& comm,
1216 const int rootRank, Packet *
object
1219 broadcast<Ordinal,Packet>(comm,rootRank,1,object);
1223 template<
typename Ordinal,
typename Packet>
1224 void Teuchos::broadcast(
1225 const Comm<Ordinal>& comm,
1226 const int rootRank,
const Ptr<Packet> &
object
1229 broadcast<Ordinal,Packet>(comm,rootRank,1,
object.getRawPtr());
1233 template<
typename Ordinal,
typename Packet>
1234 void Teuchos::broadcast(
1235 const Comm<Ordinal>& comm,
const Serializer<Ordinal,Packet> &serializer,
1236 const int rootRank,
const Ordinal count, Packet*
const buffer[]
1239 TEUCHOS_COMM_TIME_MONITOR(
1240 "Teuchos::CommHelpers: broadcast<"
1241 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
1242 <<
">( reference type )"
1244 ReferenceTypeSerializationBuffer<Ordinal,Packet>
1245 charBuffer(serializer, count, buffer);
1247 rootRank,charBuffer.getBytes(),charBuffer.getCharBuffer()
1252 template<
typename Ordinal,
typename Packet>
1253 void Teuchos::broadcast(
1254 const Comm<Ordinal>& comm,
const Serializer<Ordinal,Packet> &serializer,
1255 const int rootRank,
const ArrayView<
const Ptr<Packet> > &buffer
1258 Array<Packet*> bufferPtrArray;
1259 for (
int i = 0; i < buffer.size(); ++i) {
1260 bufferPtrArray.push_back(buffer[i].getRawPtr());
1262 broadcast<Ordinal,Packet>(comm, serializer, rootRank,
1263 buffer.size(), bufferPtrArray.getRawPtr());
1266 template<
typename Ordinal,
typename Packet,
typename Serializer>
1267 void Teuchos::broadcast(
1268 const Comm<Ordinal>& comm,
1269 const Serializer& serializer,
1270 const int rootRank,
const Ordinal count, Packet buffer[]
1273 TEUCHOS_COMM_TIME_MONITOR(
1274 "Teuchos::CommHelpers: broadcast<"
1275 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
1278 ValueTypeSerializationBuffer<Ordinal,Packet,Serializer>
1279 charBuffer(count,buffer,
rcp(&serializer,
false));
1281 rootRank,charBuffer.getBytes(),charBuffer.getCharBuffer()
1286 template<
typename Ordinal,
typename Packet>
1287 void Teuchos::gatherAll(
1288 const Comm<Ordinal>& comm,
1289 const Ordinal sendCount,
const Packet sendBuffer[],
1290 const Ordinal recvCount, Packet recvBuffer[]
1293 TEUCHOS_COMM_TIME_MONITOR(
1294 "Teuchos::CommHelpers: gatherAll<"
1295 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
1298 ConstValueTypeSerializationBuffer<Ordinal,Packet>
1299 charSendBuffer(sendCount,sendBuffer);
1300 ValueTypeSerializationBuffer<Ordinal,Packet>
1301 charRecvBuffer(recvCount,recvBuffer);
1303 charSendBuffer.getBytes(),charSendBuffer.getCharBuffer()
1304 ,charRecvBuffer.getBytes(),charRecvBuffer.getCharBuffer()
1308 template<
typename Ordinal,
typename Packet>
1310 Teuchos::gather (
const Packet sendBuf[],
1311 const Ordinal sendCount,
1313 const Ordinal recvCount,
1315 const Comm<Ordinal>& comm)
1317 TEUCHOS_COMM_TIME_MONITOR(
1318 "Teuchos::CommHelpers: gather<"
1319 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
1322 ConstValueTypeSerializationBuffer<Ordinal,Packet>
1323 charSendBuffer (sendCount, sendBuf);
1324 ValueTypeSerializationBuffer<Ordinal,Packet>
1325 charRecvBuffer (recvCount, recvBuf);
1326 comm.gather (charSendBuffer.getBytes (),
1327 charSendBuffer.getCharBuffer (),
1328 charRecvBuffer.getBytes (),
1329 charRecvBuffer.getCharBuffer (),
1333 template<
typename Ordinal,
typename Packet>
1335 Teuchos::gatherv (
const Packet sendBuf[],
1336 const Ordinal sendCount,
1338 const Ordinal recvCounts[],
1339 const Ordinal displs[],
1341 const Comm<Ordinal>& comm)
1364 "Teuchos::gatherv: The general case is not implemented.");
1367 template<
typename Ordinal,
typename Packet>
1368 void Teuchos::gatherAll(
1369 const Comm<Ordinal>& comm,
const Serializer<Ordinal,Packet> &serializer,
1370 const Ordinal sendCount,
const Packet*
const sendBuffer[],
1371 const Ordinal recvCount, Packet*
const recvBuffer[]
1377 template<
typename Ordinal,
typename Packet,
typename Serializer>
1378 void Teuchos::gatherAll(
1379 const Comm<Ordinal>& comm,
1380 const Serializer& serializer,
1381 const Ordinal sendCount,
const Packet sendBuffer[],
1382 const Ordinal recvCount, Packet recvBuffer[]
1385 TEUCHOS_COMM_TIME_MONITOR(
1386 "Teuchos::CommHelpers: gatherAll<"
1387 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
1390 ConstValueTypeSerializationBuffer<Ordinal,Packet,Serializer>
1391 charSendBuffer(sendCount,sendBuffer,
rcp(&serializer,
false));
1392 ValueTypeSerializationBuffer<Ordinal,Packet,Serializer>
1393 charRecvBuffer(recvCount,recvBuffer,
rcp(&serializer,
false));
1395 charSendBuffer.getBytes(),charSendBuffer.getCharBuffer()
1396 ,charRecvBuffer.getBytes(),charRecvBuffer.getCharBuffer()
1401 template<
typename Ordinal,
typename Packet>
1403 Teuchos::reduce (
const Packet sendBuf[],
1405 const Ordinal count,
1408 const Comm<Ordinal>& comm)
1414 (
true, std::logic_error,
"Teuchos::reduce<" <<
1415 TypeNameTraits<Ordinal>::name () <<
"," << TypeNameTraits<Packet>::name ()
1416 <<
">: Generic version not implemented. We only implement this function "
1417 "for Ordinal = int and Packet = specific types.");
1421 template<
typename Ordinal,
typename Packet>
1422 void Teuchos::reduceAll(
1423 const Comm<Ordinal>& comm,
const ValueTypeReductionOp<Ordinal,Packet> &reductOp
1424 ,
const Ordinal count,
const Packet sendBuffer[], Packet globalReducts[]
1427 TEUCHOS_COMM_TIME_MONITOR(
1428 "Teuchos::CommHelpers: reduceAll<"
1429 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
1430 <<
">( value type, user-defined op )"
1432 ConstValueTypeSerializationBuffer<Ordinal,Packet>
1433 charSendBuffer(count,sendBuffer);
1434 ValueTypeSerializationBuffer<Ordinal,Packet>
1435 charGlobalReducts(count,globalReducts);
1436 CharToValueTypeReductionOp<Ordinal,Packet>
1437 charReductOp(
rcp(&reductOp,
false));
1439 charReductOp,charSendBuffer.getBytes(),charSendBuffer.getCharBuffer()
1440 ,charGlobalReducts.getCharBuffer()
1445 template<
typename Ordinal,
typename Packet>
1446 void Teuchos::reduceAll(
1448 const Ordinal count,
const Packet sendBuffer[], Packet globalReducts[]
1451 TEUCHOS_COMM_TIME_MONITOR(
1452 "Teuchos::CommHelpers: reduceAll<"
1453 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
1454 <<
">( value type, "<<
toString(reductType)<<
" )"
1457 ValueTypeReductionOp<Ordinal,Packet>* reductOp =
1458 createOp<Ordinal, Packet> (reductType);
1460 reduceAll(comm,*reductOp,count,sendBuffer,globalReducts);
1462 catch (std::exception& e) {
1478 #ifdef HAVE_TEUCHOS_COMPLEX
1481 TEUCHOSCOMM_LIB_DLL_EXPORT
void
1482 reduceAll<int, std::complex<double> > (
const Comm<int>& comm,
1483 const EReductionType reductType,
1485 const std::complex<double> sendBuffer[],
1486 std::complex<double> globalReducts[]);
1488 TEUCHOSCOMM_LIB_DLL_EXPORT RCP<CommRequest<int> >
1489 ireceive<int, std::complex<double> > (
const Comm<int>& comm,
1490 const ArrayRCP<std::complex<double> >& recvBuffer,
1491 const int sourceRank);
1493 TEUCHOSCOMM_LIB_DLL_EXPORT RCP<CommRequest<int> >
1494 ireceive<int, std::complex<double> > (
const ArrayRCP<std::complex<double> > &recvBuffer,
1495 const int sourceRank,
1497 const Comm<int>& comm);
1499 TEUCHOSCOMM_LIB_DLL_EXPORT
void
1500 send<int, std::complex<double> > (
const Comm<int>& comm,
1502 const std::complex<double> sendBuffer[],
1503 const int destRank);
1505 TEUCHOSCOMM_LIB_DLL_EXPORT
void
1506 send<int, std::complex<double> > (
const std::complex<double> sendBuffer[],
1510 const Comm<int>& comm);
1512 TEUCHOSCOMM_LIB_DLL_EXPORT RCP<CommRequest<int> >
1513 isend<int, std::complex<double> > (
const ArrayRCP<const std::complex<double> >& sendBuffer,
1516 const Comm<int>& comm);
1520 TEUCHOSCOMM_LIB_DLL_EXPORT
void
1521 reduceAll<int, std::complex<float> > (
const Comm<int>& comm,
1522 const EReductionType reductType,
1524 const std::complex<float> sendBuffer[],
1525 std::complex<float> globalReducts[]);
1527 TEUCHOSCOMM_LIB_DLL_EXPORT RCP<CommRequest<int> >
1528 ireceive<int, std::complex<float> > (
const Comm<int>& comm,
1529 const ArrayRCP<std::complex<float> >& recvBuffer,
1530 const int sourceRank);
1532 TEUCHOSCOMM_LIB_DLL_EXPORT RCP<CommRequest<int> >
1533 ireceive<int, std::complex<float> > (
const ArrayRCP<std::complex<float> > &recvBuffer,
1534 const int sourceRank,
1536 const Comm<int>& comm);
1538 TEUCHOSCOMM_LIB_DLL_EXPORT
void
1539 send<int, std::complex<float> > (
const Comm<int>& comm,
1541 const std::complex<float> sendBuffer[],
1542 const int destRank);
1544 TEUCHOSCOMM_LIB_DLL_EXPORT
void
1545 send<int, std::complex<float> > (
const std::complex<float> sendBuffer[],
1549 const Comm<int>& comm);
1551 TEUCHOSCOMM_LIB_DLL_EXPORT RCP<CommRequest<int> >
1552 isend<int, std::complex<float> > (
const ArrayRCP<const std::complex<float> >& sendBuffer,
1555 const Comm<int>& comm);
1556 #endif // HAVE_TEUCHOS_COMPLEX
1561 TEUCHOSCOMM_LIB_DLL_EXPORT
void
1562 reduceAll<int, double> (
const Comm<int>& comm,
1563 const EReductionType reductType,
1565 const double sendBuffer[],
1566 double globalReducts[]);
1568 TEUCHOSCOMM_LIB_DLL_EXPORT RCP<CommRequest<int> >
1569 ireceive<int, double> (
const Comm<int>& comm,
1570 const ArrayRCP<double>& recvBuffer,
1571 const int sourceRank);
1573 TEUCHOSCOMM_LIB_DLL_EXPORT RCP<CommRequest<int> >
1574 ireceive<int, double> (
const ArrayRCP<double> &recvBuffer,
1575 const int sourceRank,
1577 const Comm<int>& comm);
1579 TEUCHOSCOMM_LIB_DLL_EXPORT
void
1580 send<int, double> (
const Comm<int>& comm,
1582 const double sendBuffer[],
1583 const int destRank);
1585 TEUCHOSCOMM_LIB_DLL_EXPORT
void
1586 send<int, double> (
const double sendBuffer[],
1590 const Comm<int>& comm);
1592 TEUCHOSCOMM_LIB_DLL_EXPORT RCP<CommRequest<int> >
1593 isend<int, double> (
const ArrayRCP<const double>& sendBuffer,
1596 const Comm<int>& comm);
1599 TEUCHOSCOMM_LIB_DLL_EXPORT
void
1600 gatherv<int, double> (
const double sendBuf[],
1601 const int sendCount,
1603 const int recvCounts[],
1606 const Comm<int>& comm);
1610 TEUCHOSCOMM_LIB_DLL_EXPORT
void
1611 reduceAll<int, float> (
const Comm<int>& comm,
1612 const EReductionType reductType,
1614 const float sendBuffer[],
1615 float globalReducts[]);
1617 TEUCHOSCOMM_LIB_DLL_EXPORT RCP<CommRequest<int> >
1618 ireceive<int, float> (
const Comm<int>& comm,
1619 const ArrayRCP<float>& recvBuffer,
1620 const int sourceRank);
1622 TEUCHOSCOMM_LIB_DLL_EXPORT RCP<CommRequest<int> >
1623 ireceive<int, float> (
const ArrayRCP<float> &recvBuffer,
1624 const int sourceRank,
1626 const Comm<int>& comm);
1628 TEUCHOSCOMM_LIB_DLL_EXPORT
void
1629 send<int, float> (
const Comm<int>& comm,
1631 const float sendBuffer[],
1632 const int destRank);
1634 TEUCHOSCOMM_LIB_DLL_EXPORT
void
1635 send<int, float> (
const float sendBuffer[],
1639 const Comm<int>& comm);
1641 TEUCHOSCOMM_LIB_DLL_EXPORT RCP<CommRequest<int> >
1642 isend<int, float> (
const ArrayRCP<const float>& sendBuffer,
1645 const Comm<int>& comm);
1648 TEUCHOSCOMM_LIB_DLL_EXPORT
void
1649 gatherv<int, float> (
const float sendBuf[],
1650 const int sendCount,
1652 const int recvCounts[],
1655 const Comm<int>& comm);
1659 TEUCHOSCOMM_LIB_DLL_EXPORT
void
1660 gather<int, long long> (
const long long sendBuf[],
1661 const int sendCount,
1662 long long recvBuf[],
1663 const int recvCount,
1665 const Comm<int>& comm);
1667 TEUCHOSCOMM_LIB_DLL_EXPORT
void
1668 gatherv<int, long long> (
const long long sendBuf[],
1669 const int sendCount,
1670 long long recvBuf[],
1671 const int recvCounts[],
1674 const Comm<int>& comm);
1676 TEUCHOSCOMM_LIB_DLL_EXPORT
void
1677 reduceAll<int, long long> (
const Comm<int>& comm,
1678 const EReductionType reductType,
1680 const long long sendBuffer[],
1681 long long globalReducts[]);
1683 TEUCHOSCOMM_LIB_DLL_EXPORT RCP<CommRequest<int> >
1684 ireceive<int, long long> (
const Comm<int>& comm,
1685 const ArrayRCP<long long>& recvBuffer,
1686 const int sourceRank);
1688 TEUCHOSCOMM_LIB_DLL_EXPORT RCP<CommRequest<int> >
1689 ireceive<int, long long> (
const ArrayRCP<long long> &recvBuffer,
1690 const int sourceRank,
1692 const Comm<int>& comm);
1694 TEUCHOSCOMM_LIB_DLL_EXPORT
void
1695 send<int, long long> (
const Comm<int>& comm,
1697 const long long sendBuffer[],
1698 const int destRank);
1700 TEUCHOSCOMM_LIB_DLL_EXPORT
void
1701 send<int, long long> (
const long long sendBuffer[],
1705 const Comm<int>& comm);
1707 TEUCHOSCOMM_LIB_DLL_EXPORT RCP<CommRequest<int> >
1708 isend<int, long long> (
const ArrayRCP<const long long>& sendBuffer,
1711 const Comm<int>& comm);
1715 TEUCHOSCOMM_LIB_DLL_EXPORT
void
1716 gather<int, unsigned long long> (
const unsigned long long sendBuf[],
1717 const int sendCount,
1718 unsigned long long recvBuf[],
1719 const int recvCount,
1721 const Comm<int>& comm);
1723 TEUCHOSCOMM_LIB_DLL_EXPORT
void
1724 gatherv<int, unsigned long long> (
const unsigned long long sendBuf[],
1725 const int sendCount,
1726 unsigned long long recvBuf[],
1727 const int recvCounts[],
1730 const Comm<int>& comm);
1732 TEUCHOSCOMM_LIB_DLL_EXPORT
void
1733 reduceAll<int, unsigned long long> (
const Comm<int>& comm,
1734 const EReductionType reductType,
1736 const unsigned long long sendBuffer[],
1737 unsigned long long globalReducts[]);
1739 TEUCHOSCOMM_LIB_DLL_EXPORT RCP<CommRequest<int> >
1740 ireceive<int, unsigned long long> (
const Comm<int>& comm,
1741 const ArrayRCP<unsigned long long>& recvBuffer,
1742 const int sourceRank);
1744 TEUCHOSCOMM_LIB_DLL_EXPORT RCP<CommRequest<int> >
1745 ireceive<int, unsigned long long> (
const ArrayRCP<unsigned long long> &recvBuffer,
1746 const int sourceRank,
1748 const Comm<int>& comm);
1750 TEUCHOSCOMM_LIB_DLL_EXPORT
void
1751 send<int, unsigned long long> (
const Comm<int>& comm,
1753 const unsigned long long sendBuffer[],
1754 const int destRank);
1756 TEUCHOSCOMM_LIB_DLL_EXPORT
void
1757 send<int, unsigned long long> (
const unsigned long long sendBuffer[],
1761 const Comm<int>& comm);
1763 TEUCHOSCOMM_LIB_DLL_EXPORT RCP<CommRequest<int> >
1764 isend<int, unsigned long long> (
const ArrayRCP<const unsigned long long>& sendBuffer,
1767 const Comm<int>& comm);
1771 TEUCHOSCOMM_LIB_DLL_EXPORT
void
1772 gather<int, long> (
const long sendBuf[],
1773 const int sendCount,
1775 const int recvCount,
1777 const Comm<int>& comm);
1779 TEUCHOSCOMM_LIB_DLL_EXPORT
void
1780 gatherv<int, long> (
const long sendBuf[],
1781 const int sendCount,
1783 const int recvCounts[],
1786 const Comm<int>& comm);
1788 TEUCHOSCOMM_LIB_DLL_EXPORT
void
1789 reduceAll<int, long> (
const Comm<int>& comm,
1790 const EReductionType reductType,
1792 const long sendBuffer[],
1793 long globalReducts[]);
1795 TEUCHOSCOMM_LIB_DLL_EXPORT RCP<CommRequest<int> >
1796 ireceive<int, long> (
const Comm<int>& comm,
1797 const ArrayRCP<long>& recvBuffer,
1798 const int sourceRank);
1800 TEUCHOSCOMM_LIB_DLL_EXPORT RCP<CommRequest<int> >
1801 ireceive<int, long> (
const ArrayRCP<long> &recvBuffer,
1802 const int sourceRank,
1804 const Comm<int>& comm);
1806 TEUCHOSCOMM_LIB_DLL_EXPORT
void
1807 send<int, long> (
const Comm<int>& comm,
1809 const long sendBuffer[],
1810 const int destRank);
1812 TEUCHOSCOMM_LIB_DLL_EXPORT
void
1813 send<int, long> (
const long sendBuffer[],
1817 const Comm<int>& comm);
1819 TEUCHOSCOMM_LIB_DLL_EXPORT RCP<CommRequest<int> >
1820 isend<int, long> (
const ArrayRCP<const long>& sendBuffer,
1823 const Comm<int>& comm);
1827 TEUCHOSCOMM_LIB_DLL_EXPORT
void
1828 gather<int, unsigned long> (
const unsigned long sendBuf[],
1829 const int sendCount,
1830 unsigned long recvBuf[],
1831 const int recvCount,
1833 const Comm<int>& comm);
1835 TEUCHOSCOMM_LIB_DLL_EXPORT
void
1836 gatherv<int, unsigned long> (
const unsigned long sendBuf[],
1837 const int sendCount,
1838 unsigned long recvBuf[],
1839 const int recvCounts[],
1842 const Comm<int>& comm);
1844 TEUCHOSCOMM_LIB_DLL_EXPORT
void
1845 reduceAll<int, unsigned long> (
const Comm<int>& comm,
1846 const EReductionType reductType,
1848 const unsigned long sendBuffer[],
1849 unsigned long globalReducts[]);
1851 TEUCHOSCOMM_LIB_DLL_EXPORT RCP<CommRequest<int> >
1852 ireceive<int, unsigned long> (
const Comm<int>& comm,
1853 const ArrayRCP<unsigned long>& recvBuffer,
1854 const int sourceRank);
1856 TEUCHOSCOMM_LIB_DLL_EXPORT RCP<CommRequest<int> >
1857 ireceive<int, unsigned long> (
const ArrayRCP<unsigned long> &recvBuffer,
1858 const int sourceRank,
1860 const Comm<int>& comm);
1862 TEUCHOSCOMM_LIB_DLL_EXPORT
void
1863 send<int, unsigned long> (
const Comm<int>& comm,
1865 const unsigned long sendBuffer[],
1866 const int destRank);
1868 TEUCHOSCOMM_LIB_DLL_EXPORT
void
1869 send<int, unsigned long> (
const unsigned long sendBuffer[],
1873 const Comm<int>& comm);
1875 TEUCHOSCOMM_LIB_DLL_EXPORT RCP<CommRequest<int> >
1876 isend<int, unsigned long> (
const ArrayRCP<const unsigned long>& sendBuffer,
1879 const Comm<int>& comm);
1883 TEUCHOSCOMM_LIB_DLL_EXPORT
void
1884 gather<int, int> (
const int sendBuf[],
1885 const int sendCount,
1887 const int recvCount,
1889 const Comm<int>& comm);
1891 TEUCHOSCOMM_LIB_DLL_EXPORT
void
1892 gatherv<int, int> (
const int sendBuf[],
1893 const int sendCount,
1895 const int recvCounts[],
1898 const Comm<int>& comm);
1900 TEUCHOSCOMM_LIB_DLL_EXPORT
void
1901 scatter (
const int sendBuf[],
1902 const int sendCount,
1904 const int recvCount,
1906 const Comm<int>& comm);
1908 TEUCHOSCOMM_LIB_DLL_EXPORT
void
1909 scatterv (
const double sendBuf[],
1910 const int sendCounts[],
1913 const int recvCount,
1915 const Comm<int>& comm);
1917 TEUCHOSCOMM_LIB_DLL_EXPORT
void
1918 scatterv (
const float sendBuf[],
1919 const int sendCounts[],
1922 const int recvCount,
1924 const Comm<int>& comm);
1926 TEUCHOSCOMM_LIB_DLL_EXPORT
void
1927 reduce<int, int> (
const int sendBuf[],
1930 const EReductionType reductType,
1932 const Comm<int>& comm);
1934 TEUCHOSCOMM_LIB_DLL_EXPORT
void
1935 reduce<int, long> (
const long sendBuf[],
1938 const EReductionType reductType,
1940 const Comm<int>& comm);
1942 TEUCHOSCOMM_LIB_DLL_EXPORT
void
1943 reduce<int, unsigned long> (
const unsigned long sendBuf[],
1944 unsigned long recvBuf[],
1946 const EReductionType reductType,
1948 const Comm<int>& comm);
1950 TEUCHOSCOMM_LIB_DLL_EXPORT
void
1951 reduce<int, unsigned long long > (
const unsigned long long sendBuf[],
1952 unsigned long long recvBuf[],
1954 const EReductionType reductType,
1956 const Comm<int>& comm);
1958 TEUCHOSCOMM_LIB_DLL_EXPORT
void
1959 reduce<int, double> (
const double sendBuf[],
1962 const EReductionType reductType,
1964 const Comm<int>& comm);
1966 TEUCHOSCOMM_LIB_DLL_EXPORT
void
1967 reduceAll<int, int> (
const Comm<int>& comm,
1968 const EReductionType reductType,
1970 const int sendBuffer[],
1971 int globalReducts[]);
1974 TEUCHOSCOMM_LIB_DLL_EXPORT RCP<CommRequest<int> >
1975 ireceive<int, int> (
const Comm<int>& comm,
1976 const ArrayRCP<int>& recvBuffer,
1977 const int sourceRank);
1979 TEUCHOSCOMM_LIB_DLL_EXPORT RCP<CommRequest<int> >
1980 ireceive<int, int> (
const ArrayRCP<int> &recvBuffer,
1981 const int sourceRank,
1983 const Comm<int>& comm);
1985 TEUCHOSCOMM_LIB_DLL_EXPORT
void
1986 send<int, int> (
const Comm<int>& comm,
1988 const int sendBuffer[],
1989 const int destRank);
1991 TEUCHOSCOMM_LIB_DLL_EXPORT
void
1992 send<int, int> (
const int sendBuffer[],
1996 const Comm<int>& comm);
1998 TEUCHOSCOMM_LIB_DLL_EXPORT RCP<CommRequest<int> >
1999 isend<int, int> (
const ArrayRCP<const int>& sendBuffer,
2002 const Comm<int>& comm);
2006 TEUCHOSCOMM_LIB_DLL_EXPORT
void
2007 gather<int, unsigned int> (
const unsigned int sendBuf[],
2008 const int sendCount,
2009 unsigned int recvBuf[],
2010 const int recvCount,
2012 const Comm<int>& comm);
2014 TEUCHOSCOMM_LIB_DLL_EXPORT
void
2015 gatherv<int, unsigned int> (
const unsigned int sendBuf[],
2016 const int sendCount,
2017 unsigned int recvBuf[],
2018 const int recvCounts[],
2021 const Comm<int>& comm);
2023 TEUCHOSCOMM_LIB_DLL_EXPORT
void
2024 reduceAll<int, unsigned int> (
const Comm<int>& comm,
2025 const EReductionType reductType,
2027 const unsigned int sendBuffer[],
2028 unsigned int globalReducts[]);
2030 TEUCHOSCOMM_LIB_DLL_EXPORT RCP<CommRequest<int> >
2031 ireceive<int, unsigned int> (
const Comm<int>& comm,
2032 const ArrayRCP<unsigned int>& recvBuffer,
2033 const int sourceRank);
2035 TEUCHOSCOMM_LIB_DLL_EXPORT RCP<CommRequest<int> >
2036 ireceive<int, unsigned int> (
const ArrayRCP<unsigned int> &recvBuffer,
2037 const int sourceRank,
2039 const Comm<int>& comm);
2041 TEUCHOSCOMM_LIB_DLL_EXPORT
void
2042 send<int, unsigned int> (
const Comm<int>& comm,
2044 const unsigned int sendBuffer[],
2045 const int destRank);
2047 TEUCHOSCOMM_LIB_DLL_EXPORT
void
2048 send<int, unsigned int> (
const unsigned int sendBuffer[],
2052 const Comm<int>& comm);
2054 TEUCHOSCOMM_LIB_DLL_EXPORT RCP<CommRequest<int> >
2055 isend<int, unsigned int> (
const ArrayRCP<const unsigned int>& sendBuffer,
2058 const Comm<int>& comm);
2062 TEUCHOSCOMM_LIB_DLL_EXPORT
void
2063 gather<int, short> (
const short sendBuf[],
2064 const int sendCount,
2066 const int recvCount,
2068 const Comm<int>& comm);
2070 TEUCHOSCOMM_LIB_DLL_EXPORT
void
2071 gatherv<int, short> (
const short sendBuf[],
2072 const int sendCount,
2074 const int recvCounts[],
2077 const Comm<int>& comm);
2079 TEUCHOSCOMM_LIB_DLL_EXPORT
void
2080 reduceAll<int, short> (
const Comm<int>& comm,
2081 const EReductionType reductType,
2083 const short sendBuffer[],
2084 short globalReducts[]);
2086 TEUCHOSCOMM_LIB_DLL_EXPORT RCP<CommRequest<int> >
2087 ireceive<int, short> (
const Comm<int>& comm,
2088 const ArrayRCP<short>& recvBuffer,
2089 const int sourceRank);
2091 TEUCHOSCOMM_LIB_DLL_EXPORT RCP<CommRequest<int> >
2092 ireceive<int, short> (
const ArrayRCP<short> &recvBuffer,
2093 const int sourceRank,
2095 const Comm<int>& comm);
2097 TEUCHOSCOMM_LIB_DLL_EXPORT
void
2098 send<int, short> (
const Comm<int>& comm,
2100 const short sendBuffer[],
2101 const int destRank);
2103 TEUCHOSCOMM_LIB_DLL_EXPORT
void
2104 send<int, short> (
const short sendBuffer[],
2108 const Comm<int>& comm);
2110 TEUCHOSCOMM_LIB_DLL_EXPORT RCP<CommRequest<int> >
2111 isend<int, short> (
const ArrayRCP<const short>& sendBuffer,
2114 const Comm<int>& comm);
2127 TEUCHOSCOMM_LIB_DLL_EXPORT
void
2128 reduceAll<int, char> (
const Comm<int>& comm,
2129 const EReductionType reductType,
2131 const char sendBuffer[],
2132 char globalReducts[]);
2137 template<
typename Ordinal,
typename Packet>
2138 void Teuchos::reduceAll(
2140 ,
const Packet &
send,
const Ptr<Packet> &globalReduct
2145 reduceAll<Ordinal,Packet>(comm, reductType, 1, &
send, &*globalReduct);
2149 template<
typename Ordinal,
typename Packet>
2150 void Teuchos::reduceAll(
2151 const Comm<Ordinal>& comm,
const Serializer<Ordinal,Packet> &serializer,
2152 const ReferenceTypeReductionOp<Ordinal,Packet> &reductOp,
2153 const Ordinal count,
const Packet*
const sendBuffer[], Packet*
const globalReducts[]
2156 TEUCHOS_COMM_TIME_MONITOR(
2157 "Teuchos::CommHelpers: reduceAll<"
2158 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
2159 <<
">( reference type )"
2161 ConstReferenceTypeSerializationBuffer<Ordinal,Packet>
2162 charSendBuffer(serializer,count,sendBuffer);
2163 ReferenceTypeSerializationBuffer<Ordinal,Packet>
2164 charGlobalReducts(serializer,count,globalReducts);
2165 CharToReferenceTypeReductionOp<Ordinal,Packet>
2166 charReductOp(
rcp(&serializer,
false),
rcp(&reductOp,
false));
2168 charReductOp,charSendBuffer.getBytes(),charSendBuffer.getCharBuffer()
2169 ,charGlobalReducts.getCharBuffer()
2173 template<
typename Ordinal,
typename Packet,
typename Serializer>
2174 void Teuchos::reduceAll(
2175 const Comm<Ordinal>& comm,
2176 const Serializer& serializer,
2177 const ValueTypeReductionOp<Ordinal,Packet> &reductOp,
2178 const Ordinal count,
const Packet sendBuffer[], Packet globalReducts[]
2181 TEUCHOS_COMM_TIME_MONITOR(
2182 "Teuchos::CommHelpers: reduceAll<"
2183 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
2184 <<
">( value type, user-defined op )"
2186 ConstValueTypeSerializationBuffer<Ordinal,Packet,Serializer>
2187 charSendBuffer(count,sendBuffer,
rcp(&serializer,
false));
2188 ValueTypeSerializationBuffer<Ordinal,Packet,Serializer>
2189 charGlobalReducts(count,globalReducts,
rcp(&serializer,
false));
2190 CharToValueTypeReductionOp<Ordinal,Packet,Serializer>
2191 charReductOp(
rcp(&reductOp,
false),
rcp(&serializer,
false));
2193 charReductOp,charSendBuffer.getBytes(),charSendBuffer.getCharBuffer()
2194 ,charGlobalReducts.getCharBuffer()
2199 template<
typename Ordinal,
typename Packet,
typename Serializer>
2200 void Teuchos::reduceAll(
2201 const Comm<Ordinal>& comm,
2202 const Serializer& serializer,
2204 const Ordinal count,
const Packet sendBuffer[], Packet globalReducts[]
2207 TEUCHOS_COMM_TIME_MONITOR(
2208 "Teuchos::CommHelpers: reduceAll<"
2209 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
2210 <<
">( value type, "<<
toString(reductType)<<
" )"
2213 ValueTypeReductionOp<Ordinal,Packet>* reductOp =
2214 createOp<Ordinal, Packet> (reductType);
2216 reduceAll(comm,serializer,*reductOp,count,sendBuffer,globalReducts);
2218 catch (std::exception& e) {
2226 template<
typename Ordinal,
typename Packet>
2228 const Comm<Ordinal>& comm,
const ValueTypeReductionOp<Ordinal,Packet> &reductOp,
2229 const Ordinal count,
const Packet sendBuffer[], Packet scanReducts[]
2232 TEUCHOS_COMM_TIME_MONITOR(
2233 "Teuchos::CommHelpers: scan<"
2234 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
2235 <<
">( value type, user-defined op )"
2237 ConstValueTypeSerializationBuffer<Ordinal,Packet>
2238 charSendBuffer(count,sendBuffer);
2239 ValueTypeSerializationBuffer<Ordinal,Packet>
2240 charScanReducts(count,scanReducts);
2241 CharToValueTypeReductionOp<Ordinal,Packet>
2242 charReductOp(
rcp(&reductOp,
false));
2244 charReductOp,charSendBuffer.getBytes(),charSendBuffer.getCharBuffer()
2245 ,charScanReducts.getCharBuffer()
2250 template<
typename Ordinal,
typename Packet>
2253 const Ordinal count,
const Packet sendBuffer[], Packet scanReducts[]
2256 TEUCHOS_COMM_TIME_MONITOR(
2257 "Teuchos::CommHelpers: scan<"
2258 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
2259 <<
">( value type, "<<
toString(reductType)<<
" )"
2262 ValueTypeReductionOp<Ordinal,Packet>* reductOp =
2263 createOp<Ordinal, Packet> (reductType);
2265 scan(comm,*reductOp,count,sendBuffer,scanReducts);
2267 catch (std::exception& e) {
2275 template<
typename Ordinal,
typename Packet>
2278 const Packet &
send,
const Ptr<Packet> &scanReduct
2281 scan<Ordinal,Packet>(comm, reductType, 1, &
send, &*scanReduct);
2285 template<
typename Ordinal,
typename Packet>
2287 const Comm<Ordinal>& comm,
const Serializer<Ordinal,Packet> &serializer,
2288 const ReferenceTypeReductionOp<Ordinal,Packet> &reductOp,
2289 const Ordinal count,
const Packet*
const sendBuffer[], Packet*
const scanReducts[]
2295 template<
typename Ordinal,
typename Packet,
typename Serializer>
2297 const Comm<Ordinal>& comm,
2298 const Serializer& serializer,
2299 const ValueTypeReductionOp<Ordinal,Packet> &reductOp,
2300 const Ordinal count,
const Packet sendBuffer[], Packet scanReducts[]
2303 TEUCHOS_COMM_TIME_MONITOR(
2304 "Teuchos::CommHelpers: scan<"
2305 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
2306 <<
">( value type, user-defined op )"
2308 ConstValueTypeSerializationBuffer<Ordinal,Packet,Serializer>
2309 charSendBuffer(count,sendBuffer,
rcp(&serializer,
false));
2310 ValueTypeSerializationBuffer<Ordinal,Packet,Serializer>
2311 charScanReducts(count,scanReducts,
rcp(&serializer,
false));
2312 CharToValueTypeReductionOp<Ordinal,Packet,Serializer>
2313 charReductOp(
rcp(&reductOp,
false),
rcp(&serializer,
false));
2315 charReductOp,charSendBuffer.getBytes(),charSendBuffer.getCharBuffer()
2316 ,charScanReducts.getCharBuffer()
2321 template<
typename Ordinal,
typename Packet,
typename Serializer>
2323 const Comm<Ordinal>& comm,
2324 const Serializer& serializer,
2326 const Ordinal count,
const Packet sendBuffer[], Packet scanReducts[]
2329 TEUCHOS_COMM_TIME_MONITOR(
2330 "Teuchos::CommHelpers: scan<"
2331 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
2332 <<
">( value type, "<<
toString(reductType)<<
" )"
2335 ValueTypeReductionOp<Ordinal,Packet>* reductOp =
2336 createOp<Ordinal, Packet> (reductType);
2338 scan(comm,serializer,*reductOp,count,sendBuffer,scanReducts);
2340 catch (std::exception& e) {
2347 template<
typename Ordinal,
typename Packet>
2349 const Comm<Ordinal>& comm,
2350 const Ordinal count,
const Packet sendBuffer[],
const int destRank
2353 TEUCHOS_COMM_TIME_MONITOR(
2354 "Teuchos::CommHelpers: send<"
2355 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
2358 ConstValueTypeSerializationBuffer<Ordinal,Packet>
2359 charSendBuffer(count,sendBuffer);
2361 charSendBuffer.getBytes(),charSendBuffer.getCharBuffer()
2366 template<
typename Ordinal,
typename Packet>
2369 const Ordinal count,
2374 TEUCHOS_COMM_TIME_MONITOR(
2375 "Teuchos::CommHelpers: send<"
2380 comm.
send (charSendBuffer.getBytes (), charSendBuffer.getCharBuffer (), destRank, tag);
2383 template<
typename Ordinal,
typename Packet>
2385 const Comm<Ordinal>& comm,
2386 const Ordinal count,
const Packet sendBuffer[],
const int destRank
2389 TEUCHOS_COMM_TIME_MONITOR(
2390 "Teuchos::CommHelpers: ssend<"
2391 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
2394 ConstValueTypeSerializationBuffer<Ordinal,Packet>
2395 charSendBuffer(count,sendBuffer);
2397 charSendBuffer.getBytes(),charSendBuffer.getCharBuffer()
2402 template<
typename Ordinal,
typename Packet>
2405 const Ordinal count,
2410 TEUCHOS_COMM_TIME_MONITOR(
2411 "Teuchos::CommHelpers: ssend<"
2416 buf_type charSendBuffer (count, sendBuffer);
2417 comm.
ssend (charSendBuffer.getBytes (),
2418 charSendBuffer.getCharBuffer (),
2422 template<
typename Ordinal,
typename Packet>
2424 const Comm<Ordinal>& comm,
2425 const Packet &
send,
const int destRank
2428 Teuchos::send<Ordinal,Packet>(comm,1,&
send,destRank);
2431 template<
typename Ordinal,
typename Packet>
2433 const Comm<Ordinal>& comm,
2434 const Packet &
send,
const int destRank
2437 Teuchos::ssend<Ordinal,Packet>(comm,1,&
send,destRank);
2440 template<
typename Ordinal,
typename Packet>
2442 const Comm<Ordinal>& comm,
const Serializer<Ordinal,Packet> &serializer,
2443 const Ordinal count,
const Packet*
const sendBuffer[],
const int destRank
2449 template<
typename Ordinal,
typename Packet,
typename Serializer>
2451 const Comm<Ordinal>& comm,
2452 const Serializer& serializer,
2453 const Ordinal count,
const Packet sendBuffer[],
const int destRank
2456 TEUCHOS_COMM_TIME_MONITOR(
2457 "Teuchos::CommHelpers: send<"
2458 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
2461 ConstValueTypeSerializationBuffer<Ordinal,Packet,Serializer>
2462 charSendBuffer(count,sendBuffer,
rcp(&serializer,
false));
2464 charSendBuffer.getBytes(),charSendBuffer.getCharBuffer()
2469 template<
typename Ordinal,
typename Packet>
2470 int Teuchos::receive(
2471 const Comm<Ordinal>& comm,
2472 const int sourceRank,
const Ordinal count, Packet recvBuffer[]
2475 TEUCHOS_COMM_TIME_MONITOR(
2476 "Teuchos::CommHelpers: receive<"
2477 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
2480 ValueTypeSerializationBuffer<Ordinal,Packet>
2481 charRecvBuffer(count,recvBuffer);
2482 return comm.receive(
2484 ,charRecvBuffer.getBytes(),charRecvBuffer.getCharBuffer()
2489 template<
typename Ordinal,
typename Packet>
2490 int Teuchos::receive(
2491 const Comm<Ordinal>& comm,
2492 const int sourceRank, Packet *recv
2495 return Teuchos::receive<Ordinal,Packet>(comm,sourceRank,1,recv);
2499 template<
typename Ordinal,
typename Packet>
2500 int Teuchos::receive(
2501 const Comm<Ordinal>& comm,
const Serializer<Ordinal,Packet> &serializer,
2502 const int sourceRank,
const Ordinal count, Packet*
const recvBuffer[]
2508 template<
typename Ordinal,
typename Packet,
typename Serializer>
2509 int Teuchos::receive(
2510 const Comm<Ordinal>& comm,
2511 const Serializer& serializer,
2512 const int sourceRank,
const Ordinal count, Packet recvBuffer[]
2515 TEUCHOS_COMM_TIME_MONITOR(
2516 "Teuchos::CommHelpers: receive<"
2517 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
2520 ValueTypeSerializationBuffer<Ordinal,Packet,Serializer>
2521 charRecvBuffer(count,recvBuffer,
rcp(&serializer,
false));
2522 return comm.receive(
2524 ,charRecvBuffer.getBytes(),charRecvBuffer.getCharBuffer()
2528 template<
typename Ordinal,
typename Packet>
2530 const Comm<Ordinal>& comm,
2531 const ArrayView<const Packet> &sendBuffer,
2535 TEUCHOS_COMM_TIME_MONITOR(
2536 "Teuchos::CommHelpers: readySend<"
2537 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
2540 ConstValueTypeSerializationBuffer<Ordinal,Packet>
2541 charSendBuffer(sendBuffer.size(), sendBuffer.getRawPtr());
2542 comm.readySend( charSendBuffer.getCharBufferView(), destRank );
2545 template<
typename Ordinal,
typename Packet>
2548 const Ordinal count,
2553 TEUCHOS_COMM_TIME_MONITOR(
2554 "Teuchos::CommHelpers: readySend<"
2559 buf_type charSendBuffer (count, sendBuffer);
2560 comm.
readySend (charSendBuffer.getBytes (),
2561 charSendBuffer.getCharBuffer (),
2565 template<
typename Ordinal,
typename Packet>
2567 const Comm<Ordinal>& comm,
2572 readySend<Ordinal, Packet>( comm,
arrayView(&send,1), destRank );
2575 template<
typename Ordinal,
typename Packet,
typename Serializer>
2577 const Comm<Ordinal>& comm,
2578 const Serializer& serializer,
2579 const ArrayView<const Packet> &sendBuffer,
2583 TEUCHOS_COMM_TIME_MONITOR(
2584 "Teuchos::CommHelpers: readySend<"
2585 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
2588 ConstValueTypeSerializationBuffer<Ordinal,Packet,Serializer>
2589 charSendBuffer(sendBuffer.size(), sendBuffer.getRawPtr(), serializer);
2590 comm.readySend( charSendBuffer.getCharBufferView(), destRank );
2593 template<
typename Ordinal,
typename Packet>
2596 const Comm<Ordinal>& comm,
2597 const ArrayRCP<const Packet> &sendBuffer,
2601 TEUCHOS_COMM_TIME_MONITOR(
2602 "Teuchos::CommHelpers: isend<"
2603 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
2606 ConstValueTypeSerializationBuffer<Ordinal,Packet>
2607 charSendBuffer(sendBuffer.size(), sendBuffer.getRawPtr());
2608 RCP<CommRequest<Ordinal> > commRequest = comm.isend(
2609 charSendBuffer.getCharBufferView(), destRank );
2614 template<
typename Ordinal,
typename Packet>
2619 const Comm<Ordinal>& comm)
2621 TEUCHOS_COMM_TIME_MONITOR(
2622 "Teuchos::isend<" << OrdinalTraits<Ordinal>::name () <<
","
2623 << TypeNameTraits<Packet>::name () <<
">");
2624 ConstValueTypeSerializationBuffer<Ordinal,Packet>
2625 charSendBuffer (sendBuffer.size (), sendBuffer.getRawPtr ());
2626 RCP<CommRequest<Ordinal> > commRequest =
2627 comm.isend (charSendBuffer.getCharBufferView (), destRank, tag);
2632 template<
typename Ordinal,
typename Packet>
2635 const Comm<Ordinal>& comm,
2636 const RCP<const Packet> &
send,
2640 const ArrayRCP<const Packet> sendBuffer =
2644 return isend<Ordinal, Packet>( comm, sendBuffer, destRank );
2647 template<
typename Ordinal,
typename Packet,
typename Serializer>
2650 const Comm<Ordinal>& comm,
2651 const Serializer& serializer,
2652 const ArrayRCP<const Packet> &sendBuffer,
2656 TEUCHOS_COMM_TIME_MONITOR(
2657 "Teuchos::CommHelpers: isend<"
2658 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
2661 ConstValueTypeSerializationBuffer<Ordinal,Packet,Serializer>
2662 charSendBuffer(sendBuffer.size(), sendBuffer.getRawPtr(), serializer);
2663 RCP<CommRequest<Ordinal> > commRequest = comm.isend(
2664 charSendBuffer.getCharBufferView(), destRank );
2669 template<
typename Ordinal,
typename Packet>
2672 const Comm<Ordinal>& comm,
2673 const ArrayRCP<Packet> &recvBuffer,
2674 const int sourceRank
2677 TEUCHOS_COMM_TIME_MONITOR(
2678 "Teuchos::ireceive<int, " <<
"," << TypeNameTraits<Packet>::name () <<
">");
2679 ValueTypeSerializationBuffer<Ordinal,Packet>
2680 charRecvBuffer(recvBuffer.size(), recvBuffer.getRawPtr());
2681 RCP<CommRequest<Ordinal> > commRequest = comm.ireceive(
2682 charRecvBuffer.getCharBufferView(), sourceRank );
2687 template<
typename Ordinal,
typename Packet>
2690 const int sourceRank,
2694 TEUCHOS_COMM_TIME_MONITOR(
2695 "Teuchos::ireceive<int, " <<
"," << TypeNameTraits<Packet>::name () <<
">");
2696 ValueTypeSerializationBuffer<int, Packet>
2697 charRecvBuffer (recvBuffer.
size (), recvBuffer.
getRawPtr ());
2698 RCP<CommRequest<int> > commRequest =
2699 comm.
ireceive (charRecvBuffer.getCharBufferView (), sourceRank, tag);
2704 template<
typename Ordinal,
typename Packet>
2707 const Comm<Ordinal>& comm,
2708 const RCP<Packet> &recv,
2709 const int sourceRank
2712 const ArrayRCP<Packet> recvBuffer =
2716 return ireceive<Ordinal, Packet>( comm, recvBuffer, sourceRank );
2719 template<
typename Ordinal,
typename Packet,
typename Serializer>
2722 const Comm<Ordinal>& comm,
2723 const Serializer& serializer,
2724 const ArrayRCP<Packet> &recvBuffer,
2725 const int sourceRank
2728 TEUCHOS_COMM_TIME_MONITOR(
2729 "Teuchos::CommHelpers: ireceive<"
2730 <<OrdinalTraits<Ordinal>::name()<<
","<<TypeNameTraits<Packet>::name()
2733 ValueTypeSerializationBuffer<Ordinal,Packet,Serializer>
2734 charRecvBuffer(recvBuffer.size(), recvBuffer.getRawPtr(), serializer);
2735 RCP<CommRequest<Ordinal> > commRequest = comm.ireceive(
2736 charRecvBuffer.getCharBufferView(), sourceRank );
2741 template<
typename Ordinal>
2742 void Teuchos::waitAll(
2743 const Comm<Ordinal>& comm,
2744 const ArrayView<RCP<CommRequest<Ordinal> > > &requests
2747 comm.waitAll(requests);
2751 template<
typename Ordinal>
2753 Teuchos::waitAll (
const Comm<Ordinal>& comm,
2754 const ArrayView<RCP<CommRequest<Ordinal> > >& requests,
2755 const ArrayView<RCP<CommStatus<Ordinal> > >& statuses)
2757 comm.waitAll (requests, statuses);
2761 template<
typename Ordinal>
2763 Teuchos::wait (
const Comm<Ordinal>& comm,
2764 const Ptr<RCP<CommRequest<Ordinal> > > &request)
2766 return comm.wait (request);
2770 #endif // TEUCHOS_COMM_HELPERS_HPP
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...
ArrayView< T > arrayView(T *p, typename ArrayView< T >::size_type size)
Construct a const or non-const view to const or non-const data.
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
EReductionType
Predefined reduction operations that Teuchos::Comm understands.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Macro for throwing an exception with breakpointing to ease debugging.
T * getRawPtr() const
Get the raw C++ pointer to the underlying object.
void reduce(const Ordinal count, const Packet inBuffer[], Packet inoutBuffer[]) const
size_type size() const
The total number of entries in the array.
Standard logical AND operator for booleans.
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.
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.
Base interface class for user-defined reduction operations for objects that use value semantics...
std::string toString(const any &rhs)
Converts the value in any to a std::string.
Standard summation operator for types with value semantics.
void reduce(const Ordinal count, const Packet inBuffer[], Packet inoutBuffer[]) const
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.
Standard Max operator for types with value semantics.
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.
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 readySend(const ArrayView< const char > &sendBuffer, const int destRank) const =0
Ready send of data from this process to another process.
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.
Defines basic traits for the ordinal field type.
Default traits class that just returns typeid(T).name().
void reduce(const Ordinal count, const Packet inBuffer[], Packet inoutBuffer[]) const
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.
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.
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).
Defines basic traits returning the name of a type in a portable and readable way. ...
Definition of Teuchos::as, for conversions between types.
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...
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...
Encapsulate how an array of const objects with value sematics is serialized into a const char[] array...
Reference-counted smart pointer for managing arrays.