Revision 1600,
1.1 KB
checked in by wojtekp, 8 years ago
(diff) |
|
-
Property svn:mime-type set to
text/plain
|
Rev | Line | |
---|
[1600] | 1 | package test.fips.models.i7; |
---|
| 2 | |
---|
| 3 | |
---|
| 4 | import schedframe.resources.computing.Node; |
---|
| 5 | import schedframe.resources.computing.Processor; |
---|
| 6 | import schedframe.resources.computing.profiles.energy.ResourceEvent; |
---|
| 7 | import schedframe.resources.devices.PhysicalResource; |
---|
| 8 | import schedframe.scheduling.manager.tasks.JobRegistry; |
---|
| 9 | import example.energy.BaseEnergyEstimationPlugin; |
---|
| 10 | |
---|
| 11 | public class NodeEnergyEstimationPlugin extends BaseEnergyEstimationPlugin { |
---|
| 12 | |
---|
| 13 | |
---|
| 14 | private static double Pidle = 0; |
---|
| 15 | private static double Pfull = 0; |
---|
| 16 | |
---|
| 17 | |
---|
| 18 | public double estimatePowerConsumption(ResourceEvent event, JobRegistry jobRegistry, |
---|
| 19 | PhysicalResource resource) { |
---|
| 20 | Node node = (Node) resource; |
---|
| 21 | double powerConsumption = 0; |
---|
| 22 | |
---|
| 23 | double Pcpu = 0; |
---|
| 24 | for(Processor cpu: node.getProcessors()){ |
---|
| 25 | Pcpu = Pcpu + cpu.getPowerInterface().getRecentPowerUsage().getValue(); |
---|
| 26 | } |
---|
| 27 | |
---|
| 28 | powerConsumption = Pcpu + Pidle + (Pfull- Pidle) * node.getLoadInterface().getRecentUtilization().getValue()/100; |
---|
| 29 | //powerConsumption = powerConsumption + node.getProcessors().get(0).getResourceCharacteristic().getDevices().get(0).getPowerInterface().getRecentPowerUsage().getValue(); |
---|
| 30 | return powerConsumption; |
---|
| 31 | } |
---|
| 32 | |
---|
| 33 | |
---|
| 34 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.