Commit b3c39d1a authored by Carla Guillen's avatar Carla Guillen
Browse files

Adding power rapl metrics

parent e5c84bf2
......@@ -78,6 +78,10 @@ SMUCNGPerfConfigurator::SMUCNGPerfConfigurator() : OperatorConfiguratorTemplate(
_metricMap["CAS_COUNT_WRITE3"]=SMUCSensorBase::CAS_COUNT_WRITE3;
_metricMap["CAS_COUNT_WRITE4"]=SMUCSensorBase::CAS_COUNT_WRITE4;
_metricMap["CAS_COUNT_WRITE5"]=SMUCSensorBase::CAS_COUNT_WRITE5;
_metricMap["PKG0_ENERGY"]=SMUCSensorBase::PKG0_ENERGY;
_metricMap["PKG1_ENERGY"]=SMUCSensorBase::PKG1_ENERGY;
_metricMap["DRAM0_ENERGY"]=SMUCSensorBase::DRAM0_ENERGY;
_metricMap["DRAM1_ENERGY"]=SMUCSensorBase::DRAM1_ENERGY;
_metricMap["CPI"]=SMUCSensorBase::CPI;
_metricMap["FREQUENCY"]=SMUCSensorBase::FREQUENCY;
_metricMap["INSTRUCTIONS_PER_SECOND"]=SMUCSensorBase::INSTRUCTIONS_PER_SECOND;
......@@ -131,6 +135,8 @@ SMUCNGPerfConfigurator::SMUCNGPerfConfigurator() : OperatorConfiguratorTemplate(
_metricMap["PACKED512_FLOPS"] = SMUCSensorBase::PACKED512_FLOPS;
_metricMap["SINGLE_PRECISION_FLOPS"] = SMUCSensorBase::SINGLE_PRECISION_FLOPS;
_metricMap["DOUBLE_PRECISION_FLOPS"] = SMUCSensorBase::DOUBLE_PRECISION_FLOPS;
_metricMap["PKG_POWER"] = SMUCSensorBase::PKG_POWER;
_metricMap["DRAM_POWER"] = SMUCSensorBase::DRAM_POWER;
}
SMUCNGPerfConfigurator::~SMUCNGPerfConfigurator() {
......
......@@ -140,7 +140,9 @@ void SMUCNGPerfOperator::compute(U_Ptr unit) {
LOG(error) << "No metadata defined, sensor " << outSensor->getName() << " can't compute anything.";
continue;
}
if (outSensor->getMetric() == SMUCSensorBase::FREQUENCY) {
if (outSensor->getMetric() == SMUCSensorBase::PKG_POWER || outSensor->getMetric() == SMUCSensorBase::DRAM_POWER){
computePOWER(inputs, outSensor, timestamp);
} else if (outSensor->getMetric() == SMUCSensorBase::FREQUENCY) {
computeFREQUENCY(inputs, outSensor, timestamp);
} else if (_flop_metric.find(outSensor->getMetric()) != _flop_metric.end()) {
computeFLOPS(inputs, outSensor, timestamp);
......@@ -252,15 +254,34 @@ void SMUCNGPerfOperator::computeLOADIMBALANCES(std::vector<SMUCNGPtr>& inputs, S
auto largest = std::max_element(cpus_vec.begin(), cpus_vec.end(),
[](const reading_t& l, const reading_t& r) -> bool {return l.value < r.value;});
result.value = largest->value - smallest->value;
result.value = (largest->value - smallest->value)/_measuring_interval_s;
} else { //outSensor->getMetric() == SMUCSensorBase::INTER_NODE_LOADIMBALANCE
//calculate avg
result.value = computeAvg(cpus_vec);
result.value = computeAvg(cpus_vec)/_measuring_interval_s;
}
outSensor->storeReading(result);
}
void SMUCNGPerfOperator::computePOWER(std::vector<SMUCNGPtr>& inputs, SMUCNGPtr & outSensor, const uint64_t timestamp){
//query for every socket
std::vector<reading_t> & sockets_vec = _buffers[0];
for(auto & input: inputs) {
query(input->getName(), timestamp, sockets_vec);
}
if(sockets_vec.size() == 0){
return;
}
reading_t result;
result.timestamp = sockets_vec.begin()->timestamp;
double agg_value = 0.0;
for(auto & socket_reading :sockets_vec){
agg_value += socket_reading.value/1e6; //convertion to joules
}
result.value = agg_value/(_measuring_interval_s * *outSensor->getMetadata()->getScale() );
outSensor->storeReading(result);
}
void SMUCNGPerfOperator::computeFREQUENCY(std::vector<SMUCNGPtr>& inputs, SMUCNGPtr& outSensor, const uint64_t timestamp) {
......
......@@ -84,6 +84,12 @@ protected:
void computeMEMORY_BANDWIDTH(std::vector<SMUCNGPtr>& inputs, SMUCNGPtr &outSensor, const uint64_t timestamp);
void computeProfileMetric(std::vector<SMUCNGPtr>& inputs, SMUCNGPtr &outSensor, const uint64_t timestamp);
/**
* Both DRAM and PACKAGE are calculated the same way: first divide by the interval and then
* aggregate socket-wise
**/
void computePOWER(std::vector<SMUCNGPtr>& inputs, SMUCNGPtr & outSensor, const uint64_t timestamp);
bool isAMetricPerSecond(SMUCSensorBase::Metric_t comp);
bool isAMetricRatio(SMUCSensorBase::Metric_t comp);
bool isAProfileMetric(SMUCSensorBase::Metric_t comp);
......
......@@ -80,6 +80,10 @@ public:
CAS_COUNT_WRITE3=44,
CAS_COUNT_WRITE4=45,
CAS_COUNT_WRITE5=46,
PKG0_ENERGY=1000,
PKG1_ENERGY=1001,
DRAM0_ENERGY=1002,
DRAM1_ENERGY=1003,
//
CPI=50,
FREQUENCY=51,
......@@ -134,6 +138,8 @@ public:
PACKED512_FLOPS=100,
SINGLE_PRECISION_FLOPS=101,
DOUBLE_PRECISION_FLOPS=102,
PKG_POWER=200,
DRAM_POWER=201,
NONE
};
public:
......
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