Leverages
Available leverages
Most of these leverages only work on Grid5000, and some only on some servers (with GPU for Gpu* for example)
- class expetator.leverages.Dvfs(dummy=False, baseline=False, frequencies=None)
Cpufreq based DVFS
Detects all available frequencies and go through all of them
- Parameters:
dummy (bool) – Only uses min and max frequency
baseline (bool) – Only uses max frequency
frequencies (int list) – Limits to the provided list of frequencies
- class expetator.leverages.GpuClock(dummy=False, baseline=False, steps=2, zoomfrom=0, zoomto=0)
nvidia-smi graphics/sm clock setting
- class expetator.leverages.GpuPower(dummy=False, baseline=False, steps=3)
nvidia-smi power limit setting
- class expetator.leverages.NeoSched(schedulers, dummy=False, baseline=False)
- class expetator.leverages.Nodeepsleep(modes={False, True})
Activates or deactivates CX
- class expetator.leverages.Pct(dummy=False, baseline=False)
Intel based PCT
- class expetator.leverages.Powercap(function=None, term=0)
Example of use of an available leverages :
import expetator.experiment as experiment
from expetator.benchmarks import SleepBench
from expetator.leverages import Dvfs
experiment.run_experiment("/tmp/dvfs_demo",
[ SleepBench(default_time=2) ],
leverages = [ Dvfs(baseline=True) ],
)
The result will be in a file /tmp/dvfs_demo_${HOST}_${TIMESTAMP_START}
How to make your own leverage
A leverages has an internal list of available state (obtained through the available_states member). A state can be a tuple
A classical template would be:
class Template:
'Template for leverages'
def __init__(self):
'Initializes the internal variables using parameters'
pass
def build(self, executor):
'Builds the executable and acquire data on the system'
self.executor = executor
pass
def available_states(self):
'Returns all the possible states as a list'
return [None]
def start(self, state):
'Sets the right state on all hosts'
pass
def stop(self, output_file=None):
'Reverts to the standard state on all nodes and saves some info in the right directory'
pass
def get_state(self):
'Returns the current state'
return None
def state_to_str(self):
'''Converts the current state in a string
If there are several values, they are separated by a white-space'''
return 'None'
def get_labels(self):
'Returns the labels for the leverage as a tuple'
return ('Template')
Example of leverage
Here is an example of a simple leverage that will change the sound ouput level
import expetator.experiment as experiment
from expetator.benchmarks import SleepBench
class SoundLevel:
def __init__(self, levels = [20, 70]):
self.levels = levels
def build(self, executor):
'Builds the executable and acquire data on the system'
self.executor = executor
pass
def available_states(self):
'Returns all the possible states as a list'
return self.levels
def start(self, state):
'Sets the right state on all hosts'
self.executor.hosts('pactl set-sink-volume @DEFAULT_SINK@ '+str(state)+'%')
self.state = state
pass
def stop(self, output_file=None):
'Reverts to the standard state on all nodes and saves some info in the right directory'
pass
def get_state(self):
'Returns the current state'
return self.state
def state_to_str(self):
'Converts the current state in a string'
return str(self.state)
def get_labels(self):
'Returns the labels for the leverage'
return ('level')
if __name__ == "__main__":
experiment.run_experiment(
"/tmp/sound_demo", [SleepBench(default_time=2)],
leverages=[SoundLevel()],
)