Skip to content

Commit 3fe2541

Browse files
authored
Event order update (#1549)
* Change event delivery ordering to be based on the order registerLink() is called in a component, rather than on the alphabetization of link names. * Updates to doxygen comments * No need to write a new order to ConfigLink in postCreationCleanup() * Update dangling and unused link error checks
1 parent d31534a commit 3fe2541

File tree

10 files changed

+259
-173
lines changed

10 files changed

+259
-173
lines changed

src/sst/core/baseComponent.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,7 @@ BaseComponent::configureLink_impl(const std::string& name, SimTime_t timebase, E
686686
}
687687
}
688688
tmp->setDefaultTimeBase(timebase);
689+
tmp->setTag(getNextLinkOrder());
689690
#ifdef __SST_DEBUG_EVENT_TRACKING__
690691
tmp->setSendingComponentInfo(my_info_->getName(), my_info_->getType(), name);
691692
#endif
@@ -843,6 +844,12 @@ BaseComponent::pushValidParams(Params& params, const std::string& type)
843844
params.pushAllowedKeys(Factory::getFactory()->getParamNames(type));
844845
}
845846

847+
uint32_t
848+
BaseComponent::getNextLinkOrder()
849+
{
850+
return getParentComponent()->getNextLinkOrder();
851+
}
852+
846853

847854
void
848855
BaseComponent::vfatal(

src/sst/core/baseComponent.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,12 @@ class BaseComponent : public SST::Core::Serialization::serializable_base
596596
void serialize_order(SST::Core::Serialization::serializer& ser) override;
597597

598598

599+
/**
600+
Gets the next value or the order field of the link. The ordering of events based on links will be based on
601+
the order that configureLink() is called.
602+
*/
603+
virtual uint32_t getNextLinkOrder();
604+
599605
/**
600606
Handles the profile points, default timebase, handler tracking and checkpointing.
601607

src/sst/core/component.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "sst/core/eli/elementinfo.h"
1717
#include "sst/core/sst_types.h"
1818

19+
#include <cstdint>
1920
#include <map>
2021

2122
using namespace SST::Statistics;
@@ -58,6 +59,12 @@ class Component : public BaseComponent
5859
protected:
5960
friend class SubComponent;
6061
Component() = default; // For Serialization only
62+
63+
private:
64+
65+
uint32_t getNextLinkOrder() override { return next_event_order_++; }
66+
67+
uint32_t next_event_order_ = 1;
6168
};
6269

6370
} // namespace SST

src/sst/core/componentExtension.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class ComponentExtension : public BaseComponent
3737
ComponentExtension() = default; // For serialization only
3838

3939
void serialize_order(SST::Core::Serialization::serializer& ser) override;
40-
ImplementSerializable(SST::ComponentExtension)
40+
ImplementSerializable(SST::ComponentExtension);
4141
};
4242

4343
} // namespace SST

src/sst/core/event.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,9 @@ class Event : public Activity
210210
local links, delivery_info contains the delivery functor.
211211
@return void
212212
*/
213-
inline void setDeliveryInfo(LinkId_t tag, uintptr_t delivery_info)
213+
inline void setDeliveryInfo(uint32_t order_tag, uintptr_t delivery_info)
214214
{
215-
setOrderTag(tag);
215+
setOrderTag(order_tag);
216216
this->delivery_info = delivery_info;
217217
}
218218

@@ -228,9 +228,6 @@ class Event : public Activity
228228
/** Gets the link id used for delivery. For use by SST Core only */
229229
inline Link* getDeliveryLink() { return reinterpret_cast<Link*>(delivery_info); }
230230

231-
/** Gets the link id associated with this event. For use by SST Core only */
232-
inline LinkId_t getTag() const { return getOrderTag(); }
233-
234231

235232
/** Holds the delivery information. This is stored as a
236233
uintptr_t, but is actually a pointer converted using

src/sst/core/link.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ Link::Link() :
499499
current_time(Simulation_impl::getSimulation()->currentSimCycle),
500500
type(UNINITIALIZED),
501501
mode(INIT),
502-
tag(-1),
502+
tag(type_max<uint32_t>),
503503
attached_tools(nullptr)
504504
{}
505505

0 commit comments

Comments
 (0)