Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Cleanup mc_hash
[simgrid.git] / src / surf / host_clm03.hpp
1 /* Copyright (c) 2013-2014. 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 "storage_interface.hpp"
8 #include "cpu_interface.hpp"
9 #include "host_interface.hpp"
10 #include "network_interface.hpp"
11
12 #ifndef SURF_HOST_CLM03_HPP_
13 #define SURF_HOST_CLM03_HPP_
14
15 /***********
16  * Classes *
17  ***********/
18
19 class HostCLM03Model;
20 typedef HostCLM03Model *HostCLM03ModelPtr;
21
22 class HostCLM03;
23 typedef HostCLM03 *HostCLM03Ptr;
24
25 class HostCLM03Action;
26 typedef HostCLM03Action *HostCLM03ActionPtr;
27
28 /*********
29  * Model *
30  *********/
31
32 class HostCLM03Model : public HostModel {
33 public:
34   HostCLM03Model();
35   ~HostCLM03Model();
36   HostPtr createHost(const char *name);
37   double shareResources(double now);
38
39   void updateActionsState(double now, double delta);
40
41   ActionPtr executeParallelTask(int host_nb,
42                                         void **host_list,
43                                         double *flops_amount,
44                                         double *bytes_amount,
45                                         double rate);
46  ActionPtr communicate(HostPtr src, HostPtr dst, double size, double rate);
47 };
48
49 /************
50  * Resource *
51  ************/
52
53 class HostCLM03 : public Host {
54 public:
55   HostCLM03(HostModelPtr model, const char* name, xbt_dict_t properties, xbt_dynar_t storage, RoutingEdgePtr netElm, CpuPtr cpu);
56
57   void updateState(tmgr_trace_event_t event_type, double value, double date);
58
59   virtual ActionPtr execute(double size);
60   virtual ActionPtr sleep(double duration);
61   e_surf_resource_state_t getState();
62
63   bool isUsed();
64
65   xbt_dynar_t getVms();
66
67   /* common with vm */
68   void getParams(ws_params_t params);
69   void setParams(ws_params_t params);
70 };
71
72
73 /**********
74  * Action *
75  **********/
76
77
78
79 #endif /* SURF_HOST_CLM03_HPP_ */