Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Page-level sparse snapshot: work-in-progress, working page_store
[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 /***********
17  * Classes *
18  ***********/
19
20 class WorkstationVMHL13Model;
21 typedef WorkstationVMHL13Model *WorkstationVMHL13ModelPtr;
22
23 class WorkstationVMHL13;
24 typedef WorkstationVMHL13 *WorkstationVMHL13Ptr;
25
26 /*********
27  * Model *
28  *********/
29 class WorkstationVMHL13Model : public WorkstationVMModel {
30 public:
31   WorkstationVMHL13Model();
32   ~WorkstationVMHL13Model(){};
33
34   WorkstationVMPtr createWorkstationVM(const char *name, surf_resource_t ind_phys_workstation);
35   double shareResources(double now);
36   void adjustWeightOfDummyCpuActions() {};
37   ActionPtr communicate(WorkstationPtr src, WorkstationPtr dst, double size, double rate);
38   ActionPtr executeParallelTask(int workstation_nb,
39                                           void **workstation_list,
40                                           double *computation_amount,
41                                           double *communication_amount,
42                                           double rate);
43   void updateActionsState(double /*now*/, double /*delta*/);
44 };
45
46 /************
47  * Resource *
48  ************/
49
50 class WorkstationVMHL13 : public WorkstationVM {
51 public:
52   WorkstationVMHL13(WorkstationVMModelPtr model, const char* name, xbt_dict_t props, surf_resource_t ind_phys_workstation);
53   ~WorkstationVMHL13();
54
55   void suspend();
56   void resume();
57
58   void save();
59   void restore();
60
61   void migrate(surf_resource_t ind_dst_pm);
62
63   e_surf_resource_state_t getState();
64   void setState(e_surf_resource_state_t state);
65
66   surf_resource_t getPm(); // will be vm_ws_get_pm()
67
68   void setBound(double bound);
69   void setAffinity(CpuPtr cpu, unsigned long mask);
70
71   //FIXME: remove
72   void updateState(tmgr_trace_event_t event_type, double value, double date);
73   bool isUsed();
74
75   ActionPtr execute(double size);
76   ActionPtr sleep(double duration);
77 };
78
79 /**********
80  * Action *
81  **********/
82
83 #endif /* VM_WORKSTATION_HPP_ */