Commit a846049d authored by Carla Guillen's avatar Carla Guillen

Fixing compilation errors

parent c03a71d6
......@@ -4,7 +4,7 @@ include ../config.mk
CXXFLAGS += -DBOOST_NETWORK_ENABLE_HTTPS -I../common/include -I$(DCDBDEPLOYPATH)/include -I$(DCDBDEPLOYPATH)/include/opencv4
LIBS = -L../lib -L$(DCDBDEPLOYPATH)/lib/ -ldl -lboost_system -lboost_thread -lboost_log_setup -lboost_log -lboost_regex -lpthread -rdynamic
OPERATORS = aggregator regressor job_aggregator testeroperator filesink smucngperf
OPERATORS = aggregator regressor job_aggregator testeroperator filesink smucngperf persystsql
ifeq ($(OS),Darwin)
BACNET_PORT = bsd
......@@ -58,5 +58,9 @@ libdcdboperator_testeroperator.$(LIBEXT): operators/testeroperator/TesterOperato
libdcdboperator_filesink.$(LIBEXT): operators/filesink/FilesinkOperator.o operators/filesink/FilesinkConfigurator.o ../common/src/sensornavigator.o
$(CXX) $(LIBFLAGS)$@ -o $@ $^ -L$(DCDBDEPLOYPATH)/lib/ -lboost_log -lboost_system -lboost_regex
libdcdboperator_smucngperf.$(LIBEXT): operators/smucngperf/SMUCNGPerfOperator.o operators/smucngperf/SMUCNGPerfConfigurator.o ../common/src/sensornavigator.o
libdcdboperator_smucngperf.$(LIBEXT): operators/smucngperf/SMUCNGPerfOperator.o operators/smucngperf/SMUCNGPerfConfigurator.o operators/smucngperf/SKXPMUMetrics.o ../common/src/sensornavigator.o
$(CXX) $(LIBFLAGS)$@ -o $@ $^ -L$(DCDBDEPLOYPATH)/lib/ -lboost_log -lboost_system -lboost_regex
libdcdboperator_persystsql.$(LIBEXT): operators/persystsql/JobTSAggregatorOperator.o operators/persystsql/JobTSAggregatorConfigurator.o ../common/src/sensornavigator.o
$(CXX) $(LIBFLAGS)$@ -o $@ $^ -L$(DCDBDEPLOYPATH)/lib/ -lboost_log -lboost_system -lboost_regex
/*
* DerivedMetrics.h
*
* Created on: Jul 11, 2019
* Author: carla
*/
#ifndef ANALYTICS_COMMONDERIVEDMETRICS_DERIVEDMETRICS_H_
#define ANALYTICS_COMMONDERIVEDMETRICS_DERIVEDMETRICS_H_
#include "cacheentry.h"
template<typename ...Args>
bool getTimestampFromReadings(uint64_t & timestamp, Args&...args){
reading_t readings[] = {args...};
for(auto & reading: readings){
if(reading.timestamp != 0){
timestamp = reading.timestamp;
return true;
}
}
return false;
}
/**
* For CPI, LoadsToStore, Branch rate, miss branch ratio, etc..
*/
bool calculateMetricRatio(reading_t & dividend, reading_t & divisor,
unsigned int scaling_factor, reading_t & result) {
if(divisor.value > 0){
result.value = (dividend.value / static_cast<float>(divisor.value))*scaling_factor;
return getTimestampFromReadings(result.timestamp, dividend, divisor);
}
return false; //Division by zero
}
/** Any generic metric per second. For instance: instructions per second, l2 misses per second **/
bool calculateMetricPerSec(reading_t & metric, uint64_t interval, unsigned int scaling_factor, reading_t & result) {
if(interval > 0) {
result.value = (metric.value / static_cast<float>(interval))*scaling_factor;
return getTimestampFromReadings(result.timestamp, metric);
}
return false; //Division by zero
}
bool calculateFrequency(reading_t & unhaltedRef, reading_t & unhaltedClocks,
unsigned int min_freq, unsigned int max_freq, reading_t & result) {
if(unhaltedRef.value > 0){
result.value = (unhaltedClocks.value / static_cast<float>(unhaltedRef.value)) * max_freq;
if(result.value > (max_freq * 1.1) || result.value < (min_freq*0.9)) { //There is something wrong here...
return false;
}
return getTimestampFromReadings(result.timestamp, unhaltedRef, unhaltedClocks);
}
return false; //Division by zero
}
#endif /* ANALYTICS_COMMONDERIVEDMETRICS_DERIVEDMETRICS_H_ */
......@@ -93,7 +93,7 @@ bool JobTSAggregatorConfigurator::readUnits(JobTSAggregatorOperator& op,
if(num_quantiles == 0){
return false;
}
AggregatorSensorBase quantsensor;
AggregatorSensorBase quantsensor("");
for(auto &sensor: protoOutputs){
if(sensor->getOperation() == AggregatorSensorBase::QTL){
quantsensor = *(sensor.get());
......
......@@ -28,8 +28,6 @@
#include "SKXPMUMetrics.h"
#include "../../includes/DerivedMetrics.h"
bool calculateFlops(reading_t &scalarDB, reading_t & scalarSP,
reading_t & packedDP128, reading_t & packedSP128,
......@@ -125,3 +123,37 @@ bool calculateMemoryBandwidth(std::vector<reading_t> membw_counts, reading_t & r
}
return ret_val;
}
/**
* For CPI, LoadsToStore, Branch rate, miss branch ratio, etc..
*/
bool calculateMetricRatio(reading_t & dividend, reading_t & divisor,
unsigned int scaling_factor, reading_t & result) {
if(divisor.value > 0){
result.value = (dividend.value / static_cast<float>(divisor.value))*scaling_factor;
return getTimestampFromReadings(result.timestamp, dividend, divisor);
}
return false; //Division by zero
}
/** Any generic metric per second. For instance: instructions per second, l2 misses per second **/
bool calculateMetricPerSec(reading_t & metric, uint64_t interval, unsigned int scaling_factor, reading_t & result) {
if(interval > 0) {
result.value = (metric.value / static_cast<float>(interval))*scaling_factor;
return getTimestampFromReadings(result.timestamp, metric);
}
return false; //Division by zero
}
bool calculateFrequency(reading_t & unhaltedRef, reading_t & unhaltedClocks,
unsigned int min_freq, unsigned int max_freq, reading_t & result) {
if(unhaltedRef.value > 0){
result.value = (unhaltedClocks.value / static_cast<float>(unhaltedRef.value)) * max_freq;
if(result.value > (max_freq * 1.1) || result.value < (min_freq*0.9)) { //There is something wrong here...
return false;
}
return getTimestampFromReadings(result.timestamp, unhaltedRef, unhaltedClocks);
}
return false; //Division by zero
}
......@@ -30,6 +30,18 @@
#include <vector>
#include "cacheentry.h"
template<typename ...Args>
bool getTimestampFromReadings(uint64_t & timestamp, Args&...args){
reading_t readings[] = {args...};
for(auto & reading: readings){
if(reading.timestamp != 0){
timestamp = reading.timestamp;
return true;
}
}
return false;
}
bool calculateFlops(reading_t &scalarDB, reading_t & scalarSP,
reading_t & packedDP128, reading_t & packedSP128,
reading_t & packedDP256, reading_t & packedSP256,
......@@ -61,6 +73,15 @@ bool calculateSP_TO_TOTAL_RATIO(reading_t &scalarDB, reading_t & scalarSP,
bool calculateL3HitToL3MissRatio(reading_t & l3_misses, reading_t& l3_load_hits,
reading_t & l3_load_misses, reading_t & result, unsigned int scaling_factor);
bool calculateMetricRatio(reading_t & dividend, reading_t & divisor,
unsigned int scaling_factor, reading_t & result);
/** Any generic metric per second. For instance: instructions per second, l2 misses per second **/
bool calculateMetricPerSec(reading_t & metric, uint64_t interval, unsigned int scaling_factor, reading_t & result) ;
bool calculateFrequency(reading_t & unhaltedRef, reading_t & unhaltedClocks,
unsigned int min_freq, unsigned int max_freq, reading_t & result);
bool calculateMemoryBandwidth(std::vector<reading_t> membw_counts, reading_t & result);
#endif /* ANALYTICS_ANALYZERS_SMUCNGPERFANALYZER_SKXDERIVEDMETRICS_SKXPMUMETRICS_H_ */
......@@ -27,6 +27,7 @@
#include "SMUCNGPerfConfigurator.h"
SMUCNGPerfConfigurator::SMUCNGPerfConfigurator() : OperatorConfiguratorTemplate(){
_operatorName = "supermucngperf";
_baseName = "sensor";
......
......@@ -40,7 +40,6 @@
#include "../../../common/include/logging.h"
#include "../../../common/include/sensorbase.h"
#include "../../../common/include/timestamp.h"
#include "../../includes/DerivedMetrics.h"
#include "../../includes/QueryEngine.h"
#include "../../includes/UnitTemplate.h"
#include "SKXPMUMetrics.h"
......
......@@ -30,6 +30,7 @@
#include "../../includes/OperatorTemplate.h"
#include "SMUCSensorBase.h"
#include "SKXPMUMetrics.h"
#include <map>
class SMUCNGPerfOperator: virtual public OperatorTemplate<SMUCSensorBase>{
......
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