Commit c94e3e18 authored by Alessio Netti's avatar Alessio Netti

Minor changes to NVML plugin

- Fixing warnings here and there
parent ffc43863
......@@ -72,11 +72,14 @@ nvmlSensorGroup& nvmlSensorGroup::operator=(const nvmlSensorGroup& other) {
}
void nvmlSensorGroup::execOnInit() {
nvmlReturn_t err;
err = nvmlInit();
err = nvmlDeviceGetHandleByIndex(0,&(env.device));
err = nvmlDeviceGetTotalEnergyConsumption(env.device,&(counters.energy_initial));
if(err != NVML_SUCCESS) {
LOG(warning) << "Sensorgroup " << _groupName << ": NVML error during initialization!";
}
}
bool nvmlSensorGroup::execOnStart() {
......@@ -92,7 +95,7 @@ void nvmlSensorGroup::read() {
reading_t reading;
reading.timestamp = getTimestamp();
reading.value = 0;
nvmlReturn_t err;
nvmlReturn_t err = NVML_SUCCESS;
unsigned long long temp;
try {
for(auto s : _sensors) {
......@@ -173,14 +176,14 @@ void nvmlSensorGroup::read() {
if(err == NVML_SUCCESS) {
s->storeReading(reading);
} else {
LOG(error) << "Sensorgroup" << _groupName << " could not read " << s->getName() << ": NVML error!";
LOG(error) << "Sensorgroup " << _groupName << " could not read " << s->getName() << ": NVML error!";
}
#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();
LOG(error) << "Sensorgroup " << _groupName << " could not read value: " << e.what();
}
}
......
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