PowerRam
Python classes monitoring RAM's power usage.
We used an analytical approach to calibrate RAM power by combining information of DIMM nomminal Power for each DDR memory module version, number of DIMM slots in use and the memory footprint during application execution
PowerRam
Python classes monitoring RAM's power usage.
Source code in ea2p/src/ram.py
| def __init__(self):
"""
PowerRam
---------------
Python classes monitoring RAM's power usage.
"""
self.ram_power = self.get_memory_power()
self.number_slots = self.get_number_slots()
|
append_energy_usage
We used an analytical approach to calibrate RAM power by combining information of DIMM nomminal Power for each DDR memory module version, number of DIMM slots in use and the memory footprint during application execution
Source code in ea2p/src/ram.py
| def append_energy_usage(self):
"""
We used an analytical approach to calibrate RAM power by combining information of DIMM nomminal Power for each DDR memory module version, number of DIMM slots in use and the memory footprint during application execution
"""
ram_usage = psutil.virtual_memory()
ram_percent = ram_usage[2]
THRESHOLD0 = 5
THRESHOLD1 = 10
THRESHOLD2 = 25
THRESHOLD3 = 50
THRESHOLD4 = 70
if ram_usage[2] <= THRESHOLD0 :
ram_percent = 35
elif ram_usage[2] <= THRESHOLD1 :
ram_percent = 65
elif ram_usage[2] <= THRESHOLD2 :
ram_percent = 70
elif ram_usage[2] <= THRESHOLD3 :
ram_percent = 75
elif ram_usage[2] <= THRESHOLD4 :
ram_percent = 80
else :
ram_percent = 85
energy_usage = {"dram":(self.ram_power * self.number_slots * ram_percent / 100)}
#print(energy_usage)
return energy_usage
|