Navigation: Home | Downloads | Getting SST | Documentation | Support
There are five classes available in SST: Component, SubComponent, Link, StatisticGroup and StatisticOutput. The Component and SubComponent classes share many of the same functions and will be covered together.
The Component and SubComponent Python classes represent the Component and SubComponent C++ classes that are used to implement the simulation models used in SST. They are similar, and have similar APIs, but SubComponents can only exist inside of Components. Subsequently, Components are instanced directly, but SubComponents are only instanced through a Component or another SubComponent.
The figures below show the main structures of the Component/SubComponent objects. The right image illustrates the arbitrary nesting capability of SubComponents.
An instance of Component is created using:
Creates a new Component object.
Parameters
lib.element
format (for example, "merlin.hr_router"
) specified as a stringA SubComponent is created by calling setSubComponent() on either a Component or SubComponent object. Instancing a SubComponent in this way creates a User SubComponent and allows the user to specify the parameters and statistics directly on the SubComponent. The name of the SubComponent is automatically generated using the name of the parent Component and the slot_name(s) in which SubComponents are loaded. If more than one SubComponent is loaded into a slot, the slot_name is also indexed using square brackets (e.g. [0]). This name can be used to get a handle to the SubComponent later in the Python code. See setSubComponent function description below.
Inserts a SubComponent of the specified type into the indicated slot name and index and creates a new SubComponent object
Parameters
lib.element
format (for example, "merlin.linkcontrol"
)The following functions are available to both Component and SubComponent classes.
Adds a parameter to the Params object for the Component/SubComponent.
Parameters
__str__
method will be called to get a string representation. A list can be passed to this call when the find_array
function is used in the class to retrieve the parameters.Adds multiple parameters to the Params object for the Component/SubComponent.
Parameters
addParam()
description for information about how key and value are used.Connects a link to the specified port with the specified latency on the link. You can also connect a link by using Link.connect().
Parameters
Returns the full name of the Component/SubComponent. For Components, the name is the one supplied by the user at the time the Component was created. For SubComponents, the name is automatically generated from the parent Component and slot name. At each level, the name is generated as the parent’s name plus the slot name, separated by a colon. The slot number is appended in square brackets:
Parent:slot[index]
This holds true for SubComponents of SubComponents, the slotname and index are just appended to the parent name:
Parent:slot[index]:slot[index]
Parameters
Returns the type of the component in lib.element
format. This is simply the type supplied to either the Component constructor or setSubComponent() call.
Parameters
Sets the statistic object to use in the specified statistic slot.
Parameters
Sets the load level for this statistic. This overrides the default load level. Load levels are not used for statistics that are explicitly enabled (i.e. does not use one of the “All” variants for enabling statistics). See General Notes on Statistics for more information.
Parameters
Enables all statistics for the Component/SubComponent on which the call is made. See General Notes on Statistics for more information.
Parameters
Enables a list of statistics for the component on which the call is made. See General Notes on Statistics for more information.
Parameters
Sets the x, y, z coordinates for this element. This is for use with visualization.
Parameters
The following functions are unique to Components, and, therefore, are not available to SubComponents.
Sets the rank the Component should be assigned to. This information is only used if the partitioner is set to sst.self.
Parameters
Sets the weight of the Component. The weight is used by some partitioners to help balance Components across ranks.
Parameters
The Link object is used to connect Component/SubComponents together to form the simulation. The Link is created using:
Creats a new Link object
Parameters
Connects two ports using the link object.
Actual parameters are two tuples representing the information for the ports to be connected. The fields in the tuple are (comp, port, latency) as describe below.
Parameters
Tell the simulator that this link should not be “cut” by a partition boundary. In effect, it will guarantee that the two Components connected by this link will be on the same rank when using an autotmatic partitioning scheme (this attribute is ignored if the self partitioner is used). This must be used with care, as you can easily get into a situation where too many components are on the same rank.
Parameters
A Statistic object is created using the setStatistic()
function in a Component or SubComponent.
The following functions are also available to configure the statistics object.
Adds a parameter to the statistics Params
Parameters
__str__
method will be called to get a string representation. A list can be passed to this call when the find_array
function is used in the class to retrieve the parameters.Adds multiple parameters to the Params object for the Statistic.
Parameters
addParam()
description for information about how key and value are used.The StatisticOutput object is used to configure the output type and options for statistics and is for use with StatisticGroup. For the global statistics output, see the global functions:
setStatisticOutput()
,
setStatisticOutputOption()
and
setStatisticOutputOptions()
.
The StatisticOutput object is created using:
Constructor for StatisticOutput
Parameters
Adds a parameter to the Params object for the StatisticOutput.
Parameters
__str__
method will be called to get a string representation. A list can be passed to this call when the find_array
function is used in the class to retrieve the parameters.Adds multiple parameters to the Params object for the StatisticOutput.
Parameters
addParam()
description for information about how key and value are used.The StatisticsGroup object is used to group Statistics object together to be written to the same StatisticOutput object.
NOTE: The StatisticGroup object had limited use in the past and is evolving to include new functionality. This is the proposed functionality of the class and may not be the final API for the object.
A StatisticGroup is creating using:
Constructor for StatisticGroup
Parameters
Adds a statistic to the group.
Parameters
Add a component to the group
Parameters
Configure how the Statistics in the group should be written
Parameters
Set the frequency or rate (e.g.: “10ms”, “25kHz”) to write out the statistics.
Parameters