Skip to content
Snippets Groups Projects
Commit abfdb0b4 authored by Georges Da Costa's avatar Georges Da Costa
Browse files

Makes the project compatible with pdoc

parent 4a323674
No related branches found
No related tags found
No related merge requests found
......@@ -12,26 +12,27 @@ def read_int(filename):
def handler(arg):
stay=False
if __name__ == '__main__':
signal.signal(15, handler)
signal.signal(15, handler)
stay=True
stay=True
with open('/dev/shm/power_measures','w') as power_file:
power_file.write('#timestamp power\n')
with open('/dev/shm/power_measures','w') as power_file:
power_file.write('#timestamp power\n')
try:
while stay:
mili_volt=read_int('/sys/class/power_supply/BAT0/voltage_now')
mili_ampere=read_int('/sys/class/power_supply/BAT0/current_now')
watt = mili_volt*mili_ampere/1000000000000
try:
while stay:
mili_volt=read_int('/sys/class/power_supply/BAT0/voltage_now')
mili_ampere=read_int('/sys/class/power_supply/BAT0/current_now')
watt = mili_volt*mili_ampere/1000000000000
current_time=time.time()
int_current_time=int(current_time)
current_time=time.time()
int_current_time=int(current_time)
with open('/dev/shm/power_measures','a') as power_file:
power_file.write(str(int_current_time)+' '+str(watt)+'\n')
time.sleep(1-(current_time-int_current_time))
except:
pass
with open('/dev/shm/power_measures','a') as power_file:
power_file.write(str(int_current_time)+' '+str(watt)+'\n')
time.sleep(1-(current_time-int_current_time))
except:
pass
#!/usr/bin/python3
"""This script run HPC benchmarks with enabled monitoring
"""
import os
import sys
import platform
import expetator.experiment as experiment
from expetator.benchmarks import sleepbench
from expetator.monitors import mojitos, power
from expetator.leverages import dvfs, pct
BENCHMARKS = [sleepbench.SleepBench(default_time=5)]
LEVERAGES = [dvfs.Dvfs(dummy=True), pct.Pct(dummy=True)]
hw_pct = {'instructions', 'cache_misses'}
MONITORS = [mojitos.Mojitos(sensor_set = hw_pct),
power.Power()]
if len(sys.argv) > 1:
dest_dir = sys.argv[1]
else:
dest_dir = '/tmp/demo'
cluster = platform.node().split('-')[0]
name = '%s/%s/demo' % (dest_dir, cluster)
os.makedirs(os.path.dirname(name), exist_ok=True)
experiment.run_experiment(name, BENCHMARKS,
leverages=LEVERAGES,
monitors=MONITORS,
sweep=True, times=1)
#!/usr/bin/python3
"""This script run HPC benchmarks with enabled monitoring
"""
import os
import sys
import platform
import expetator.experiment as experiment
from expetator.benchmarks import sleepbench, cpubench, mpibench, membench, npbbench, gpucpubench, gpumembench
from expetator.monitors import mojitos, power, powergpu
from expetator.leverages import dvfs, gpuclock, gpupow
BENCHMARKS = [gpucpubench.GpuCpuBench(), gpumembench.GpuMemBench()]
LEVERAGES = [gpupow.GpuPower(steps=2), gpuclock.GpuClock(steps=2)]
hw_pct = {'instructions', 'cache_misses'}
MONITORS = [mojitos.Mojitos(sensor_set = hw_pct),
power.Power(), powergpu.Power()]
if len(sys.argv) > 1:
dest_dir = sys.argv[1]
else:
dest_dir = '/tmp/demo'
cluster = platform.node().split('-')[0]
name = '%s/%s/demo_gpu' % (dest_dir, cluster)
os.makedirs(os.path.dirname(name), exist_ok=True)
experiment.run_experiment(name, BENCHMARKS,
leverages=LEVERAGES,
monitors=MONITORS,
sweep=True, times=1)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment