12 #ifndef SST_CORE_CORE_EVENT_H
13 #define SST_CORE_CORE_EVENT_H
15 #include "sst/core/sst_types.h"
21 #include "sst/core/activity.h"
42 #if __SST_DEBUG_EVENT_TRACKING__
56 #if !SST_BUILDING_CORE
57 inline void setDeliveryLink(LinkId_t
id,
Link *link) __attribute__ ((deprecated(
"this function was not intended to be used outside of SST Core and will be removed in SST 12."))) {
61 #ifdef SST_ENFORCE_EVENT_ORDERING
62 enforce_link_order = id;
70 #if !SST_BUILDING_CORE
71 inline Link*
getDeliveryLink() __attribute__ ((deprecated("this function was not intended to be used outside of SST Core and will be removed in SST 12."))) {
79 #if !SST_BUILDING_CORE
80 inline void setRemoteEvent() __attribute__ ((deprecated("this function was not intended to be used outside of SST Core and will be removed in SST 12."))) {
88 #if !SST_BUILDING_CORE
89 inline LinkId_t
getLinkId(
void) const __attribute__ ((deprecated("this function was not intended to be used outside of SST Core and will be removed in SST 12."))) {
93 #ifdef SST_ENFORCE_EVENT_ORDERING
94 return enforce_link_order;
113 template <
typename classT,
typename argT =
void>
116 typedef void (classT::*PtrMember)(
Event*, argT);
118 const PtrMember member;
127 Handler( classT*
const object, PtrMember member, argT data ) :
134 (
object->*member)(event,data);
142 template <
typename classT>
145 typedef void (classT::*PtrMember)(
Event*);
146 const PtrMember member;
154 Handler( classT*
const object, PtrMember member ) :
160 (
object->*member)(event);
165 virtual void print(
const std::string& header,
Output &out)
const override {
166 out.
output(
"%s Generic Event to be delivered at %" PRIu64
" with priority %d\n",
170 #ifdef __SST_DEBUG_EVENT_TRACKING__
172 virtual void printTrackingInfo(
const std::string& header,
Output &out)
const {
173 out.
output(
"%s Event first sent from: %s:%s (type: %s) and last received by %s:%s (type: %s)\n", header.c_str(),
174 first_comp.c_str(),first_port.c_str(),first_type.c_str(),
175 last_comp.c_str(),last_port.c_str(),last_type.c_str());
178 const std::string& getFirstComponentName() {
return first_comp; }
179 const std::string& getFirstComponentType() {
return first_type; }
180 const std::string& getFirstPort() {
return first_port; }
181 const std::string& getLastComponentName() {
return last_comp; }
182 const std::string& getLastComponentType() {
return last_type; }
183 const std::string& getLastPort() {
return last_port; }
185 void addSendComponent(
const std::string& comp,
const std::string& type,
const std::string& port) {
186 if ( first_comp ==
"" ) {
192 void addRecvComponent(
const std::string& comp,
const std::string& type,
const std::string& port) {
201 Activity::serialize_order(ser);
202 #ifndef SST_ENFORCE_EVENT_ORDERING
205 #ifdef __SST_DEBUG_EVENT_TRACKING__
226 static std::atomic<uint64_t> id_counter;
229 #ifndef SST_ENFORCE_EVENT_ORDERING
233 #ifdef __SST_DEBUG_EVENT_TRACKING__
234 std::string first_comp;
235 std::string first_type;
236 std::string first_port;
237 std::string last_comp;
238 std::string last_type;
239 std::string last_port;
255 virtual void print(
const std::string& header,
Output &out)
const override {
256 out.
output(
"%s NullEvent to be delivered at %" PRIu64
" with priority %d\n",
268 #endif // SST_CORE_EVENT_H
Output object provides consistent method for outputting data to stdout, stderr and/or sst debug file...
Definition: output.h:54
This class is basically a wrapper for objects to declare the order in which their members should be s...
Definition: serializer.h:35
void operator()(Event *event)
Handler function.
Definition: event.h:159
LinkId_t getLinkId(void) const
Gets the link id associated with this event.
Definition: event.h:89
Base class for all Activities in the SST Event Queue.
Definition: activity.h:52
Handler(classT *const object, PtrMember member)
Constructor.
Definition: event.h:154
void operator()(Event *event)
Handler function.
Definition: event.h:133
virtual void operator()(Event *)=0
Handler function.
Null Event.
Definition: event.h:248
Link * delivery_link
Link used for delivery.
Definition: event.h:218
void execute(void) override
Cause this event to fire.
Definition: event.cc:28
Link * getDeliveryLink()
Gets the link id used for delivery.
Definition: event.h:71
Event Handler class with user-data argument.
Definition: event.h:114
std::pair< uint64_t, int > id_type
Type definition of unique identifiers.
Definition: event.h:35
void setPriority(int priority)
Set the priority of the Activity.
Definition: activity.h:338
static const id_type NO_ID
Constant, default value for id_types.
Definition: event.h:37
SimTime_t getDeliveryTime() const
Return the time at which this Activity will be delivered.
Definition: activity.h:205
void setDeliveryLink(LinkId_t id, Link *link)
Sets the link id used for delivery.
Definition: event.h:57
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:186
virtual void print(const std::string &header, Output &out) const override
Virtual function to "pretty-print" this event.
Definition: event.h:255
int getPriority() const
Return the Priority of this Activity.
Definition: activity.h:210
void setRemoteEvent()
For use by SST Core only.
Definition: event.h:80
Functor classes for Event handling.
Definition: event.h:102
id_type generateUniqueId()
Generates an ID that is unique across ranks, components and events.
Definition: event.cc:40
virtual void print(const std::string &header, Output &out) const override
Virtual function to "pretty-print" this event.
Definition: event.h:165
Base class for Events - Items sent across links to communicate between components.
Definition: event.h:31
Handler(classT *const object, PtrMember member, argT data)
Constructor.
Definition: event.h:127
Link between two components.
Definition: link.h:32
virtual Event * clone()
Clones the event in for the case of a broadcast.
Definition: event.cc:33
Definition: serializable.h:132