From 2311587e43b425e0fc6acf2d3de39d6a38ef8a56 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sun, 8 Jul 2018 00:23:59 +0200 Subject: [PATCH] tiny cleanups in HostCLM03Model --- src/surf/host_clm03.cpp | 21 ++++++--------------- src/surf/host_clm03.hpp | 17 +++-------------- 2 files changed, 9 insertions(+), 29 deletions(-) diff --git a/src/surf/host_clm03.cpp b/src/surf/host_clm03.cpp index 912e630329..f25ebdfd7b 100644 --- a/src/surf/host_clm03.cpp +++ b/src/surf/host_clm03.cpp @@ -3,42 +3,33 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include "host_clm03.hpp" +#include "src/surf/host_clm03.hpp" #include "simgrid/sg_config.hpp" #include "surf/surf.hpp" XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_host); -/************* - * CallBacks * - *************/ - -/********* - * Model * - *********/ - void surf_host_model_init_current_default() { surf_host_model = new simgrid::surf::HostCLM03Model(); simgrid::config::set_default("network/crosstraffic", true); surf_cpu_model_init_Cas01(); surf_network_model_init_LegrandVelho(); - - all_existing_models->push_back(surf_host_model); } void surf_host_model_init_compound() { xbt_assert(surf_cpu_model_pm, "No CPU model defined yet!"); xbt_assert(surf_network_model, "No network model defined yet!"); - surf_host_model = new simgrid::surf::HostCLM03Model(); - all_existing_models->push_back(surf_host_model); } namespace simgrid { namespace surf { - +HostCLM03Model::HostCLM03Model() +{ + all_existing_models->push_back(this); +} double HostCLM03Model::next_occuring_event(double now) { ignore_empty_vm_in_pm_LMM(); @@ -65,7 +56,7 @@ double HostCLM03Model::next_occuring_event(double now) void HostCLM03Model::update_actions_state(double /*now*/, double /*delta*/) { - /* I won't do what you tell me */ + /* I've no action to update */ } } diff --git a/src/surf/host_clm03.hpp b/src/surf/host_clm03.hpp index 53771aa346..1e97a2d65b 100644 --- a/src/surf/host_clm03.hpp +++ b/src/surf/host_clm03.hpp @@ -1,14 +1,8 @@ -/* Copyright (c) 2013-2018. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2013-2018. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include - -#include "StorageImpl.hpp" -#include "cpu_interface.hpp" -#include "network_interface.hpp" #include "src/surf/HostImpl.hpp" #ifndef SURF_HOST_CLM03_HPP_ @@ -21,14 +15,9 @@ namespace simgrid { namespace surf { -class XBT_PRIVATE HostCLM03Model; - -/********* - * Model * - *********/ - -class HostCLM03Model : public HostModel { +class XBT_PRIVATE HostCLM03Model : public HostModel { public: + HostCLM03Model(); double next_occuring_event(double now) override; void update_actions_state(double now, double delta) override; }; -- 2.20.1