Commit 3e53b95e authored by Ondrej Vysocky's avatar Ondrej Vysocky

Merge branch 'dev' of code.it4i.cz:vys0053/meric into dev

parents 16f506a1 8a3e2e37
......@@ -50,6 +50,30 @@ double CountersAggregateStore<TStore>::printStats (const std::string description
return avg;
}
template <class TStore>
double CountersAggregateStore<TStore>::printStats (const std::string description, std::vector<double>& data, const int dataSize, const int stride, bool storeSum, std::ofstream &ss)
{
double max = data[0];
double min = data[0];
double sum = data[0];
for(int i=stride; i<dataSize; i+=stride)
{
if (max < data[i])
max = data[i];
else if (min > data[i])
min = data[i];
sum += data[i];
}
double avg = sum/(dataSize/stride);
ss << "AVG "<< description << "," << avg << std::endl
<< "MAX "<< description << "," << max << std::endl
<< "MIN "<< description << "," << min << std::endl;
if (storeSum)
ss << "SUM "<< description << "," << sum << std::endl;
return avg;
}
template <class TStore>
void CountersAggregateStore<TStore>::saveInterval(std::ofstream &ss, std::vector<size_t> &iStarts, size_t iEnd)
{
......
......@@ -147,16 +147,6 @@ void RAPL::getCounterValues(std::map<std::string, unsigned long long int> & reco
}
}
std::string RAPL::getCounterLabel(std::string counter)
{
std::map<std::string, std::string>::iterator it = RAPL_COUNTERS::counterLabel.find(counter);
if (it != RAPL_COUNTERS::counterLabel.end())
return it->second;
else
return counter;
}
// solve counter overflow and add baseline energy consumption
unsigned long long RAPL::getResultValue(unsigned long long int startValue, unsigned long long int stopValue, double runtime, std::string counter)
{
......@@ -190,6 +180,16 @@ std::string RAPL::getCountersLabel()
{
return "RAPL";
}
std::string RAPL::getCounterLabel(std::string counter)
{
std::map<std::string, std::string>::iterator it = RAPL_COUNTERS::counterLabel.find(counter);
if (it != RAPL_COUNTERS::counterLabel.end())
return it->second;
else
return counter;
}
std::string RAPL::getSummaryCounterName()
{
return RAPL_COUNTERS::RAPL_SUM_ENERGY;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment