Merged in schedPolSwitchConfigFile (pull request #8)
SchedPolSwitchConfigFile Approved-by: Akash Kothawale <akothaw1@binghamton.edu>
This commit is contained in:
parent
b569bd3060
commit
b877d31cb8
6 changed files with 71 additions and 16 deletions
11
scheduler.go
11
scheduler.go
|
@ -27,6 +27,7 @@ var classMapWatts = flag.Bool("classMapWatts", false, "Enable mapping of watts t
|
|||
var schedPolicyName = flag.String("schedPolicy", "first-fit", "Name of the scheduling policy to be used.\n\tUse option -listSchedPolicies to get the names of available scheduling policies")
|
||||
var listSchedPolicies = flag.Bool("listSchedPolicies", false, "List the names of the pluaggable scheduling policies.")
|
||||
var enableSchedPolicySwitch = flag.Bool("switchSchedPolicy", false, "Enable switching of scheduling policies at runtime.")
|
||||
var schedPolConfigFile = flag.String("schedPolConfig", "", "Config file that contains information for each scheduling policy.")
|
||||
|
||||
// Short hand args
|
||||
func init() {
|
||||
|
@ -40,6 +41,7 @@ func init() {
|
|||
flag.StringVar(schedPolicyName, "sp", "first-fit", "Name of the scheduling policy to be used.\n Use option -listSchedPolicies to get the names of available scheduling policies (shorthand)")
|
||||
flag.BoolVar(listSchedPolicies, "lsp", false, "Names of the pluaggable scheduling policies. (shorthand)")
|
||||
flag.BoolVar(enableSchedPolicySwitch, "ssp", false, "Enable switching of scheduling policies at runtime.")
|
||||
flag.StringVar(schedPolConfigFile, "spConfig", "", "Config file that contains information for each scheduling policy (shorthand).")
|
||||
}
|
||||
|
||||
func listAllSchedulingPolicies() {
|
||||
|
@ -110,6 +112,15 @@ func main() {
|
|||
fmt.Println(task)
|
||||
}
|
||||
|
||||
if *enableSchedPolicySwitch {
|
||||
if spcf := *schedPolConfigFile; spcf == "" {
|
||||
logger.WriteLog(elecLogDef.ERROR, "No file containing characteristics for scheduling policies")
|
||||
} else {
|
||||
// Initializing the characteristics of the scheduling policies.
|
||||
schedulers.InitSchedPolicyCharacteristics(spcf)
|
||||
}
|
||||
}
|
||||
|
||||
shutdown := make(chan struct{})
|
||||
done := make(chan struct{})
|
||||
pcpLog := make(chan struct{})
|
||||
|
|
Reference in a new issue