Merge branch 'master' of https://bitbucket.org/sunybingcloud/electron into progressiveExtrema
This commit is contained in:
commit
dd3019735d
3 changed files with 36 additions and 32 deletions
|
@ -24,9 +24,11 @@ var PowerClasses = map[string]map[string]bool{
|
||||||
},
|
},
|
||||||
"B": map[string]bool{
|
"B": map[string]bool{
|
||||||
"stratos-007.cs.binghamton.edu": true,
|
"stratos-007.cs.binghamton.edu": true,
|
||||||
"stratos-008.cs.binghamton.edu": true,
|
|
||||||
},
|
},
|
||||||
"C": map[string]bool{
|
"C": map[string]bool{
|
||||||
|
"stratos-008.cs.binghamton.edu": true,
|
||||||
|
},
|
||||||
|
"D": map[string]bool {
|
||||||
"stratos-001.cs.binghamton.edu": true,
|
"stratos-001.cs.binghamton.edu": true,
|
||||||
"stratos-002.cs.binghamton.edu": true,
|
"stratos-002.cs.binghamton.edu": true,
|
||||||
"stratos-003.cs.binghamton.edu": true,
|
"stratos-003.cs.binghamton.edu": true,
|
||||||
|
|
|
@ -19,7 +19,7 @@ import (
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Tasks are categorized into small and large tasks based on the watts requirement.
|
Tasks are categorized into small and large tasks based on the watts requirement.
|
||||||
All the small tasks are packed into offers from agents belonging to power class C, using BinPacking.
|
All the small tasks are packed into offers from agents belonging to power class C and power class D, using BinPacking.
|
||||||
All the large tasks are spread among the offers from agents belonging to power class A and power class B, using FirstFit.
|
All the large tasks are spread among the offers from agents belonging to power class A and power class B, using FirstFit.
|
||||||
|
|
||||||
BinPacking has the most effect when co-scheduling of tasks is increased. Large tasks typically utilize more resources and hence,
|
BinPacking has the most effect when co-scheduling of tasks is increased. Large tasks typically utilize more resources and hence,
|
||||||
|
@ -275,11 +275,11 @@ func (s *BottomHeavy) ResourceOffers(driver sched.SchedulerDriver, offers []*mes
|
||||||
log.Printf("Received %d resource offers", len(offers))
|
log.Printf("Received %d resource offers", len(offers))
|
||||||
|
|
||||||
// We need to separate the offers into
|
// We need to separate the offers into
|
||||||
// offers from ClassA and ClassB and offers from ClassC.
|
// offers from ClassA and ClassB and offers from ClassC and ClassD.
|
||||||
// Nodes in ClassA and ClassB will be packed with the large tasks.
|
// Nodes in ClassA and ClassB will be packed with the large tasks.
|
||||||
// Small tasks will be spread out among the nodes in ClassC.
|
// Small tasks will be spread out among the nodes in ClassC and ClassD.
|
||||||
offersClassAB := []*mesos.Offer{}
|
offersHeavyPowerClasses := []*mesos.Offer{}
|
||||||
offersClassC := []*mesos.Offer{}
|
offersLightPowerClasses := []*mesos.Offer{}
|
||||||
|
|
||||||
for _, offer := range offers {
|
for _, offer := range offers {
|
||||||
select {
|
select {
|
||||||
|
@ -294,25 +294,26 @@ func (s *BottomHeavy) ResourceOffers(driver sched.SchedulerDriver, offers []*mes
|
||||||
|
|
||||||
if constants.PowerClasses["A"][*offer.Hostname] ||
|
if constants.PowerClasses["A"][*offer.Hostname] ||
|
||||||
constants.PowerClasses["B"][*offer.Hostname] {
|
constants.PowerClasses["B"][*offer.Hostname] {
|
||||||
offersClassAB = append(offersClassAB, offer)
|
offersHeavyPowerClasses = append(offersHeavyPowerClasses, offer)
|
||||||
} else if constants.PowerClasses["C"][*offer.Hostname] {
|
} else if constants.PowerClasses["C"][*offer.Hostname] ||
|
||||||
offersClassC = append(offersClassC, offer)
|
constants.PowerClasses["D"][*offer.Hostname] {
|
||||||
|
offersLightPowerClasses = append(offersLightPowerClasses, offer)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Println("Packing Large tasks into ClassAB offers:")
|
log.Println("Packing Large tasks into ClassAB offers:")
|
||||||
for _, o := range offersClassAB {
|
for _, o := range offersHeavyPowerClasses {
|
||||||
log.Println(*o.Hostname)
|
log.Println(*o.Hostname)
|
||||||
}
|
}
|
||||||
// Packing tasks into offersClassAB
|
// Packing tasks into offersHeavyPowerClasses
|
||||||
s.pack(offersClassAB, driver)
|
s.pack(offersHeavyPowerClasses, driver)
|
||||||
|
|
||||||
log.Println("Spreading Small tasks among ClassC offers:")
|
log.Println("Spreading Small tasks among ClassCD offers:")
|
||||||
for _, o := range offersClassC {
|
for _, o := range offersLightPowerClasses {
|
||||||
log.Println(*o.Hostname)
|
log.Println(*o.Hostname)
|
||||||
}
|
}
|
||||||
// Spreading tasks among offersClassC
|
// Spreading tasks among offersLightPowerClasses
|
||||||
s.spread(offersClassC, driver)
|
s.spread(offersLightPowerClasses, driver)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *BottomHeavy) StatusUpdate(driver sched.SchedulerDriver, status *mesos.TaskStatus) {
|
func (s *BottomHeavy) StatusUpdate(driver sched.SchedulerDriver, status *mesos.TaskStatus) {
|
||||||
|
|
|
@ -20,7 +20,7 @@ import (
|
||||||
/*
|
/*
|
||||||
Tasks are categorized into small and large tasks based on the watts requirement.
|
Tasks are categorized into small and large tasks based on the watts requirement.
|
||||||
All the large tasks are packed into offers from agents belonging to power class A and power class B, using BinPacking.
|
All the large tasks are packed into offers from agents belonging to power class A and power class B, using BinPacking.
|
||||||
All the small tasks are spread among the offers from agents belonging to power class C, using FirstFit.
|
All the small tasks are spread among the offers from agents belonging to power class C and power class D, using FirstFit.
|
||||||
|
|
||||||
This was done to give a little more room for the large tasks (power intensive) for execution and reduce the possibility of
|
This was done to give a little more room for the large tasks (power intensive) for execution and reduce the possibility of
|
||||||
starvation of power intensive tasks.
|
starvation of power intensive tasks.
|
||||||
|
@ -274,11 +274,11 @@ func (s *TopHeavy) ResourceOffers(driver sched.SchedulerDriver, offers []*mesos.
|
||||||
log.Printf("Received %d resource offers", len(offers))
|
log.Printf("Received %d resource offers", len(offers))
|
||||||
|
|
||||||
// We need to separate the offers into
|
// We need to separate the offers into
|
||||||
// offers from ClassA and ClassB and offers from ClassC.
|
// offers from ClassA and ClassB and offers from ClassC and ClassD.
|
||||||
// Offers from ClassA and ClassB would execute the large tasks.
|
// Offers from ClassA and ClassB would execute the large tasks.
|
||||||
// Offers from ClassC would execute the small tasks.
|
// Offers from ClassC and ClassD would execute the small tasks.
|
||||||
offersClassAB := []*mesos.Offer{}
|
offersHeavyPowerClasses := []*mesos.Offer{}
|
||||||
offersClassC := []*mesos.Offer{}
|
offersLightPowerClasses := []*mesos.Offer{}
|
||||||
|
|
||||||
for _, offer := range offers {
|
for _, offer := range offers {
|
||||||
select {
|
select {
|
||||||
|
@ -293,25 +293,26 @@ func (s *TopHeavy) ResourceOffers(driver sched.SchedulerDriver, offers []*mesos.
|
||||||
|
|
||||||
if constants.PowerClasses["A"][*offer.Hostname] ||
|
if constants.PowerClasses["A"][*offer.Hostname] ||
|
||||||
constants.PowerClasses["B"][*offer.Hostname] {
|
constants.PowerClasses["B"][*offer.Hostname] {
|
||||||
offersClassAB = append(offersClassAB, offer)
|
offersHeavyPowerClasses = append(offersHeavyPowerClasses, offer)
|
||||||
} else if constants.PowerClasses["C"][*offer.Hostname] {
|
} else if constants.PowerClasses["C"][*offer.Hostname] ||
|
||||||
offersClassC = append(offersClassC, offer)
|
constants.PowerClasses["D"][*offer.Hostname] {
|
||||||
|
offersLightPowerClasses = append(offersLightPowerClasses, offer)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Println("ClassAB Offers:")
|
log.Println("Spreading Large tasks into ClassAB Offers:")
|
||||||
for _, o := range offersClassAB {
|
for _, o := range offersHeavyPowerClasses {
|
||||||
log.Println(*o.Hostname)
|
log.Println(*o.Hostname)
|
||||||
}
|
}
|
||||||
log.Println("ClassC Offers:")
|
log.Println("Packing Small tasks into ClassCD Offers:")
|
||||||
for _, o := range offersClassC {
|
for _, o := range offersLightPowerClasses {
|
||||||
log.Println(*o.Hostname)
|
log.Println(*o.Hostname)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Packing tasks into offersClassC
|
// Packing tasks into offersLightPowerClasses
|
||||||
s.pack(offersClassC, driver)
|
s.pack(offersLightPowerClasses, driver)
|
||||||
// Spreading tasks among offersClassAB
|
// Spreading tasks among offersHeavyPowerClasses
|
||||||
s.spread(offersClassAB, driver)
|
s.spread(offersHeavyPowerClasses, driver)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *TopHeavy) StatusUpdate(driver sched.SchedulerDriver, status *mesos.TaskStatus) {
|
func (s *TopHeavy) StatusUpdate(driver sched.SchedulerDriver, status *mesos.TaskStatus) {
|
||||||
|
|
Reference in a new issue