GreenCloud Simulator
corescheduler.h
Go to the documentation of this file.
1 /*
2  * corescheduler.h
3  *
4  * @date Aug 29, 2013
5  * @author Guzek:Mateusz
6  */
7 
8 #ifndef CORESCHEDULER_H_
9 #define CORESCHEDULER_H_
10 
11 #include <stdlib.h>
12 #include <vector>
13 #include <iostream>
14 #include "taskalloc.h"
15 
16 class CloudTask;
17 class TaskAlloc;
18 class ResourceProvider;
19 
20 
21 
22 /*CoreScheduler is a class responsible for scheduling and load calculation of a core.
23  * It stores the information about the nominal, available and current mips on the level of scheduler.
24  * The tasks lists stores the tasks that are executed/assigned on/to the core.
25  * Additionally, it stores the pointers to the hosted schedulers of vcores to enable tracking the load of a core. */
27 public:
29  virtual ~CoreScheduler();
30 
32  void setDVFS(int eDVFS_enabled_);
33  double getCurrentMIPS();
34  double getCurrentMIPSRecursive();
35  double getNominalMIPS();
36  double getAvailableMIPS();
38 
39  void updateTskList(double c_mips);
40  void updateTskList();
41  void removeCompleted();
42  CloudTask* removeTaskAlloc(std::vector<TaskAlloc*>::iterator& iter,bool executed);
43  void removeTaskAlloc( TaskAlloc* ta);
44  void removeFailedTaskAlloc(std::vector<TaskAlloc*>::iterator& iter,bool executed);
45  void updateTskComputingRates( double c_mips);
46  double getMostUrgentTaskRate();
47  void setComputingRate();
48  int getAllTasksNumber();
49 
50  void assignTask(TaskAlloc* tskobj);
51  void executeTask(TaskAlloc* tskobj);
52  bool removeFromAssginedList(TaskAlloc* tskobj);
54  void startTaskExecution(CloudTask* tskobj);
55 
59 
60 
61 
62 private:
65  double current_mips_;
68  std::vector<CoreScheduler *> hosted_vcores_schedulers;
69  std::vector<TaskAlloc *> tasks_alloc_list_;
70  std::vector<TaskAlloc *> tasks_alloc_assigned_;
74 };
75 
76 
77 
78 #endif /* CORESCHEDULER_H_ */
std::vector< TaskAlloc * > tasks_alloc_list_
Definition: corescheduler.h:69
CoreScheduler * getHostScheduler()
void setComputingRate()
Capacity * available_mips_
Definition: corescheduler.h:64
CoreScheduler(Capacity *nominal_mips_, Capacity *available_mips_)
ResourceProvider * getProvider()
std::vector< TaskAlloc * > tasks_alloc_assigned_
Definition: corescheduler.h:70
void startTaskExecution(CloudTask *tskobj)
CoreScheduler * host_scheduler_
Definition: corescheduler.h:71
double getMostUrgentTaskRate()
int getAllTasksNumber()
void updateTskComputingRates(double c_mips)
double getNominalMIPS()
double getAvailableMIPS()
void setDVFS(int eDVFS_enabled_)
bool removeAllocationsFromAssginedList(CloudTask *tskobj)
double current_mips_
Definition: corescheduler.h:65
virtual ~CoreScheduler()
CloudTask * removeTaskAlloc(std::vector< TaskAlloc * >::iterator &iter, bool executed)
void updateTskList()
void removeVcoreScheduler(CoreScheduler *cs)
void assignTask(TaskAlloc *tskobj)
double getCurrentMIPS()
Capacity * nominal_mips_
Definition: corescheduler.h:63
void removeFailedTaskAlloc(std::vector< TaskAlloc * >::iterator &iter, bool executed)
double getCurrentMIPSRecursive()
void removeCompleted()
void addVcoreScheduler(CoreScheduler *cs)
void executeTask(TaskAlloc *tskobj)
bool removeFromAssginedList(TaskAlloc *tskobj)
ResourceProvider * provider
Definition: corescheduler.h:67
std::vector< CoreScheduler * > hosted_vcores_schedulers
Definition: corescheduler.h:68
void setProvider(ResourceProvider *provider)