SMUCNGPerfOperator.h 2.43 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        : SMUCNGPerfOperator.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_SMUCNGPERFOPERATOR_H_
#define ANALYTICS_SMUCNGPERF_SMUCNGPERFOPERATOR_H_
30

31
#include "../../includes/OperatorTemplate.h"
32
#include "SMUCSensorBase.h"
33
34
#include <map>

35
class SMUCNGPerfOperator: virtual public OperatorTemplate<SMUCSensorBase>{
36
private:
37
	std::map<SMUCSensorBase::Metric_t, unsigned int> _metricToPosition;
38
39

public:
40
41
	SMUCNGPerfOperator(const std::string& name);
	virtual ~SMUCNGPerfOperator();
42
43
	SMUCNGPerfOperator(const SMUCNGPerfOperator& other);
	SMUCNGPerfOperator& operator=(const SMUCNGPerfOperator& other);
44
45
    void printConfig(LOG_LEVEL ll) override;

46
	void setMetricToPosition(const std::map<SMUCSensorBase::Metric_t,unsigned int>&metricToPosition) {
47
48
49
50
51
		_metricToPosition = metricToPosition;
	}

protected:
    virtual void compute(U_Ptr unit) override;
Carla Guillen Carias's avatar
Carla Guillen Carias committed
52
53
54
55
56
    vector<vector<reading_t>> _buffers;
	const unsigned int MAX_FREQ_MHZ = 2700;
	const unsigned int MIN_FREQ_MHZ = 1200;

	void resetBuffers();
Carla Guillen's avatar
Carla Guillen committed
57
	void query(const std::string & sensor_name, const uint64_t timestamp, vector<reading_t> &buffer);
58
59
};

60
#endif /* ANALYTICS_SMUCNGPERF_SMUCNGPERFOPERATOR_H_ */