> [ 0.000000] (0:maestro@) Configuration change: Set 'network/model' to 'Constant'
> [ 0.000000] (1:pinger@Tremblay) Ping from mailbox Mailbox 1 to mailbox Mailbox 2
> [ 0.000000] (2:ponger@Jupiter) Pong from mailbox Mailbox 2 to mailbox Mailbox 1
-> [ 13.010000] (2:ponger@Jupiter) Task received : small communication (latency bound)
-> [ 13.010000] (2:ponger@Jupiter) Ping time (latency bound) 13.010000
-> [ 13.010000] (2:ponger@Jupiter) task_bw->data = 13.010
-> [ 26.020000] (1:pinger@Tremblay) Task received : large communication (bandwidth bound)
-> [ 26.020000] (1:pinger@Tremblay) Pong time (bandwidth bound): 13.010
-> [ 26.020000] (0:maestro@) Total simulation time: 26.020
+> [ 1.000000] (2:ponger@Jupiter) Task received : small communication (latency bound)
+> [ 1.000000] (2:ponger@Jupiter) Ping time (latency bound) 1.000000
+> [ 1.000000] (2:ponger@Jupiter) task_bw->data = 1.000
+> [ 2.000000] (1:pinger@Tremblay) Task received : large communication (bandwidth bound)
+> [ 2.000000] (1:pinger@Tremblay) Pong time (bandwidth bound): 1.000
+> [ 2.000000] (0:maestro@) Total simulation time: 2.000
> [ 0.000000] (0:maestro@) Configuration change: Set 'network/model' to 'Constant'
> [ 0.000000] (1:pinger@Tremblay) Ping from mailbox Mailbox 1 to mailbox Mailbox 2
> [ 0.000000] (2:ponger@Jupiter) Pong from mailbox Mailbox 2 to mailbox Mailbox 1
-> [ 13.010000] (2:ponger@Jupiter) Payload received : small communication (latency bound)
-> [ 13.010000] (2:ponger@Jupiter) Ping time (latency bound) 13.010000
-> [ 13.010000] (2:ponger@Jupiter) payload = 13.010
-> [ 26.020000] (1:pinger@Tremblay) Payload received : large communication (bandwidth bound)
-> [ 26.020000] (1:pinger@Tremblay) Pong time (bandwidth bound): 13.010
-> [ 26.020000] (0:maestro@) Total simulation time: 26.020
+> [ 1.000000] (2:ponger@Jupiter) Payload received : small communication (latency bound)
+> [ 1.000000] (2:ponger@Jupiter) Ping time (latency bound) 1.000000
+> [ 1.000000] (2:ponger@Jupiter) payload = 1.000
+> [ 2.000000] (1:pinger@Tremblay) Payload received : large communication (bandwidth bound)
+> [ 2.000000] (1:pinger@Tremblay) Pong time (bandwidth bound): 1.000
+> [ 2.000000] (0:maestro@) Total simulation time: 2.000
s4u::Link::on_bandwidth_change_cb([](s4u::Link const& link) {
Container::by_name(link.get_name())
->get_variable("bandwidth")
- ->set_event(simgrid_get_clock(), sg_bandwidth_factor * link.get_bandwidth());
+ ->set_event(simgrid_get_clock(), kernel::resource::NetworkModel::cfg_bandwidth_factor * link.get_bandwidth());
});
s4u::NetZone::on_seal_cb([](s4u::NetZone const& /*netzone*/) { currentContainer.pop_back(); });
kernel::routing::NetPoint::on_creation.connect([](kernel::routing::NetPoint const& netpoint) {
*********/
namespace simgrid::kernel::resource {
+double NetworkModel::cfg_latency_factor = 1.0; // default value
+double NetworkModel::cfg_bandwidth_factor = 1.0; // default value
/** @brief Command-line option 'network/TCP-gamma' -- see @ref options_model_network_gamma */
config::Flag<double> NetworkModel::cfg_tcp_gamma(
public:
static config::Flag<double> cfg_tcp_gamma;
static config::Flag<bool> cfg_crosstraffic;
+ static double cfg_latency_factor;
+ static double cfg_bandwidth_factor;
using Model::Model;
NetworkModel(const NetworkModel&) = delete;
* @param size The size of the message.
* @return The latency factor.
*/
- virtual double get_latency_factor(double /* size */) { return sg_latency_factor; }
+ virtual double get_latency_factor(double /* size */) { return cfg_latency_factor; }
/**
* @brief Get the right multiplicative factor for the bandwidth.
* @param size The size of the message.
* @return The bandwidth factor.
*/
- virtual double get_bandwidth_factor(double /* size*/) { return sg_bandwidth_factor; }
+ virtual double get_bandwidth_factor(double /* size*/) { return cfg_bandwidth_factor; }
double next_occurring_event_full(double now) override;
#include "src/internal_config.h"
#include "src/kernel/context/Context.hpp"
#include "src/kernel/lmm/maxmin.hpp"
+#include "src/kernel/resource/NetworkModel.hpp"
#include "src/mc/mc_config.hpp"
#include "src/mc/mc_replay.hpp"
#include "src/smpi/include/smpi_config.hpp"
/* The parameters of network models */
- sg_latency_factor = 13.01; // comes from the default LV08 network model
- simgrid::config::bind_flag(sg_latency_factor, "network/latency-factor",
+ simgrid::config::bind_flag(simgrid::kernel::resource::NetworkModel::cfg_latency_factor, "network/latency-factor",
"Correction factor to apply to the provided latency (default value set by network model)");
- sg_bandwidth_factor = 0.97; // comes from the default LV08 network model
simgrid::config::bind_flag(
- sg_bandwidth_factor, "network/bandwidth-factor",
+ simgrid::kernel::resource::NetworkModel::cfg_bandwidth_factor, "network/bandwidth-factor",
"Correction factor to apply to the provided bandwidth (default value set by network model)");
sg_weight_S_parameter = 20537; // comes from the default LV08 network model
"Set linear equations solver used by network model",
"maxmin", &simgrid::kernel::lmm::System::validate_solver);
-double sg_latency_factor = 1.0; /* default value; can be set by model or from command line */
-double sg_bandwidth_factor = 1.0; /* default value; can be set by model or from command line */
double sg_weight_S_parameter = 0.0; /* default value; can be set by model or from command line */
/************************************************************************/
action.latency_ = 0.0;
}
}
- action.update_remains(action.get_cost() * delta / sg_latency_factor);
+ action.update_remains(action.get_cost() * delta / cfg_latency_factor);
action.update_max_duration(delta);
if ((action.get_remains_no_update() <= 0) ||
NetworkConstantAction::NetworkConstantAction(NetworkConstantModel* model_, s4u::Host& src, s4u::Host& dst, double size)
: NetworkAction(model_, src, dst, size, false)
{
- latency_ = sg_latency_factor;
+ latency_ = NetworkModel::cfg_latency_factor;
if (latency_ <= 0.0)
set_state(Action::State::FINISHED);
}
XBT_PUBLIC_DATA double sg_surf_precision;
XBT_PUBLIC_DATA int sg_concurrency_limit;
-extern XBT_PRIVATE double sg_latency_factor;
-extern XBT_PRIVATE double sg_bandwidth_factor;
extern XBT_PRIVATE double sg_weight_S_parameter;
extern XBT_PRIVATE std::vector<std::string> surf_path;
extern XBT_PRIVATE std::unordered_map<std::string, simgrid::kernel::profile::Profile*> traces_set_list;