changed the type of percentage in rapl.Cap(...) from int to float64. Retrofitted power-capping strategies to cap using a float64 value instead of an int. Moved common functions in loganddynamiccap.go and logAndProgressiveExtrema.go into pcp/utils.go. New power-capping strategy that builds on top of extrema, where it caps the victims at different until it can't cap further, in which case it starts uncapping them in the reverse order of capping.

This commit is contained in:
Pradyumna Kaushik 2017-02-15 19:22:56 -05:00
parent d5d3c87ff2
commit d42b7a3a3b
9 changed files with 237 additions and 56 deletions

View file

@ -6,7 +6,7 @@ import (
"strconv"
)
func Cap(host, username string, percentage int) error {
func Cap(host, username string, percentage float64) error {
if percentage > 100 || percentage < 0 {
return errors.New("Percentage is out of range")
@ -31,7 +31,7 @@ func Cap(host, username string, percentage int) error {
return errors.Wrap(err, "Failed to create session")
}
err = session.Run("sudo /misc/shared_data/rdelval1/RAPL_PKG_Throttle.py " + strconv.Itoa(percentage))
err = session.Run("sudo /misc/shared_data/rdelval1/RAPL_PKG_Throttle.py " + strconv.FormatFloat(percentage, 'f', 2, 64))
if err != nil {
return errors.Wrap(err, "Failed to run RAPL script")
}