Giter VIP home page Giter VIP logo

Comments (3)

mperrinel avatar mperrinel commented on September 3, 2024

@jjwilke
I started to analysed/worked on this issue.
The current way to create a sst.StatisticGroup is to provide only its name as a parameter.
Then to add a statistic to the group, it is necessary to use the addStatistic method that takes a name and Params, as parameters.
There are also two other methods : setOuput and setFrequency.

To start the modification on the StatisticGroup, I suggest to use the work done with the new Statistic python object (ConfigStatistic).
Basically, the idea is to modify the way that a statistic is registered in ConfigStatGroup (configGraph.h) :

std::map<std::string, Params> statMap;

to

std::vector<StatisticId_t> statistics;

Since that we have an ID for every statistics, we can use it to retrieve all ConfigStatistic instances when necessary, like it is already done, in the same struct (ConfigStatGroup), for the components:

std::vector<ComponentId_t> components;

As a result, this first modification should permit to create a StatisticGroup like that in the python file :

a = sst.Component("a", "ctest.CtestComponent")

statA = a.setStatistic("traffic_intensity")
statA.addParams({"type":"sst.StatVTK"})

group = sst.StatisticGroup("StatVTKGroup")
group.addStatistic(statA)

In this issue, you may want to have the output to be defined directly at the construction of the StatisticGroup :

group = sst.StatisticGroup("StatVTKGroup", "sst.StatisticOutputExodus")

What do you think about that ? We can discuss this tomorrow at the call.

from sst-core.

mperrinel avatar mperrinel commented on September 3, 2024

The StatisticsGroup permits to add all Statistics of the group to all added components of the group.

a = sst.Component("a", "ctest.CtestComponent")
b = sst.Component("b", "ctest.CtestComponent")

statA = a.setStatistic("traffic_intensity")
statA.addParams({"type":"sst.StatVTK"})

group = sst.StatisticGroup("StatVTKGroup")
group.addComponent(b)
group.addStatistic(statA)

In this example, b is a component on the group "StatVTKGroup", on which, the statA statistic have been added. That means b have also the statA statistic. As a result, we don't need to do :

b.enableStatistics(["traffic_intensity"], {"type":"sst.StatVTK"})

But this example shows also two things:

  • a is not a Component of the StatVTKGroup (a default group will be affected to him at the registerStatisticCore method of the StatisticProcessingEngine class.
  • the sst.StatVTK instance affected to the component a will not be part of StatVTKGroup even if we have requested the statA to be added to the group.

In addition, the StatisticProcessingEngine class holds the default group and a list of named group :

    StatisticGroup                            m_defaultGroup;
    std::vector<StatisticGroup>               m_statGroups;

A StatisticGroup can be constructed by two ways:

  • The StatisticGroup() default constructor, without any parameter will create what we call the default group.
  • The StatisticGroup(const ConfigStatGroup &csg) which takes a ConfigStatGroup will basically copy all members of ConfigStatGroup into the StatisticGroup.

The setup method of the StatisticProcessingEngine fill the m_statGroups variable member. The registerStatisticCore creates a default StatisticGroup as a local variable, then try to find a ** StatisticGroup** that knows the statistic provided at a parameter, and in case of success, re-assigned the local StatisticGroup with it. I think it is possible to remove the local variable and simply use the variable members.

Let's talk about the design of the group at the meeting.

from sst-core.

mperrinel avatar mperrinel commented on September 3, 2024

@jjwilke
We said on last Friday meeting that we don't want to use the addComponent method anymore from the python file parameter. What is the best way to do that ? :

  • To remove the addComp method of the pymodel_statgroup
  • To add a comment : "// Deprecated"
  • To log a comment : " This method is deprecated, please use instead the addStatistic method."

from sst-core.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.