Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
generateDotFile, to generate dot files for fat trees
[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   ActionPtr communicate(WorkstationPtr src, WorkstationPtr dst, double size, double rate);
43   ActionPtr executeParallelTask(int workstation_nb,
44                                           void **workstation_list,
45                                           double *computation_amount,
46                                           double *communication_amount,
47                                           double rate);
48   void updateActionsState(double /*now*/, double /*delta*/);
49 };
50
51 /************
52  * Resource *
53  ************/
54
55 class WorkstationVMHL13 : public WorkstationVM {
56 public:
57   WorkstationVMHL13(WorkstationVMModelPtr model, const char* name, xbt_dict_t props, surf_resource_t ind_phys_workstation);
58   ~WorkstationVMHL13();
59
60   void suspend();
61   void resume();
62
63   void save();
64   void restore();
65
66   void migrate(surf_resource_t ind_dst_pm);
67
68   e_surf_resource_state_t getState();
69   void setState(e_surf_resource_state_t state);
70
71   surf_resource_t getPm(); // will be vm_ws_get_pm()
72
73   void setBound(double bound);
74   void setAffinity(CpuPtr cpu, unsigned long mask);
75
76   //FIXME: remove
77   void updateState(tmgr_trace_event_t event_type, double value, double date);
78   bool isUsed();
79
80   ActionPtr execute(double size);
81   ActionPtr sleep(double duration);
82 };
83
84 /**********
85  * Action *
86  **********/
87
88 #endif /* VM_WORKSTATION_HPP_ */