try to handle inconsistencies in github environments.
std::vector<double> comm(4, 0.0);
// Different hosts.
std::vector<sg4::Host*> hosts_diff = {e->host_by_name("MyHost2"), e->host_by_name("MyHost3")};
- double start_time = e->get_clock();
+ double start_time = sg4::Engine::get_clock();
sg4::this_actor::parallel_execute(hosts_diff, comp, comm);
XBT_INFO("Computed 2-core activity on two different hosts. Took %g s", e->get_clock() - start_time);
// Same host, monocore.
std::vector<sg4::Host*> monocore_hosts = {e->host_by_name("MyHost2"), e->host_by_name("MyHost2")};
- start_time = e->get_clock();
+ start_time = sg4::Engine::get_clock();
sg4::this_actor::parallel_execute(monocore_hosts, comp, comm);
XBT_INFO("Computed 2-core activity one 1-core host. Took %g s", e->get_clock() - start_time);
// Same host, multicore.
std::vector<sg4::Host*> multicore_host = {e->host_by_name("MyHost1"), e->host_by_name("MyHost1")};
- start_time = e->get_clock();
+ start_time = sg4::Engine::get_clock();
sg4::this_actor::parallel_execute(multicore_host, comp, comm);
XBT_INFO("Computed 2-core activity on one 2-core host. Took %g s", e->get_clock() - start_time);
std::vector<double> comp6(6, 1e9);
std::vector<double> comm6(36, 0.0);
std::vector<sg4::Host*> multicore_overload(6, e->host_by_name("MyHost1"));
- start_time = e->get_clock();
+ start_time = sg4::Engine::get_clock();
sg4::this_actor::parallel_execute(multicore_overload, comp6, comm6);
XBT_INFO("Computed 6-core activity of a 4-core host. Took %g s", e->get_clock() - start_time);
}
const std::vector<simgrid::kernel::resource::Model*>& get_model_list(simgrid::kernel::resource::Model::Type type);
/** @brief Get list of all models managed by this engine */
- const std::vector<std::shared_ptr<simgrid::kernel::resource::Model>>& get_all_models();
+ const std::vector<std::shared_ptr<simgrid::kernel::resource::Model>>& get_all_models() const;
/** @brief Retrieves all netzones of the type indicated by the template argument */
template <class T> std::vector<T*> get_filtered_netzones() const
return pimpl->get_model_list(type);
}
-const std::vector<std::shared_ptr<simgrid::kernel::resource::Model>>& Engine::get_all_models()
+const std::vector<std::shared_ptr<simgrid::kernel::resource::Model>>& Engine::get_all_models() const
{
return pimpl->get_all_models();
}
class CpuCas01 : public Cpu {
public:
- CpuCas01(s4u::Host* host, const std::vector<double>& speed_per_pstate) : Cpu(host, speed_per_pstate) {}
+ using Cpu::Cpu;
CpuCas01(const CpuCas01&) = delete;
CpuCas01& operator=(const CpuCas01&) = delete;
void apply_event(profile::Event* event, double value) override;
namespace kernel {
namespace resource {
-DiskS19Model::DiskS19Model()
-{
-}
-
DiskImpl* DiskS19Model::create_disk(const std::string& name, double read_bandwidth, double write_bandwidth)
{
return (new DiskS19(name, read_bandwidth, write_bandwidth))->set_model(this);
class DiskS19Model : public DiskModel {
public:
- DiskS19Model();
+ DiskS19Model() = default;
DiskImpl* create_disk(const std::string& name, double read_bandwidth, double write_bandwidth) override;
double next_occurring_event(double now) override;
void update_actions_state(double now, double delta) override;
namespace simgrid {
namespace surf {
-HostCLM03Model::HostCLM03Model()
-{
-}
-
double HostCLM03Model::next_occurring_event(double now)
{
/* nothing specific to be done here
class XBT_PRIVATE HostCLM03Model : public HostModel {
public:
- HostCLM03Model();
+ HostCLM03Model() = default;
double next_occurring_event(double now) override;
void update_actions_state(double now, double delta) override;
kernel::resource::Action* execute_parallel(const std::vector<s4u::Host*>& host_list, const double* flops_amount,
return get_constraint()->get_sharing_policy();
}
-void LinkImpl::latency_check(double latency)
+void LinkImpl::latency_check(double latency) const
{
static double last_warned_latency = sg_surf_precision;
if (latency != 0.0 && latency < last_warned_latency) {
public:
void destroy(); // Must be called instead of the destructor
- void latency_check(double latency);
+ void latency_check(double latency) const;
/** @brief Public interface */
const s4u::Link* get_iface() const { return &piface_; }
engine->add_model(simgrid::kernel::resource::Model::Type::CPU_PM, std::move(cpu_model), true);
}
-HostL07Model::~HostL07Model() {}
-
CpuL07Model::CpuL07Model(HostL07Model* hmodel, kernel::lmm::System* sys)
: CpuModel(Model::UpdateAlgo::FULL), hostModel_(hmodel)
{
HostL07Model();
HostL07Model(const HostL07Model&) = delete;
HostL07Model& operator=(const HostL07Model&) = delete;
- ~HostL07Model() override;
double next_occurring_event(double now) override;
void update_actions_state(double now, double delta) override;
CpuL07Model(const CpuL07Model&) = delete;
CpuL07Model& operator=(const CpuL07Model&) = delete;
~CpuL07Model() override;
- /* this action is done by HostL07Model which shares the LMM system with the CPU model
- * Overriding to an empty function here allows us to handle the Cpu07Model as a regular
- * method in surf_presolve */
- void update_actions_state(double now, double delta) override{};
+ void update_actions_state(double /*now*/, double /*delta*/) override{
+ /* this action is done by HostL07Model which shares the LMM system with the CPU model
+ * Overriding to an empty function here allows us to handle the Cpu07Model as a regular
+ * method in surf_presolve */
+ };
kernel::resource::Cpu* create_cpu(s4u::Host* host, const std::vector<double>& speed_per_pstate) override;
HostL07Model* hostModel_;
s4u::Link::SharingPolicy policy) override;
kernel::resource::Action* communicate(s4u::Host* src, s4u::Host* dst, double size, double rate) override;
- /* this action is done by HostL07Model which shares the LMM system with the CPU model
- * Overriding to an empty function here allows us to handle the Cpu07Model as a regular
- * method in surf_presolve */
- void update_actions_state(double now, double delta) override{};
+ void update_actions_state(double /*now*/, double /*delta*/) override{
+ /* this action is done by HostL07Model which shares the LMM system with the CPU model
+ * Overriding to an empty function here allows us to handle the Cpu07Model as a regular
+ * method in surf_presolve */
+ };
HostL07Model* hostModel_;
};
class CpuL07 : public kernel::resource::Cpu {
public:
- CpuL07(s4u::Host* host, const std::vector<double>& speed_per_pstate) : Cpu(host, speed_per_pstate){};
+ using kernel::resource::Cpu::Cpu;
CpuL07(const CpuL07&) = delete;
CpuL07& operator=(const CpuL07&) = delete;
xbt_assert(argc > 1, "Usage: %s platform.xml\n", argv[0]);
parse_platform_file(argv[1]);
- sg_netzone_t as_zone = sg_zone_get_by_name("AS0");
+ const_sg_netzone_t as_zone = sg_zone_get_by_name("AS0");
simgrid::kernel::resource::NetworkModel* net_model = as_zone->get_impl()->get_network_model();
simgrid::kernel::resource::CpuModel* cpu_model_pm = as_zone->get_impl()->get_cpu_pm_model();
hostB->pimpl_cpu->execution_start(1000.0);
hostB->pimpl_cpu->sleep(7.32);
- sg_netzone_t as_zone = sg_zone_get_by_name("AS0");
+ const_sg_netzone_t as_zone = sg_zone_get_by_name("AS0");
simgrid::kernel::resource::NetworkModel* net_model = as_zone->get_impl()->get_network_model();
net_model->communicate(hostA, hostB, 150.0, -1.0);