vt  1.6.0
(Virtual Transport)
active.h
Go to the documentation of this file.
1 /*
2 //@HEADER
3 // *****************************************************************************
4 //
5 // active.h
6 // DARMA/vt => Virtual Transport
7 //
8 // Copyright 2019-2024 National Technology & Engineering Solutions of Sandia, LLC
9 // (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S.
10 // Government retains certain rights in this software.
11 //
12 // Redistribution and use in source and binary forms, with or without
13 // modification, are permitted provided that the following conditions are met:
14 //
15 // * Redistributions of source code must retain the above copyright notice,
16 // this list of conditions and the following disclaimer.
17 //
18 // * Redistributions in binary form must reproduce the above copyright notice,
19 // this list of conditions and the following disclaimer in the documentation
20 // and/or other materials provided with the distribution.
21 //
22 // * Neither the name of the copyright holder nor the names of its
23 // contributors may be used to endorse or promote products derived from this
24 // software without specific prior written permission.
25 //
26 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
27 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
30 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 // POSSIBILITY OF SUCH DAMAGE.
37 //
38 // Questions? Contact darma@sandia.gov
39 //
40 // *****************************************************************************
41 //@HEADER
42 */
43 
44 #if !defined INCLUDED_VT_MESSAGING_ACTIVE_H
45 #define INCLUDED_VT_MESSAGING_ACTIVE_H
46 
47 #include <cstdint>
48 #include <memory>
49 #include <mpi.h>
50 
51 #include "vt/config.h"
52 #include "vt/activefn/activefn.h"
57 #include "vt/messaging/send_info.h"
59 #include "vt/messaging/param_msg.h"
60 #include "vt/event/event.h"
62 #include "vt/trace/trace_common.h"
65 #include "vt/elm/elm_id.h"
66 #include "vt/elm/elm_lb_data.h"
69 
70 #if vt_check_enabled(trace_enabled)
71  #include "vt/trace/trace_headers.h"
72 #endif
73 
74 #include <type_traits>
75 #include <tuple>
76 #include <vector>
77 #include <unordered_map>
78 #include <limits>
79 #include <stack>
80 
81 namespace vt {
82 
84 using PtrLenPairType = std::tuple<std::byte*, ByteType>;
85 
88  std::function<void(PtrLenPairType data, ActionType deleter)>;
89 
90 } /* end namespace vt */
91 
92 namespace vt {
93 
94 struct StrongNodeType { };
96 
97 namespace messaging {
98 
101 using MPI_TagType = int;
102 
103 static constexpr TagType const PutPackedTag =
104  std::numeric_limits<TagType>::max();
105 
106 enum class MPITag : MPI_TagType {
107  ActiveMsgTag = 1,
108  DataMsgTag = 2,
109 
110  // Size-class active message tags
111  ActiveMsgS = 11, // <= 512 bytes
112  ActiveMsgM = 12, // <= 2048 bytes
113  ActiveMsgL = 13, // <= 8192 bytes
114  ActiveMsgXL = 14 // <= 32768 bytes
115 };
116 
117 static constexpr TagType const starting_direct_buffer_tag = 1000;
118 static constexpr MsgSizeType const max_pack_direct_size = 512;
119 
125 struct PendingRecv {
126  int nchunks = 0;
127  std::byte* user_buf = nullptr;
130  NodeType sender = uninitialized_destination;
131  PriorityType priority = no_priority;
132  bool is_user_buf = false;
133 
135  int in_nchunks, std::byte* in_user_buf, ContinuationDeleterType in_cont,
136  ActionType in_dealloc_user_buf, NodeType node,
137  PriorityType in_priority, bool in_is_user_buf
138  ) : nchunks(in_nchunks), user_buf(in_user_buf), cont(in_cont),
139  dealloc_user_buf(in_dealloc_user_buf), sender(node),
140  priority(in_priority), is_user_buf(in_is_user_buf)
141  { }
142 
143  template <typename Serializer>
144  void serialize(Serializer& s) {
145  s | nchunks
146  | user_buf
147  | cont
149  | sender
150  | priority
151  | is_user_buf;
152  }
153 };
154 
162  std::byte* in_buf, MsgSizeType in_probe_bytes, NodeType in_sender
163  ) : buf(in_buf), probe_bytes(in_probe_bytes), sender(in_sender),
164  valid(true)
165  { }
166 
167  template <typename Serializer>
168  void serialize(Serializer& s) {
169  s | buf
170  | probe_bytes
171  | sender
172  | valid;
173  }
174 
175  std::byte* buf = nullptr;
177  NodeType sender = uninitialized_destination;
178  bool valid = false;
179 };
180 
187 
189  std::byte* in_buf, MsgSizeType in_probe_bytes, NodeType in_sender,
190  MPI_Request in_req = MPI_REQUEST_NULL
191  ) : InProgressBase(in_buf, in_probe_bytes, in_sender),
192  req(in_req)
193  { }
194 
195  bool test(int& num_mpi_tests) {
196  VT_ALLOW_MPI_CALLS; // MPI_Test
197 
198  int flag = 0;
199  MPI_Status stat;
200  MPI_Test(&req, &flag, &stat);
201  num_mpi_tests++;
202  return flag;
203  }
204 
205 private:
206  MPI_Request req = MPI_REQUEST_NULL;
207 };
208 
216  std::byte* in_buf, MsgSizeType in_probe_bytes, NodeType in_sender,
217  std::vector<MPI_Request> in_reqs, std::byte* const in_user_buf,
218  ActionType in_dealloc_user_buf,
219  ContinuationDeleterType in_next,
220  PriorityType in_priority
221  ) : InProgressBase{in_buf, in_probe_bytes, in_sender},
222  user_buf(in_user_buf), dealloc_user_buf(in_dealloc_user_buf),
223  next(in_next), priority(in_priority), reqs(std::move(in_reqs))
224  { }
225 
226  bool test(int& num_mpi_tests) {
227  int flag = 0;
228  MPI_Status stat;
229  for ( ; cur < reqs.size(); cur++) {
230  VT_ALLOW_MPI_CALLS; // MPI_Test
231 
232  MPI_Test(&reqs[cur], &flag, &stat);
233  num_mpi_tests++;
234 
235  if (flag == 0) {
236  return false;
237  }
238  }
239 
240  return true;
241  }
242 
243  template <typename Serializer>
244  void serialize(Serializer& s) {
245  s | user_buf
247  | next
248  | priority
249  | cur
250  | reqs;
251  }
252 
253  std::byte* user_buf = nullptr;
256  PriorityType priority = no_priority;
257 
258 private:
259  std::size_t cur = 0;
260  std::vector<MPI_Request> reqs;
261 };
262 
270 
274 
276  MessageType const& in_buffered_msg, NodeType const& in_from_node,
277  ActionType in_cont
278  ) : buffered_msg(in_buffered_msg), from_node(in_from_node), cont(in_cont)
279  { }
280 
281  template <typename Serializer>
282  void serialize(Serializer& s) {
283  s | buffered_msg
284  | from_node
285  | cont;
286  }
287 };
288 
289 // forward-declare for header
290 struct MultiMsg;
291 
330  using CountType = int32_t;
335  using ContainerPendingType = std::unordered_map<TagType,PendingRecvType>;
336  using ReadyHanTagType = std::tuple<HandlerType, TagType>;
339 
343  ActiveMessenger();
344 
348  virtual ~ActiveMessenger();
349 
350  std::string name() override { return "ActiveMessenger"; }
351 
352  void startup() override;
353  void initialize() override;
354 
364  template <typename MsgPtrT>
365  void markAsTermMessage(MsgPtrT const msg);
366 
372  template <typename MsgPtrT>
373  void markAsLocationMessage(MsgPtrT const msg);
374 
380  template <typename MsgPtrT>
381  void markAsSerialMsgMessage(MsgPtrT const msg);
382 
388  template <typename MsgPtrT>
389  void markAsCollectionMessage(MsgPtrT const msg);
390 
397  template <typename MsgT>
398  void setEpochMessage(MsgT* msg, EpochType epoch);
399 
407  template <typename MsgT>
408  void setTagMessage(MsgT* msg, TagType tag);
409 
411  HandlerType const handler, ByteType serialized_msg_size, bool is_bcast
412  );
413 
414  // With serialization, the correct method is resolved via SFINAE.
415  // This also includes additional guards to detect ambiguity.
416  template <typename MsgT>
418  NodeType dest,
419  HandlerType han,
420  MsgSharedPtr<MsgT>& msg,
421  TagType tag
422  );
423 
424  // All messages that do NOT define their own serialization policy
425  // and do NOT define their own serialization function are required
426  // to be byte-transmittable. This covers basic byte-copyable
427  // messages directly inheriting from ActiveMsg. ActivMsg implements
428  // a serialize function which is implicitly inherited..
429  template <
430  typename MsgT,
431  std::enable_if_t<true
432  and not ::vt::messaging::msg_defines_serialize_mode<MsgT>::value,
433  int
434  > = 0
435  >
437  NodeType dest,
438  HandlerType han,
439  MsgSharedPtr<MsgT>& msg,
440  TagType tag
441  ) {
442 #ifndef vt_quirked_serialize_method_detection
443  static_assert(
444  not ::vt::messaging::has_own_serialize<MsgT>,
445  "Message prohibiting serialization must not have a serialization function."
446  );
447 #endif
448  return sendMsgCopyableImpl<MsgT>(dest, han, msg, tag);
449  }
450 
451  // Serializable and serialization required on this type.
452  template <
453  typename MsgT,
454  std::enable_if_t<true
455  and ::vt::messaging::msg_defines_serialize_mode<MsgT>::value
456  and ::vt::messaging::msg_serialization_mode<MsgT>::required,
457  int
458  > = 0
459  >
461  NodeType dest,
462  HandlerType han,
463  MsgSharedPtr<MsgT>& msg,
464  TagType tag
465  ) {
466 #ifndef vt_quirked_serialize_method_detection
467  static_assert(
468  ::vt::messaging::has_own_serialize<MsgT>,
469  "Message requiring serialization must have a serialization function."
470  );
471 #endif
472  return sendMsgSerializableImpl<MsgT>(dest, han, msg, tag);
473  }
474 
475  // Serializable, but support is only for derived types.
476  // This type will still be sent using byte-copy serialization.
477  template <
478  typename MsgT,
479  std::enable_if_t<true
480  and ::vt::messaging::msg_defines_serialize_mode<MsgT>::value
481  and ::vt::messaging::msg_serialization_mode<MsgT>::supported,
482  int
483  > = 0
484  >
486  NodeType dest,
487  HandlerType han,
488  MsgSharedPtr<MsgT>& msg,
489  TagType tag
490  ) {
491 #ifndef vt_quirked_serialize_method_detection
492  static_assert(
493  ::vt::messaging::has_own_serialize<MsgT>,
494  "Message supporting serialization must have a serialization function."
495  );
496 #endif
497  return sendMsgCopyableImpl<MsgT>(dest, han, msg, tag);
498  }
499 
500  // Messaged marked as prohibiting serialization cannot define
501  // a serialization function and must be sent via byte-transmission.
502  template <
503  typename MsgT,
504  std::enable_if_t<true
505  and ::vt::messaging::msg_defines_serialize_mode<MsgT>::value
506  and ::vt::messaging::msg_serialization_mode<MsgT>::prohibited,
507  int
508  > = 0
509  >
511  NodeType dest,
512  HandlerType han,
513  MsgSharedPtr<MsgT>& msg,
514  TagType tag
515  ) {
516 #ifndef vt_quirked_serialize_method_detection
517  static_assert(
518  not ::vt::messaging::has_own_serialize<MsgT>,
519  "Message prohibiting serialization must not have a serialization function."
520  );
521 #endif
522  return sendMsgCopyableImpl<MsgT>(dest, han, msg, tag);
523  }
524 
525  template <typename MsgT>
527  NodeType dest,
528  HandlerType han,
529  MsgSharedPtr<MsgT>& msg,
530  TagType tag
531  );
532 
576  template <typename MsgT>
577  [[deprecated("size must be set in makeMessageSz, use regular sendMsg")]]
579  NodeType dest,
580  HandlerType han,
581  MsgPtrThief<MsgT> msg,
582  ByteType msg_size,
583  TagType tag = no_tag
584  );
585 
598  template <typename MsgT>
600  NodeType dest,
601  HandlerType han,
602  MsgPtrThief<MsgT> msg,
603  TagType tag = no_tag
604  );
605 
620  template <typename MsgT>
622  NodeType dest,
623  HandlerType han,
624  MsgPtrThief<MsgT> msg,
625  TagType tag = no_tag
626  );
627 
630  /*
631  *----------------------------------------------------------------------------
632  * End Basic Active Message Send with Pre-Registered Handler
633  *----------------------------------------------------------------------------
634  */
635 
677  template <typename MsgT, ActiveTypedFnType<MsgT>* f>
679  MsgPtrThief<MsgT> msg,
680  ByteType msg_size,
681  bool deliver_to_sender = true,
682  TagType tag = no_tag
683  );
684 
696  template <typename MsgT, ActiveTypedFnType<MsgT>* f>
698  MsgPtrThief<MsgT> msg,
699  bool deliver_to_sender = true,
700  TagType tag = no_tag
701  );
702 
714  template <auto f>
716  MsgPtrThief<typename FuncTraits<decltype(f)>::MsgT> msg,
717  bool deliver_to_sender = true,
718  TagType tag = no_tag
719  ) {
720  using MsgT = typename FuncTraits<decltype(f)>::MsgT;
721  return broadcastMsg<MsgT, f>(msg, deliver_to_sender, tag);
722  }
723 
735  template <typename MsgT, ActiveTypedFnType<MsgT>* f>
737  NodeType dest,
738  MsgPtrThief<MsgT> msg,
739  TagType tag = no_tag
740  );
741 
753  template <auto f>
755  NodeType dest,
756  MsgPtrThief<typename FuncTraits<decltype(f)>::MsgT> msg,
757  TagType tag = no_tag
758  ) {
759  using MsgT = typename FuncTraits<decltype(f)>::MsgT;
760  return sendMsg<MsgT, f>(dest, msg, tag);
761  }
762 
771  template <auto f, typename... Params>
772  PendingSendType send(Node dest, Params&&... params) {
773  using Tuple = typename FuncTraits<decltype(f)>::TupleType;
774  using MsgT = ParamMsg<Tuple>;
775  auto msg = vt::makeMessage<MsgT>();
776  msg->setParams(std::forward<Params>(params)...);
777  auto han = auto_registry::makeAutoHandlerParam<decltype(f), f, MsgT>();
778  return sendMsg<MsgT>(dest.get(), han, msg, no_tag);
779  }
780 
788  template <auto f, typename... Params>
789  PendingSendType broadcast(Params&&... params) {
790  using Tuple = typename FuncTraits<decltype(f)>::TupleType;
791  using MsgT = ParamMsg<Tuple>;
792  auto msg = vt::makeMessage<MsgT>();
793  msg->setParams(std::forward<Params>(params)...);
794  auto han = auto_registry::makeAutoHandlerParam<decltype(f), f, MsgT>();
795  constexpr bool deliver_to_sender = true;
796  return broadcastMsg<MsgT>(han, msg, deliver_to_sender, no_tag);
797  }
798 
815  template <typename MsgT, ActiveTypedFnType<MsgT>* f>
816  [[deprecated("size must be set in makeMessageSz, use regular sendMsg")]]
818  NodeType dest,
819  MsgPtrThief<MsgT> msg,
820  ByteType msg_size,
821  TagType tag = no_tag
822  );
823 
836  template <typename MsgT, ActiveTypedFnType<MsgT>* f>
838  MsgPtrThief<MsgT> msg,
839  TagType tag = no_tag
840  );
841 
855  template <typename MsgT, ActiveTypedFnType<MsgT>* f>
857  NodeType dest,
858  MsgPtrThief<MsgT> msg,
859  TagType tag = no_tag
860  );
861 
864  /*
865  *----------------------------------------------------------------------------
866  * End Send Message Active Function (type-safe handler)
867  *----------------------------------------------------------------------------
868  */
869 
913  template <ActiveFnType* f, typename MsgT>
915  MsgPtrThief<MsgT> msg,
916  bool deliver_to_sender = true,
917  TagType tag = no_tag
918  );
919 
931  template <ActiveFnType* f, typename MsgT>
933  NodeType dest,
934  MsgPtrThief<MsgT> msg,
935  TagType tag = no_tag
936  );
937 
940  /*
941  *----------------------------------------------------------------------------
942  * End Send Message BASIC Active Function (deprecated?)
943  *----------------------------------------------------------------------------
944  */
945 
986  template <
987  typename FunctorT,
988  typename MsgT
989  >
991  MsgPtrThief<MsgT> msg,
992  bool deliver_to_sender = true,
993  TagType tag = no_tag
994  );
995 
1007  template <typename FunctorT>
1010  bool deliver_to_sender = true,
1011  TagType tag = no_tag
1012  );
1013 
1026  template <
1027  typename FunctorT,
1028  typename MsgT = typename util::FunctorExtractor<FunctorT>::MessageType
1029  >
1031  MsgPtrThief<MsgT> msg,
1032  TagType tag = no_tag
1033  );
1034 
1046  template <typename FunctorT,typename MsgT>
1048  NodeType dest,
1049  MsgPtrThief<MsgT> msg,
1050  TagType tag = no_tag
1051  );
1052 
1064  template <typename FunctorT>
1066  NodeType dest,
1068  TagType tag = no_tag
1069  );
1070 
1084  template <
1085  typename FunctorT,
1086  typename MsgT = typename util::FunctorExtractor<FunctorT>::MessageType
1087  >
1089  NodeType dest,
1090  MsgPtrThief<MsgT> msg,
1091  TagType tag = no_tag
1092  );
1093 
1096  /*
1097  *----------------------------------------------------------------------------
1098  * End Send Message Functor Variants
1099  *----------------------------------------------------------------------------
1100  */
1101 
1154  template <typename MsgT>
1156  HandlerType han,
1157  MsgPtrThief<MsgT> msg,
1158  bool deliver_to_sender = true,
1159  TagType tag = no_tag
1160  );
1161 
1174  template <typename MsgT>
1176  NodeType dest,
1177  HandlerType han,
1178  MsgPtrThief<MsgT> msg,
1179  UserSendFnType send_payload_fn
1180  );
1181 
1193  template <typename MsgT, ActiveTypedFnType<MsgT>* f>
1195  NodeType dest,
1196  MsgPtrThief<MsgT> msg,
1197  UserSendFnType send_payload_fn
1198  );
1199 
1213  template <typename MsgT>
1215  HandlerType han,
1216  MsgPtrThief<MsgT> msg,
1217  TagType tag = no_tag
1218  );
1219 
1222  /*
1223  *----------------------------------------------------------------------------
1224  * End Send Data Message
1225  *----------------------------------------------------------------------------
1226  */
1227 
1244  MessageType* msg, MsgSizeType size, std::byte* ptr, MsgSizeType ptr_bytes
1245  );
1246 
1258  PtrLenPairType const& ptr, NodeType const& dest, TagType const& tag
1259  );
1260 
1271  std::tuple<EventType, int> sendDataMPI(
1272  PtrLenPairType const& ptr, NodeType const& dest, TagType const& tag
1273  );
1274 
1287  bool recvDataMsgPriority(
1288  int nchunks, PriorityType priority, TagType const& tag,
1289  NodeType const& node, ContinuationDeleterType next = nullptr
1290  );
1291 
1303  bool recvDataMsg(
1304  int nchunks, TagType const& tag, NodeType const& node,
1305  ContinuationDeleterType next = nullptr
1306  );
1307 
1321  bool recvDataMsg(
1322  int nchunks, PriorityType priority, TagType const& tag,
1323  NodeType const& sender, bool const& enqueue,
1324  ContinuationDeleterType next = nullptr
1325  );
1326 
1343  bool recvDataMsgBuffer(
1344  int nchunks, std::byte* const user_buf, PriorityType priority, TagType const& tag,
1345  NodeType const& node = uninitialized_destination, bool const& enqueue = true,
1346  ActionType dealloc_user_buf = nullptr,
1347  ContinuationDeleterType next = nullptr, bool is_user_buf = false
1348  );
1349 
1365  bool recvDataMsgBuffer(
1366  int nchunks, std::byte* const user_buf, TagType const& tag,
1367  NodeType const& node = uninitialized_destination, bool const& enqueue = true,
1368  ActionType dealloc_user_buf = nullptr,
1369  ContinuationDeleterType next = nullptr, bool is_user_buf = false
1370  );
1371 
1387  void recvDataDirect(
1388  int nchunks, std::byte* const buf, TagType const tag, NodeType const from,
1389  MsgSizeType len, PriorityType prio, ActionType dealloc = nullptr,
1390  ContinuationDeleterType next = nullptr, bool is_user_buf = false
1391 #if MPI_VERSION >= 3
1392  , MPI_Message first_msg = MPI_MESSAGE_NULL, MsgSizeType first_chunk_bytes = 0
1393 #endif
1394  );
1395 
1405  void recvDataDirect(
1406  int nchunks, TagType const tag, NodeType const from,
1408  );
1409 
1422  );
1423 
1431 
1438  bool tryProcessDataMsgRecv();
1439 
1448  int progress(TimeType current_time) override;
1449 
1463  void processActiveMsg(
1464  MsgSharedPtr<BaseMsgType> const& base, NodeType const& sender,
1465  bool insert, ActionType cont = nullptr
1466  );
1467 
1477  void prepareActiveMsgToRun(
1478  MsgSharedPtr<BaseMsgType> const& base, NodeType const& from_node,
1479  bool insert, ActionType cont
1480  );
1481 
1494  NodeType const& dest, MsgSharedPtr<BaseMsgType> const& base,
1495  MsgSizeType const& msg_size, TagType const& send_tag
1496  );
1497 
1508  NodeType const& dest, MsgSharedPtr<BaseMsgType> const& base
1509  );
1510 
1524  NodeType const& dest, MsgSharedPtr<BaseMsgType> const& base,
1525  MsgSizeType const& msg_size, TagType const& send_tag
1526  );
1527 
1538  inline void pushEpoch(EpochType const& epoch);
1539 
1554  inline EpochType popEpoch(EpochType const& epoch = no_epoch);
1555 
1562  inline EpochType getEpoch() const;
1563 
1573  template <typename MsgT>
1574  inline EpochType getEpochContextMsg(MsgT* msg);
1575 
1585  template <typename MsgT>
1586  inline EpochType getEpochContextMsg(MsgSharedPtr<MsgT> const& msg);
1587 
1601  template <typename MsgT>
1602  inline EpochType setupEpochMsg(MsgT* msg);
1603 
1612  template <typename MsgT>
1613  inline EpochType setupEpochMsg(MsgSharedPtr<MsgT> const& msg);
1614 
1620  void registerAsyncOp(std::unique_ptr<AsyncOp> op);
1621 
1631  void blockOnAsyncOp(std::unique_ptr<AsyncOp> op);
1632 
1633  template <typename SerializerT>
1634  void serialize(SerializerT& s) {
1635  s | pending_recvs_
1639  | in_progress_ops
1640  | this_node_
1642  | amHandlerCount
1643  | amPollCount
1647  | bcastsSentCount
1648  | dmPollCount
1652  | tdRecvCount
1653  | tdSentCount;
1654 
1655  # if vt_check_enabled(trace_enabled)
1656  s | trace_irecv
1657  | trace_isend
1658  | trace_irecv_polling_am
1659  | trace_irecv_polling_dm
1660  | trace_asyncop;
1661  # endif
1662  }
1663 
1664 private:
1674 
1681  void handleChunkedMultiMsg(MultiMsg* msg);
1682 
1689  static void chunkedMultiMsg(MultiMsg* msg);
1690 
1697 
1704 
1710  bool testPendingAsyncOps();
1711 
1716 
1721 
1730  NodeType const dest, MsgSharedPtr<BaseMsgType> const& base,
1731  MsgSizeType const msg_size
1732  );
1733 
1740 
1749  struct Slot {
1750  int cap = 0;
1752  std::byte* buf = nullptr;
1753  MPI_Request req = MPI_REQUEST_NULL;
1754  bool posted = false;
1755  };
1756 
1757  void setup(ActiveMessenger* self);
1758  bool progress(ActiveMessenger* self);
1759 
1760  static constexpr int num_caps_ = 4;
1761  static constexpr int caps_[num_caps_] = {512, 2048, 8192, 32768};
1762  private:
1763  std::vector<Slot> slots_;
1764  static constexpr MPI_TagType tags_[num_caps_] = {
1765  static_cast<MPI_TagType>(MPITag::ActiveMsgS),
1766  static_cast<MPI_TagType>(MPITag::ActiveMsgM),
1767  static_cast<MPI_TagType>(MPITag::ActiveMsgL),
1768  static_cast<MPI_TagType>(MPITag::ActiveMsgXL)
1769  };
1770  static constexpr int slots_per_class_ = 4;
1771 
1772  void postSlot(ActiveMessenger* self, Slot& s);
1773  public:
1774  // Cleanup outstanding posted receives and buffers to avoid leaks at shutdown
1775  void cleanup();
1776  };
1777 
1778 public:
1784  auto getRankLBData() {
1785  return std::make_tuple(
1788  );
1789  }
1790 
1791 private:
1792 # if vt_check_enabled(trace_enabled)
1793  trace::UserEventIDType trace_irecv = trace::no_user_event_id;
1794  trace::UserEventIDType trace_isend = trace::no_user_event_id;
1795  trace::UserEventIDType trace_irecv_polling_am = trace::no_user_event_id;
1796  trace::UserEventIDType trace_irecv_polling_dm = trace::no_user_event_id;
1797  trace::UserEventIDType trace_asyncop = trace::no_user_event_id;
1798 # endif
1799 
1801  TagType cur_direct_buffer_tag_ = starting_direct_buffer_tag;
1805  NodeType this_node_ = uninitialized_destination;
1806 
1807 private:
1808  // Diagnostic counter gauge combos for sent counts/bytes
1811 
1812  // Diagnostic counters for recv counts/bytes
1815 
1816  // Diagnostic counters for posted irecv counts/bytes
1819 
1820  // Diagnostic counters for counting various actions
1827 
1828  // Diagnostic counters for counting forwarded messages
1830 
1831 private:
1834  MPI_Comm comm_ = MPI_COMM_NULL;
1835 
1836  // Active receive broker instance
1838 };
1839 
1840 }} // end namespace vt::messaging
1841 
1842 namespace vt {
1843 
1845 
1847 
1848 } // end namespace vt
1849 
1850 #include "vt/messaging/active.impl.h"
1851 
1852 #endif /*INCLUDED_VT_MESSAGING_ACTIVE_H*/
vt::messaging::ActiveMsg
The base class for all messages. Common alias is vt::Message which uses the default envelope.
Definition: message.h:79
vt::messaging::ActiveMessenger::active_broker_
ActiveRecvBroker active_broker_
Definition: active.h:1837
vt::messaging::PendingRecv::serialize
void serialize(Serializer &s)
Definition: active.h:144
vt::messaging::MsgPtrThief
Helper to unify 'stealing' message ownership.
Definition: smart_ptr.h:313
send_info.h
vt::messaging::InProgressBase::valid
bool valid
Definition: active.h:178
vt::messaging::InProgressBase::InProgressBase
InProgressBase(std::byte *in_buf, MsgSizeType in_probe_bytes, NodeType in_sender)
Definition: active.h:161
vt::messaging::InProgressDataIRecv::dealloc_user_buf
ActionType dealloc_user_buf
Definition: active.h:254
vt::messaging::ActiveMessenger::in_progress_ops
RequestHolder< AsyncOpWrapper > in_progress_ops
Definition: active.h:1804
vt::messaging::ActiveMessenger::ActiveMessenger
ActiveMessenger()
Definition: active.cc:64
vt::messaging::ActiveMessenger::ActiveRecvBroker::Slot::cap
int cap
Definition: active.h:1750
vt::HandlerManager
Definition: handler.h:96
vt::messaging::ActiveMessenger::broadcastMsg
PendingSendType broadcastMsg(MsgPtrThief< MsgT > msg, bool deliver_to_sender=true, TagType tag=no_tag)
Broadcast a message.
Definition: active.impl.h:250
vt::util::strong::detail::Strong
Used to hoist weak C++ types (like vt::VirtualProxyType ) into strongly typed values that have a uniq...
Definition: strong_type.h:60
vt::messaging::ActiveMessenger::ActiveRecvBroker::progress
bool progress(ActiveMessenger *self)
Definition: active.cc:1377
vt::messaging::ActiveMessenger::recvDataMsgPriority
bool recvDataMsgPriority(int nchunks, PriorityType priority, TagType const &tag, NodeType const &node, ContinuationDeleterType next=nullptr)
Receive data as bytes from a node with a priority.
Definition: active.cc:647
vt::messaging::ActiveMessenger::in_progress_data_irecv
RequestHolder< InProgressDataIRecv > in_progress_data_irecv
Definition: active.h:1803
vt::util::strong::detail::Strong::get
T & get()
Get reference.
Definition: strong_type.h:153
vt::messaging::InProgressDataIRecv::user_buf
std::byte * user_buf
Definition: active.h:253
vt::messaging::ActiveMessenger::initialize
void initialize() override
Empty default overridden initialize method.
Definition: active.cc:149
vt::messaging::MPITag::ActiveMsgS
vt::config::epoch
Definition: debug_config.h:82
vt::messaging::ActiveMessenger::dmPollCount
diagnostic::Counter dmPollCount
Definition: active.h:1824
vt::messaging::ActiveMessenger::finishPendingDataMsgAsyncRecv
void finishPendingDataMsgAsyncRecv(InProgressDataIRecv *irecv)
Called when a VT-MPI message has been received.
Definition: active.cc:921
vt::messaging::InProgressIRecv::req
MPI_Request req
Definition: active.h:206
vt::messaging::ActiveMessenger::sendMsgSerializableImpl
ActiveMessenger::PendingSendType sendMsgSerializableImpl(NodeType dest, HandlerType han, MsgSharedPtr< MsgT > &msg, TagType tag)
Definition: active.impl.h:111
vt::messaging::ActiveMessenger::prepareActiveMsgToRun
void prepareActiveMsgToRun(MsgSharedPtr< BaseMsgType > const &base, NodeType const &from_node, bool insert, ActionType cont)
Prepare an active message to run by building a RunnableNew.
Definition: active.cc:1167
vt::messaging::ActiveMessenger::sendMsgAuto
PendingSendType sendMsgAuto(NodeType dest, HandlerType han, MsgPtrThief< MsgT > msg, TagType tag=no_tag)
Send a message with a pre-registered handler.
Definition: active.impl.h:222
vt::messaging::ActiveMessenger::MessageType
ShortMessage MessageType
Definition: active.h:329
vt::messaging::ActiveMessenger::bare_handler_lb_data_
elm::ElementLBData bare_handler_lb_data_
Definition: active.h:1833
vt::messaging::ActiveMessenger::UserSendFnType
std::function< void(SendFnType)> UserSendFnType
Definition: active.h:334
auto_registry_interface.h
vt::messaging::ActiveMessenger::ActiveRecvBroker::Slot
Definition: active.h:1749
vt::messaging::ActiveMessenger::amForwardCounterGauge
diagnostic::CounterGauge amForwardCounterGauge
Definition: active.h:1829
vt::messaging::PendingRecv::dealloc_user_buf
ActionType dealloc_user_buf
Definition: active.h:129
vt::messaging::ActiveMessenger::sendMsgSz
PendingSendType sendMsgSz(NodeType dest, HandlerType han, MsgPtrThief< MsgT > msg, ByteType msg_size, TagType tag=no_tag)
Send a message with a pre-registered handler.
Definition: active.impl.h:210
vt::messaging::MPI_TagType
int MPI_TagType
Definition: active.h:101
vt::messaging::ActiveMessenger::ActiveRecvBroker::slots_
std::vector< Slot > slots_
Definition: active.h:1763
vt::messaging::ActiveMessenger::amRecvCounterGauge
diagnostic::CounterGauge amRecvCounterGauge
Definition: active.h:1813
vt::messaging::ActiveMessenger::doMessageSend
EventType doMessageSend(MsgSharedPtr< BaseMsgType > &msg)
Low-level send of a message, handler and other control data should be set already.
Definition: active.cc:456
vt::config::handler
Definition: debug_config.h:66
vt::ActionType
std::function< void()> ActionType
Used for generically store an action to perform.
Definition: types_type.h:125
activefn.h
vt::trace::UserEventIDType
int64_t UserEventIDType
Definition: trace_common.h:65
vt::messaging::ActiveMessenger::registerAsyncOp
void registerAsyncOp(std::unique_ptr< AsyncOp > op)
Register a async operation that needs polling.
Definition: active.cc:1459
vt::messaging::PendingRecv::sender
NodeType sender
Definition: active.h:130
vt::messaging::ActiveMessenger::ActiveRecvBroker::tags_
static constexpr MPI_TagType tags_[num_caps_]
Definition: active.h:1764
vt::messaging::ActiveMessenger::ContainerPendingType
std::unordered_map< TagType, PendingRecvType > ContainerPendingType
Definition: active.h:335
vt::StrongNodeType
Definition: active.h:94
vt::messaging::BufferedActiveMsg::cont
ActionType cont
Definition: active.h:273
vt::messaging::ActiveMessenger::ReadyHanTagType
std::tuple< HandlerType, TagType > ReadyHanTagType
Definition: active.h:336
vt::messaging::ActiveMessenger::ActiveRecvBroker::Slot::posted
bool posted
Definition: active.h:1754
vt::messaging::RequestHolder
Holds a set of pending MPI Irecvs to poll for completion.
Definition: request_holder.h:69
vt::HandlerType
int64_t HandlerType
Used to hold a handler ID which identifier a function pointer/context.
Definition: types_type.h:63
vt::messaging::InProgressDataIRecv::priority
PriorityType priority
Definition: active.h:256
trace_headers.h
vt::messaging::PendingRecv::user_buf
std::byte * user_buf
Definition: active.h:127
vt::messaging::ActiveMessenger::bare_handler_dummy_elm_id_for_lb_data_
elm::ElementIDStruct bare_handler_dummy_elm_id_for_lb_data_
Definition: active.h:1832
vt::messaging::ActiveMessenger::chunkedMultiMsg
static void chunkedMultiMsg(MultiMsg *msg)
Handle a control message; immediately calls handleChunkedMultiMsg.
Definition: active.cc:316
vt::FuncTraits
Definition: fntraits.h:390
vt::messaging::ActiveMessenger::getEpoch
EpochType getEpoch() const
Returns the top of the epoch stack.
Definition: active.impl.h:468
vt::epoch::EpochType
Definition: epoch_type.h:54
vt::messaging::ActiveMessenger::ActiveRecvBroker::Slot::req
MPI_Request req
Definition: active.h:1753
vt::ByteType
uint64_t ByteType
Used to store some number of bytes.
Definition: types_type.h:83
vt::messaging::ActiveMessenger::recordLBDataCommForSend
void recordLBDataCommForSend(NodeType const dest, MsgSharedPtr< BaseMsgType > const &base, MsgSizeType const msg_size)
Record LB's data for sending a message.
Definition: active.cc:967
vt::messaging::ActiveMessenger::tryProcessDataMsgRecv
bool tryProcessDataMsgRecv()
Poll MPI for raw data messages.
Definition: active.cc:661
vt::messaging::ActiveMessenger::tdRecvCount
diagnostic::Counter tdRecvCount
Definition: active.h:1826
vt::NodeType
PhysicalResourceType NodeType
Used to hold the current node/rank or the number of nodes.
Definition: types_type.h:57
pending_send.h
vt::messaging::ActiveMessenger::in_progress_active_msg_irecv
RequestHolder< InProgressIRecv > in_progress_active_msg_irecv
Definition: active.h:1802
vt::messaging::ActiveMessenger::markAsTermMessage
void markAsTermMessage(MsgPtrT const msg)
Mark a message as a termination message.
Definition: active.impl.h:63
vt::messaging::ActiveMessenger::markAsLocationMessage
void markAsLocationMessage(MsgPtrT const msg)
Mark a message as a location message.
vt::TagType
int32_t TagType
Used to hold an tag, e.g., on messages or reduces.
Definition: types_type.h:73
vt::messaging::PendingRecv::is_user_buf
bool is_user_buf
Definition: active.h:132
vt::messaging::BufferedActiveMsg::buffered_msg
MessageType buffered_msg
Definition: active.h:271
vt::messaging::ActiveMessenger::markAsCollectionMessage
void markAsCollectionMessage(MsgPtrT const msg)
Mark a message as a collection message.
vt::messaging::BufferedActiveMsg::serialize
void serialize(Serializer &s)
Definition: active.h:282
vt::messaging::MPITag::ActiveMsgM
vt::messaging::ActiveMessenger::send
PendingSendType send(Node dest, Params &&... params)
Send parameters to a handler in a message.
Definition: active.h:772
vt::event::AsyncEvent::EventRecordType
EventRecord EventRecordType
Definition: event.h:89
vt::messaging::ActiveMessenger::ActiveRecvBroker
Active receive broker that keeps a pool of pre-posted Irecv slots per size-class tag to drain unexpec...
Definition: active.h:1748
vt::messaging::InProgressDataIRecv::reqs
std::vector< MPI_Request > reqs
Definition: active.h:260
vt::messaging::InProgressDataIRecv::serialize
void serialize(Serializer &s)
Definition: active.h:244
vt::messaging::MPITag::ActiveMsgXL
vt::messaging::ActiveMessenger::broadcastMsgSz
PendingSendType broadcastMsgSz(MsgPtrThief< MsgT > msg, ByteType msg_size, bool deliver_to_sender=true, TagType tag=no_tag)
Broadcast a message with an explicit size.
vt::theMsg
messaging::ActiveMessenger * theMsg()
Definition: runtime_get.cc:103
vt::messaging::ActiveMessenger::dmPostedCounterGauge
diagnostic::CounterGauge dmPostedCounterGauge
Definition: active.h:1818
vt::messaging::ActiveMessenger::~ActiveMessenger
virtual ~ActiveMessenger()
Definition: active.cc:170
vt::messaging::PendingSend
A pending send (or other similar operation) that is delayed until this holder goes out of scope.
Definition: pending_send.h:70
component_pack.h
vt::messaging::ActiveMessenger::pushEpoch
void pushEpoch(EpochType const &epoch)
Push an epoch on the stack.
Definition: active.impl.h:460
vt::messaging::ActiveMessenger::recvDataMsgBuffer
bool recvDataMsgBuffer(int nchunks, std::byte *const user_buf, PriorityType priority, TagType const &tag, NodeType const &node=uninitialized_destination, bool const &enqueue=true, ActionType dealloc_user_buf=nullptr, ContinuationDeleterType next=nullptr, bool is_user_buf=false)
Receive data as bytes with a buffer and priority.
Definition: active.cc:700
vt::messaging::MsgSharedPtr< BaseMsgType >
vt::messaging::ActiveMessenger
Core component of VT used to send messages.
Definition: active.h:327
vt::messaging::ActiveMessenger::CountType
int32_t CountType
Definition: active.h:330
vt::messaging::InProgressDataIRecv::test
bool test(int &num_mpi_tests)
Definition: active.h:226
strong_type.h
vt::messaging::ActiveMessenger::ActiveRecvBroker::caps_
static constexpr int caps_[num_caps_]
Definition: active.h:1761
vt::messaging::ActiveMessenger::this_node_
NodeType this_node_
Definition: active.h:1805
vt::ShortMessage
messaging::ActiveMsg< Envelope > ShortMessage
Alias to the shortest message available with no epoch or tag allowed.
Definition: message.h:211
vt::messaging::ActiveMessenger::sendMsgBytesWithPut
EventType sendMsgBytesWithPut(NodeType const &dest, MsgSharedPtr< BaseMsgType > const &base)
Send message as low-level bytes that is already packed.
Definition: active.cc:225
vt::messaging::ActiveMessenger::getEpochContextMsg
EpochType getEpochContextMsg(MsgT *msg)
Get the epoch for a message based on the current context so an subsequent operation on it can be safe...
Definition: active.impl.h:473
vt::messaging::BufferedActiveMsg::from_node
NodeType from_node
Definition: active.h:272
vt::messaging::InProgressBase::serialize
void serialize(Serializer &s)
Definition: active.h:168
vt::messaging::ActiveMessenger::dmRecvCounterGauge
diagnostic::CounterGauge dmRecvCounterGauge
Definition: active.h:1814
vt::ContinuationDeleterType
std::function< void(PtrLenPairType data, ActionType deleter)> ContinuationDeleterType
A continuation function with an allocated pointer with a deleter function.
Definition: active.h:88
vt::messaging::ActiveMessenger::ActiveRecvBroker::postSlot
void postSlot(ActiveMessenger *self, Slot &s)
Definition: active.cc:1323
vt::messaging::ActiveMessenger::SendFnType
std::function< SendInfo(PtrLenPairType, NodeType, TagType)> SendFnType
Definition: active.h:333
vt::messaging::PendingRecv::PendingRecv
PendingRecv(int in_nchunks, std::byte *in_user_buf, ContinuationDeleterType in_cont, ActionType in_dealloc_user_buf, NodeType node, PriorityType in_priority, bool in_is_user_buf)
Definition: active.h:134
vt::TimeTypeWrapper
Definition: timing_type.h:58
vt::messaging::BufferedActiveMsg
Holds a buffered active message, used internally.
Definition: active.h:268
vt::messaging::ActiveMessenger::setupEpochMsg
EpochType setupEpochMsg(MsgT *msg)
Set the epoch on a message.
Definition: active.impl.h:506
vt::messaging::MPITag::ActiveMsgTag
vt::elm::ElementIDStruct
A general identifier for a task context. The id is unique in the system.
Definition: elm_id.h:67
vt::messaging::ActiveMessenger::PendingSendType
PendingSend PendingSendType
Definition: active.h:338
vt::messaging::ActiveMessenger::testPendingAsyncOps
bool testPendingAsyncOps()
Test pending general asynchronous events.
Definition: active.cc:1313
vt
Definition: activefn.h:51
vt::messaging::ActiveMessenger::sendMsgCopyableImpl
ActiveMessenger::PendingSendType sendMsgCopyableImpl(NodeType dest, HandlerType han, MsgSharedPtr< MsgT > &msg, TagType tag)
Definition: active.impl.h:147
vt::PriorityType
uint16_t PriorityType
Used for hold the priority of a message.
Definition: types_type.h:113
vt::messaging::ActiveMessenger::recvDataMsg
bool recvDataMsg(int nchunks, TagType const &tag, NodeType const &node, ContinuationDeleterType next=nullptr)
Receive data as bytes from a node.
Definition: active.cc:654
vt::messaging::ActiveMessenger::amHandlerCount
diagnostic::Counter amHandlerCount
Definition: active.h:1821
vt::messaging::InProgressIRecv::test
bool test(int &num_mpi_tests)
Definition: active.h:195
async_op_wrapper.h
vt::messaging::ActiveMessenger::tdSentCount
diagnostic::Counter tdSentCount
Definition: active.h:1825
vt::messaging::ActiveMessenger::sendMsg
PendingSendType sendMsg(NodeType dest, MsgPtrThief< typename FuncTraits< decltype(f)>::MsgT > msg, TagType tag=no_tag)
Send a message (message type not required).
Definition: active.h:754
vt::messaging::ActiveMessenger::getRankLBData
auto getRankLBData()
Get the rank-based LB data along with element ID for rank-based work.
Definition: active.h:1784
vt::messaging::ActiveMessenger::blockOnAsyncOp
void blockOnAsyncOp(std::unique_ptr< AsyncOp > op)
Block the current task's execution on an pollable async operation until it completes.
Definition: active.cc:1463
vt::elm::ElementLBData
Definition: elm_lb_data.h:59
param_msg.h
vt::messaging::ActiveMessenger::cur_direct_buffer_tag_
TagType cur_direct_buffer_tag_
Definition: active.h:1801
vt::messaging::InProgressDataIRecv::InProgressDataIRecv
InProgressDataIRecv(std::byte *in_buf, MsgSizeType in_probe_bytes, NodeType in_sender, std::vector< MPI_Request > in_reqs, std::byte *const in_user_buf, ActionType in_dealloc_user_buf, ContinuationDeleterType in_next, PriorityType in_priority)
Definition: active.h:215
vt::messaging::MPITag::DataMsgTag
event.h
vt::util::FunctorExtractor::MessageType
MessageT MessageType
Definition: functor.h:77
vt::messaging::ActiveMessenger::ActiveRecvBroker::slots_per_class_
static constexpr int slots_per_class_
Definition: active.h:1770
vt::messaging::ActiveMessenger::amPollCount
diagnostic::Counter amPollCount
Definition: active.h:1823
vt::messaging::ActiveMessenger::startup
void startup() override
Empty default overridden startup method.
Definition: active.cc:153
vt::messaging::ActiveMessenger::amPostedCounterGauge
diagnostic::CounterGauge amPostedCounterGauge
Definition: active.h:1817
vt::messaging::ActiveMessenger::dmSentCounterGauge
diagnostic::CounterGauge dmSentCounterGauge
Definition: active.h:1810
vt::messaging::ActiveMessenger::setTagMessage
void setTagMessage(MsgT *msg, TagType tag)
Set the tag in the envelope of a message.
Definition: active.impl.h:106
vt::event::EventRecord
Definition: event_record.h:79
vt::messaging::PendingRecv
An pending receive event.
Definition: active.h:125
vt::messaging::ActiveMessenger::name
std::string name() override
Get the name of the component.
Definition: active.h:350
vt::messaging::SendInfo
Returned from a data send to be used to receive the data.
Definition: send_info.h:56
vt::MsgSizeType
int64_t MsgSizeType
Used for hold the size of a message.
Definition: types_type.h:101
vt::messaging::ActiveMessenger::packMsg
MsgSizeType packMsg(MessageType *msg, MsgSizeType size, std::byte *ptr, MsgSizeType ptr_bytes)
Pack a message, used by the system.
Definition: active.cc:194
vt::messaging::InProgressDataIRecv::next
ContinuationDeleterType next
Definition: active.h:255
vt::messaging::ActiveMessenger::sendMsgBytes
EventType sendMsgBytes(NodeType const &dest, MsgSharedPtr< BaseMsgType > const &base, MsgSizeType const &msg_size, TagType const &send_tag)
Send message as low-level bytes after packing put bytes if needed.
Definition: active.cc:413
vt::messaging::ActiveMessenger::allocateNewTag
MPI_TagType allocateNewTag()
Allocate a new, unused tag.
Definition: active.cc:532
vt::messaging::ActiveMessenger::ActiveRecvBroker::setup
void setup(ActiveMessenger *self)
Definition: active.cc:1356
elm_id.h
vt::messaging::ActiveMessenger::sendMsgImpl
ActiveMessenger::PendingSendType sendMsgImpl(NodeType dest, HandlerType han, MsgSharedPtr< MsgT > &msg, TagType tag)
Definition: active.h:436
vt::messaging::ActiveMessenger::ActiveRecvBroker::Slot::tag
MPI_TagType tag
Definition: active.h:1751
trace_common.h
vt::messaging::ActiveMessenger::popEpoch
EpochType popEpoch(EpochType const &epoch=no_epoch)
Pop an epoch off the stack.
Definition: active.impl.h:464
vt::messaging::ActiveMessenger::handleChunkedMultiMsg
void handleChunkedMultiMsg(MultiMsg *msg)
Handle a control message that coordinates multiple payloads arriving that constitute a contiguous pay...
Definition: active.cc:320
vt::runtime::component::meter::CounterGauge< CounterDefaultType, GaugeDefaultType >
vt::messaging::ActiveMessenger::broadcast
PendingSendType broadcast(Params &&... params)
Broadcast parameters to a handler in a message.
Definition: active.h:789
vt::messaging::ActiveMessenger::setEpochMessage
void setEpochMessage(MsgT *msg, EpochType epoch)
Set the epoch in the envelope of a message.
Definition: active.impl.h:101
vt::messaging::MPITag
MPITag
Definition: active.h:106
vt::messaging::ActiveMessenger::comm_
MPI_Comm comm_
Definition: active.h:1834
vt::messaging::PendingRecv::nchunks
int nchunks
Definition: active.h:126
VT_ALLOW_MPI_CALLS
#define VT_ALLOW_MPI_CALLS
Definition: mpi_access.h:52
elm_lb_data.h
active.fwd.h
vt::messaging::ActiveMessenger::tryProcessIncomingActiveMsg
bool tryProcessIncomingActiveMsg()
Poll MPI to discover an incoming message with a handler.
Definition: active.cc:1032
vt::messaging::ActiveMessenger::markAsSerialMsgMessage
void markAsSerialMsgMessage(MsgPtrT const msg)
Mark a message as a serialization control message.
vt::messaging::ActiveMessenger::sendDataMPI
std::tuple< EventType, int > sendDataMPI(PtrLenPairType const &ptr, NodeType const &dest, TagType const &tag)
Send raw bytes to a node with potentially multiple sends.
Definition: active.cc:581
vt::messaging::ActiveMessenger::ActiveRecvBroker::Slot::buf
std::byte * buf
Definition: active.h:1752
vt::messaging::ActiveMessenger::sendMsg
PendingSendType sendMsg(NodeType dest, HandlerType han, MsgPtrThief< MsgT > msg, TagType tag=no_tag)
Send a message with a pre-registered handler.
Definition: active.impl.h:199
fntraits.h
vt::messaging::ActiveMessenger::sendMsgMPI
EventType sendMsgMPI(NodeType const &dest, MsgSharedPtr< BaseMsgType > const &base, MsgSizeType const &msg_size, TagType const &send_tag)
Send already-packed message bytes with MPI using multiple sends if necessary.
Definition: active.cc:342
vt::runtime::component::PollableComponent
Component class for a generic, pollable VT runtime module, CRTP'ed over the component's actual type....
Definition: component.h:161
vt::messaging::ActiveMessenger::recvDataDirect
void recvDataDirect(int nchunks, std::byte *const buf, TagType const tag, NodeType const from, MsgSizeType len, PriorityType prio, ActionType dealloc=nullptr, ContinuationDeleterType next=nullptr, bool is_user_buf=false)
Receive data from MPI in multiple chunks.
Definition: active.cc:810
active.impl.h
vt::messaging::InProgressBase::probe_bytes
MsgSizeType probe_bytes
Definition: active.h:176
vt::messaging::ActiveMessenger::pending_recvs_
ContainerPendingType pending_recvs_
Definition: active.h:1800
smart_ptr.h
vt::messaging::ActiveMessenger::serialize
void serialize(SerializerT &s)
Definition: active.h:1634
vt::messaging::ActiveMessenger::sendData
SendInfo sendData(PtrLenPairType const &ptr, NodeType const &dest, TagType const &tag)
Send raw bytes to a node.
Definition: active.cc:543
vt::messaging::InProgressBase
Base class for an in-progress MPI operation.
Definition: active.h:160
vt::messaging::InProgressBase::buf
std::byte * buf
Definition: active.h:175
config.h
vt::messaging::ActiveMessenger::finishPendingActiveMsgAsyncRecv
void finishPendingActiveMsgAsyncRecv(InProgressIRecv *irecv)
Called when a VT-MPI message has been received.
Definition: active.cc:1221
vt::messaging::ActiveMessenger::progress
int progress(TimeType current_time) override
Call into the progress engine.
Definition: active.cc:1446
vt::PtrLenPairType
std::tuple< std::byte *, ByteType > PtrLenPairType
A pair of a std::byte* and number of bytes (length) for sending data.
Definition: active.h:84
vt::messaging::ActiveMessenger::makeTraceCreationSend
trace::TraceEventIDType makeTraceCreationSend(HandlerType const handler, ByteType serialized_msg_size, bool is_bcast)
Definition: active.cc:175
vt::messaging::ActiveMessenger::bcastsSentCount
diagnostic::Counter bcastsSentCount
Definition: active.h:1822
vt::messaging::ActiveMessenger::testPendingDataMsgAsyncRecv
bool testPendingDataMsgAsyncRecv()
Test pending MPI request for data message receives.
Definition: active.cc:1301
vt::messaging::MultiMsg
Definition: active.cc:299
vt::messaging::InProgressDataIRecv::cur
std::size_t cur
Definition: active.h:259
vt::messaging::MPITag::ActiveMsgL
vt::messaging::ActiveMessenger::ActiveRecvBroker::cleanup
void cleanup()
Definition: active.cc:1426
vt::messaging::ActiveMessenger::amSentCounterGauge
diagnostic::CounterGauge amSentCounterGauge
Definition: active.h:1809
request_holder.h
vt::trace::TraceEventIDType
uint32_t TraceEventIDType
Definition: trace_common.h:62
vt::messaging::ActiveMessenger::broadcastMsg
PendingSendType broadcastMsg(MsgPtrThief< typename FuncTraits< decltype(f)>::MsgT > msg, bool deliver_to_sender=true, TagType tag=no_tag)
Broadcast a message (message type not required).
Definition: active.h:715
vt::config::node
Definition: debug_config.h:88
vt::messaging::InProgressIRecv::InProgressIRecv
InProgressIRecv(std::byte *in_buf, MsgSizeType in_probe_bytes, NodeType in_sender, MPI_Request in_req=MPI_REQUEST_NULL)
Definition: active.h:188
vt::messaging::ActiveMessenger::processActiveMsg
void processActiveMsg(MsgSharedPtr< BaseMsgType > const &base, NodeType const &sender, bool insert, ActionType cont=nullptr)
Process an incoming active message.
Definition: active.cc:998
vt::runtime::component::meter::Counter< CounterDefaultType >
vt::messaging::ActiveMessenger::ActiveRecvBroker::num_caps_
static constexpr int num_caps_
Definition: active.h:1760
functor.h
vt::messaging::PendingRecv::priority
PriorityType priority
Definition: active.h:131
vt::messaging::InProgressIRecv
An in-progress MPI_Irecv watched by the runtime.
Definition: active.h:186
vt::config::function
Definition: debug_config.h:99
vt::messaging::ActiveMessenger::broadcastMsgAuto
PendingSendType broadcastMsgAuto(MsgPtrThief< MsgT > msg, TagType tag=no_tag)
Broadcast a message.
Definition: active.impl.h:300
vt::messaging::ActiveMessenger::selectActiveTag
static MPI_TagType selectActiveTag(MsgSizeType size)
Select an active message tag based on the size of the message.
Definition: active.cc:217
vt::messaging::ActiveMessenger::testPendingActiveMsgAsyncRecv
bool testPendingActiveMsgAsyncRecv()
Test pending MPI request for active message receives.
Definition: active.cc:1289
vt::messaging::BufferedActiveMsg::BufferedActiveMsg
BufferedActiveMsg(MessageType const &in_buffered_msg, NodeType const &in_from_node, ActionType in_cont)
Definition: active.h:275
vt::messaging::ParamMsg
Definition: param_msg.h:150
vt::EventType
uint64_t EventType
Used to hold a local/remote event to wait for completion.
Definition: types_type.h:69
vt::messaging::InProgressBase::sender
NodeType sender
Definition: active.h:177
vt::messaging::PendingRecv::cont
ContinuationDeleterType cont
Definition: active.h:128
vt::messaging::InProgressDataIRecv
An in-progress pure data MPI_Irecv watched by the runtime.
Definition: active.h:214