Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
dcdb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
7
Issues
7
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
dcdb
dcdb
Commits
4a2c30e1
Commit
4a2c30e1
authored
Feb 11, 2020
by
Weronika
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed the intial version of the nvml plugin
parent
7201e142
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
486 additions
and
1 deletion
+486
-1
config.mk
config.mk
+1
-1
dcdbpusher/Makefile
dcdbpusher/Makefile
+4
-0
dcdbpusher/sensors/nvml/nvmlConfigurator.cpp
dcdbpusher/sensors/nvml/nvmlConfigurator.cpp
+68
-0
dcdbpusher/sensors/nvml/nvmlConfigurator.h
dcdbpusher/sensors/nvml/nvmlConfigurator.h
+65
-0
dcdbpusher/sensors/nvml/nvmlSensorBase.h
dcdbpusher/sensors/nvml/nvmlSensorBase.h
+106
-0
dcdbpusher/sensors/nvml/nvmlSensorGroup.cpp
dcdbpusher/sensors/nvml/nvmlSensorGroup.cpp
+170
-0
dcdbpusher/sensors/nvml/nvmlSensorGroup.h
dcdbpusher/sensors/nvml/nvmlSensorGroup.h
+72
-0
No files found.
config.mk
View file @
4a2c30e1
...
...
@@ -3,7 +3,7 @@ DCDBDEPSPATH ?= $(DCDBBASEPATH)/deps
DCDBDEPLOYPATH
?=
$(DCDBBASEPATH)
/install
# dcdbpusher plugins to be built
PLUGINS
=
sysfs perfevent ipmi pdu bacnet snmp procfs tester gpfsmon opa msr
PLUGINS
=
sysfs perfevent ipmi pdu bacnet snmp procfs tester gpfsmon opa msr
nvml
# data analytics plugins to be built
OPERATORS
=
aggregator smoothing regressor clustering job_aggregator testeroperator filesink smucngperf persystsql
...
...
dcdbpusher/Makefile
View file @
4a2c30e1
...
...
@@ -117,3 +117,7 @@ libdcdbplugin_msr.$(LIBEXT): sensors/msr/MSRSensorGroup.o sensors/msr/MSRConfigu
libdcdbplugin_caliper.$(LIBEXT)
:
sensors/caliper/CaliperSensorGroup.o sensors/caliper/CaliperConfigurator.o
$(CXX)
$(LIBFLAGS)$@
-o
$@
$^
-L
$(DCDBDEPLOYPATH)
/lib/
-lboost_log
-lboost_system
# nvcc compiler and extra flags to enable the linking and creating of .so file to work:
libdcdbplugin_nvml.$(LIBEXT)
:
sensors/nvml/nvmlSensorGroup.o sensors/nvml/nvmlConfigurator.o
$(NVCC)
-shared
--compiler-options
'-fPIC'
-o
$@
$^
-L
$(DCDBDEPLOYPATH)
/lib/
-lboost_log
-lboost_system
-lnvidia-ml
dcdbpusher/sensors/nvml/nvmlConfigurator.cpp
0 → 100644
View file @
4a2c30e1
//================================================================================
// Name : nvmlConfigurator.cpp
// Author : Weronika Filinger, EPCC @ The University of Edinburgh
// Contact :
// Copyright :
// Description : Source file for nvml plugin configurator class.
//================================================================================
//================================================================================
// This file is part of DCDB (DataCenter DataBase)
// Copyright (C) 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.
//================================================================================
#include "nvmlConfigurator.h"
nvmlConfigurator
::
nvmlConfigurator
()
{
/*
* TODO
* If you want sensor or group to be named differently in the config file, you can change it here
*/
_groupName
=
"group"
;
_baseName
=
"sensor"
;
}
nvmlConfigurator
::~
nvmlConfigurator
()
{}
void
nvmlConfigurator
::
sensorBase
(
nvmlSensorBase
&
s
,
CFG_VAL
config
)
{
ADD
{
/*
* TODO
* Add ATTRIBUTE macros for sensorBase attributes
*/
//ATTRIBUTE("attributeName", attributeSetter);
}
}
void
nvmlConfigurator
::
sensorGroup
(
nvmlSensorGroup
&
s
,
CFG_VAL
config
)
{
ADD
{
/*
* TODO
* Add ATTRIBUTE macros for sensorGroup attributes
*/
}
}
void
nvmlConfigurator
::
printConfiguratorConfig
(
LOG_LEVEL
ll
)
{
/*
* TODO
* Log attributes here for debug reasons or delete this method if there are
* not attributes to log.
*/
LOG_VAR
(
ll
)
<<
" NumSpacesAsIndention: "
<<
2
;
}
dcdbpusher/sensors/nvml/nvmlConfigurator.h
0 → 100644
View file @
4a2c30e1
//================================================================================
// Name : nvmlConfigurator.h
// Author : Weronika Filinger, EPCC @ The University of Edinburgh
// Contact :
// Copyright :
// Description : Header file for nvml plugin configurator class.
//================================================================================
//================================================================================
// This file is part of DCDB (DataCenter DataBase)
// Copyright (C) 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.
//================================================================================
#ifndef NVML_NVMLCONFIGURATOR_H_
#define NVML_NVMLCONFIGURATOR_H_
#include "../../includes/ConfiguratorTemplate.h"
#include "nvmlSensorGroup.h"
/**
* @brief ConfiguratorTemplate specialization for this plugin.
*
* @ingroup nvml
*/
class
nvmlConfigurator
:
public
ConfiguratorTemplate
<
nvmlSensorBase
,
nvmlSensorGroup
>
{
public:
nvmlConfigurator
();
virtual
~
nvmlConfigurator
();
protected:
/* Overwritten from ConfiguratorTemplate */
void
sensorBase
(
nvmlSensorBase
&
s
,
CFG_VAL
config
)
override
;
void
sensorGroup
(
nvmlSensorGroup
&
s
,
CFG_VAL
config
)
override
;
//TODO implement if required
//void global(CFG_VAL config) override;
//void derivedSetGlobalSettings(const pluginSettings_t& pluginSettings) override;
virtual
void
printConfiguratorConfig
(
LOG_LEVEL
ll
)
final
override
;
};
extern
"C"
ConfiguratorInterface
*
create
()
{
return
new
nvmlConfigurator
;
}
extern
"C"
void
destroy
(
ConfiguratorInterface
*
c
)
{
delete
c
;
}
#endif
/* NVML_NVMLCONFIGURATOR_H_ */
dcdbpusher/sensors/nvml/nvmlSensorBase.h
0 → 100644
View file @
4a2c30e1
//================================================================================
// Name : nvmlSensorBase.h
// Author : Weronika Filinger, EPCC @ The University of Edinburgh
// Contact :
// Copyright :
// Description : Sensor base class for nvml plugin.
//================================================================================
//================================================================================
// This file is part of DCDB (DataCenter DataBase)
// Copyright (C) 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.
//================================================================================
/**
* @defgroup nvml nvml plugin
* @ingroup pusherplugins
*
* @brief Describe your plugin in one sentence
*/
#ifndef NVML_NVMLSENSORBASE_H_
#define NVML_NVMLSENSORBASE_H_
#include "sensorbase.h"
/*
* TODO
* Add plugin specific includes
*/
/**
* @brief SensorBase specialization for this plugin.
*
* @ingroup nvml
*/
class
nvmlSensorBase
:
public
SensorBase
{
public:
nvmlSensorBase
(
const
std
::
string
&
name
)
:
SensorBase
(
name
)
{
/*
* TODO
* Initialize plugin specific attributes
*/
}
nvmlSensorBase
(
const
nvmlSensorBase
&
other
)
:
SensorBase
(
other
)
{
/*
* TODO
* Copy construct plugin specific attributes
*/
}
virtual
~
nvmlSensorBase
()
{
/*
* TODO
* If necessary, deconstruct plugin specific attributes
*/
}
nvmlSensorBase
&
operator
=
(
const
nvmlSensorBase
&
other
)
{
SensorBase
::
operator
=
(
other
);
/*
* TODO
* Implement assignment operator for plugin specific attributes
*/
return
*
this
;
}
/*
* TODO
* Getters and Setters for plugin specific attributes
*/
void
printConfig
(
LOG_LEVEL
ll
,
LOGGER
&
lg
,
unsigned
leadingSpaces
=
16
)
{
/*
* TODO
* Log attributes here for debug reasons
*/
LOG_VAR
(
ll
)
<<
" NumSpacesAsIndention: "
<<
5
;
}
protected:
/*
* TODO
* Add plugin specific attributes here
*/
};
#endif
/* NVML_NVMLSENSORBASE_H_ */
dcdbpusher/sensors/nvml/nvmlSensorGroup.cpp
0 → 100644
View file @
4a2c30e1
//================================================================================
// Name : nvmlSensorGroup.cpp
// Author : Fiona Reid, Weronika Filinger, EPCC @ The University of Edinburgh
// Contact :
// Copyright :
// Description : Source file for nvml sensor group class.
//================================================================================
//================================================================================
// This file is part of DCDB (DataCenter DataBase)
// Copyright (C) 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.
//================================================================================
#include "nvmlSensorGroup.h"
#include "timestamp.h"
// Used to ensure we get a sensible value of energy by computing the difference
// between calls to the read function
static
int
isfirsttime
=
0
;
// We need the energy values to be global too
unsigned
long
long
energy_initial
;
unsigned
long
long
energy_current
;
unsigned
long
long
energy_previous
;
// FR defn of env was global in our test case
struct
env_t
{
nvmlDevice_t
device
;
}
env
;
// FR
nvmlSensorGroup
::
nvmlSensorGroup
(
const
std
::
string
&
name
)
:
SensorGroupTemplate
(
name
)
{
/*
* TODO
* Construct attributes
*/
}
nvmlSensorGroup
::
nvmlSensorGroup
(
const
nvmlSensorGroup
&
other
)
:
SensorGroupTemplate
(
other
)
{
/*
* TODO
* Copy construct attributes
*/
}
nvmlSensorGroup
::~
nvmlSensorGroup
()
{
/*
* TODO
* Tear down attributes
*/
}
nvmlSensorGroup
&
nvmlSensorGroup
::
operator
=
(
const
nvmlSensorGroup
&
other
)
{
SensorGroupTemplate
::
operator
=
(
other
);
/*
* TODO
* Implement assignment operator
*/
return
*
this
;
}
void
nvmlSensorGroup
::
execOnInit
()
{
/*
* TODO
* Implement one time initialization logic for this group here
* (e.g. allocate memory for buffer) or remove this method if not
* required.
*/
// FR Add the contents of init_environment in here
nvmlReturn_t
err
;
err
=
nvmlInit
();
err
=
nvmlDeviceGetHandleByIndex
(
0
,
&
(
env
.
device
));
err
=
nvmlDeviceGetTotalEnergyConsumption
(
env
.
device
,
&
(
energy_initial
));
// FR
}
bool
nvmlSensorGroup
::
execOnStart
()
{
/*
* TODO
* Implement logic before the group starts polling here
* (e.g. open a file descriptor) or remove this method if not required.
*/
// FR
cudaError_t
cerr
;
cerr
=
cudaProfilerStart
();
// FR
return
true
;
}
void
nvmlSensorGroup
::
execOnStop
()
{
/*
* TODO
* Implement logic when the group stops polling here
* (e.g. close a file descriptor) or remove this method if not required.
*/
// FR
cudaError_t
cerr
;
cerr
=
cudaProfilerStop
();
// FR
}
void
nvmlSensorGroup
::
read
()
{
reading_t
reading
;
reading
.
timestamp
=
getTimestamp
();
// FR
nvmlReturn_t
err
;
unsigned
long
long
temp
;
// FR
try
{
for
(
auto
s
:
_sensors
)
{
// reading.value = /*
// * TODO
// * Read a value for every sensor affiliated with this group and store
// * it with the appropriate sensor.
// */ 0;
// FR
// Need to measure the difference in energy used between calls to the read function
if
(
isfirsttime
==
0
){
// First time through we use the initial value to set previous and get the new energy into current
energy_previous
=
energy_initial
;
err
=
nvmlDeviceGetTotalEnergyConsumption
(
env
.
device
,
&
(
energy_current
));
isfirsttime
=
1
;
}
else
{
// Otherwise, set previous energy to whatever it was before and get the new value
energy_previous
=
energy_current
;
err
=
nvmlDeviceGetTotalEnergyConsumption
(
env
.
device
,
&
(
energy_current
));
}
temp
=
energy_current
-
energy_previous
;
// Take difference and compute energy in millijoules
// You might want to consider putting this in the else block so we always measure something?
reading
.
value
=
temp
;
// FR
s
->
storeReading
(
reading
);
#ifdef DEBUG
LOG
(
debug
)
<<
_groupName
<<
"::"
<<
s
->
getName
()
<<
" raw reading:
\"
"
<<
reading
.
value
<<
"
\"
"
;
#endif
}
}
catch
(
const
std
::
exception
&
e
)
{
LOG
(
error
)
<<
"Sensorgroup"
<<
_groupName
<<
" could not read value: "
<<
e
.
what
();
}
}
void
nvmlSensorGroup
::
printGroupConfig
(
LOG_LEVEL
ll
,
unsigned
int
leadingSpaces
)
{
/*
* TODO
* Log attributes here for debug reasons
*/
LOG_VAR
(
ll
)
<<
" NumSpacesAsIndention: "
<<
12
;
}
dcdbpusher/sensors/nvml/nvmlSensorGroup.h
0 → 100644
View file @
4a2c30e1
//================================================================================
// Name : nvmlSensorGroup.h
// Author : Fiona Reid, Weronika Filinger, EPCC @ The University of Edinburgh
// Contact :
// Copyright :
// Description : Header file for nvml sensor group class.
//================================================================================
//================================================================================
// This file is part of DCDB (DataCenter DataBase)
// Copyright (C) 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.
//================================================================================
#ifndef NVML_NVMLSENSORGROUP_H_
#define NVML_NVMLSENSORGROUP_H_
#include "../../includes/SensorGroupTemplate.h"
#include "nvmlSensorBase.h"
// FR Include files needed for NVML etc
#include <nvml.h>
#include <cuda_profiler_api.h>
// FR
/**
* @brief SensorGroupTemplate specialization for this plugin.
*
* @ingroup nvml
*/
class
nvmlSensorGroup
:
public
SensorGroupTemplate
<
nvmlSensorBase
>
{
public:
nvmlSensorGroup
(
const
std
::
string
&
name
);
nvmlSensorGroup
(
const
nvmlSensorGroup
&
other
);
virtual
~
nvmlSensorGroup
();
nvmlSensorGroup
&
operator
=
(
const
nvmlSensorGroup
&
other
);
void
execOnInit
()
final
override
;
bool
execOnStart
()
final
override
;
void
execOnStop
()
final
override
;
/*
* TODO
* Add getter and setters for group attributes if required
*/
void
printGroupConfig
(
LOG_LEVEL
ll
,
unsigned
int
leadingSpaces
)
final
override
;
private:
void
read
()
final
override
;
/*
* TODO
* Add group internal attributes
*/
};
#endif
/* NVML_NVMLSENSORGROUP_H_ */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment