Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
rename some symbols around Link::isShared to make their purpose clear
[simgrid.git] / src / surf / vm_hl13.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 "host_clm03.hpp"
10 #include "virtual_machine.hpp"
11
12 #ifndef SURF_VM_HPP_
13 #define SURF_VM_HPP_
14
15 #define GUESTOS_NOISE 100 // This value corresponds to the cost of the global action associated to the VM
16                           // It corresponds to the cost of a VM running no tasks.
17
18 /***********
19  * Classes *
20  ***********/
21
22 class XBT_PRIVATE VMHL13Model;
23 class XBT_PRIVATE VMHL13;
24
25 /*********
26  * Model *
27  *********/
28 class VMHL13Model : public VMModel {
29 public:
30   VMHL13Model();
31   ~VMHL13Model(){};
32
33   VirtualMachine *createVM(const char *name, surf_resource_t host_PM);
34   double shareResources(double now);
35   void adjustWeightOfDummyCpuActions() {};
36   Action *executeParallelTask(int host_nb,
37                               sg_host_t *host_list,
38                                                           double *flops_amount,
39                                                           double *bytes_amount,
40                                                           double rate);
41   void updateActionsState(double /*now*/, double /*delta*/);
42 };
43
44 /************
45  * Resource *
46  ************/
47
48 class VMHL13 : public VirtualMachine {
49 public:
50   VMHL13(VMModel *model, const char* name, xbt_dict_t props, surf_resource_t host_PM);
51   ~VMHL13();
52
53   void suspend();
54   void resume();
55
56   void save();
57   void restore();
58
59   void migrate(surf_resource_t ind_dst_pm);
60
61   e_surf_resource_state_t getState();
62   void setState(e_surf_resource_state_t state);
63
64   surf_resource_t getPm(); // will be vm_ws_get_pm()
65
66   void setBound(double bound);
67   void setAffinity(Cpu *cpu, unsigned long mask);
68
69   //FIXME: remove
70   void updateState(tmgr_trace_event_t event_type, double value, double date);
71   bool isUsed();
72
73   Action *execute(double size);
74   Action *sleep(double duration);
75 };
76
77 /**********
78  * Action *
79  **********/
80
81 #endif /* SURF_VM_HPP_ */