Commit 54ae7b6b authored by Lubomir Riha's avatar Lubomir Riha
Browse files

ENH DAVIDE energy measurement on all available nodes #50

parent 3772c7c1
......@@ -22,9 +22,23 @@ void DAVIDE::init()
char hostname[50];
gethostname(hostname, 50);
MERIC_INFO << "Using hardcoded machine name due to problems with hostnames on DAVIDE\n";
std::string davideHostname = std::string(hostname);
std::string::iterator it = davideHostname.begin();
while (it != davideHostname.end() && !std::isdigit(*it))
++it;
if (!davideHostname.empty() || it != davideHostname.end())
{
int numero;
std::stringstream(std::string(it, davideHostname.end())) >> numero;
davideHostname = std::to_string(numero);
}
else
davideHostname = "";
node_n = "davide" + davideHostname;
//MERIC_INFO << "Using hardcoded machine name due to problems with hostnames on DAVIDE\n";
//node_n = std::string(hostname); //"davide43";
node_n = std::string("davide1");
//node_n = std::string("davide1");
MERIC_INFO << "Hostname : " << node_n << "\n";
metric = "power";
......
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