Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines for 2023.
[simgrid.git] / src / smpi / include / smpi_host.hpp
index 4223134..503df80 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2017-2022. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2017-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. */
@@ -9,19 +9,20 @@
 #include "smpi_utils.hpp"
 
 #include "simgrid/s4u/Host.hpp"
+#include "src/kernel/resource/FactorSet.hpp"
 #include <string>
 #include <vector>
 #include <xbt/Extendable.hpp>
 
 namespace simgrid::smpi {
-static auto factor_lambda(s_smpi_factor_t const& fact, double size)
+static auto factor_lambda(std::vector<double> const& values, double size)
 {
-  return fact.values[0] + fact.values[1] * static_cast<size_t>(size);
+  return values[0] + values[1] * size;
 }
 class Host {
-  utils::FactorSet orecv_{"smpi/or", 0.0, factor_lambda};
-  utils::FactorSet osend_{"smpi/os", 0.0, factor_lambda};
-  utils::FactorSet oisend_{"smpi/ois", 0.0, factor_lambda};
+  kernel::resource::FactorSet orecv_{"smpi/or", 0.0, factor_lambda};
+  kernel::resource::FactorSet osend_{"smpi/os", 0.0, factor_lambda};
+  kernel::resource::FactorSet oisend_{"smpi/ois", 0.0, factor_lambda};
   s4u::Host* host = nullptr;
   /**
    * @brief Generates warning message if user's config is conflicting (callback vs command line/xml)
@@ -34,9 +35,9 @@ public:
 
   explicit Host(s4u::Host* ptr);
 
-  double orecv(size_t size, s4u::Host* src, s4u::Host* dst);
-  double osend(size_t size, s4u::Host* src, s4u::Host* dst);
-  double oisend(size_t size, s4u::Host* src, s4u::Host* dst);
+  double orecv(size_t size, s4u::Host* src, s4u::Host* dst) const;
+  double osend(size_t size, s4u::Host* src, s4u::Host* dst) const;
+  double oisend(size_t size, s4u::Host* src, s4u::Host* dst) const;
 };
 
 } // namespace simgrid::smpi