Changeset 539 for DCWoRMS/trunk/build/classes/schedframe/resources
- Timestamp:
- 10/31/12 13:52:06 (12 years ago)
- Location:
- DCWoRMS/trunk/build/classes/schedframe/resources
- Files:
-
- 16 added
- 41 edited
Legend:
- Unmodified
- Added
- Removed
-
DCWoRMS/trunk/build/classes/schedframe/resources/computing/ComputingNode.java
r477 r539 10 10 import schedframe.resources.computing.extensions.ExtensionType; 11 11 import schedframe.resources.computing.profiles.energy.EnergyExtension; 12 import schedframe.resources.computing.profiles.energy.power.Power ProfileFactory;12 import schedframe.resources.computing.profiles.energy.power.PowerInterfaceFactory; 13 13 import schedframe.resources.computing.profiles.energy.power.ui.ComputingNodePowerInterface; 14 14 import schedframe.resources.computing.profiles.energy.power.ui.PowerInterface; … … 26 26 27 27 //extensionList.add(new EnergyExtension(this, resDesc.getPowerInterface(), resDesc.getEnergyEstimationPlugin())); 28 PowerInterface pi = Power ProfileFactory.createPowerInterface(this, resDesc.getPowerProfile());28 PowerInterface pi = PowerInterfaceFactory.createPowerInterface(this, resDesc.getPowerProfile()); 29 29 accept(new EnergyExtension(pi, resDesc.getPowerProfile())); 30 30 } … … 39 39 40 40 public ComputingNodePowerInterface getPowerInterface(){ 41 ComputingNodePowerInterface power Profile = null;41 ComputingNodePowerInterface powerInterface = null; 42 42 if(extensionList.isExtensionAvailable(ExtensionType.ENERGY_EXTENSION)){ 43 43 EnergyExtension ee = (EnergyExtension)extensionList.getExtension(ExtensionType.ENERGY_EXTENSION); 44 power Profile = (ComputingNodePowerInterface)ee.getPowerInterface();44 powerInterface = (ComputingNodePowerInterface)ee.getPowerInterface(); 45 45 } 46 return power Profile;46 return powerInterface; 47 47 } 48 48 -
DCWoRMS/trunk/build/classes/schedframe/resources/computing/ComputingResource.java
r477 r539 2 2 3 3 import gridsim.GridSimTags; 4 import gridsim. gssim.WormsTags;4 import gridsim.dcworms.DCWormsTags; 5 5 6 6 import java.util.ArrayList; … … 28 28 import schedframe.resources.computing.profiles.energy.EnergyEventType; 29 29 import schedframe.resources.computing.profiles.energy.EnergyExtension; 30 import schedframe.resources.computing.profiles.energy.airthroughput.ui.AirThroughputInterface; 30 31 import schedframe.resources.computing.profiles.energy.power.ui.PowerInterface; 31 32 import schedframe.resources.computing.properties.DefaultPropertiesBuilder; … … 68 69 } 69 70 70 //TODO remove if possible (check if all scenarios can be realized - statistics issue) , since it'stemporary method71 //TODO remove if possible (check if all scenarios can be realized - statistics issue), since it's a temporary method 71 72 private void addFakeProcessors() { 72 73 if(getResourceCharacteristic().getResourceUnits().get(StandardResourceUnitName.PE) != null){ … … 145 146 sec.execute(event); 146 147 147 148 148 //old, correctly working method 149 149 /*if (extensionList != null) { … … 157 157 //if(scheduler != null && (parent != null && scheduler != parent.getScheduler())/*scheduler.getResources().contains(this)*/){ 158 158 // String src = event.getSource() != null ? event.getSource() : name; 159 // scheduler.sendInternal(GridSimTags.SCHEDULE_NOW, GssimTags.UPDATE, src);159 // scheduler.sendInternal(GridSimTags.SCHEDULE_NOW, DCWormsTags.UPDATE, src); 160 160 //} 161 161 //triggerEventUp(event); … … 188 188 } 189 189 190 protected List<? extends ComputingResource> searchDescendants(List<ResourceValidator> validators, boolean cut off) {190 protected List<? extends ComputingResource> searchDescendants(List<ResourceValidator> validators, boolean cutOff) { 191 191 192 192 List<ComputingResource> descendants = new ArrayList<ComputingResource>(); … … 198 198 ComputingResource resource = toExamine.pop(); 199 199 List<ComputingResource> resources = resource.getChildren(); 200 /*if (resources == null)201 continue;*/202 200 int numberOfRes = resources.size(); 203 201 for (int i = 0; i < numberOfRes; i++) { … … 205 203 if (resourceChild.match(validators)) { 206 204 descendants.add(resourceChild); 207 if(cut off == false) {205 if(cutOff == false) { 208 206 toExamine.addLast(resourceChild); 209 207 } … … 243 241 return null; 244 242 } 243 244 public AirThroughputInterface getAirThroughputInterface(){ 245 if (extensionList != null) { 246 for (Extension extension : extensionList) { 247 if (extension.getType() == ExtensionType.ENERGY_EXTENSION) { 248 EnergyExtension ee = (EnergyExtension)extension; 249 return ee.getAirThroughputInterface(); 250 } 251 } 252 } 253 return null; 254 } 245 255 246 256 public Scheduler getScheduler() { … … 257 267 } 258 268 259 class SimpleEventHandler implements EventHandler{269 class ComputingResourceEventHandler implements EventHandler{ 260 270 261 271 public void handleResourceEvent(Event event){ … … 275 285 if(scheduler != null && (parent != null && scheduler != parent.getScheduler())/*scheduler.getResources().contains(this)*/){ 276 286 String src = event.getSource() != null ? event.getSource() : name; 277 scheduler.sendInternal(GridSimTags.SCHEDULE_NOW, WormsTags.UPDATE, src);287 scheduler.sendInternal(GridSimTags.SCHEDULE_NOW, DCWormsTags.UPDATE, src); 278 288 } else if(parent != null) 279 289 parent.getEventHandler().handleSchedulingEvent(event); … … 282 292 283 293 public EventHandler getEventHandler(){ 284 return new SimpleEventHandler();294 return new ComputingResourceEventHandler(); 285 295 } 286 296 287 297 public void initiate(){ 298 288 299 ResourceEventCommand rec = new ResourceEventCommand(this); 289 EnergyEvent event = new EnergyEvent(EnergyEventType. POWER_STATE_CHANGED, "Resource controller");300 EnergyEvent event = new EnergyEvent(EnergyEventType.AIRFLOW_STATE_CHANGED, "Resource controller"); 290 301 event.setReason(EventReason.SIM_INIT); 291 302 rec.execute(event); 303 304 rec = new ResourceEventCommand(this); 305 event = new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, "Resource controller"); 306 event.setReason(EventReason.SIM_INIT); 307 rec.execute(event); 308 292 309 //alternative way 310 //getEventHandler().handleResourceEvent(new EnergyEvent(EnergyEventType.AIRFLOW_STATE_CHANGED, "Resource controller")); 293 311 //getEventHandler().handleResourceEvent(new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, "Resource controller")); 294 312 } -
DCWoRMS/trunk/build/classes/schedframe/resources/computing/Core.java
r477 r539 3 3 import schedframe.resources.computing.description.ComputingResourceDescription; 4 4 import schedframe.resources.computing.profiles.energy.EnergyExtension; 5 import schedframe.resources.computing.profiles.energy.power.Power ProfileFactory;5 import schedframe.resources.computing.profiles.energy.power.PowerInterfaceFactory; 6 6 import schedframe.resources.computing.profiles.energy.power.ui.PowerInterface; 7 7 import schedframe.resources.units.CpuSpeed; … … 13 13 public Core (ComputingResourceDescription resDesc) { 14 14 super(resDesc); 15 PowerInterface pi = Power ProfileFactory.createPowerInterface(this, resDesc.getPowerProfile());15 PowerInterface pi = PowerInterfaceFactory.createPowerInterface(this, resDesc.getPowerProfile()); 16 16 accept(new EnergyExtension(pi, resDesc.getPowerProfile())); 17 17 } -
DCWoRMS/trunk/build/classes/schedframe/resources/computing/DataCenter.java
r477 r539 3 3 import schedframe.resources.computing.description.ComputingResourceDescription; 4 4 import schedframe.resources.computing.profiles.energy.EnergyExtension; 5 import schedframe.resources.computing.profiles.energy.power.Power ProfileFactory;5 import schedframe.resources.computing.profiles.energy.power.PowerInterfaceFactory; 6 6 import schedframe.resources.computing.profiles.energy.power.ui.PowerInterface; 7 7 … … 11 11 super(resDesc); 12 12 //extensionList.add(new EnergyExtension(this, resDesc.getPowerInterface(), resDesc.getEnergyEstimationPlugin())); 13 PowerInterface pi = Power ProfileFactory.createPowerInterface(this, resDesc.getPowerProfile());13 PowerInterface pi = PowerInterfaceFactory.createPowerInterface(this, resDesc.getPowerProfile()); 14 14 accept(new EnergyExtension(pi, resDesc.getPowerProfile())); 15 15 } -
DCWoRMS/trunk/build/classes/schedframe/resources/computing/Processor.java
r477 r539 8 8 import schedframe.resources.computing.extensions.ExtensionType; 9 9 import schedframe.resources.computing.profiles.energy.EnergyExtension; 10 import schedframe.resources.computing.profiles.energy.power.Power ProfileFactory;10 import schedframe.resources.computing.profiles.energy.power.PowerInterfaceFactory; 11 11 import schedframe.resources.computing.profiles.energy.power.ui.PowerInterface; 12 12 import schedframe.resources.computing.profiles.energy.power.ui.ProcessorPowerInterface; … … 22 22 super(resDesc); 23 23 //extensionList.add(new EnergyExtension(this, resDesc.getPowerInterface(), resDesc.getEnergyEstimationPlugin())); 24 PowerInterface pi = Power ProfileFactory.createPowerInterface(this, resDesc.getPowerProfile());24 PowerInterface pi = PowerInterfaceFactory.createPowerInterface(this, resDesc.getPowerProfile()); 25 25 accept(new EnergyExtension(pi, resDesc.getPowerProfile())); 26 26 } -
DCWoRMS/trunk/build/classes/schedframe/resources/computing/Rack.java
r477 r539 6 6 import schedframe.resources.computing.description.ComputingResourceDescription; 7 7 import schedframe.resources.computing.profiles.energy.EnergyExtension; 8 import schedframe.resources.computing.profiles.energy.power.Power ProfileFactory;8 import schedframe.resources.computing.profiles.energy.power.PowerInterfaceFactory; 9 9 import schedframe.resources.computing.profiles.energy.power.ui.PowerInterface; 10 10 … … 14 14 public Rack (ComputingResourceDescription resDesc) { 15 15 super(resDesc); 16 PowerInterface pi = Power ProfileFactory.createPowerInterface(this, resDesc.getPowerProfile());16 PowerInterface pi = PowerInterfaceFactory.createPowerInterface(this, resDesc.getPowerProfile()); 17 17 accept(new EnergyExtension(pi, resDesc.getPowerProfile())); 18 18 } -
DCWoRMS/trunk/build/classes/schedframe/resources/computing/ResourceFactory.java
r477 r539 11 11 import schedframe.scheduling.policy.local.LocalManagementSystem; 12 12 import schedframe.scheduling.queue.TaskQueueList; 13 import simulator. WormsConstants;13 import simulator.DCWormsConstants; 14 14 15 15 … … 20 20 if (resDesc.getType().equals(StandardResourceType.DataCenter)) 21 21 return new DataCenter(resDesc); 22 else if (resDesc.getType().equals(StandardResourceType.Rack)) 23 return new Rack(resDesc); 22 24 else if (resDesc.getType().equals(StandardResourceType.ComputingNode)) 23 25 return new ComputingNode(resDesc); … … 46 48 } 47 49 case LS: { 48 ms = new LocalManagementSystem(id, WormsConstants.MANAGEMENT_SYSTEM,50 ms = new LocalManagementSystem(id, DCWormsConstants.MANAGEMENT_SYSTEM, 49 51 schedulingPlugin, execTimeEstimationPlugin, queues); 50 52 return new Scheduler(ms, type, managedResources); … … 52 54 53 55 default:{ 54 ms = new LocalManagementSystem(id, WormsConstants.MANAGEMENT_SYSTEM,56 ms = new LocalManagementSystem(id, DCWormsConstants.MANAGEMENT_SYSTEM, 55 57 schedulingPlugin, execTimeEstimationPlugin, queues); 56 58 return new Scheduler(ms, type, managedResources); -
DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/EnergyEventType.java
r477 r539 15 15 FREQUENCY_CHANGED(64), 16 16 VOLTAGE_CHANGED(128), 17 RESOURCE_FAILED(256) 17 18 AIRFLOW_STATE_CHANGED(256), 19 20 RESOURCE_FAILED(512) 18 21 ; 19 22 -
DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/EnergyExtension.java
r477 r539 11 11 import schedframe.resources.computing.extensions.ExtensionException; 12 12 import schedframe.resources.computing.extensions.ExtensionType; 13 import schedframe.resources.computing.profiles.energy.airthroughput.AirThroughputProfile; 14 import schedframe.resources.computing.profiles.energy.airthroughput.ui.AirThroughputInterface; 13 15 import schedframe.resources.computing.profiles.energy.power.PowerProfile; 14 16 import schedframe.resources.computing.profiles.energy.power.ui.PowerInterface; 15 17 import schedframe.scheduling.manager.tasks.JobRegistryImpl; 16 18 17 public class EnergyExtension implements Extension /*, ResourceVisitor */{19 public class EnergyExtension implements Extension{ 18 20 19 21 private Log log = LogFactory.getLog(EnergyExtension.class); … … 21 23 protected PowerInterface powerInterface; 22 24 protected PowerProfile powerProfile; 23 25 26 protected AirThroughputInterface airFlowInterface; 27 protected AirThroughputProfile airFlowProfile; 28 24 29 protected ComputingResource computingResource; 25 30 … … 29 34 } 30 35 31 @Override 36 public EnergyExtension(PowerInterface powerInterface, PowerProfile powerProfile, 37 AirThroughputInterface airFlowInterface, AirThroughputProfile airFlowProfile) { 38 super(); 39 this.powerInterface = powerInterface; 40 this.powerProfile = powerProfile; 41 this.airFlowInterface = airFlowInterface; 42 this.airFlowProfile = airFlowProfile; 43 } 44 32 45 public boolean supportsEvent(Event event) { 33 46 34 47 if(powerProfile == null || powerProfile.getEnergyEstimationPlugin() == null) 35 48 return false; 36 37 49 if(event.getType().getName().equals(EnergyEventType.POWER_STATE_CHANGED.getName())) 38 50 return true; … … 43 55 else if(event.getType().getName().equals(EnergyEventType.TASK_FINISHED.getName())) 44 56 return true; 57 58 if(airFlowProfile == null) 59 return false; 60 if(event.getType().getName().equals(EnergyEventType.AIRFLOW_STATE_CHANGED.getName())) 61 return true; 62 45 63 else return false; 46 64 47 65 } 48 49 66 50 @Override51 67 public void handleEvent(Event event) { 52 68 EnergyEvent enEvent = (EnergyEvent)event; … … 87 103 //System.out.println(this.resource.getName() + " - ESTIMATED ENERGY:" + power); 88 104 powerProfile.addToPowerUsageHistory(power); 89 105 break; 106 case AIRFLOW_STATE_CHANGED: 107 System.out.println("====="); 108 double airFlow = powerProfile.getEnergyEstimationPlugin().estimateAirThroughput(enEvent, new JobRegistryImpl(computingResource.getName()), computingResource); 109 airFlowProfile.addToPowerUsageHistory(airFlow); 110 power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(enEvent, new JobRegistryImpl(computingResource.getName()), computingResource); 111 powerProfile.addToPowerUsageHistory(power); 90 112 break; 91 113 } 92 114 } 93 94 @Override 115 95 116 public void init(Properties properties) throws ExtensionException { 96 117 // TODO Auto-generated method stub 97 118 } 98 119 99 @Override100 120 public ExtensionType getType() { 101 121 return ExtensionType.ENERGY_EXTENSION; … … 118 138 } 119 139 140 public AirThroughputInterface getAirThroughputInterface() { 141 return airFlowInterface; 142 } 143 144 public AirThroughputProfile getAirFlowProfile() { 145 return airFlowProfile; 146 } 120 147 121 148 } -
DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/airthroughput/AirThroughputProfile.java
r477 r539 1 1 package schedframe.resources.computing.profiles.energy.airthroughput; 2 2 3 import java.util.ArrayList; 3 4 import java.util.List; 5 6 import org.joda.time.DateTimeUtils; 4 7 5 8 import schedframe.Parameters; … … 8 11 public class AirThroughputProfile { 9 12 10 AirThroughputEstimationPlugin airThroughputEstimationPlugin; 13 protected List<AirFlowValue> airFlowHistory; 14 15 protected AirThroughputEstimationPlugin airThroughputEstimationPlugin; 11 16 protected List <AirThroughputState> airThroughputStates; 17 protected Parameters parameters; 12 18 13 19 public AirThroughputProfile(AirThroughputEstimationPlugin airThroughputEstimationPlugin, List<AirThroughputState> airThroughputStates) { … … 15 21 this.airThroughputEstimationPlugin = airThroughputEstimationPlugin; 16 22 this.airThroughputStates = airThroughputStates; 23 this.airFlowHistory = new ArrayList<AirFlowValue>(); 17 24 } 18 25 … … 21 28 } 22 29 23 public void init(Parameters parameters){ 24 30 public void addToPowerUsageHistory(double airFlow) { 31 32 if (airFlowHistory.size() == 0) { 33 AirFlowValue usage = new AirFlowValue(DateTimeUtils.currentTimeMillis(), airFlow); 34 airFlowHistory.add(usage); 35 return; 36 } 37 38 int lastIdx = airFlowHistory.size() - 1; 39 double lastAirFlow = airFlowHistory.get(lastIdx).getValue(); 40 if (lastAirFlow != airFlow) { 41 AirFlowValue usage = airFlowHistory.get(lastIdx); 42 long currentTime = DateTimeUtils.currentTimeMillis(); 43 if (usage.getTimestamp() == currentTime) { 44 usage.setValue(airFlow); 45 if(lastIdx > 0 && airFlowHistory.get(lastIdx - 1).getValue() == airFlow) 46 airFlowHistory.remove(usage); 47 } else { 48 usage = new AirFlowValue(DateTimeUtils.currentTimeMillis(), airFlow); 49 airFlowHistory.add(usage); 50 } 51 } 52 } 53 54 public List<AirFlowValue> getAirThroughputHistory() { 55 return airFlowHistory; 56 } 57 58 public void init(Parameters params){ 59 this.parameters = params; 60 } 61 62 public Parameters getParameters() { 63 return parameters; 25 64 } 26 65 } -
DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/PowerProfile.java
r477 r539 19 19 protected Map<String, PState> supportedPStates; 20 20 21 protected Parameters parameters; 22 21 23 22 public PowerProfile(EnergyEstimationPlugin energyEstimationPlugin, List< schedframe.resources.computing.profiles.energy.power.PowerState> supportedPowerStates) {24 public PowerProfile(EnergyEstimationPlugin energyEstimationPlugin, List<PowerState> powerStates) { 23 25 this.energyEstimationPlugin = energyEstimationPlugin; 24 26 this.powerUsage = new ArrayList<PowerUsage>(); 25 this.supportedPowerStates = supportedPowerStates;27 this.supportedPowerStates = powerStates; 26 28 } 27 29 28 public PowerProfile(EnergyEstimationPlugin energyEstimationPlugin, List< schedframe.resources.computing.profiles.energy.power.PowerState> supportedPowerStates, List<schedframe.resources.computing.profiles.energy.power.PState> pStates) {30 public PowerProfile(EnergyEstimationPlugin energyEstimationPlugin, List<PowerState> powerStates, List<PState> pStates) { 29 31 this.energyEstimationPlugin = energyEstimationPlugin; 30 this.supportedPowerStates = supportedPowerStates;32 this.supportedPowerStates = powerStates; 31 33 this.powerUsage = new ArrayList<PowerUsage>(); 32 34 if(pStates.size() > 0) … … 98 100 } 99 101 100 public void init(Parameters parameters){ 101 102 public void init(Parameters params){ 103 this.parameters = params; 104 } 105 106 public Parameters getParameters() { 107 return parameters; 102 108 } 103 109 110 104 111 } -
DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/PowerUsage.java
r477 r539 1 1 package schedframe.resources.computing.profiles.energy.power; 2 2 3 public class PowerUsage { 3 import schedframe.resources.computing.profiles.energy.MeasurementHistory; 4 4 5 protected long timestamp; 6 protected double value; 5 public class PowerUsage extends MeasurementHistory{ 7 6 8 7 public PowerUsage(long timestamp, double value){ 9 this.timestamp = timestamp; 10 this.value = value; 11 } 12 13 public long getTimestamp() { 14 return timestamp; 15 } 16 17 public double getValue() { 18 return value; 19 } 20 21 public void setValue(double value) { 22 this.value = value; 8 super(timestamp, value); 23 9 } 24 10 -
DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/plugin/EnergyEstimationPlugin.java
r477 r539 10 10 public double estimatePowerConsumption(EnergyEvent event, JobRegistry jobRegistry, ComputingResource resource); 11 11 12 public double estimate EnergyDissipation(EnergyEvent event, JobRegistry jobRegistry, ComputingResource resource);12 public double estimateAirThroughput(EnergyEvent event, JobRegistry jobRegistry, ComputingResource resource); 13 13 14 14 public double estimateTemperature(EnergyEvent event, JobRegistry jobRegistry, ComputingResource resource); -
DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/ui/ComputingNodePowerInterface.java
r477 r539 10 10 import schedframe.resources.computing.profiles.energy.power.StandardPowerStateName; 11 11 12 public class ComputingNodePowerInterface extends AbstractPowerInterface{12 public class ComputingNodePowerInterface extends ComputingResourcePowerInterface{ 13 13 14 14 public static long START_TIME = 600000; … … 28 28 currentPowerState = state; 29 29 ComputingNode computingNode = (ComputingNode) resource; 30 boolean pePowerStateChangeStatus = false; 30 31 if(computingNode.getProcessors() != null) 31 32 { 32 33 for(ComputingResource child:computingNode.getProcessors()){ 33 child.getPowerInterface().setPowerState(state); 34 if(child.getPowerInterface() != null){ 35 pePowerStateChangeStatus = child.getPowerInterface().setPowerState(state); 36 } 34 37 } 35 } else { 38 } 39 40 if(!pePowerStateChangeStatus){ 36 41 computingNode.handleEvent(new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, computingNode.getName())); 37 42 } 38 43 39 44 if(state == StandardPowerStateName.OFF){ 40 45 computingNode.setStatus(ResourceStatus.UNAVAILABLE); … … 46 51 return true; 47 52 } 48 49 /*public double getPowerConsumption(PowerState state) {50 if(currentPowerState == PowerState.OFF)51 return 0;52 else if(currentPowerState == PowerState.ON)53 return 750;54 else return 500;55 }*/56 57 /*public boolean supportPowerState(PowerState state) {58 switch(state){59 case ON:60 return true;61 case OFF:62 return true;63 case SLEEP:64 return true;65 case HIBERNATE:66 return true;67 default:68 return false;69 }70 }71 72 public List<PowerState> getSupportedPowerStates() {73 return Arrays.asList(new PowerState[]{PowerState.ON, PowerState.OFF, PowerState.SLEEP, PowerState.HIBERNATE});74 }*/75 53 76 54 public void turnOn(){ -
DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/ui/DataCenterPowerInterface.java
r477 r539 7 7 import schedframe.resources.computing.profiles.energy.power.StandardPowerStateName; 8 8 9 public class DataCenterPowerInterface extends AbstractPowerInterface{9 public class DataCenterPowerInterface extends ComputingResourcePowerInterface{ 10 10 11 12 13 14 11 public DataCenterPowerInterface(ComputingResource resource, PowerProfile pp){ 15 12 super(resource, pp); -
DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/ui/PowerInterface.java
r477 r539 3 3 import java.util.List; 4 4 5 import schedframe.Parameters; 5 6 import schedframe.resources.computing.profiles.energy.power.PowerState; 6 7 import schedframe.resources.computing.profiles.energy.power.PowerStateName; … … 25 26 List<PowerUsage> getPowerUsageHistory(); 26 27 28 public Parameters getParameters(); 27 29 } -
DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/ui/ProcessorPowerInterface.java
r477 r539 1 1 package schedframe.resources.computing.profiles.energy.power.ui; 2 3 4 import gridsim.GridSimTags; 5 import gridsim.dcworms.DCWormsTags; 2 6 3 7 import java.util.Map; 4 8 5 import schedframe.events.ResourceEventCommand;6 9 import schedframe.resources.ResourceStatus; 7 10 import schedframe.resources.computing.ComputingResource; 8 import schedframe.resources.computing.Processor;9 11 import schedframe.resources.computing.profiles.energy.EnergyEvent; 10 12 import schedframe.resources.computing.profiles.energy.EnergyEventType; … … 16 18 import schedframe.resources.units.StandardResourceUnitName; 17 19 18 public class ProcessorPowerInterface extends AbstractPowerInterface {20 public class ProcessorPowerInterface extends ComputingResourcePowerInterface { 19 21 20 22 protected PState currentPState; … … 36 38 if(powerState != currentPowerState){ 37 39 currentPowerState = powerState; 38 //Processor cpu = (Processor) resource;39 40 if(powerState == StandardPowerStateName.OFF){ 40 41 resource.setStatus(ResourceStatus.UNAVAILABLE); … … 42 43 resource.setStatus(ResourceStatus.FREE); 43 44 } 44 resource.handleEvent(new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, resource.getName())); 45 //cpu.handleEvent(new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, cpu.getName())); 45 resource.handleEvent(new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, resource.getName())); 46 46 } 47 47 … … 79 79 80 80 if(newPState != currentPState){ 81 double factor = newPState.getFrequency()/currentPState.getFrequency();81 //double factor = newPState.getFrequency()/currentPState.getFrequency(); 82 82 currentPState = newPState; 83 CpuSpeed speed = (CpuSpeed)resource.getResourceCharacteristic().getResourceUnits().get(StandardResourceUnitName.CPUSPEED).get(0);84 speed.setAmount(Double.valueOf(currentPState.getFrequency()).intValue());83 //CpuSpeed speed = (CpuSpeed)resource.getResourceCharacteristic().getResourceUnits().get(StandardResourceUnitName.CPUSPEED).get(0); 84 //speed.setAmount(Double.valueOf(currentPState.getFrequency()).intValue()); 85 85 //new ResourceEventCommand(resource).execute(EnergyEventType.FREQUENCY_CHANGED); 86 86 resource.handleEvent(new EnergyEvent(EnergyEventType.FREQUENCY_CHANGED, resource.getName())); 87 //resource.getScheduler().sendInternal(GridSimTags.SCHEDULE_NOW, GssimTags.UPDATE, resource.getName());87 //resource.getScheduler().sendInternal(GridSimTags.SCHEDULE_NOW, DCWormsTags.UPDATE, resource.getName()); 88 88 return true; 89 89 } -
DCWoRMS/trunk/build/classes/schedframe/resources/units/AbstractResourceUnit.java
r477 r539 78 78 public ResourceUnitProvisioner getProvisioner() { 79 79 return provisioner; 80 80 } 81 82 public Parameters getParameters(){ 83 return null; 81 84 } 82 85 -
DCWoRMS/trunk/build/classes/schedframe/resources/units/ResourceUnit.java
r477 r539 23 23 public void init(Parameters parameters); 24 24 25 public Parameters getParameters(); 26 25 27 public ResourceUnitProvisioner getProvisioner(); 26 28 }
Note: See TracChangeset
for help on using the changeset viewer.