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 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);
48 Activity() : delivery_time(0), priority_order(0), queue_order(0) {}
58 template <
bool T,
bool P,
bool Q>
64 if ( T && lhs->delivery_time != rhs->delivery_time )
return lhs->delivery_time < rhs->delivery_time;
65 if ( P && lhs->priority_order != rhs->priority_order )
return lhs->priority_order < rhs->priority_order;
66 return Q && lhs->queue_order < rhs->queue_order;
101 template <
bool T,
bool P,
bool Q>
107 if ( T && lhs->delivery_time != rhs->delivery_time )
return lhs->delivery_time > rhs->delivery_time;
108 if ( P && lhs->priority_order != rhs->priority_order )
return lhs->priority_order > rhs->priority_order;
109 return Q && lhs->queue_order > rhs->queue_order;
147 inline int getPriority()
const {
return (
int)(priority_order >> 32); }
150 inline void setOrderTag(uint32_t tag) { priority_order = (priority_order & 0xFFFFFFFF00000000ul) | (uint64_t)tag; }
153 inline uint32_t
getOrderTag()
const {
return (uint32_t)(priority_order & 0xFFFFFFFFul); }
169 std::stringstream buf;
175#ifdef __SST_DEBUG_EVENT_TRACKING__
176 virtual void printTrackingInfo(
const std::string& UNUSED(header),
Output& UNUSED(out))
const {}
181 void setPriority(uint64_t priority) { priority_order = (priority_order & 0x00000000FFFFFFFFul) | (priority << 32); }
190 std::stringstream buf;
209 void setQueueOrder(uint64_t order)
216 SimTime_t delivery_time;
219 uint64_t priority_order;
222 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:103
Class to use as the less than operator for STL functions or sorting algorithms.
Definition: activity.h:60
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:167
void setPriority(uint64_t priority)
Set the priority of the Activity.
Definition: activity.h:181
SimTime_t getDeliveryTime() const
Return the time at which this Activity will be delivered.
Definition: activity.h:144
void setDeliveryTime(SimTime_t time)
Set the time for which this Activity should be delivered.
Definition: activity.h:141
uint64_t getQueueOrder() const
Returns the queue order associated with this activity.
Definition: activity.h:156
void setOrderTag(uint32_t tag)
Sets the order tag.
Definition: activity.h:150
uint32_t getOrderTag() const
Return the order tag associated with this activity.
Definition: activity.h:153
std::string getDeliveryTimeInfo() const
Gets the delivery time info as a string.
Definition: activity.h:188
virtual void execute(void)=0
Function which will be called when the time for this Activity comes to pass.
ImplementVirtualSerializable(SST::Activity) void setQueueOrder(uint64_t order)
Set a new Queue order.
Definition: activity.h:205
int getPriority() const
Return the Priority of this Activity.
Definition: activity.h:147
This class is basically a wrapper for objects to declare the order in which their members should be s...
Definition: serializer.h:35
Output object provides consistent method for outputting data to stdout, stderr and/or sst debug file.
Definition: output.h:52