Starting from 2021-07-01, all LRZ GitLab users will be required to explicitly accept the GitLab Terms of Service. Please see the detailed information at https://doku.lrz.de/display/PUBLIC/GitLab and make sure that your projects conform to the requirements.

SMUCSensorBase.h 4.8 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
//================================================================================
// Name        : SMUCSensorBase.h
// Author      : Carla Guillen
// Contact     : info@dcdb.it
// Copyright   : Leibniz Supercomputing Centre
// Description : Template implementing features to use Units in Operators.
//================================================================================

//================================================================================
// This file is part of DCDB (DataCenter DataBase)
// Copyright (C) 2018-2019 Leibniz Supercomputing Centre
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
//================================================================================
27

28 29
#ifndef ANALYTICS_SMUCNGPERF_SMUCSENSORBASE_H_
#define ANALYTICS_SMUCNGPERF_SMUCSENSORBASE_H_
30 31 32 33 34

#include "sensorbase.h"

class SMUCSensorBase : public SensorBase {
public:
35
	enum Metric_t {
36 37 38 39 40 41 42 43 44 45 46 47 48
		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,
49 50
		NETWORK_XMIT_BYTES=13,
		NETWORK_RCVD_BYTES=14,
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
		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,
71 72 73 74 75 76 77 78 79 80 81 82
		CAS_COUNT_READ0=35,
		CAS_COUNT_READ1=36,
		CAS_COUNT_READ2=37,
		CAS_COUNT_READ3=38,
		CAS_COUNT_READ4=39,
		CAS_COUNT_READ5=40,
		CAS_COUNT_WRITE0=41,
		CAS_COUNT_WRITE1=42,
		CAS_COUNT_WRITE2=43,
		CAS_COUNT_WRITE3=44,
		CAS_COUNT_WRITE4=45,
		CAS_COUNT_WRITE5=46,
83
		//
84 85 86 87 88 89 90 91 92
		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,
93 94
		INTRA_NODE_LOADIMBALANCE=59,
		INTER_NODE_LOADIMBALANCE=60,
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
		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,
114
		NETWORK_XMIT_BYTES_PER_PKT=80,
115
		NETWORK_BYTES_XMIT_PER_SECOND=81,
116
		NETWORK_RCV_BYTES_PER_PKT=82,
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
		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,
132
		NONE
133 134
	};
public:
135
	SMUCSensorBase(const std::string& name): SensorBase(name), _position(0), _metric(NONE) {}
136 137 138 139 140 141
	SMUCSensorBase(const SMUCSensorBase& other): SensorBase(other){
		copy(other);
	}
	SMUCSensorBase& operator=(const SMUCSensorBase& other){
 		SensorBase::operator=(other);
		copy(other);
Carla Guillen's avatar
Carla Guillen committed
142
		return *this;
143
	}
144
	virtual ~SMUCSensorBase(){}
145

146 147 148 149 150 151 152 153
	
	void setMetric(Metric_t metric){
		_metric = metric;
	}

	Metric_t getMetric(){
		return _metric;
	}
154

155 156 157 158 159 160 161 162
	unsigned int getPosition(){
		return _position;
	}

	void setPosition(unsigned int position){
		_position = position;
	}

163
private:
164
	unsigned int _position;
165 166 167 168 169 170
	Metric_t _metric;

	void copy(const SMUCSensorBase & other){
                _position = other._position;
                _metric = other._metric;
	}
171 172 173 174
};

using SMUCNGPtr = std::shared_ptr<SMUCSensorBase>;

175
#endif /* ANALYTICS_SMUCNGPERF_SMUCSENSORBASE_H_ */