1 /* Copyright (c) 2017-2022. The SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
9 #include "smpi_utils.hpp"
11 #include "simgrid/s4u/Host.hpp"
12 #include "src/kernel/resource/FactorSet.hpp"
15 #include <xbt/Extendable.hpp>
17 namespace simgrid::smpi {
18 static auto factor_lambda(std::vector<double> const& values, double size)
20 return values[0] + values[1] * static_cast<size_t>(size);
23 kernel::resource::FactorSet orecv_{"smpi/or", 0.0, factor_lambda};
24 kernel::resource::FactorSet osend_{"smpi/os", 0.0, factor_lambda};
25 kernel::resource::FactorSet oisend_{"smpi/ois", 0.0, factor_lambda};
26 s4u::Host* host = nullptr;
28 * @brief Generates warning message if user's config is conflicting (callback vs command line/xml)
29 * @param op String with config name (smpi/os, smpi/or, smpi/ois)
31 void check_factor_configs(const std::string& op) const;
34 static xbt::Extension<s4u::Host, smpi::Host> EXTENSION_ID;
36 explicit Host(s4u::Host* ptr);
38 double orecv(size_t size, s4u::Host* src, s4u::Host* dst);
39 double osend(size_t size, s4u::Host* src, s4u::Host* dst);
40 double oisend(size_t size, s4u::Host* src, s4u::Host* dst);
43 } // namespace simgrid::smpi