Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add "attach" attribute to storage tag in platform description
[simgrid.git] / src / surf / workstation_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 "workstation_interface.hpp"
8 #include "storage_interface.hpp"
9 #include "cpu_interface.hpp"
10 #include "network_interface.hpp"
11
12 #ifndef SURF_WORKSTATION_CLM03_HPP_
13 #define SURF_WORKSTATION_CLM03_HPP_
14
15 /***********
16  * Classes *
17  ***********/
18
19 class WorkstationCLM03Model;
20 typedef WorkstationCLM03Model *WorkstationCLM03ModelPtr;
21
22 class WorkstationCLM03;
23 typedef WorkstationCLM03 *WorkstationCLM03Ptr;
24
25 class WorkstationCLM03Action;
26 typedef WorkstationCLM03Action *WorkstationCLM03ActionPtr;
27
28 /*********
29  * Model *
30  *********/
31
32 class WorkstationCLM03Model : public WorkstationModel {
33 public:
34   WorkstationCLM03Model();
35   ~WorkstationCLM03Model();
36   void parseInit(sg_platf_host_cbarg_t host);
37   WorkstationPtr createResource(const char *name);
38   double shareResources(double now);
39
40   void updateActionsState(double now, double delta);
41
42   ActionPtr executeParallelTask(int workstation_nb,
43                                         void **workstation_list,
44                                         double *computation_amount,
45                                         double *communication_amount,
46                                         double rate);
47  ActionPtr communicate(WorkstationPtr src, WorkstationPtr dst, double size, double rate);
48 };
49
50 /************
51  * Resource *
52  ************/
53
54 class WorkstationCLM03 : public Workstation {
55 public:
56   WorkstationCLM03(WorkstationModelPtr model, const char* name, xbt_dict_t properties, xbt_dynar_t storage, RoutingEdgePtr netElm, CpuPtr cpu);
57
58   void updateState(tmgr_trace_event_t event_type, double value, double date);
59
60   virtual ActionPtr execute(double size);
61   virtual ActionPtr sleep(double duration);
62   e_surf_resource_state_t getState();
63
64   bool isUsed();
65
66   xbt_dynar_t getVms();
67
68   /* common with vm */
69   void getParams(ws_params_t params);
70   void setParams(ws_params_t params);
71 };
72
73
74 /**********
75  * Action *
76  **********/
77
78
79
80 #endif /* SURF_WORKSTATION_CLM03_HPP_ */