From: Martin Quinson Date: Sun, 8 Jul 2018 22:43:47 +0000 (+0200) Subject: cosmetics X-Git-Tag: v3_21~512 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/f7c345a00e92ff915252ae30043dc90ca9a48686 cosmetics --- diff --git a/src/surf/network_cm02.cpp b/src/surf/network_cm02.cpp index 72d1a9af5d..7adee01564 100644 --- a/src/surf/network_cm02.cpp +++ b/src/surf/network_cm02.cpp @@ -34,8 +34,7 @@ double sg_weight_S_parameter = 0.0; /* default value; can be set by model or /* } */ void surf_network_model_init_LegrandVelho() { - if (surf_network_model) - return; + xbt_assert(surf_network_model == nullptr, "Cannot set the network model twice"); surf_network_model = new simgrid::kernel::resource::NetworkCm02Model(); all_existing_models->push_back(surf_network_model); @@ -58,8 +57,7 @@ void surf_network_model_init_LegrandVelho() /* } */ void surf_network_model_init_CM02() { - if (surf_network_model) - return; + xbt_assert(surf_network_model == nullptr, "Cannot set the network model twice"); simgrid::config::set_default("network/latency-factor", 1.0); simgrid::config::set_default("network/bandwidth-factor", 1.0); @@ -81,8 +79,7 @@ void surf_network_model_init_CM02() /* } */ void surf_network_model_init_Reno() { - if (surf_network_model) - return; + xbt_assert(surf_network_model == nullptr, "Cannot set the network model twice"); namespace lmm = simgrid::kernel::lmm; lmm::Lagrange::set_default_protocol_function(lmm::func_reno_f, lmm::func_reno_fp, lmm::func_reno_fpi); @@ -98,8 +95,7 @@ void surf_network_model_init_Reno() void surf_network_model_init_Reno2() { - if (surf_network_model) - return; + xbt_assert(surf_network_model == nullptr, "Cannot set the network model twice"); namespace lmm = simgrid::kernel::lmm; lmm::Lagrange::set_default_protocol_function(lmm::func_reno2_f, lmm::func_reno2_fp, lmm::func_reno2_fpi); @@ -114,8 +110,7 @@ void surf_network_model_init_Reno2() void surf_network_model_init_Vegas() { - if (surf_network_model) - return; + xbt_assert(surf_network_model == nullptr, "Cannot set the network model twice"); namespace lmm = simgrid::kernel::lmm; lmm::Lagrange::set_default_protocol_function(lmm::func_vegas_f, lmm::func_vegas_fp, lmm::func_vegas_fpi); diff --git a/src/surf/network_ib.cpp b/src/surf/network_ib.cpp index a6335848b3..d672a8df21 100644 --- a/src/surf/network_ib.cpp +++ b/src/surf/network_ib.cpp @@ -85,8 +85,7 @@ static void IB_action_init_callback(simgrid::kernel::resource::NetworkAction* ac /* } */ void surf_network_model_init_IB() { - if (surf_network_model) - return; + xbt_assert(surf_network_model == nullptr, "Cannot set the network model twice"); surf_network_model = new simgrid::kernel::resource::NetworkIBModel(); all_existing_models->push_back(surf_network_model); diff --git a/src/surf/network_ns3.cpp b/src/surf/network_ns3.cpp index bc8a59a3ce..cfc5864394 100644 --- a/src/surf/network_ns3.cpp +++ b/src/surf/network_ns3.cpp @@ -136,8 +136,7 @@ static void postparse_cb() *********/ void surf_network_model_init_NS3() { - if (surf_network_model) - return; + xbt_assert(surf_network_model == nullptr, "Cannot set the network model twice"); surf_network_model = new simgrid::kernel::resource::NetworkNS3Model(); all_existing_models->push_back(surf_network_model); diff --git a/src/surf/ptask_L07.cpp b/src/surf/ptask_L07.cpp index 36a7e0f16d..f0deae582b 100644 --- a/src/surf/ptask_L07.cpp +++ b/src/surf/ptask_L07.cpp @@ -18,8 +18,8 @@ XBT_LOG_EXTERNAL_CATEGORY(xbt_cfg); void surf_host_model_init_ptask_L07() { XBT_CINFO(xbt_cfg,"Switching to the L07 model to handle parallel tasks."); - xbt_assert(not surf_cpu_model_pm, "CPU model type already defined"); - xbt_assert(not surf_network_model, "network model type already defined"); + xbt_assert(not surf_cpu_model_pm, "Cannot switch to ptasks: CPU model already defined"); + xbt_assert(not surf_network_model, "Cannot switch to ptasks: network model already defined"); surf_host_model = new simgrid::surf::HostL07Model(); all_existing_models->push_back(surf_host_model); diff --git a/src/surf/sg_platf.cpp b/src/surf/sg_platf.cpp index accf45b3ec..3343bfc622 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -549,11 +549,11 @@ simgrid::kernel::routing::NetZoneImpl* sg_platf_new_Zone_begin(simgrid::kernel:: simgrid::s4u::on_platform_creation(); /* Initialize the surf models. That must be done after we got all config, and before we need the models. - * That is, after the last tag, if any, and before the first of cluster|peer|AS|trace|trace_connect + * That is, after the last tag, if any, and before the first of cluster|peer|zone|trace|trace_connect * * I'm not sure for and , there may be a bug here * (FIXME: check it out by creating a file beginning with one of these tags) - * but cluster and peer create ASes internally, so putting the code in there is ok. + * but cluster and peer come down to zone creations, so putting this verification here is correct. */ surf_parse_models_setup_already_called = 1; surf_config_models_setup();