SST/macro
recv_cq.h
Go to the documentation of this file.
1 #ifndef NIC_RECV_CQ_H
2 #define NIC_RECV_CQ_H
3 
4 #include <sprockit/unordered.h>
6 
7 namespace sstmac {
8 namespace hw {
9 /**
10 A Receive Completion Queue.
11 Based on packets coming in, it determines when a message has completely arrived.
12 A large message, in some models, is broken up into many #message_chunk
13 objects. When using minimal, in-order routing, tracking message completion is easier
14 because a packet can be marked as the "tail" and used to track when an entire message has arrived.
15 When using adaptive or multipath routing, messages arrive out-of-order.
16 This class tracks whether all packets have been received and signals to some handler
17 that an entire message has fully arrived.
18 @class nic_recv_cq
19 */
20 class recv_cq
21 {
22 
23  public:
24  /**
25  Log packet and determine if parent message has fully arrived
26  @param packet The arriving packet
27  @return The completed msg or a null msg indicating not yet complete
28  */
29  message*
30  recv(packet* pkt);
31 
32  message*
33  recv(uint64_t unique_id, int bytes, message* payload);
34 
35  void
36  print();
37 
38  protected:
39  struct incoming_msg {
44  bytes_arrived(0),
45  bytes_total(0),
46  msg(0)
47  {
48  }
49  };
50 
51  /**
52  Keys are unique network ID for all messages.
53  Value is the number of bytes receved.
54  */
55  typedef spkt_unordered_map<uint64_t, incoming_msg> received_map;
56  received_map bytes_recved_;
57 };
58 
59 }
60 }
61 
62 
63 #endif // NIC_RECV_CQ_H
64 
A class describing an event.
Definition: sst_message.h:42
spkt_unordered_map< uint64_t, incoming_msg > received_map
Keys are unique network ID for all messages.
Definition: recv_cq.h:55
received_map bytes_recved_
Definition: recv_cq.h:56
SUMI = Simulator unified messagine interface It is also the name for a solid ink in Japanese - i...
message * recv(packet *pkt)
Log packet and determine if parent message has fully arrived.