/* } */
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);
/* } */
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<double>("network/latency-factor", 1.0);
simgrid::config::set_default<double>("network/bandwidth-factor", 1.0);
/* } */
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);
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);
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);
/* } */
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);
*********/
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);
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);
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 <config> tag, if any, and before the first of cluster|peer|AS|trace|trace_connect
+ * That is, after the last <config> tag, if any, and before the first of cluster|peer|zone|trace|trace_connect
*
* I'm not sure for <trace> and <trace_connect>, 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();