12 #ifndef SST_CORE_EVENT_H 13 #define SST_CORE_EVENT_H 15 #include "sst/core/activity.h" 16 #include "sst/core/sst_types.h" 17 #include "sst/core/ssthandler.h" 33 class DeliveryInfoCompEvent;
68 template <
typename classT,
typename dataT =
void>
70 [[deprecated(
"Handler has been deprecated. Please use Handler2 instead as it supports checkpointing.")]] =
77 template <
typename classT, auto funcT,
typename dataT =
void>
94 bool operator()(
const Event* lhs,
const Event* rhs)
const 96 if ( lhs->delivery_info != rhs->delivery_info )
return lhs->delivery_info < rhs->delivery_info;
112 #if __SST_DEBUG_EVENT_TRACKING__ 117 ~
Event()
override =
default;
123 #ifdef __SST_DEBUG_EVENT_TRACKING__ 125 virtual void printTrackingInfo(
const std::string& header,
Output& out)
const override 127 out.
output(
"%s Event first sent from: %s:%s (type: %s) and last received by %s:%s (type: %s)\n", header.c_str(),
128 first_comp.c_str(), first_port.c_str(), first_type.c_str(), last_comp.c_str(), last_port.c_str(),
132 const std::string& getFirstComponentName() {
return first_comp; }
133 const std::string& getFirstComponentType() {
return first_type; }
134 const std::string& getFirstPort() {
return first_port; }
135 const std::string& getLastComponentName() {
return last_comp; }
136 const std::string& getLastComponentType() {
return last_type; }
137 const std::string& getLastPort() {
return last_port; }
139 void addSendComponent(
const std::string& comp,
const std::string& type,
const std::string& port)
141 if ( first_comp ==
"" ) {
147 void addRecvComponent(
const std::string& comp,
const std::string& type,
const std::string& port)
156 bool isEvent() const override final {
return true; }
157 bool isAction() const override final {
return false; }
159 void copyAllDeliveryInfo(
const Activity* act)
override final 161 Activity::copyAllDeliveryInfo(act);
162 const Event* ev =
static_cast<const Event*
>(act);
163 delivery_info = ev->delivery_info;
169 Activity::serialize_order(ser);
170 SST_SER(delivery_info);
171 #ifdef __SST_DEBUG_EVENT_TRACKING__ 190 friend class NullEvent;
191 friend class RankSync;
192 friend class ThreadSync;
193 friend class TimeVortex;
194 friend class Simulation_impl;
198 void execute()
override;
213 inline void setDeliveryInfo(LinkId_t tag, uintptr_t delivery_info)
216 this->delivery_info = delivery_info;
225 void updateDeliveryInfo(uintptr_t dinfo) { delivery_info = dinfo; }
229 inline Link* getDeliveryLink() {
return reinterpret_cast<Link*
>(delivery_info); }
232 inline LinkId_t getTag()
const {
return getOrderTag(); }
243 uintptr_t delivery_info;
246 static std::atomic<uint64_t> id_counter;
248 #ifdef __SST_DEBUG_EVENT_TRACKING__ 249 std::string first_comp;
250 std::string first_type;
251 std::string first_port;
252 std::string last_comp;
253 std::string last_type;
254 std::string last_port;
278 const ComponentId_t comp_id;
279 const std::string comp_name;
280 const std::string comp_type;
281 const std::string port_name;
284 ComponentId_t
id,
const std::string& cname,
const std::string& ctype,
const std::string& pname) :
303 static uintptr_t getDeliveryInfo(
Event* ev) {
return ev->delivery_info; }
312 #endif // SST_CORE_EVENT_H Output object provides consistent method for outputting data to stdout, stderr and/or sst debug file...
Definition: output.h:57
This class is basically a wrapper for objects to declare the order in which their members should be s...
Definition: serializer.h:42
Base template for handlers which take a class defined argument.
Definition: ssthandler.h:109
Base class for all Activities in the SST Event Queue.
Definition: activity.h:47
id_type generateUniqueId()
Generates an ID that is unique across ranks, components and events.
Definition: event.cc:43
Base template for the class.
Definition: ssthandler.h:1273
Handler class with user-data argument.
Definition: ssthandler.h:1136
void setOrderTag(uint32_t tag)
Sets the order tag.
Definition: activity.h:156
Class used with std::lower_bound to find the start of events in a sorted list with the specified deli...
Definition: event.h:300
void setPriority(uint64_t priority)
Set the priority of the Activity.
Definition: activity.h:200
std::pair< uint64_t, int > id_type
Type definition of unique identifiers.
Definition: event.h:103
void output(uint32_t line, const char *file, const char *func, const char *format,...) const
Output the message with formatting as specified by the format parameter.
Definition: output.h:189
static const id_type NO_ID
Constant, default value for id_types.
Definition: event.h:105
Empty Event.
Definition: event.h:263
Class used to sort events during checkpointing.
Definition: event.h:91
virtual Event * clone()
Clones the event in for the case of a broadcast.
Definition: event.cc:34
Class to use as the less than operator for STL functions or sorting algorithms.
Definition: activity.h:65
Base class for Events - Items sent across links to communicate between components.
Definition: event.h:40
uint32_t getOrderTag() const
Return the order tag associated with this activity.
Definition: activity.h:159