Skip to content

Commit b4bcff9

Browse files
author
Simon Pickartz
authored
Merge pull request #57 from lrr-tum/mmbwmon_init_measurement
system_info message added to mmbwmon.
2 parents d5616e6 + 61ca2f6 commit b4bcff9

File tree

8 files changed

+92
-8
lines changed

8 files changed

+92
-8
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ set(HEADERS
134134
"${CMAKE_CURRENT_SOURCE_DIR}/include/fast-lib/message/agent/mmbwmon/reply.hpp"
135135
"${CMAKE_CURRENT_SOURCE_DIR}/include/fast-lib/message/agent/mmbwmon/stop.hpp"
136136
"${CMAKE_CURRENT_SOURCE_DIR}/include/fast-lib/message/agent/mmbwmon/restart.hpp"
137+
"${CMAKE_CURRENT_SOURCE_DIR}/include/fast-lib/message/agent/mmbwmon/system_info.hpp"
137138
"${CMAKE_CURRENT_SOURCE_DIR}/include/fast-lib/message/migfra/pci_id.hpp"
138139
"${CMAKE_CURRENT_SOURCE_DIR}/include/fast-lib/message/migfra/ivshmem.hpp"
139140
"${CMAKE_CURRENT_SOURCE_DIR}/include/fast-lib/message/migfra/time_measurement.hpp"
@@ -154,6 +155,7 @@ set(SRC
154155
"${CMAKE_CURRENT_SOURCE_DIR}/src/message/agent/mmbwmon/reply.cpp"
155156
"${CMAKE_CURRENT_SOURCE_DIR}/src/message/agent/mmbwmon/stop.cpp"
156157
"${CMAKE_CURRENT_SOURCE_DIR}/src/message/agent/mmbwmon/restart.cpp"
158+
"${CMAKE_CURRENT_SOURCE_DIR}/src/message/agent/mmbwmon/system_info.cpp"
157159
"${CMAKE_CURRENT_SOURCE_DIR}/src/message/migfra/pci_id.cpp"
158160
"${CMAKE_CURRENT_SOURCE_DIR}/src/message/migfra/ivshmem.cpp"
159161
"${CMAKE_CURRENT_SOURCE_DIR}/src/message/migfra/time_measurement.cpp"
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/*
2+
* This file is part of fast-lib.
3+
* Copyright (C) 2017 Jens Breitbart
4+
*
5+
* This file is licensed under the GNU Lesser General Public License Version 3
6+
* Version 3, 29 June 2007. For details see 'LICENSE.md' in the root directory.
7+
*/
8+
9+
#ifndef FAST_LIB_MESSAGE_AGENT_MMBWMON_SYSTEM_INFO
10+
#define FAST_LIB_MESSAGE_AGENT_MMBWMON_SYSTEM_INFO
11+
12+
#include <fast-lib/serializable.hpp>
13+
14+
#include <map>
15+
#include <string>
16+
#include <vector>
17+
18+
namespace fast {
19+
namespace msg {
20+
namespace agent {
21+
namespace mmbwmon {
22+
23+
/**
24+
* topic: fast/agent/<hostname>/task/mmbwmon/system_info
25+
* Payload
26+
* task: mmbwmon system info
27+
* threads: <number of threads>
28+
* smt: <smt factor> (eg 2 on normal Xeon)
29+
* numa: <number of NUMA domains>
30+
* bandwidth: <measured memory bandwidth in compact,1 mode> (in GBytes/s)
31+
*/
32+
33+
struct system_info : public fast::Serializable
34+
{
35+
system_info() = default;
36+
system_info(const size_t _threads, const size_t _smt, const size_t _numa, const std::vector<double> &_membw);
37+
38+
YAML::Node emit() const override;
39+
void load(const YAML::Node &node) override;
40+
41+
size_t threads;
42+
size_t smt;
43+
size_t numa;
44+
std::vector<double> membw;
45+
};
46+
47+
}
48+
}
49+
}
50+
}
51+
52+
YAML_CONVERT_IMPL(fast::msg::agent::mmbwmon::system_info)
53+
54+
#endif

src/message/agent/mmbwmon/ack.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ namespace mmbwmon {
99
YAML::Node ack::emit() const
1010
{
1111
YAML::Node node;
12-
node["task"] = "mmbwmon ack";
1312
return node;
1413
}
1514

src/message/agent/mmbwmon/reply.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ reply::reply(const std::vector<size_t> &_cores, double _result) : cores(_cores),
1212
YAML::Node reply::emit() const
1313
{
1414
YAML::Node node;
15-
node["task"] = "mmbwmon response";
1615
node["cores"] = cores;
17-
node["result"] = result;
16+
node["result"] = result;
1817
return node;
1918
}
2019

src/message/agent/mmbwmon/request.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ request::request(const std::vector<size_t> &_cores) : cores(_cores)
1212
YAML::Node request::emit() const
1313
{
1414
YAML::Node node;
15-
node["task"] = "mmbwmon request";
1615
node["cores"] = cores;
1716
return node;
1817
}

src/message/agent/mmbwmon/restart.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ restart::restart(const std::string _cgroup) : cgroup(_cgroup)
1212
YAML::Node restart::emit() const
1313
{
1414
YAML::Node node;
15-
node["task"] = "mmbwmon restart";
16-
node["cgroup"] = cgroup;
15+
node["cgroup"] = cgroup;
1716
return node;
1817
}
1918

src/message/agent/mmbwmon/stop.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ stop::stop(const std::string _cgroup) : cgroup(_cgroup)
1212
YAML::Node stop::emit() const
1313
{
1414
YAML::Node node;
15-
node["task"] = "mmbwmon stop";
16-
node["cgroup"] = cgroup;
15+
node["cgroup"] = cgroup;
1716
return node;
1817
}
1918

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#include <fast-lib/message/agent/mmbwmon/system_info.hpp>
2+
3+
namespace fast {
4+
namespace msg {
5+
namespace agent {
6+
namespace mmbwmon {
7+
8+
system_info::system_info(const size_t _threads, const size_t _smt, const size_t _numa, const std::vector<double> &_membw): threads(_threads), smt(_smt), numa(_numa), membw(_membw)
9+
{
10+
}
11+
12+
YAML::Node system_info::emit() const
13+
{
14+
YAML::Node node;
15+
node["threads"] = threads;
16+
node["smt"] = smt;
17+
node["numa"] = numa;
18+
node["bandwidth"] = membw;
19+
return node;
20+
}
21+
22+
void system_info::load(const YAML::Node &node)
23+
{
24+
fast::load(threads, node["threads"]);
25+
fast::load(smt, node["smt"]);
26+
fast::load(numa, node["numa"]);
27+
fast::load(membw, node["bandwidth"]);
28+
}
29+
30+
}
31+
}
32+
}
33+
}

0 commit comments

Comments
 (0)