X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f6b6ec5ae0cc5d28201720961c23277c4a72e152..a0c8da3bbcebc9266ce49ee6e48c2b1d52b4a5f8:/docs/source/tuto_network_calibration/dahu_platform_dhist.cpp diff --git a/docs/source/tuto_network_calibration/dahu_platform_dhist.cpp b/docs/source/tuto_network_calibration/dahu_platform_dhist.cpp index 9f596fbeef..d48288bf69 100644 --- a/docs/source/tuto_network_calibration/dahu_platform_dhist.cpp +++ b/docs/source/tuto_network_calibration/dahu_platform_dhist.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2022. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2006-2023. The SimGrid Team. All rights reserved. */ /* 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. */ @@ -19,15 +19,15 @@ class DhistSampler : public Sampler { std::mt19937& gen_; public: - DhistSampler(bool log, std::mt19937& gen, const std::vector& b, const std::vector h) - : log_(log_), breaks_(b), heights_(h), gen_(gen) + DhistSampler(bool log, std::mt19937& gen, const std::vector& b, const std::vector& h) + : log_(log), breaks_(b), heights_(h), gen_(gen) { } - double sample() + double sample() override { std::piecewise_constant_distribution d(breaks_.begin(), breaks_.end(), heights_.begin()); auto value = d(gen_); - if (log) + if (log_) value = std::exp(value); return value; } @@ -38,7 +38,7 @@ public: * * @param latency_base The base latency for this calibration (user-defined) * @param seg Segmentation (user-defined) - * @param size Message size (simgrid) + * @param size Message size (SimGrid) */ static double latency_factor_cb(double latency_base, const SegmentedRegression& seg, double size, const sg4::Host* /*src*/, const sg4::Host* /*dst*/, @@ -56,7 +56,7 @@ static double latency_factor_cb(double latency_base, const SegmentedRegression& * * @param bw_base The base bandwidth for this calibration (user-defined) * @param seg Segmentation (user-defined) - * @param size Message size (simgrid) + * @param size Message size (SimGrid) */ static double bw_factor_cb(double bw_base, const SegmentedRegression& seg, double size, const sg4::Host* /*src*/, const sg4::Host* /*dst*/, const std::vector& /*links*/, @@ -126,11 +126,11 @@ void load_platform(const sg4::Engine& e) /* 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, @@ -142,4 +142,4 @@ void load_platform(const sg4::Engine& e) 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 +}