SST  13.1.0
Structural Simulation Toolkit
SST::Factory Class Reference

Class for instantiating Components, Links and the like out of element libraries. More...

#include <factory.h>

Public Member Functions

bool isPortNameValid (const std::string &type, const std::string &port_name)
 Get a list of allowed ports for a given component type. More...
 
const Params::KeySet_tgetParamNames (const std::string &type)
 Get a list of allowed param keys for a given component type. More...
 
ComponentCreateComponent (ComponentId_t id, const std::string &componentname, Params &params)
 Attempt to create a new Component instantiation. More...
 
void RequireEvent (const std::string &eventname)
 Ensure that an element library containing the required event is loaded. More...
 
bool doesSubComponentExist (const std::string &type)
 
Partition::SSTPartitionerCreatePartitioner (const std::string &name, RankInfo total_ranks, RankInfo my_rank, int verbosity)
 Return partitioner function. More...
 
template<class Base >
bool isSubComponentLoadableUsingAPI (const std::string &type)
 Check to see if a given element type is loadable with a particular API. More...
 
template<class Base , int index, class InfoType >
const InfoType & getSimpleInfo (const std::string &type)
 
template<class Base , class... CtorArgs>
Base * Create (const std::string &type, CtorArgs &&... args)
 General function to create a given base class. More...
 
template<class T , class... ARGS>
T * CreateProfileTool (const std::string &type, ARGS... args)
 
template<class Base , class... CtorArgs>
Base * CreateWithParams (const std::string &type, SST::Params &params, CtorArgs &&... args)
 General function to create a given base class. More...
 
template<class T , class... Args>
Statistics::Statistic< T > * CreateStatistic (const std::string &type, BaseComponent *comp, const std::string &statName, const std::string &stat, Params &params, Args... args)
 Instantiate a new Statistic. More...
 
SSTElementPythonModulegetPythonModule (const std::string &name)
 Return Python Module creation function. More...
 
bool hasLibrary (const std::string &elemlib, std::ostream &err_os)
 hasLibrary Checks to see if library exists and can be loaded More...
 
void requireLibrary (const std::string &elemlib, std::ostream &err_os)
 
void requireLibrary (const std::string &elemlib)
 requireLibrary Throws away error messages More...
 
void getLoadedLibraryNames (std::set< std::string > &lib_names)
 
void loadUnloadedLibraries (const std::set< std::string > &lib_names)
 
bool DoesSubComponentSlotExist (const std::string &type, const std::string &slotName)
 Determine if a SubComponentSlot is defined in a components ElementInfoStatistic. More...
 
bool DoesComponentInfoStatisticNameExist (const std::string &type, const std::string &statisticName)
 Determine if a statistic is defined in a components ElementInfoStatistic. More...
 
const std::vector< std::string > & GetValidStatistics (const std::string &compType)
 
uint8_t GetComponentInfoStatisticEnableLevel (const std::string &type, const std::string &statisticName)
 Get the enable level of a statistic defined in the component's ElementInfoStatistic. More...
 
std::string GetComponentInfoStatisticUnits (const std::string &type, const std::string &statisticName)
 Get the units of a statistic defined in the component's ElementInfoStatistic. More...
 
bool isProfilePointValid (const std::string &type, const std::string &point)
 Get a list of allowed ports for a given component type. More...
 

Static Public Member Functions

static FactorygetFactory ()
 

Protected Attributes

Outputout
 

Detailed Description

Class for instantiating Components, Links and the like out of element libraries.

Member Function Documentation

◆ Create()

template<class Base , class... CtorArgs>
Base* SST::Factory::Create ( const std::string &  type,
CtorArgs &&...  args 
)
inline

General function to create a given base class.

Parameters
type
params
argsConstructor arguments

◆ CreateComponent()

Component * SST::Factory::CreateComponent ( ComponentId_t  id,
const std::string &  componentname,
Params params 
)

Attempt to create a new Component instantiation.

Parameters
id- The unique ID of the component instantiation
componentname- The fully qualified elementlibname.componentname type of component
params- The params to pass to the component's constructor
Returns
Newly created component

References SST::BaseComponent::fatal(), SST::Params::popAllowedKeys(), and SST::Params::pushAllowedKeys().

◆ CreatePartitioner()

Partition::SSTPartitioner * SST::Factory::CreatePartitioner ( const std::string &  name,
RankInfo  total_ranks,
RankInfo  my_rank,
int  verbosity 
)

Return partitioner function.

Parameters
name- Fully qualified elementlibname.partitioner type name

◆ CreateStatistic()

template<class T , class... Args>
Statistics::Statistic<T>* SST::Factory::CreateStatistic ( const std::string &  type,
BaseComponent comp,
const std::string &  statName,
const std::string &  stat,
Params params,
Args...  args 
)
inline

Instantiate a new Statistic.

Parameters
comp- Owning component
type- Fully qualified elementlibname.statisticname type
statName- Name of the statistic
statSubId- Name of the sub statistic
params- Parameters to pass to the Statistics's constructor
fieldType- Type of data stored in statistic

References SST::Output::fatal().

◆ CreateWithParams()

template<class Base , class... CtorArgs>
Base* SST::Factory::CreateWithParams ( const std::string &  type,
SST::Params params,
CtorArgs &&...  args 
)
inline

General function to create a given base class.

This version should be used if a Params object is being passed in and you need the system to populate the allowed keys for the object. If you don't need the allowed keys to be populated, just use the Create() bunction.

Parameters
type
params
argsConstructor arguments

References SST::Params::popAllowedKeys(), and SST::Params::pushAllowedKeys().

◆ DoesComponentInfoStatisticNameExist()

bool SST::Factory::DoesComponentInfoStatisticNameExist ( const std::string &  type,
const std::string &  statisticName 
)

Determine if a statistic is defined in a components ElementInfoStatistic.

Parameters
type- The name of the component
statisticName- The name of the statistic
Returns
True if the statistic is defined in the component's ElementInfoStatistic

◆ DoesSubComponentSlotExist()

bool SST::Factory::DoesSubComponentSlotExist ( const std::string &  type,
const std::string &  slotName 
)

Determine if a SubComponentSlot is defined in a components ElementInfoStatistic.

Parameters
type- The name of the component/subcomponent
slotName- The name of the SubComponentSlot
Returns
True if the SubComponentSlot is defined in the component's ELI

◆ GetComponentInfoStatisticEnableLevel()

uint8_t SST::Factory::GetComponentInfoStatisticEnableLevel ( const std::string &  type,
const std::string &  statisticName 
)

Get the enable level of a statistic defined in the component's ElementInfoStatistic.

Parameters
componentname- The name of the component
statisticName- The name of the statistic
Returns
The Enable Level of the statistic from the ElementInfoStatistic

◆ GetComponentInfoStatisticUnits()

std::string SST::Factory::GetComponentInfoStatisticUnits ( const std::string &  type,
const std::string &  statisticName 
)

Get the units of a statistic defined in the component's ElementInfoStatistic.

Parameters
componentname- The name of the component
statisticName- The name of the statistic
Returns
The units string of the statistic from the ElementInfoStatistic

◆ getParamNames()

const Params::KeySet_t & SST::Factory::getParamNames ( const std::string &  type)

Get a list of allowed param keys for a given component type.

Parameters
type- Name of component in lib.name format
Returns
True if this is a valid portname

◆ getPythonModule()

SSTElementPythonModule * SST::Factory::getPythonModule ( const std::string &  name)

Return Python Module creation function.

Parameters
name- Fully qualified elementlibname.pythonModName type name

◆ hasLibrary()

bool SST::Factory::hasLibrary ( const std::string &  elemlib,
std::ostream &  err_os 
)

hasLibrary Checks to see if library exists and can be loaded

Parameters
elemlib
err_osStream to print error messages to
Returns
whether the library was found

◆ isPortNameValid()

bool SST::Factory::isPortNameValid ( const std::string &  type,
const std::string &  port_name 
)

Get a list of allowed ports for a given component type.

Parameters
type- Name of component in lib.name format
Returns
True if this is a valid portname

◆ isProfilePointValid()

bool SST::Factory::isProfilePointValid ( const std::string &  type,
const std::string &  point 
)

Get a list of allowed ports for a given component type.

Parameters
type- Type of component in lib.name format
point= Profile point to check
Returns
True if this is a valid profile point

◆ isSubComponentLoadableUsingAPI()

template<class Base >
bool SST::Factory::isSubComponentLoadableUsingAPI ( const std::string &  type)
inline

Check to see if a given element type is loadable with a particular API.

Parameters
name- Name of element to check in lib.name format
Returns
True if loadable as the API specified as the template parameter

◆ RequireEvent()

void SST::Factory::RequireEvent ( const std::string &  eventname)

Ensure that an element library containing the required event is loaded.

Parameters
eventname- The fully qualified elementlibname.eventname type

◆ requireLibrary()

void SST::Factory::requireLibrary ( const std::string &  elemlib)

requireLibrary Throws away error messages

Parameters
elemlib

The documentation for this class was generated from the following files: