Skip to content

Commit

Permalink
Header file cleanup for ELI and serialization headers.
Browse files Browse the repository at this point in the history
  • Loading branch information
feldergast committed Oct 28, 2024
1 parent 6ee77fb commit 77cefbc
Show file tree
Hide file tree
Showing 22 changed files with 216 additions and 54 deletions.
15 changes: 7 additions & 8 deletions src/sst/core/baseComponent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ BaseComponent::setDefaultTimeBaseForLinks(TimeConverter* tc)
void
BaseComponent::pushValidParams(Params& params, const std::string& type)
{
const Params::KeySet_t& keyset = Factory::getFactory()->getParamNames(type);
params.pushAllowedKeys(keyset);
params.pushAllowedKeys(Factory::getFactory()->getParamNames(type));
}

void
Expand Down Expand Up @@ -790,12 +789,12 @@ void
BaseComponent::configureAllowedStatParams(SST::Params& params)
{
// Identify what keys are Allowed in the parameters
Params::KeySet_t allowedKeySet;
allowedKeySet.insert("type");
allowedKeySet.insert("rate");
allowedKeySet.insert("startat");
allowedKeySet.insert("stopat");
allowedKeySet.insert("resetOnRead");
std::vector<std::string> allowedKeySet;
allowedKeySet.push_back("type");
allowedKeySet.push_back("rate");
allowedKeySet.push_back("startat");
allowedKeySet.push_back("stopat");
allowedKeySet.push_back("resetOnRead");
params.pushAllowedKeys(allowedKeySet);
}

Expand Down
2 changes: 2 additions & 0 deletions src/sst/core/eli/defaultInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#ifndef SST_CORE_ELI_DEFAULTINFO_H
#define SST_CORE_ELI_DEFAULTINFO_H

#include "sst/core/eli/elibase.h"

#include <string>
#include <vector>

Expand Down
6 changes: 5 additions & 1 deletion src/sst/core/eli/elementinfo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@

#include "sst/core/eli/elibase.h"

#include <sstream>
#include <string>
#include <vector>

namespace SST {

/**************************************************************************
Expand Down Expand Up @@ -128,7 +132,7 @@ void
ProvidesParams::init()
{
for ( auto& item : params_ ) {
allowedKeys.insert(item.name);
allowedKeys.push_back(item.name);
}
}

Expand Down
1 change: 0 additions & 1 deletion src/sst/core/eli/elementinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include "sst/core/eli/simpleInfo.h"
#include "sst/core/eli/statsInfo.h"
#include "sst/core/eli/subcompSlotInfo.h"
#include "sst/core/params.h"
#include "sst/core/sst_types.h"
#include "sst/core/warnmacros.h"

Expand Down
3 changes: 3 additions & 0 deletions src/sst/core/eli/interfaceInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
#ifndef SST_CORE_ELI_INTERFACE_INFO_H
#define SST_CORE_ELI_INTERFACE_INFO_H

#include <iostream>
#include <string>

namespace SST {
namespace ELI {

Expand Down
5 changes: 2 additions & 3 deletions src/sst/core/eli/paramsInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#define SST_CORE_ELI_PARAMS_INFO_H

#include "sst/core/eli/elibase.h"
#include "sst/core/params.h"

#include <string>
#include <vector>
Expand Down Expand Up @@ -62,7 +61,7 @@ class ProvidesParams
}
}

const Params::KeySet_t& getParamNames() const { return allowedKeys; }
const std::vector<std::string>& getParamNames() const { return allowedKeys; }

protected:
template <class T>
Expand All @@ -74,7 +73,7 @@ class ProvidesParams
private:
void init();

Params::KeySet_t allowedKeys;
std::vector<std::string> allowedKeys;
std::vector<ElementInfoParam> params_;
};

Expand Down
4 changes: 2 additions & 2 deletions src/sst/core/factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,12 @@ Factory::isPortNameValid(const std::string& type, const std::string& port_name)
return false;
}

const Params::KeySet_t&
const std::vector<std::string>&
Factory::getParamNames(const std::string& type)
{
// This is only needed so we can return something in the error
// case. It is never used.
static Params::KeySet_t empty_keyset;
static std::vector<std::string> empty_keyset;

std::string elemlib, elem;
std::tie(elemlib, elem) = parseLoadName(type);
Expand Down
5 changes: 3 additions & 2 deletions src/sst/core/factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#define SST_CORE_FACTORY_H

#include "sst/core/eli/elementinfo.h"
#include "sst/core/output.h"
#include "sst/core/params.h"
#include "sst/core/sst_types.h"
#include "sst/core/sstpart.h"
Expand Down Expand Up @@ -53,9 +54,9 @@ class Factory

/** Get a list of allowed param keys for a given component type.
* @param type - Name of component in lib.name format
* @return True if this is a valid portname
* @return Allowed parameter names
*/
const Params::KeySet_t& getParamNames(const std::string& type);
const std::vector<std::string>& getParamNames(const std::string& type);

/** Attempt to create a new Component instantiation
* @param id - The unique ID of the component instantiation
Expand Down
2 changes: 2 additions & 0 deletions src/sst/core/impl/timevortex/timeVortexBinnedMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#ifndef SST_CORE_IMPL_TIMEVORTEX_TIMEVORTEXBINNEDMAP_H
#define SST_CORE_IMPL_TIMEVORTEX_TIMEVORTEXBINNEDMAP_H

#include "sst/core/threadsafe.h"

#include <atomic>
#include <queue>
#include <sst/core/timeVortex.h>
Expand Down
1 change: 1 addition & 0 deletions src/sst/core/impl/timevortex/timeVortexPQ.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#define SST_CORE_IMPL_TIMEVORTEX_TIMEVORTEXPQ_H

#include "sst/core/eli/elementinfo.h"
#include "sst/core/threadsafe.h"
#include "sst/core/timeVortex.h"

#include <functional>
Expand Down
1 change: 1 addition & 0 deletions src/sst/core/interactiveConsole.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

namespace SST {

class Params;
class Simulation_impl;
class TimeConverter;

Expand Down
1 change: 1 addition & 0 deletions src/sst/core/model/sstmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#define SST_CORE_MODEL_SSTMODEL_H

#include "sst/core/eli/elementinfo.h"
#include "sst/core/params.h"
#include "sst/core/warnmacros.h"

namespace SST {
Expand Down
3 changes: 3 additions & 0 deletions src/sst/core/module.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
#include "sst/core/serialization/serializable.h"

namespace SST {

class Params;

/**
Module is a tag class used with the loadModule function.
*/
Expand Down
9 changes: 7 additions & 2 deletions src/sst/core/params.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#include "sst/core/params.h"

#include "sst/core/output.h"
#include "sst/core/unitAlgebra.h"

#include <map>
Expand Down Expand Up @@ -223,9 +224,13 @@ Params::contains(const key_type& k) const
}

void
Params::pushAllowedKeys(const KeySet_t& keys)
Params::pushAllowedKeys(const std::vector<std::string>& keys)
{
allowedKeys.push_back(keys);
KeySet_t key_set;
for ( auto x : keys ) {
key_set.insert(x);
}
allowedKeys.push_back(key_set);
}

void
Expand Down
4 changes: 2 additions & 2 deletions src/sst/core/params.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#define SST_CORE_PARAM_H

#include "sst/core/from_string.h"
#include "sst/core/output.h"
#include "sst/core/serialization/serializable.h"
#include "sst/core/serialization/serializer.h"
#include "sst/core/threadsafe.h"
Expand All @@ -34,6 +33,7 @@ namespace SST {

class ConfigGraph;
class ConfigComponent;
class Output;
class SSTModelDescription;

namespace Core {
Expand Down Expand Up @@ -834,7 +834,7 @@ class Params : public SST::Core::Serialization::serializable
* @param keys Set of keys to consider valid to add to the stack
* of legal keys
*/
void pushAllowedKeys(const KeySet_t& keys);
void pushAllowedKeys(const std::vector<std::string>& keys);

/**
* Removes the most recent set of keys considered allowed
Expand Down
1 change: 1 addition & 0 deletions src/sst/core/profile/clockHandlerProfileTool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "sst/core/profile/clockHandlerProfileTool.h"

#include "sst/core/output.h"
#include "sst/core/params.h"
#include "sst/core/sst_types.h"

#include <chrono>
Expand Down
1 change: 1 addition & 0 deletions src/sst/core/profile/componentProfileTool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "sst/core/profile/componentProfileTool.h"

#include "sst/core/output.h"
#include "sst/core/params.h"
#include "sst/core/sst_types.h"

#include <chrono>
Expand Down
1 change: 1 addition & 0 deletions src/sst/core/profile/eventHandlerProfileTool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "sst/core/profile/eventHandlerProfileTool.h"

#include "sst/core/output.h"
#include "sst/core/params.h"
#include "sst/core/sst_types.h"

#include <chrono>
Expand Down
Loading

0 comments on commit 77cefbc

Please sign in to comment.