XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_lmm, kernel, "Kernel Linear Max-Min solver");
double sg_maxmin_precision = 1E-5; /* Change this with --cfg=maxmin/precision:VALUE */
-double sg_surf_precision = 1E-9; /* Change this with --cfg=surf/precision:VALUE */
+double sg_precision_timing = 1E-9; /* Change this with --cfg=surf/precision:VALUE */
int sg_concurrency_limit = -1; /* Change this with --cfg=maxmin/concurrency-limit:VALUE */
namespace simgrid::kernel::lmm {
void Action::update_max_duration(double delta)
{
if (max_duration_ != NO_MAX_DURATION)
- double_update(&max_duration_, delta, sg_surf_precision);
+ double_update(&max_duration_, delta, sg_precision_timing);
}
void Action::update_remains(double delta)
{
- double_update(&remains_, delta, sg_maxmin_precision * sg_surf_precision);
+ double_update(&remains_, delta, sg_maxmin_precision * sg_precision_timing);
}
void Action::set_last_update()
void CpuModel::update_actions_state_lazy(double now, double /*delta*/)
{
- while (not get_action_heap().empty() && double_equals(get_action_heap().top_date(), now, sg_surf_precision)) {
+ while (not get_action_heap().empty() && double_equals(get_action_heap().top_date(), now, sg_precision_timing)) {
auto* action = static_cast<CpuAction*>(get_action_heap().pop());
XBT_DEBUG("Something happened to action %p", action);
void StandardLinkImpl::latency_check(double latency) const
{
- static double last_warned_latency = sg_surf_precision;
+ static double last_warned_latency = sg_precision_timing;
if (latency != 0.0 && latency < last_warned_latency) {
XBT_WARN("Latency for link %s is smaller than surf/precision (%g < %g)."
" For more accuracy, consider setting \"--cfg=surf/precision:%g\".",
- get_cname(), latency, sg_surf_precision, latency);
+ get_cname(), latency, sg_precision_timing, latency);
last_warned_latency = latency;
}
}
if (duration <= 0) /* that's a no-op */
return;
- if (duration < sg_surf_precision) {
+ if (duration < sg_precision_timing) {
static unsigned int warned = 0; // At most 20 such warnings
warned++;
if (warned <= 20)
XBT_INFO("The parameter to sleep_for() is smaller than the SimGrid numerical accuracy (%g < %g). "
"Please refer to https://simgrid.org/doc/latest/Configuring_SimGrid.html#numerical-precision",
- duration, sg_surf_precision);
+ duration, sg_precision_timing);
if (warned == 20)
XBT_VERB("(further warnings about the numerical accuracy of sleep_for() will be omitted).");
}
simgrid_host_models().create_flag("host/model", "The model to use for the host", "default", false);
simgrid_disk_models().create_flag("disk/model", "The model to use for the disk", "S19", false);
- simgrid::config::bind_flag(sg_surf_precision, "surf/precision",
+ simgrid::config::bind_flag(sg_precision_timing, "surf/precision",
"Numerical precision used when updating simulation times (in seconds)");
simgrid::config::bind_flag(sg_maxmin_precision, "maxmin/precision",
return smpi_mpi_wtime();
}
-extern double sg_surf_precision;
+extern double sg_precision_timing;
double PMPI_Wtick()
{
- return sg_surf_precision;
+ return sg_precision_timing;
}
int PMPI_Address(const void* location, MPI_Aint* address)
#include "smpi_utils.hpp"
#include "src/internal_config.h"
#include "src/mc/mc_replay.hpp"
-#include "src/surf/surf_interface.hpp" // sg_surf_precision
+#include "src/surf/surf_interface.hpp" // sg_precision_timing
#include "xbt/config.hpp"
#include "xbt/file.hpp"
unsigned long long smpi_rastro_resolution ()
{
const SmpiBenchGuard suspend_bench;
- return static_cast<unsigned long long>(1.0 / sg_surf_precision);
+ return static_cast<unsigned long long>(1.0 / sg_precision_timing);
}
unsigned long long smpi_rastro_timestamp ()
{
const SmpiBenchGuard suspend_bench;
- return static_cast<unsigned long long>(simgrid::s4u::Engine::get_clock() / sg_surf_precision);
+ return static_cast<unsigned long long>(simgrid::s4u::Engine::get_clock() / sg_precision_timing);
}
/* ****************************** Functions related to the SMPI_SAMPLE_ macros ************************************/
CpuAction* CpuCas01::sleep(double duration)
{
if (duration > 0)
- duration = std::max(duration, sg_surf_precision);
+ duration = std::max(duration, sg_precision_timing);
XBT_IN("(%s, %g)", get_cname(), duration);
auto* action = new CpuCas01Action(get_model(), 1.0, not is_on(), speed_.scale * speed_.peak, get_constraint(), 1);
XBT_DEBUG("a %f ind %ld integral %f ind + 1 %f ind %f time +1 %f time %f", a, ind, integral, integral_[ind + 1],
integral_[ind], time_points_[ind + 1], time_points_[ind]);
- double_update(&a_aux, time_points_[ind], sg_maxmin_precision * sg_surf_precision);
+ double_update(&a_aux, time_points_[ind], sg_maxmin_precision * sg_precision_timing);
if (a_aux > 0)
integral +=
((integral_[ind + 1] - integral_[ind]) / (time_points_[ind + 1] - time_points_[ind])) * (a - time_points_[ind]);
void CpuTiModel::update_actions_state(double now, double /*delta*/)
{
- while (not get_action_heap().empty() && double_equals(get_action_heap().top_date(), now, sg_surf_precision)) {
+ while (not get_action_heap().empty() && double_equals(get_action_heap().top_date(), now, sg_precision_timing)) {
auto* action = static_cast<CpuTiAction*>(get_action_heap().pop());
XBT_DEBUG("Action %p: finish", action);
action->finish(Action::State::FINISHED);
CpuAction* CpuTi::sleep(double duration)
{
if (duration > 0)
- duration = std::max(duration, sg_surf_precision);
+ duration = std::max(duration, sg_precision_timing);
XBT_IN("(%s,%g)", get_cname(), duration);
auto* action = new CpuTiAction(this, 1.0);
void NetworkCm02Model::update_actions_state_lazy(double now, double /*delta*/)
{
- while (not get_action_heap().empty() && double_equals(get_action_heap().top_date(), now, sg_surf_precision)) {
+ while (not get_action_heap().empty() && double_equals(get_action_heap().top_date(), now, sg_precision_timing)) {
auto* action = static_cast<NetworkCm02Action*>(get_action_heap().pop());
XBT_DEBUG("Something happened to action %p", action);
XBT_DEBUG("Something happened to action %p", &action);
if (action.latency_ > 0) {
if (action.latency_ > delta) {
- double_update(&action.latency_, delta, sg_surf_precision);
+ double_update(&action.latency_, delta, sg_precision_timing);
} else {
action.latency_ = 0.0;
}
++it; // increment iterator here since the following calls to action.finish() may invalidate it
if (action.latency_ > 0) {
if (action.latency_ > delta) {
- double_update(&action.latency_, delta, sg_surf_precision);
+ double_update(&action.latency_, delta, sg_precision_timing);
} else {
action.latency_ = 0.0;
}
double penalized_bw = num_comm_out ? comm->init_rate / penalty : comm->init_rate;
- if (not double_equals(penalized_bw, rate_before_update, sg_surf_precision)) {
+ if (not double_equals(penalized_bw, rate_before_update, sg_precision_timing)) {
XBT_DEBUG("%d->%d action %p penalty updated : bw now %f, before %f , initial rate %f", root->id_,
comm->destination->id_, comm->action, penalized_bw, comm->action->get_bound(), comm->init_rate);
get_maxmin_system()->update_variable_bound(comm->action->get_variable(), penalized_bw);
// NS-3 stops as soon as a flow ends,
// but it does not process the other flows that may finish at the same (simulated) time.
// If another flow ends at the same time, time_to_next_flow_completion = 0
- if (double_equals(time_to_next_flow_completion, 0, sg_surf_precision))
+ if (double_equals(time_to_next_flow_completion, 0, sg_precision_timing))
time_to_next_flow_completion = 0.0;
XBT_DEBUG("min : %f", now);
// If there is no other started actions, we need to move NS-3 forward to be sync with SimGrid
if (model->get_started_action_set()->size() == 1) {
- while (double_positive(EngineImpl::get_clock() - ns3::Simulator::Now().GetSeconds(), sg_surf_precision)) {
+ while (double_positive(EngineImpl::get_clock() - ns3::Simulator::Now().GetSeconds(), sg_precision_timing)) {
XBT_DEBUG("Synchronizing NS-3 (time %f) with SimGrid (time %f)", ns3::Simulator::Now().GetSeconds(),
EngineImpl::get_clock());
ns3_simulator(EngineImpl::get_clock() - ns3::Simulator::Now().GetSeconds());
++it; // increment iterator here since the following calls to action.finish() may invalidate it
if (action.get_latency() > 0) {
if (action.get_latency() > delta) {
- action.update_latency(delta, sg_surf_precision);
+ action.update_latency(delta, sg_precision_timing);
} else {
action.set_latency(0.0);
}
/* user-visible parameters */
XBT_PUBLIC_DATA double sg_maxmin_precision;
-XBT_PUBLIC_DATA double sg_surf_precision;
+XBT_PUBLIC_DATA double sg_precision_timing;
XBT_PUBLIC_DATA int sg_concurrency_limit;
extern XBT_PRIVATE std::unordered_map<std::string, simgrid::kernel::profile::Profile*> traces_set_list;