Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
8f4cffe1fbeb8de8fa4b92223257772e270c6a66
[simgrid.git] / src / surf / host_clm03.hpp
1 /* Copyright (c) 2013-2015. The SimGrid Team.
2  * All rights reserved.                                                     */
3
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. */
6
7 #include <xbt/base.h>
8
9 #include "storage_interface.hpp"
10 #include "cpu_interface.hpp"
11 #include "host_interface.hpp"
12 #include "network_interface.hpp"
13
14 #ifndef SURF_HOST_CLM03_HPP_
15 #define SURF_HOST_CLM03_HPP_
16
17 /***********
18  * Classes *
19  ***********/
20
21 namespace simgrid {
22 namespace surf {
23
24 class XBT_PRIVATE HostCLM03Model;
25 class XBT_PRIVATE HostCLM03;
26 class XBT_PRIVATE HostCLM03Action;
27
28 /*********
29  * Model *
30  *********/
31
32 class HostCLM03Model : public HostModel {
33 public:
34   HostCLM03Model(): HostModel(){}
35   ~HostCLM03Model() {}
36   Host *createHost(const char *name, RoutingEdge *netElm, Cpu *cpu, xbt_dict_t props) override;
37   double shareResources(double now) override;
38
39   void updateActionsState(double now, double delta) override;
40
41   Action *executeParallelTask(int host_nb,
42                               sg_host_t *host_list,
43                                                           double *flops_amount,
44                                                           double *bytes_amount,
45                                                           double rate) override;
46 };
47
48 /************
49  * Resource *
50  ************/
51
52 class HostCLM03 : public Host {
53 public:
54   HostCLM03(HostModel *model, const char* name, xbt_dict_t properties, xbt_dynar_t storage, RoutingEdge *netElm, Cpu *cpu);
55   ~HostCLM03();
56   void updateState(tmgr_trace_event_t event_type, double value, double date) override;
57
58   virtual Action *execute(double size) override;
59   virtual Action *sleep(double duration) override;
60
61   bool isUsed() override;
62
63   xbt_dynar_t getVms();
64 };
65
66
67 /**********
68  * Action *
69  **********/
70
71 }
72 }
73
74 #endif /* SURF_HOST_CLM03_HPP_ */