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"
27#define INTERACTIVEPRIOIRTY 0
28#define THREADSYNCPRIORITY 20
29#define SYNCPRIORITY 25
30#define STOPACTIONPRIORITY 30
31#define CLOCKPRIORITY 40
32#define EVENTPRIORITY 50
33#define MEMEVENTPRIORITY 50
34#define BARRIERPRIORITY 75
35#define ONESHOTPRIORITY 80
36#define STATISTICCLOCKPRIORITY 85
37#define FINALEVENTPRIORITY 98
38#define EXITPRIORITY 99
40extern int main(
int argc,
char** argv);
53 virtual ~Activity() {}
62 template <
bool T,
bool P,
bool Q>
66 inline bool operator()(
const Activity* lhs,
const Activity* rhs)
const
68 if ( T && lhs->delivery_time != rhs->delivery_time )
return lhs->delivery_time < rhs->delivery_time;
69 if ( P && lhs->priority_order != rhs->priority_order )
return lhs->priority_order < rhs->priority_order;
70 return Q && lhs->queue_order < rhs->queue_order;
105 template <
bool T,
bool P,
bool Q>
109 inline bool operator()(
const Activity* lhs,
const Activity* rhs)
const
111 if ( T && lhs->delivery_time != rhs->delivery_time )
return lhs->delivery_time > rhs->delivery_time;
112 if ( P && lhs->priority_order != rhs->priority_order )
return lhs->priority_order > rhs->priority_order;
113 return Q && lhs->queue_order > rhs->queue_order;
151 inline int getPriority()
const {
return (
int)(priority_order >> 32); }
154 inline void setOrderTag(uint32_t tag) { priority_order = (priority_order & 0xFFFFFFFF00000000ul) | (uint64_t)tag; }
157 inline uint32_t
getOrderTag()
const {
return (uint32_t)(priority_order & 0xFFFFFFFFul); }
162 virtual bool isEvent() {
return false; }
163 virtual bool isAction() {
return false; }
176 std::stringstream buf;
182#ifdef __SST_DEBUG_EVENT_TRACKING__
183 virtual void printTrackingInfo(
const std::string& UNUSED(header),
Output& UNUSED(out))
const {}
189 virtual void copyAllDeliveryInfo(
const Activity* act)
191 delivery_time = act->delivery_time;
192 priority_order = act->priority_order;
193 queue_order = act->queue_order;
198 void setPriority(uint64_t priority) { priority_order = (priority_order & 0x00000000FFFFFFFFul) | (priority << 32); }
207 std::stringstream buf;
219 SST_SER(delivery_time);
220 SST_SER(priority_order);
221 SST_SER(queue_order);
228 SimTime_t delivery_time;
232 uint64_t priority_order;
236 uint64_t queue_order;
Class to use as the greater than operator for STL functions or sorting algorithms (used if you want t...
Definition activity.h:107
Class to use as the less than operator for STL functions or sorting algorithms.
Definition activity.h:64
Base class for all Activities in the SST Event Queue.
Definition activity.h:46
std::string toString() const override
Get a string represenation of the event.
Definition activity.h:174
void setQueueOrder(uint64_t order)
Set a new Queue order.
Definition activity.h:187
void setPriority(uint64_t priority)
Set the priority of the Activity.
Definition activity.h:198
SimTime_t getDeliveryTime() const
Return the time at which this Activity will be delivered.
Definition activity.h:148
void setDeliveryTime(SimTime_t time)
Set the time for which this Activity should be delivered.
Definition activity.h:145
uint64_t getQueueOrder() const
Returns the queue order associated with this activity.
Definition activity.h:160
void setOrderTag(uint32_t tag)
Sets the order tag.
Definition activity.h:154
virtual void execute()=0
Function which will be called when the time for this Activity comes to pass.
uint32_t getOrderTag() const
Return the order tag associated with this activity.
Definition activity.h:157
std::string getDeliveryTimeInfo() const
Gets the delivery time info as a string.
Definition activity.h:205
int getPriority() const
Return the Priority of this Activity.
Definition activity.h:151
This class is basically a wrapper for objects to declare the order in which their members should be s...
Definition serializer.h:45
Output object provides consistent method for outputting data to stdout, stderr and/or sst debug file.
Definition output.h:54