Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fixes in docs/source/tuto_* (untested).
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 6 Mar 2023 15:16:49 +0000 (16:16 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 6 Mar 2023 17:44:39 +0000 (18:44 +0100)
docs/source/tuto_disk/tuto_disk.cpp
docs/source/tuto_network_calibration/dahu_platform_ckmeans.cpp
docs/source/tuto_network_calibration/dahu_platform_dhist.cpp
docs/source/tuto_smpi/gemm_mpi.cpp

index 1fad8ae..0f487ff 100644 (file)
@@ -35,7 +35,7 @@ static void estimate_bw(const sg4::Disk* disk, int n, int n_flows, bool read)
     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()
@@ -60,7 +60,7 @@ class DiskNoise {
   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)
   {
   }
index 226cbac..4ee3584 100644 (file)
@@ -18,13 +18,13 @@ class NormalMixture : public Sampler {
   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_);
@@ -121,11 +121,11 @@ void load_platform(const sg4::Engine& e)
   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,
index e9ee85d..cc817e3 100644 (file)
@@ -19,15 +19,15 @@ class DhistSampler : public Sampler {
   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;
   }
@@ -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
+}
index 6b28638..ab9920b 100644 (file)
@@ -3,8 +3,8 @@
 /* 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;
 
@@ -27,7 +27,7 @@ int main(int argc, char* argv[])
 {
     int rank, nproc;
     int istart, iend;
-    double start, end;
+    // double start, end;
 
     MPI_Init(&argc, &argv);
     MPI_Comm_size(MPI_COMM_WORLD, &nproc);