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

Fixing small bug in configurator. SMUCSensorBase: giving numbers to all...

Fixing small bug in configurator. SMUCSensorBase: giving numbers to all Metrics (these will be used in the database as ids). Operator: changing some logs.
parent 699bdff9
include ../config.mk
#include ../common.mk
CXXFLAGS += -DBOOST_NETWORK_ENABLE_HTTPS -I../common/include -I$(DCDBDEPLOYPATH)/include -I$(DCDBDEPLOYPATH)/include/opencv4
CXXFLAGS += -DBOOST_NETWORK_ENABLE_HTTPS -I../common/include -I$(DCDBDEPLOYPATH)/include -I$(DCDBDEPLOYPATH)/include/opencv4 -I$(DCDBDEPLOYPATH)/include/mariadb
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 persystsql
......@@ -62,5 +63,5 @@ libdcdboperator_smucngperf.$(LIBEXT): operators/smucngperf/SMUCNGPerfOperator.o
$(CXX) $(LIBFLAGS)$@ -o $@ $^ -L$(DCDBDEPLOYPATH)/lib/ -lboost_log -lboost_system -lboost_regex
libdcdboperator_persystsql.$(LIBEXT): operators/persystsql/PerSystSqlOperator.o operators/persystsql/PerSystSqlConfigurator.o operators/persystsql/PerSystDB.o ../common/src/sensornavigator.o
$(CXX) $(LIBFLAGS)$@ -o $@ $^ -L$(DCDBDEPLOYPATH)/lib/ -lboost_log -lboost_system -lboost_regex
$(CXX) $(LIBFLAGS)$@ -o $@ $^ -L$(DCDBDEPLOYPATH)/lib/ -L$(DCDBDEPLOYPATH)/lib/mariadb/ -lboost_log -lboost_system -lboost_regex -lmariadb
......@@ -36,32 +36,40 @@ SMUCNGPerfConfigurator::SMUCNGPerfConfigurator() : OperatorConfiguratorTemplate(
SMUCNGPerfConfigurator::~SMUCNGPerfConfigurator() {
}
bool endsWith (std::string const &fullString, std::string const &ending) {
if (fullString.length() >= ending.length()) {
return (0 == fullString.compare (fullString.length() - ending.length(), ending.length(), ending));
} else {
return false;
}
}
void SMUCNGPerfConfigurator::sensorBase(SMUCSensorBase& s, CFG_VAL config) {
BOOST_FOREACH(boost::property_tree::iptree::value_type &val, config) {
if (boost::iequals(val.first, "position")) {
unsigned int position = std::stoul(val.second.data());
s.setPosition(position);
std::string name = s.getName();
if(name.find("instructions") != std::string::npos) {
if(endsWith(name, "instructions")) {
_metricToPosition[SMUCSensorBase::INSTRUCTIONS] = position;
s.setMetric(SMUCSensorBase::INSTRUCTIONS);
} else if(name.find("clocks") != std::string::npos) {
} else if(endsWith(name, "clocks") && !endsWith(name, "ref_clocks")) {
_metricToPosition[SMUCSensorBase::CLOCKS] = position;
s.setMetric(SMUCSensorBase::CLOCKS);
} else if(name.find("ref_clocks") != std::string::npos) {
} else if(endsWith(name, "ref_clocks") ) {
_metricToPosition[SMUCSensorBase::CLOCKS_REF] = position;
s.setMetric(SMUCSensorBase::CLOCKS_REF);
} else if(name.find("cpi") != std::string::npos) {
} else if(endsWith(name, "cpi")) {
_metricToPosition[SMUCSensorBase::CPI] = position;
s.setMetric(SMUCSensorBase::CPI);
} else if(name.find("frequency") != std::string::npos) {
} else if(endsWith(name, "frequency")) {
_metricToPosition[SMUCSensorBase::FREQUENCY] = position;
s.setMetric(SMUCSensorBase::FREQUENCY);
} else if(endsWith(name, "instructionsps")) {
_metricToPosition[SMUCSensorBase::INSTRUCTIONS_PER_SECOND] = position;
s.setMetric(SMUCSensorBase::INSTRUCTIONS_PER_SECOND);
}
} else if (boost::iequals(val.first, "scaling_factor")){
unsigned int scaling_factor = std::stoul(val.second.data());
s.setScalingFactor(scaling_factor);
}
}
}
}
......
......@@ -86,7 +86,7 @@ void SMUCNGPerfOperator::copy(const SMUCNGPerfOperator& other){
void SMUCNGPerfOperator::printConfig(LOG_LEVEL ll) {
OperatorTemplate<SMUCSensorBase>::printConfig(ll);
LOG_VAR(ll) << " metric to position map: ";
LOG_VAR(ll) << "Metric to position map size(" << _metricToPosition.size() << "):";
for(auto &kv : _metricToPosition){
LOG_VAR(ll) << "Metric = " << kv.first << " Position = " << kv.second;
}
......
......@@ -33,94 +33,94 @@
class SMUCSensorBase : public SensorBase {
public:
enum Metric_t {
INSTRUCTIONS,
CLOCKS,
CLOCKS_REF,
USERPCT,
SYSTEMPCT,
IOWAITPCT,
MEMINFO,
IOBYTESREAD,
IOBYTESWRITE,
IOOPENS,
IOCLOSES,
IOREADS,
IOWRITES,
NETWORK_XMIT,
NETWORK_RCVD,
NETWORK_XMIT_PKTS,
NETWORK_RCVD_PKTS,
L2_RQSTS_MISS,
ARITH_FPU_DIVIDER_ACTIVE,
FP_ARITH_SCALAR_DOUBLE,
FP_ARITH_SCALAR_SINGLE,
FP_ARITH_128B_PACKED_DOUBLE,
FP_ARITH_128B_PACKED_SINGLE,
FP_ARITH_256B_PACKED_DOUBLE,
FP_ARITH_256B_PACKED_SINGLE,
FP_ARITH_512B_PACKED_DOUBLE,
FP_ARITH_512B_PACKED_SINGLE,
MEM_INST_RETIRED_ALL_LOADS,
MEM_INST_RETIRED_ALL_STORES,
MEM_LOAD_UOPS_RETIRED_L3_MISS,
MEM_LOAD_RETIRED_L3_HIT,
MEM_LOAD_RETIRED_L3_MISS,
PERF_COUNT_HW_BRANCH_INSTRUCTIONS,
PERF_COUNT_HW_BRANCH_MISSES,
CORE_TEMPERATURE,
INSTRUCTIONS=0,
CLOCKS=1,
CLOCKS_REF=2,
USERPCT=3,
SYSTEMPCT=4,
IOWAITPCT=5,
MEMINFO=6,
IOBYTESREAD=7,
IOBYTESWRITE=8,
IOOPENS=9,
IOCLOSES=10,
IOREADS=11,
IOWRITES=12,
NETWORK_XMIT=13,
NETWORK_RCVD=14,
NETWORK_XMIT_PKTS=15,
NETWORK_RCVD_PKTS=16,
L2_RQSTS_MISS=17,
ARITH_FPU_DIVIDER_ACTIVE=18,
FP_ARITH_SCALAR_DOUBLE=19,
FP_ARITH_SCALAR_SINGLE=20,
FP_ARITH_128B_PACKED_DOUBLE=21,
FP_ARITH_128B_PACKED_SINGLE=22,
FP_ARITH_256B_PACKED_DOUBLE=23,
FP_ARITH_256B_PACKED_SINGLE=24,
FP_ARITH_512B_PACKED_DOUBLE=25,
FP_ARITH_512B_PACKED_SINGLE=26,
MEM_INST_RETIRED_ALL_LOADS=27,
MEM_INST_RETIRED_ALL_STORES=28,
MEM_LOAD_UOPS_RETIRED_L3_MISS=29,
MEM_LOAD_RETIRED_L3_HIT=30,
MEM_LOAD_RETIRED_L3_MISS=31,
PERF_COUNT_HW_BRANCH_INSTRUCTIONS=32,
PERF_COUNT_HW_BRANCH_MISSES=33,
CORE_TEMPERATURE=34,
//
CPI,
FREQUENCY,
INSTRUCTIONS_PER_SECOND,
FLOPS,
PACKED_FLOPS,
AVX512_TOVECTORIZED_RATIO, //AVX512/(TOTAL VECTORIZED)
VECTORIZED_RATIO, //(TOTAL VECTORIZED)/(ALL FLOPS)
SINGLE_PRECISION_TO_TOTAL_RATIO, //Flops
EXPENSIVE_INSTRUCTIONS_PER_SECOND,
INSTR_INTRA_NODE_LOADIMBALANCE,
INSTR_INTER_NODE_LOADIMBALANCE,
L2_HITS_PER_SECOND,
L2_MISSES_PER_SECOND,
L3_HITS_PER_SECOND,
L3_MISSES_PER_SECOND,
L3_TO_INSTRUCTIONS_RATIO,
L3_BANDWIDTH,
L3HIT_TO_L3MISS_RATIO,
LOADS_TO_STORES,
LOADS_TOL3MISS_RATIO,
MISSBRANCHES_PER_SECOND,
BRANCH_PER_INSTRUCTIONS,
MISSBRANCHES_TO_TOTAL_BRANCH_RATIO,
MEMORY_BANDWIDTH,
RAPL_PKG,
RAPL_MEM,
IPMI_CPU,
IPMI_MEM,
IPMI_DC,
IPMI_AC,
NETWORK_XMIT_BYTES_PER_OP,
NETWORK_BYTES_XMIT_PER_SECOND,
NETWORK_RCV_BYTES_PER_OP,
NETWORK_BYTES_RCVD_PER_SECOND,
IOOPENS_PER_SECOND,
IOCLOSES_PER_SECOND,
IOBYTESREAD_PER_SECOND,
IOBYTESWRITE_PER_SECOND,
IOREADS_PER_SECOND,
IOWRITES_PER_SECOND,
IO_BYTES_READ_PER_OP,
IO_BYTES_WRITE_PER_OP,
IOBYTESREAD_PER_SECOND_PROF,
IOBYTESWRITE_PER_SECOND_PROF,
IOREADS_PER_SECOND_PROF,
IOWRITES_PER_SECOND_PROF,
IO_BYTES_READ_PER_OP_PROF,
IO_BYTES_WRITE_PER_OP_PROF,
CPI=50,
FREQUENCY=51,
INSTRUCTIONS_PER_SECOND=52,
FLOPS=53,
PACKED_FLOPS=54,
AVX512_TOVECTORIZED_RATIO=55, //AVX512/(TOTAL VECTORIZED)
VECTORIZED_RATIO=56, //(TOTAL VECTORIZED)/(ALL FLOPS)
SINGLE_PRECISION_TO_TOTAL_RATIO=57, //Flops
EXPENSIVE_INSTRUCTIONS_PER_SECOND=58,
INSTR_INTRA_NODE_LOADIMBALANCE=59,
INSTR_INTER_NODE_LOADIMBALANCE=60,
L2_HITS_PER_SECOND=61,
L2_MISSES_PER_SECOND=62,
L3_HITS_PER_SECOND=63,
L3_MISSES_PER_SECOND=64,
L3_TO_INSTRUCTIONS_RATIO=65,
L3_BANDWIDTH=66,
L3HIT_TO_L3MISS_RATIO=67,
LOADS_TO_STORES=68,
LOADS_TOL3MISS_RATIO=69,
MISSBRANCHES_PER_SECOND=70,
BRANCH_PER_INSTRUCTIONS=71,
MISSBRANCHES_TO_TOTAL_BRANCH_RATIO=72,
MEMORY_BANDWIDTH=73,
RAPL_PKG=74,
RAPL_MEM=75,
IPMI_CPU=76,
IPMI_MEM=77,
IPMI_DC=78,
IPMI_AC=79,
NETWORK_XMIT_BYTES_PER_OP=80,
NETWORK_BYTES_XMIT_PER_SECOND=81,
NETWORK_RCV_BYTES_PER_OP=82,
NETWORK_BYTES_RCVD_PER_SECOND=83,
IOOPENS_PER_SECOND=84,
IOCLOSES_PER_SECOND=85,
IOBYTESREAD_PER_SECOND=86,
IOBYTESWRITE_PER_SECOND=87,
IOREADS_PER_SECOND=88,
IOWRITES_PER_SECOND=89,
IO_BYTES_READ_PER_OP=90,
IO_BYTES_WRITE_PER_OP=91,
IOBYTESREAD_PER_SECOND_PROF=92,
IOBYTESWRITE_PER_SECOND_PROF=93,
IOREADS_PER_SECOND_PROF=94,
IOWRITES_PER_SECOND_PROF=95,
IO_BYTES_READ_PER_OP_PROF=96,
IO_BYTES_WRITE_PER_OP_PROF=97,
NONE
};
public:
SMUCSensorBase(const std::string& name): SensorBase(name), _scaling_factor(1), _position(0), _metric(NONE) {}
SMUCSensorBase(const std::string& name): SensorBase(name), _position(0), _metric(NONE) {}
SMUCSensorBase(const SMUCSensorBase& other): SensorBase(other){
copy(other);
}
......@@ -132,14 +132,6 @@ public:
virtual ~SMUCSensorBase(){}
unsigned int getScalingFactor() const {
return _scaling_factor;
}
void setScalingFactor(unsigned int scalingFactor) {
_scaling_factor = scalingFactor;
}
void setMetric(Metric_t metric){
_metric = metric;
}
......@@ -157,12 +149,10 @@ public:
}
private:
unsigned int _scaling_factor;
unsigned int _position;
Metric_t _metric;
void copy(const SMUCSensorBase & other){
_scaling_factor = other._scaling_factor;
_position = other._position;
_metric = other._metric;
}
......
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