12 #ifndef SST_CORE_ACTIVITY_H 13 #define SST_CORE_ACTIVITY_H 15 #include "sst/core/mempool.h" 16 #include "sst/core/output.h" 17 #include "sst/core/serialization/serializable.h" 18 #include "sst/core/sst_types.h" 19 #include "sst/core/warnmacros.h" 25 #include <unordered_map> 28 #define INTERACTIVEPRIOIRTY 0 29 #define THREADSYNCPRIORITY 20 30 #define SYNCPRIORITY 25 31 #define STOPACTIONPRIORITY 30 32 #define CLOCKPRIORITY 40 33 #define EVENTPRIORITY 50 34 #define MEMEVENTPRIORITY 50 35 #define BARRIERPRIORITY 75 36 #define ONESHOTPRIORITY 80 37 #define STATISTICCLOCKPRIORITY 85 38 #define FINALEVENTPRIORITY 98 39 #define EXITPRIORITY 99 41 extern int main(
int argc,
char** argv);
49 Activity() : delivery_time(0), priority_order(0), queue_order(0) {}
59 template <
bool T,
bool P,
bool Q>
65 if ( T && lhs->delivery_time != rhs->delivery_time )
return lhs->delivery_time < rhs->delivery_time;
66 if ( P && lhs->priority_order != rhs->priority_order )
return lhs->priority_order < rhs->priority_order;
67 return Q && lhs->queue_order < rhs->queue_order;
102 template <
bool T,
bool P,
bool Q>
108 if ( T && lhs->delivery_time != rhs->delivery_time )
return lhs->delivery_time > rhs->delivery_time;
109 if ( P && lhs->priority_order != rhs->priority_order )
return lhs->priority_order > rhs->priority_order;
110 return Q && lhs->queue_order > rhs->queue_order;
139 virtual void execute(
void) = 0;
148 inline int getPriority()
const {
return (
int)(priority_order >> 32); }
151 inline void setOrderTag(uint32_t tag) { priority_order = (priority_order & 0xFFFFFFFF00000000ul) | (uint64_t)tag; }
154 inline uint32_t
getOrderTag()
const {
return (uint32_t)(priority_order & 0xFFFFFFFFul); }
159 virtual bool isEvent() {
return false; }
160 virtual bool isAction() {
return false; }
173 std::stringstream buf;
179 #ifdef __SST_DEBUG_EVENT_TRACKING__ 180 virtual void printTrackingInfo(
const std::string& UNUSED(header),
Output& UNUSED(out))
const {}
185 void setPriority(uint64_t priority) { priority_order = (priority_order & 0x00000000FFFFFFFFul) | (priority << 32); }
194 std::stringstream buf;
213 void setQueueOrder(uint64_t order)
220 SimTime_t delivery_time;
223 uint64_t priority_order;
226 uint64_t queue_order;
231 #endif // SST_CORE_ACTIVITY_H Output object provides consistent method for outputting data to stdout, stderr and/or sst debug file...
Definition: output.h:53
This class is basically a wrapper for objects to declare the order in which their members should be s...
Definition: serializer.h:43
int getPriority() const
Return the Priority of this Activity.
Definition: activity.h:148
void setDeliveryTime(SimTime_t time)
Set the time for which this Activity should be delivered.
Definition: activity.h:142
uint64_t getQueueOrder() const
Returns the queue order associated with this activity.
Definition: activity.h:157
Base class for all Activities in the SST Event Queue.
Definition: activity.h:46
void setOrderTag(uint32_t tag)
Sets the order tag.
Definition: activity.h:151
virtual void execute(void)=0
Function which will be called when the time for this Activity comes to pass.
void setPriority(uint64_t priority)
Set the priority of the Activity.
Definition: activity.h:185
SimTime_t getDeliveryTime() const
Return the time at which this Activity will be delivered.
Definition: activity.h:145
ImplementVirtualSerializable(SST::Activity) void setQueueOrder(uint64_t order)
Set a new Queue order.
Definition: activity.h:209
std::string toString() const override
Get a string represenation of the event.
Definition: activity.h:171
Class to use as the greater than operator for STL functions or sorting algorithms (used if you want t...
Definition: activity.h:103
Class to use as the less than operator for STL functions or sorting algorithms.
Definition: activity.h:60
std::string getDeliveryTimeInfo() const
Gets the delivery time info as a string.
Definition: activity.h:192
uint32_t getOrderTag() const
Return the order tag associated with this activity.
Definition: activity.h:154