1 /* Copyright (c) 2013-2018. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
11 #include "host_clm03.hpp"
13 #include "cpu_cas01.hpp"
14 #include "simgrid/sg_config.hpp"
16 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_host);
26 void surf_host_model_init_current_default()
28 surf_host_model = new simgrid::surf::HostCLM03Model();
29 xbt_cfg_setdefault_boolean("network/crosstraffic", "yes");
30 surf_cpu_model_init_Cas01();
31 surf_network_model_init_LegrandVelho();
33 all_existing_models->push_back(surf_host_model);
36 void surf_host_model_init_compound()
38 xbt_assert(surf_cpu_model_pm, "No CPU model defined yet!");
39 xbt_assert(surf_network_model, "No network model defined yet!");
41 surf_host_model = new simgrid::surf::HostCLM03Model();
42 all_existing_models->push_back(surf_host_model);
48 double HostCLM03Model::next_occuring_event(double now)
50 ignore_empty_vm_in_pm_LMM();
52 double min_by_cpu = surf_cpu_model_pm->next_occuring_event(now);
54 surf_network_model->next_occuring_event_is_idempotent() ? surf_network_model->next_occuring_event(now) : -1;
55 double min_by_sto = surf_storage_model->next_occuring_event(now);
57 XBT_DEBUG("model %p, %s min_by_cpu %f, %s min_by_net %f, %s min_by_sto %f",
58 this, typeid(surf_cpu_model_pm).name(), min_by_cpu,
59 typeid(surf_network_model).name(), min_by_net,
60 typeid(surf_storage_model).name(), min_by_sto);
62 double res = std::max({min_by_cpu, min_by_net, min_by_sto});
63 if (min_by_cpu >= 0.0 && min_by_cpu < res)
65 if (min_by_net >= 0.0 && min_by_net < res)
67 if (min_by_sto >= 0.0 && min_by_sto < res)
72 void HostCLM03Model::update_actions_state(double /*now*/, double /*delta*/)
74 /* I won't do what you tell me */