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" 29 #define INTERACTIVEPRIOIRTY 0 30 #define THREADSYNCPRIORITY 20 31 #define SYNCPRIORITY 25 32 #define STOPACTIONPRIORITY 30 33 #define CLOCKPRIORITY 40 34 #define EVENTPRIORITY 50 35 #define MEMEVENTPRIORITY 50 36 #define BARRIERPRIORITY 75 37 #define ONESHOTPRIORITY 80 38 #define STATISTICCLOCKPRIORITY 85 39 #define FINALEVENTPRIORITY 98 40 #define EXITPRIORITY 99 42 extern int main(
int argc,
char** argv);
64 template <
bool T,
bool P,
bool Q>
70 if ( T && lhs->delivery_time != rhs->delivery_time )
return lhs->delivery_time < rhs->delivery_time;
71 if ( P && lhs->priority_order != rhs->priority_order )
return lhs->priority_order < rhs->priority_order;
72 return Q && lhs->queue_order < rhs->queue_order;
107 template <
bool T,
bool P,
bool Q>
113 if ( T && lhs->delivery_time != rhs->delivery_time )
return lhs->delivery_time > rhs->delivery_time;
114 if ( P && lhs->priority_order != rhs->priority_order )
return lhs->priority_order > rhs->priority_order;
115 return Q && lhs->queue_order > rhs->queue_order;
153 inline int getPriority()
const {
return (
int)(priority_order >> 32); }
156 inline void setOrderTag(uint32_t tag) { priority_order = (priority_order & 0xFFFFFFFF00000000ul) | (uint64_t)tag; }
159 inline uint32_t
getOrderTag()
const {
return (uint32_t)(priority_order & 0xFFFFFFFFul); }
164 virtual bool isEvent()
const = 0;
165 virtual bool isAction()
const = 0;
178 std::stringstream buf;
184 #ifdef __SST_DEBUG_EVENT_TRACKING__ 185 virtual void printTrackingInfo(
const std::string& UNUSED(header),
Output& UNUSED(out))
const {}
191 virtual void copyAllDeliveryInfo(
const Activity* act)
193 delivery_time = act->delivery_time;
194 priority_order = act->priority_order;
195 queue_order = act->queue_order;
200 void setPriority(uint64_t priority) { priority_order = (priority_order & 0x00000000FFFFFFFFul) | (priority << 32); }
209 std::stringstream buf;
221 SST_SER(delivery_time);
222 SST_SER(priority_order);
223 SST_SER(queue_order);
230 SimTime_t delivery_time;
234 uint64_t priority_order;
238 uint64_t queue_order;
243 #endif // SST_CORE_ACTIVITY_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
int getPriority() const
Return the Priority of this Activity.
Definition: activity.h:153
void setDeliveryTime(SimTime_t time)
Set the time for which this Activity should be delivered.
Definition: activity.h:147
void setQueueOrder(uint64_t order)
Set a new Queue order.
Definition: activity.h:189
uint64_t getQueueOrder() const
Returns the queue order associated with this activity.
Definition: activity.h:162
Base class for all Activities in the SST Event Queue.
Definition: activity.h:47
void setOrderTag(uint32_t tag)
Sets the order tag.
Definition: activity.h:156
void setPriority(uint64_t priority)
Set the priority of the Activity.
Definition: activity.h:200
virtual void execute()=0
Function which will be called when the time for this Activity comes to pass.
SimTime_t getDeliveryTime() const
Return the time at which this Activity will be delivered.
Definition: activity.h:150
std::string toString() const override
Get a string represenation of the event.
Definition: activity.h:176
Class to use as the greater than operator for STL functions or sorting algorithms (used if you want t...
Definition: activity.h:108
Class to use as the less than operator for STL functions or sorting algorithms.
Definition: activity.h:65
std::string getDeliveryTimeInfo() const
Gets the delivery time info as a string.
Definition: activity.h:207
uint32_t getOrderTag() const
Return the order tag associated with this activity.
Definition: activity.h:159