X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/2c01336cbfb90976b513b71718a748b3a01a8e6a..9451efc97c14403a6f030ce37a2269b2b9491b7e:/src/surf/network_cm02.cpp diff --git a/src/surf/network_cm02.cpp b/src/surf/network_cm02.cpp index 75af96b496..5a4eb90592 100644 --- a/src/surf/network_cm02.cpp +++ b/src/surf/network_cm02.cpp @@ -65,12 +65,12 @@ void surf_network_model_init_CM02() if (surf_network_model) return; - surf_network_model = new simgrid::surf::NetworkCm02Model(); - all_existing_models->push_back(surf_network_model); - xbt_cfg_setdefault_double("network/latency-factor", 1.0); xbt_cfg_setdefault_double("network/bandwidth-factor", 1.0); xbt_cfg_setdefault_double("network/weight-S", 0.0); + + surf_network_model = new simgrid::surf::NetworkCm02Model(); + all_existing_models->push_back(surf_network_model); } /***************************************************************************/ @@ -88,14 +88,14 @@ void surf_network_model_init_Reno() if (surf_network_model) return; - surf_network_model = new simgrid::surf::NetworkCm02Model(&lagrange_solve); - all_existing_models->push_back(surf_network_model); - lmm_set_default_protocol_function(func_reno_f, func_reno_fp, func_reno_fpi); - xbt_cfg_setdefault_double("network/latency-factor", 10.4); - xbt_cfg_setdefault_double("network/bandwidth-factor", 0.92); - xbt_cfg_setdefault_double("network/weight-S", 8775); + xbt_cfg_setdefault_double("network/latency-factor", 13.01); + xbt_cfg_setdefault_double("network/bandwidth-factor", 0.97); + xbt_cfg_setdefault_double("network/weight-S", 20537); + + surf_network_model = new simgrid::surf::NetworkCm02Model(&lagrange_solve); + all_existing_models->push_back(surf_network_model); } @@ -104,14 +104,14 @@ void surf_network_model_init_Reno2() if (surf_network_model) return; - surf_network_model = new simgrid::surf::NetworkCm02Model(&lagrange_solve); - all_existing_models->push_back(surf_network_model); - lmm_set_default_protocol_function(func_reno2_f, func_reno2_fp, func_reno2_fpi); - xbt_cfg_setdefault_double("network/latency-factor", 10.4); - xbt_cfg_setdefault_double("network/bandwidth-factor", 0.92); - xbt_cfg_setdefault_double("network/weight-S", 8775); + xbt_cfg_setdefault_double("network/latency-factor", 13.01); + xbt_cfg_setdefault_double("network/bandwidth-factor", 0.97); + xbt_cfg_setdefault_double("network/weight-S", 20537); + + surf_network_model = new simgrid::surf::NetworkCm02Model(&lagrange_solve); + all_existing_models->push_back(surf_network_model); } void surf_network_model_init_Vegas() @@ -119,14 +119,14 @@ void surf_network_model_init_Vegas() if (surf_network_model) return; - surf_network_model = new simgrid::surf::NetworkCm02Model(&lagrange_solve); - all_existing_models->push_back(surf_network_model); - lmm_set_default_protocol_function(func_vegas_f, func_vegas_fp, func_vegas_fpi); - xbt_cfg_setdefault_double("network/latency-factor", 10.4); - xbt_cfg_setdefault_double("network/bandwidth-factor", 0.92); - xbt_cfg_setdefault_double("network/weight-S", 8775); + xbt_cfg_setdefault_double("network/latency-factor", 13.01); + xbt_cfg_setdefault_double("network/bandwidth-factor", 0.97); + xbt_cfg_setdefault_double("network/weight-S", 20537); + + surf_network_model = new simgrid::surf::NetworkCm02Model(&lagrange_solve); + all_existing_models->push_back(surf_network_model); } namespace simgrid { @@ -138,10 +138,10 @@ NetworkCm02Model::NetworkCm02Model() char *optim = xbt_cfg_get_string("network/optim"); bool select = xbt_cfg_get_boolean("network/maxmin-selective-update"); - if (!strcmp(optim, "Full")) { + if (not strcmp(optim, "Full")) { updateMechanism_ = UM_FULL; selectiveUpdate_ = select; - } else if (!strcmp(optim, "Lazy")) { + } else if (not strcmp(optim, "Lazy")) { updateMechanism_ = UM_LAZY; selectiveUpdate_ = true; xbt_assert(select || (xbt_cfg_is_default_value("network/maxmin-selective-update")), @@ -208,8 +208,6 @@ void NetworkCm02Model::updateActionsStateLazy(double now, double /*delta*/) action->finish(); action->setState(Action::State::done); action->heapRemove(actionHeap_); - - action->gapRemove(); } } } @@ -234,7 +232,7 @@ void NetworkCm02Model::updateActionsStateFull(double now, double delta) double_update(&(deltap), action->latency_, sg_surf_precision); action->latency_ = 0.0; } - if (action->latency_ <= 0.0 && !(action->isSuspended())) + if (action->latency_ <= 0.0 && not action->isSuspended()) lmm_update_variable_weight(maxminSystem_, action->getVariable(), action->weight_); } if (TRACE_is_enabled()) { @@ -249,7 +247,7 @@ void NetworkCm02Model::updateActionsStateFull(double now, double delta) action->getLastUpdate(), now - action->getLastUpdate()); } } - if (!lmm_get_number_of_cnst_from_var (maxminSystem_, action->getVariable())) { + if (not lmm_get_number_of_cnst_from_var(maxminSystem_, action->getVariable())) { /* There is actually no link used, hence an infinite bandwidth. This happens often when using models like * vivaldi. In such case, just make sure that the action completes immediately. */ @@ -264,7 +262,6 @@ void NetworkCm02Model::updateActionsStateFull(double now, double delta) ((action->getMaxDuration() > NO_MAX_DURATION) && (action->getMaxDuration() <= 0))) { action->finish(); action->setState(Action::State::done); - action->gapRemove(); } } } @@ -276,12 +273,12 @@ Action* NetworkCm02Model::communicate(s4u::Host* src, s4u::Host* dst, double siz std::vector* back_route = nullptr; std::vector* route = new std::vector(); - XBT_IN("(%s,%s,%g,%g)", src->cname(), dst->cname(), size, rate); + XBT_IN("(%s,%s,%g,%g)", src->getCname(), dst->getCname(), size, rate); src->routeTo(dst, route, &latency); - xbt_assert(!route->empty() || latency, + xbt_assert(not route->empty() || latency, "You're trying to send data from %s to %s but there is no connecting path between these two hosts.", - src->cname(), dst->cname()); + src->getCname(), dst->getCname()); for (auto link: *route) if (link->isOff()) @@ -318,11 +315,11 @@ Action* NetworkCm02Model::communicate(s4u::Host* src, s4u::Host* dst, double siz action->latency_ *= latencyFactor(size); action->rate_ = bandwidthConstraint(action->rate_, bandwidth_bound, size); if (haveGap_) { - xbt_assert(! route->empty(), + xbt_assert(not route->empty(), "Using a model with a gap (e.g., SMPI) with a platform without links (e.g. vivaldi)!!!"); gapAppend(size, route->at(0), action); - XBT_DEBUG("Comm %p: %s -> %s gap=%f (lat=%f)", action, src->cname(), dst->cname(), action->senderGap_, + XBT_DEBUG("Comm %p: %s -> %s gap=%f (lat=%f)", action, src->getCname(), dst->getCname(), action->senderGap_, action->latency_); } @@ -447,7 +444,7 @@ void NetworkCm02Link::setBandwidth(double value) while ((var = lmm_get_var_from_cnst_safe(model()->getMaxminSystem(), constraint(), &elem, &nextelem, &numelem))) { NetworkCm02Action *action = static_cast(lmm_variable_id(var)); action->weight_ += delta; - if (!action->isSuspended()) + if (not action->isSuspended()) lmm_update_variable_weight(model()->getMaxminSystem(), action->getVariable(), action->weight_); } } @@ -480,7 +477,7 @@ void NetworkCm02Link::setLatency(double value) XBT_INFO("Flow is limited BYLATENCY, latency of flow is %f", action->latCurrent_); } } - if (!action->isSuspended()) + if (not action->isSuspended()) lmm_update_variable_weight(model()->getMaxminSystem(), action->getVariable(), action->weight_); } }