X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/54e35ebda7e4ffacd769653b8ebb8ba93c7298bf..796c472929f78dd5131c885d544579d4a6bdc425:/src/surf/host_clm03.hpp diff --git a/src/surf/host_clm03.hpp b/src/surf/host_clm03.hpp index 3a935eb0a9..9e073b5c3f 100644 --- a/src/surf/host_clm03.hpp +++ b/src/surf/host_clm03.hpp @@ -1,74 +1,29 @@ -/* Copyright (c) 2013-2014. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2013-2022. 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 "storage_interface.hpp" -#include "cpu_interface.hpp" -#include "host_interface.hpp" -#include "network_interface.hpp" +#include "src/surf/HostImpl.hpp" -#ifndef SURF_HOST_CLM03_HPP_ -#define SURF_HOST_CLM03_HPP_ +#ifndef HOST_CLM03_HPP_ +#define HOST_CLM03_HPP_ /*********** * Classes * ***********/ -class HostCLM03Model; -class HostCLM03; -class HostCLM03Action; +namespace simgrid::kernel::resource { -/********* - * Model * - *********/ - -class HostCLM03Model : public HostModel { -public: - HostCLM03Model(); - ~HostCLM03Model(); - Host *createHost(const char *name); - double shareResources(double now); - - void updateActionsState(double now, double delta); - - Action *executeParallelTask(int host_nb, - void **host_list, - double *flops_amount, - double *bytes_amount, - double rate); - Action *communicate(Host *src, Host *dst, double size, double rate); -}; - -/************ - * Resource * - ************/ - -class HostCLM03 : public Host { +class XBT_PRIVATE HostCLM03Model : public HostModel { public: - HostCLM03(HostModel *model, const char* name, xbt_dict_t properties, xbt_dynar_t storage, RoutingEdge *netElm, Cpu *cpu); - - void updateState(tmgr_trace_event_t event_type, double value, double date); - - virtual Action *execute(double size); - virtual Action *sleep(double duration); - e_surf_resource_state_t getState(); - - bool isUsed(); - - xbt_dynar_t getVms(); - - /* common with vm */ - void getParams(ws_params_t params); - void setParams(ws_params_t params); + using HostModel::HostModel; + double next_occurring_event(double now) override; + void update_actions_state(double now, double delta) override; + Action* execute_thread(const s4u::Host* host, double flops_amount, int thread_count) override; + Action* execute_parallel(const std::vector& host_list, const double* flops_amount, + const double* bytes_amount, double rate) override; + Action* io_stream(s4u::Host* src_host, DiskImpl* src_disk, s4u::Host* dst_host, DiskImpl* dst_disk, double size) override { return nullptr; } }; +} // namespace simgrid::kernel::resource - -/********** - * Action * - **********/ - - - -#endif /* SURF_HOST_CLM03_HPP_ */ +#endif /* HOST_CLM03_HPP_ */