12 #ifndef SST_CORE_PORTMODULE_H 13 #define SST_CORE_PORTMODULE_H 15 #include "sst/core/eli/elementinfo.h" 16 #include "sst/core/event.h" 17 #include "sst/core/link.h" 18 #include "sst/core/statapi/statbase.h" 19 #include "sst/core/statapi/statengine.h" 51 public Event::HandlerBase::InterceptPoint,
62 SST_ELI_DECLARE_INFO_EXTERN(
105 virtual void eventSent(uintptr_t key,
Event*& ev)
override = 0;
173 virtual void interceptHandler(uintptr_t key,
Event*& data,
bool& cancel)
override = 0;
216 const std::string& getName()
const;
227 SimTime_t getCurrentSimCycle()
const;
230 int getCurrentPriority()
const;
236 Output& getSimulationOutput()
const;
244 [[deprecated(
"Use of shared TimeConverter objects is deprecated. Use 'getCurrentSimTime(TimeConverter& timebase)' " 245 "(i.e., no pointer) instead.")]]
255 SimTime_t getCurrentSimTime(
const std::string& base)
const;
261 SimTime_t getCurrentSimTimeNano()
const;
267 SimTime_t getCurrentSimTimeMicro()
const;
273 SimTime_t getCurrentSimTimeMilli()
const;
296 void fatal(uint32_t line,
const char* file,
const char* func,
int exit_code,
const char* format, ...) const
297 __attribute__((format(printf, 6, 7)));
322 void sst_assert(
bool condition, uint32_t line, const
char* file, const
char* func,
int exit_code,
323 const
char* format, ...) const __attribute__((format(printf, 7, 8)));
337 template <typename T>
339 SST::
Params& params, const std::
string& stat_name, const std::
string& stat_sub_id = "")
341 return registerStatistic_impl<T>(params, stat_name, stat_sub_id);
344 template <
typename T>
348 return registerStatistic_impl<T>(empty, stat_name, stat_sub_id);
351 virtual std::string getEliType()
const {
return ""; }
354 friend class BaseComponent;
359 BaseComponent* component_ =
nullptr;
367 void vfatal(uint32_t line,
const char* file,
const char* func,
int exit_code,
const char* format, va_list arg)
const 368 __attribute__((format(printf, 6, 0)));
373 template <
typename T>
374 Statistics::Statistic<T>* registerStatistic_impl(
375 SST::Params& params,
const std::string& stat_name,
const std::string& stat_sub_id)
378 uint8_t level = getStatisticValidityAndLevel(stat_name);
379 if ( level == 255 ) {
380 fatal(__LINE__, __FILE__,
"registerStatistic", 1,
381 "attempting to register a statistic '%s' that is not found in ELI", stat_name.c_str());
386 std::tie(enabled, cfg_params) = isStatisticEnabled(stat_name, level);
389 cfg_params.insert(params);
390 auto stat = getStatEngine()->createStatistic<T>(component_, stat_name, stat_sub_id, cfg_params);
391 stat->setPortModName(id_.first, id_.second);
395 return getStatEngine()->createDisabledStatistic<T>();
403 Statistics::StatisticProcessingEngine* getStatEngine()
const;
408 uint8_t getStatisticValidityAndLevel(
const std::string& statistic_name)
const;
414 std::pair<bool, Params> isStatisticEnabled(
const std::string& statistic_name,
const uint8_t min_level);
420 #define SST_ELI_REGISTER_PORTMODULE(cls, lib, name, version, desc) \ 421 SST_ELI_REGISTER_DERIVED(SST::PortModule,cls,lib,name,ELI_FORWARD_AS_ONE(version),desc) \ 422 std::string getEliType() const override \ 424 std::string ret(lib); \ 425 return ret + "." + name; \ 428 #endif // SST_CORE_PORTMODULE_H Output object provides consistent method for outputting data to stdout, stderr and/or sst debug file...
Definition: output.h:57
virtual bool installOnSend()
Called to determine if the PortModule should be installed on sends.
Definition: portModule.h:214
This class is basically a wrapper for objects to declare the order in which their members should be s...
Definition: serializer.h:42
A class to convert between a component's view of time and the core's view of time.
Definition: timeConverter.h:27
Definition: statsInfo.h:39
Forms the template defined base class for statistics gathering within SST.
Definition: elementinfo.h:46
Definition: serializable.h:23
Definition: paramsInfo.h:39
virtual bool installOnReceive()
Called to determine if the PortModule should be installed on receives.
Definition: portModule.h:204
Parameter store.
Definition: params.h:63
Definition: attributeInfo.h:40
Attach point for inspecting, modifying or dropping events sent on the Link.
Definition: link.h:73
Definition: elementinfo.h:44
Base class for Events - Items sent across links to communicate between components.
Definition: event.h:40
Performs Unit math in full precision.
Definition: unitAlgebra.h:105
PortModules are modules that can be attached to the send and/or receive side of ports.
Definition: portModule.h:50