SST 16.0.0
Structural Simulation Toolkit
profiletool.h
1// Copyright 2009-2026 NTESS. Under the terms
2// of Contract DE-NA0003525 with NTESS, the U.S.
3// Government retains certain rights in this software.
4//
5// Copyright (c) 2009-2026, NTESS
6// All rights reserved.
7//
8// This file is part of the SST software package. For license
9// information, see the LICENSE file in the top level directory of the
10// distribution.
11
12#ifndef SST_CORE_PROFILE_PROFILETOOL_H
13#define SST_CORE_PROFILE_PROFILETOOL_H
14
15#include "sst/core/eli/elementinfo.h"
16#include "sst/core/rankInfo.h"
17#include "sst/core/sst_types.h"
18#include "sst/core/warnmacros.h"
19
20#include <string>
21
22namespace SST {
23class Params;
24
25namespace Util {
26class DataRecord;
27}
28} // namespace SST
29
30
31namespace SST::Profile {
32
33/**
34 ProfileTool is a class loadable through the factory which allows
35 dynamic addition of profiling capabililites to profile points.
36*/
38{
39
40public:
41 SST_ELI_DECLARE_BASE(ProfileTool)
42 // maybe declare extern to limit compile times??
43 SST_ELI_DECLARE_CTOR_EXTERN(const std::string&, Params&)
44 SST_ELI_DECLARE_INFO_EXTERN(
47
48 explicit ProfileTool(const std::string& name);
49
50 virtual ~ProfileTool() {}
51
52 std::string getName() { return name; }
53
54 virtual void outputData(SST::Util::DataRecord* record, RankInfo rank) = 0;
55
56protected:
57 const std::string name;
58};
59
60} // namespace SST::Profile
61
62// Register profile tools. Must register an interface
63// (API) first, then you can register a subcomponent that implements
64// it
65#define SST_ELI_REGISTER_PROFILETOOL_API(cls, ...) \
66 SST_ELI_DECLARE_NEW_BASE(SST::Profile::ProfileTool,::cls) \
67 SST_ELI_NEW_BASE_CTOR(const std::string&,##__VA_ARGS__)
68
69#define SST_ELI_REGISTER_PROFILETOOL_DERIVED_API(cls, base, ...) \
70 SST_ELI_DECLARE_NEW_BASE(::base,::cls) \
71 SST_ELI_NEW_BASE_CTOR(const std::string&,##__VA_ARGS__)
72
73#define SST_ELI_REGISTER_PROFILETOOL(cls, interface, lib, name, version, desc) \
74 SST_ELI_REGISTER_DERIVED(::interface,cls,lib,name,ELI_FORWARD_AS_ONE(version),desc) \
75 SST_ELI_INTERFACE_INFO(#interface)
76
77#endif // SST_CORE_SUBCOMPONENT_H
Definition interfaceInfo.h:22
Definition paramsInfo.h:41
Parameter store.
Definition params.h:65
ProfileTool is a class loadable through the factory which allows dynamic addition of profiling capabi...
Definition profiletool.h:38
Definition rankInfo.h:24
Definition perfReporter.h:64