Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Cleanup.
[simgrid.git] / src / surf / vm_workstation_hl13.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 "vm_workstation_interface.hpp"
8 #include "workstation_clm03.hpp"
9
10 #ifndef VM_WORKSTATION_HPP_
11 #define VM_WORKSTATION_HPP_
12
13 #define GUESTOS_NOISE 100 // This value corresponds to the cost of the global action associated to the VM
14                           // It corresponds to the cost of a VM running no tasks.
15
16 void surf_vm_workstation_model_init(void);
17
18 /***********
19  * Classes *
20  ***********/
21
22 class WorkstationVMHL13Model;
23 typedef WorkstationVMHL13Model *WorkstationVMHL13ModelPtr;
24
25 class WorkstationVMHL13;
26 typedef WorkstationVMHL13 *WorkstationVMHL13Ptr;
27
28 /*********
29  * Tools *
30  *********/
31
32 /*********
33  * Model *
34  *********/
35 class WorkstationVMHL13Model : public WorkstationVMModel {
36 public:
37   WorkstationVMHL13Model();
38   ~WorkstationVMHL13Model(){};
39   void createResource(const char *name, void *ind_phys_workstation);
40   double shareResources(double now);
41   void adjustWeightOfDummyCpuActions() {};
42   xbt_dynar_t getRoute(WorkstationPtr src, WorkstationPtr dst);
43   ActionPtr communicate(WorkstationPtr src, WorkstationPtr dst, double size, double rate);
44   ActionPtr executeParallelTask(int workstation_nb,
45                                           void **workstation_list,
46                                           double *computation_amount,
47                                           double *communication_amount,
48                                           double rate);
49   void updateActionsState(double /*now*/, double /*delta*/);
50 };
51
52 /************
53  * Resource *
54  ************/
55
56 class WorkstationVMHL13 : public WorkstationVM {
57 public:
58   WorkstationVMHL13(WorkstationVMModelPtr model, const char* name, xbt_dict_t props, surf_resource_t ind_phys_workstation);
59   ~WorkstationVMHL13();
60
61   void suspend();
62   void resume();
63
64   void save();
65   void restore();
66
67   void migrate(surf_resource_t ind_dst_pm);
68
69   e_surf_resource_state_t getState();
70   void setState(e_surf_resource_state_t state);
71
72   surf_resource_t getPm(); // will be vm_ws_get_pm()
73
74   void setBound(double bound);
75   void setAffinity(CpuPtr cpu, unsigned long mask);
76
77   //FIXME: remove
78   void updateState(tmgr_trace_event_t event_type, double value, double date);
79   bool isUsed();
80
81   ActionPtr execute(double size);
82   ActionPtr sleep(double duration);
83 };
84
85 /**********
86  * Action *
87  **********/
88
89 #endif /* VM_WORKSTATION_HPP_ */