formatted the code
This commit is contained in:
parent
f6ec974182
commit
81d795f197
4 changed files with 113 additions and 111 deletions
|
@ -47,7 +47,6 @@ func UpdateCapMargin(new_cap_margin float64) bool {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Threshold factor that would make (Cap_margin * task.Watts) equal to (60/100 * task.Watts).
|
// Threshold factor that would make (Cap_margin * task.Watts) equal to (60/100 * task.Watts).
|
||||||
var Starvation_factor = 0.8
|
var Starvation_factor = 0.8
|
||||||
|
|
||||||
|
@ -73,7 +72,7 @@ func AddTotalPowerForHost(host string, total_power float64) bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Window size for running average
|
// Window size for running average
|
||||||
var Window_size = 160
|
var Window_size = 10
|
||||||
|
|
||||||
// Update the window size.
|
// Update the window size.
|
||||||
func UpdateWindowSize(new_window_size int) bool {
|
func UpdateWindowSize(new_window_size int) bool {
|
||||||
|
|
|
@ -118,6 +118,9 @@ A recapping strategy which decides between 2 different recapping schemes.
|
||||||
2. A scheme based on the average of the loads on each node in the cluster.
|
2. A scheme based on the average of the loads on each node in the cluster.
|
||||||
|
|
||||||
The recap value picked the least among the two.
|
The recap value picked the least among the two.
|
||||||
|
|
||||||
|
The cleverRecap scheme works well when the cluster is relatively idle and until then,
|
||||||
|
the primitive recapping scheme works better.
|
||||||
*/
|
*/
|
||||||
func (capper clusterwideCapper) cleverRecap(total_power map[string]float64,
|
func (capper clusterwideCapper) cleverRecap(total_power map[string]float64,
|
||||||
task_monitor map[string][]def.Task, finished_taskId string) (float64, error) {
|
task_monitor map[string][]def.Task, finished_taskId string) (float64, error) {
|
||||||
|
@ -153,7 +156,7 @@ func (capper clusterwideCapper) cleverRecap(total_power map[string]float64,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Updating task monitor. If recap(...) has deleted the finished task from the taskMonitor,
|
// Updating task monitor. If recap(...) has deleted the finished task from the taskMonitor,
|
||||||
// then this will be ignored.
|
// then this will be ignored. Else (this is only when an error occured with recap(...)), we remove it here.
|
||||||
if host_of_finished_task != "" && index_of_finished_task != -1 {
|
if host_of_finished_task != "" && index_of_finished_task != -1 {
|
||||||
log.Printf("Removing task with task [%s] from the list of running tasks\n",
|
log.Printf("Removing task with task [%s] from the list of running tasks\n",
|
||||||
task_monitor[host_of_finished_task][index_of_finished_task].TaskID)
|
task_monitor[host_of_finished_task][index_of_finished_task].TaskID)
|
||||||
|
|
Reference in a new issue