- Timestamp:
- 03/19/14 18:22:27 (11 years ago)
- Location:
- DCWoRMS/branches/coolemall/src/schedframe/resources/computing
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
DCWoRMS/branches/coolemall/src/schedframe/resources/computing/ComputingResource.java
r1207 r1299 3 3 import gridsim.GridSimTags; 4 4 import gridsim.dcworms.DCWormsTags; 5 import gridsim.dcworms.filter.ResourceEventFilter; 5 6 6 7 import java.util.ArrayList; … … 24 25 import schedframe.resources.computing.profiles.energy.EnergyEventType; 25 26 import schedframe.resources.computing.profiles.energy.EnergyExtension; 27 import schedframe.resources.computing.profiles.load.LoadExtension; 28 import schedframe.resources.computing.profiles.load.ResourceLoadCalendar; 29 import schedframe.resources.computing.profiles.load.TimestampUtilization; 30 import schedframe.resources.computing.profiles.load.ui.LoadInterface; 26 31 import schedframe.resources.computing.properties.DefaultPropertiesBuilder; 27 32 import schedframe.resources.computing.properties.PropertiesDirector; … … 34 39 import schedframe.resources.devices.PhysicalResource; 35 40 import schedframe.scheduling.Scheduler; 41 import simulator.DataCenterWorkloadSimulator; 36 42 37 43 public class ComputingResource extends PhysicalResource{ … … 51 57 this.extensionList = new ExtensionListImpl(1); 52 58 initCharacteristics(resDesc); 59 accept(new LoadExtension(resDesc.getLoadProfile(), this)); 53 60 accept(new EnergyExtension.Builder().resource(this).powerProfile(resDesc.getPowerProfile()).airFlowProfile(resDesc.getAirThroughputProfile()).thermalProfile(resDesc.getThermalProfile()).build()); 54 61 } … … 67 74 public void setParent(ComputingResource newParent) { 68 75 parent = newParent; 76 if(this.getLoadInterface().getLoadCalendar().getLoadDistribution().size() == 0){ 77 this.getLoadInterface().getLoadCalendar().getLoadDistribution().addAll(parent.getLoadInterface().getLoadCalendar().getLoadDistribution()); 78 } 69 79 } 70 80 … … 220 230 public void handleResourceEvent(Event event){ 221 231 if (extensionList != null) { 222 for (Extension extension 232 for (Extension extension: extensionList) { 223 233 if (extension.supportsEvent(event)) { 224 234 extension.handleEvent(event); … … 227 237 228 238 for (Device device: ((ComputingResourceCharacteristics)resourceCharacteristic).getDevices()) { 229 for (Extension extension 239 for (Extension extension: device.getExtensionList()) { 230 240 if (extension.supportsEvent(event)) { 231 //extension.handleEvent(event);241 extension.handleEvent(event); 232 242 } 233 243 } … … 242 252 if(scheduler != null && (parent != null && scheduler != parent.getScheduler())/*scheduler.getResources().contains(this)*/){ 243 253 String src = event.getSource() != null ? event.getSource() : name; 254 ResourceEventFilter filter = new ResourceEventFilter(src.hashCode(), DCWormsTags.UPDATE_PROCESSING); 255 scheduler.sim_cancel(filter, null); 244 256 scheduler.sendInternal(GridSimTags.SCHEDULE_NOW, DCWormsTags.UPDATE_PROCESSING, src); 245 257 } else if(parent != null) … … 274 286 rec.execute(event); 275 287 288 LoadInterface li = getLoadInterface(); 289 if(li != null){ 290 ResourceLoadCalendar rlc = li.getLoadCalendar(); 291 LinkedList<TimestampUtilization> ll = rlc.getLoadDistribution(); 292 for(TimestampUtilization tu: ll){ 293 DataCenterWorkloadSimulator.getEventManager().sendToResource(getFullName(), tu.getStartTime(), new EnergyEvent(EnergyEventType.RESOURCE_UTILIZATION_CHANGED, getFullName())); 294 DataCenterWorkloadSimulator.getEventManager().sendToResource(getFullName(), tu.getEndTime(), new EnergyEvent(EnergyEventType.RESOURCE_UTILIZATION_CHANGED, getFullName())); 295 } 296 } 276 297 //alternative way 277 298 //getEventHandler().handleResourceEvent(new EnergyEvent(EnergyEventType.AIRFLOW_STATE_CHANGED, "Resource controller")); -
DCWoRMS/branches/coolemall/src/schedframe/resources/computing/coolemall/NodeGroup.java
r1247 r1299 1 1 package schedframe.resources.computing.coolemall; 2 2 3 import java.util.ArrayList; 3 4 import java.util.List; 4 5 … … 8 9 import schedframe.resources.computing.Processor; 9 10 import schedframe.resources.computing.description.ComputingResourceDescription; 11 import schedframe.resources.computing.description.ResourceDescription; 12 import schedframe.resources.devices.Device; 13 import schedframe.resources.devices.Fan; 14 import test.Node_Fan_Mapping; 10 15 11 16 public class NodeGroup extends ComputingResource{ … … 13 18 public NodeGroup(ComputingResourceDescription resDesc) { 14 19 super(resDesc); 20 initNodes_FansMapping(resDesc); 15 21 } 16 22 … … 25 31 } 26 32 33 34 private void initNodes_FansMapping(ComputingResourceDescription resDesc){ 35 Node_Fan_Mapping.init(); 36 for(Device dev: this.getResourceCharacteristic().getDevices()){ 37 if(dev.getType().equals(StandardResourceType.Fan) || dev.getType().equals(StandardResourceType.Inlet) | dev.getType().equals(StandardResourceType.Outlet)){ 38 Fan fan = (Fan) dev; 39 List<String> chilledResources = new ArrayList<String>(); 40 for(ResourceDescription nodeDesc: resDesc.getChildren()){ 41 String nodeName = this.getFullName() + "/" + nodeDesc.getId(); 42 if(!Node_Fan_Mapping.getNode_fan().containsKey(nodeName)){ 43 chilledResources.add(nodeName); 44 } else if(Node_Fan_Mapping.getNode_fan().get(nodeName).equals(fan.getFullName())){ 45 chilledResources.add(nodeName); 46 } else { 47 //if mapping present but there is no match do nothing 48 } 49 } 50 fan.setChilledResources(chilledResources); 51 } 52 } 53 } 27 54 } -
DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/ui/ProcessorPowerInterface.java
r1281 r1299 20 20 super(resource, pp); 21 21 currentPowerState = StandardPowerStateName.ON; 22 currentPState = get HighestPState();22 currentPState = getLowestPState(); 23 23 } 24 24
Note: See TracChangeset
for help on using the changeset viewer.