act->wait();
double elapsed_time = sg4::Engine::get_clock() - cur_time;
- printf("%s,%s,%d,%d,%d,%lf\n", disk->get_cname(), read ? "read" : "write", n, n_flows, size, elapsed_time);
+ printf("%s,%s,%d,%d,%llu,%lf\n", disk->get_cname(), read ? "read" : "write", n, n_flows, size, elapsed_time);
}
static void host()
std::mt19937& gen_;
public:
- DiskNoise(double capacity, std::mt19937& gen, const std::vector<double>& b, const std::vector<double> h)
+ DiskNoise(double capacity, std::mt19937& gen, const std::vector<double>& b, const std::vector<double>& h)
: bw_(capacity), breaks_(b), heights_(h), gen_(gen)
{
}
std::mt19937& gen_;
public:
- NormalMixture(std::mt19937& gen) : gen_(gen) {}
+ explicit NormalMixture(std::mt19937& gen) : gen_(gen) {}
void append(double mean, double stddev, double prob)
{
mixture_.push_back(std::normal_distribution<double>(mean, stddev));
prob_.push_back(prob);
}
- double sample()
+ double sample() override
{
std::discrete_distribution<> d(prob_.begin(), prob_.end());
int index = d(gen_);
auto zone = e.get_netzone_root();
SegmentedRegression seg = read_json_file("pingpong_ckmeans.json", gen, false);
- zone->set_lat_factor_cb(std::bind(&latency_factor_cb, lat_base, seg, std::placeholders::_1, std::placeholders::_2,
- std::placeholders::_3, std::placeholders::_4, std::placeholders::_5));
+ zone->set_latency_factor_cb(std::bind(&latency_factor_cb, lat_base, seg, std::placeholders::_1, std::placeholders::_2,
+ std::placeholders::_3, std::placeholders::_4, std::placeholders::_5));
- zone->set_bw_factor_cb(std::bind(&bw_factor_cb, bw_base, seg, std::placeholders::_1, std::placeholders::_2,
- std::placeholders::_3, std::placeholders::_4, std::placeholders::_5));
+ zone->set_bandwidth_factor_cb(std::bind(&bw_factor_cb, bw_base, seg, std::placeholders::_1, std::placeholders::_2,
+ std::placeholders::_3, std::placeholders::_4, std::placeholders::_5));
seg = read_json_file("send_ckmeans.json", gen);
smpi_register_op_cost_callback(SmpiOperation::SEND, std::bind(&smpi_cost_cb, seg, std::placeholders::_1,
std::mt19937& gen_;
public:
- DhistSampler(bool log, std::mt19937& gen, const std::vector<double>& b, const std::vector<double> h)
- : log_(log_), breaks_(b), heights_(h), gen_(gen)
+ DhistSampler(bool log, std::mt19937& gen, const std::vector<double>& b, const std::vector<double>& h)
+ : log_(log), breaks_(b), heights_(h), gen_(gen)
{
}
- double sample()
+ double sample() override
{
std::piecewise_constant_distribution<double> d(breaks_.begin(), breaks_.end(), heights_.begin());
auto value = d(gen_);
- if (log)
+ if (log_)
value = std::exp(value);
return value;
}
/* setting network factors callbacks */
auto* zone = e.get_netzone_root();
SegmentedRegression seg = read_json_file("pingpong_dhist.json", gen, false);
- zone->set_lat_factor_cb(std::bind(&latency_factor_cb, lat_base, seg, std::placeholders::_1, std::placeholders::_2,
- std::placeholders::_3, std::placeholders::_4, std::placeholders::_5));
+ zone->set_latency_factor_cb(std::bind(&latency_factor_cb, lat_base, seg, std::placeholders::_1, std::placeholders::_2,
+ std::placeholders::_3, std::placeholders::_4, std::placeholders::_5));
- zone->set_bw_factor_cb(std::bind(&bw_factor_cb, bw_base, seg, std::placeholders::_1, std::placeholders::_2,
- std::placeholders::_3, std::placeholders::_4, std::placeholders::_5));
+ zone->set_bandwidth_factor_cb(std::bind(&bw_factor_cb, bw_base, seg, std::placeholders::_1, std::placeholders::_2,
+ std::placeholders::_3, std::placeholders::_4, std::placeholders::_5));
seg = read_json_file("send_dhist.json", gen);
smpi_register_op_cost_callback(SmpiOperation::SEND, std::bind(&smpi_cost_cb, seg, std::placeholders::_1,
seg = read_json_file("recv_dhist.json", gen);
smpi_register_op_cost_callback(SmpiOperation::RECV, std::bind(&smpi_cost_cb, seg, std::placeholders::_1,
std::placeholders::_2, std::placeholders::_3));
-}
\ No newline at end of file
+}
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-#include "stdio.h"
-#include "mpi.h"
+#include <mpi.h>
+#include <stdio.h>
const int size = 3000;
{
int rank, nproc;
int istart, iend;
- double start, end;
+ // double start, end;
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &nproc);