25 #include <TGraphAsymmErrors.h>
26 #include <TGraphErrors.h>
30 #include <TMultiGraph.h>
44 c.SetCanvasSize(1920, 1200);
45 std::vector<real_t> x(agents.size());
46 std::vector<real_t> y(agents.size());
48 uint64_t min = std::numeric_limits<uint64_t>::max();
49 for (uint64_t i = 0; i < agents.size(); ++i) {
50 auto val =
reinterpret_cast<uint64_t
>(agents[i]);
55 for (uint64_t i = 1; i < agents.size(); ++i) {
57 y[i] =
reinterpret_cast<uint64_t
>(agents[i]) - min;
59 TGraph graph(agents.size(), x.data(), y.data());
60 graph.SetTitle(
";Agent element index; Virtual memory address");
70 c.SaveAs(
Concat(dir,
"/mem-layout-", steps,
"-", numa_node,
".png").c_str());
76 c.SetCanvasSize(1920, 1200);
78 TH1F hist(
"",
"", 100, 1, 10000);
79 hist.SetTitle(
";#Delta bytes; Count");
80 for (uint64_t i = 1; i < agents.size(); ++i) {
82 auto t =
reinterpret_cast<uint64_t
>(agents[i]);
83 auto l =
reinterpret_cast<uint64_t
>(agents[i - 1]);
89 val = std::min(val, 10000.f - 1);
103 Concat(dir,
"/mem-layout-hist-", steps,
"-", numa_node,
".png").c_str());
113 if (neighbor ==
query) {
116 auto t =
reinterpret_cast<int64_t
>(
query);
117 auto l =
reinterpret_cast<int64_t
>(neighbor);
118 diffs.push_back(t - l);
130 auto* env = sim->GetEnvironment();
131 auto squared_radius = env->GetLargestAgentSizeSquared();
132 sim->GetExecutionContext()->ForEachNeighbor(fen, *agent, squared_radius);
139 c.SetCanvasSize(1920, 1200);
141 if (rm->GetNumAgents() == 0) {
144 std::vector<int64_t> diffs;
145 diffs.reserve(rm->GetNumAgents() * 3);
150 rm->ForEachAgent(fea);
151 auto min = std::numeric_limits<float>::max();
152 auto max = std::numeric_limits<float>::min();
153 for (uint64_t i = 0; i < diffs.size(); ++i) {
154 if (diffs[i] < min) {
157 if (diffs[i] > max) {
163 uint64_t nbins = std::max(
static_cast<uint64_t
>(100u),
164 static_cast<uint64_t
>((max - min) / 20000));
165 TH1F hist(
"",
"", nbins, min, max);
166 hist.SetTitle(
";#Delta bytes; Count");
167 for (uint64_t i = 0; i < diffs.size(); ++i) {
180 std::string suffix =
"-end";
185 Concat(dir,
"/mem-layout-neighbor-hist-", steps, suffix,
".png").c_str());
187 Concat(dir,
"/mem-layout-neighbor-hist-", steps, suffix,
".C").c_str());