Changeset 1207 for DCWoRMS/branches/coolemall/src/example/localplugin/FCFSBF_FanManagementClusterPlugin.java
- Timestamp:
- 11/26/13 11:56:07 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
DCWoRMS/branches/coolemall/src/example/localplugin/FCFSBF_FanManagementClusterPlugin.java
r778 r1207 8 8 9 9 import schedframe.events.scheduling.SchedulingEvent; 10 import schedframe.resources.StandardResourceType; 10 11 import schedframe.resources.computing.ComputingNode; 11 12 import schedframe.resources.computing.profiles.energy.airthroughput.StandardAirThroughputStateName; 12 13 import schedframe.resources.computing.profiles.energy.airthroughput.UserAirThroughputStateName; 14 import schedframe.resources.devices.Device; 13 15 import schedframe.scheduling.manager.resources.ClusterResourceManager; 14 16 import schedframe.scheduling.manager.resources.ResourceManager; … … 54 56 if (node != null) { 55 57 //if there are two or more tasks ( running on the given node then 56 if(new JobRegistryImpl(node.getName()).getRunningTasks().size() > 0) 57 node.getAirThroughputInterface().setAirThroughputState(new UserAirThroughputStateName("FAN_ON_TURBO")); 58 else 59 node.getAirThroughputInterface().setAirThroughputState(StandardAirThroughputStateName.FAN_ON); 58 if(new JobRegistryImpl(node.getFullName()).getRunningTasks().size() > 0){ 59 List<Device> devices = node.getResourceCharacteristic().getDevices(); 60 for(Device dev : devices){ 61 if(dev.getType().equals(StandardResourceType.Fan)){ 62 dev.getAirThroughputInterface().setAirThroughputState(new UserAirThroughputStateName("FAN_ON_TURBO")); 63 } 64 } 65 } 66 else { 67 List<Device> devices = node.getResourceCharacteristic().getDevices(); 68 for(Device dev : devices){ 69 if(dev.getType().equals(StandardResourceType.Fan)){ 70 dev.getAirThroughputInterface().setAirThroughputState(StandardAirThroughputStateName.ON); 71 } 72 } 73 } 60 74 notSelectedNodes.remove(node); 61 addToSchedulingPlan(plan, task, node.get Name());75 addToSchedulingPlan(plan, task, node.getFullName()); 62 76 } 63 77 } … … 98 112 private void adjustOtherFans(List<ComputingNode> nodes){ 99 113 for(ComputingNode node : nodes){ 114 List<Device> devices = node.getResourceCharacteristic().getDevices(); 100 115 if(node.getFreeProcessorsNumber() == node.getProcessorsNumber()){ 101 node.getAirThroughputInterface().setAirThroughputState(StandardAirThroughputStateName.FAN_OFF); 102 } else if(new JobRegistryImpl(node.getName()).getRunningTasks().size() > 1) 103 node.getAirThroughputInterface().setAirThroughputState(new UserAirThroughputStateName("FAN_ON_TURBO")); 104 else 105 node.getAirThroughputInterface().setAirThroughputState(StandardAirThroughputStateName.FAN_ON); 116 for(Device dev : devices){ 117 if(dev.getType().equals(StandardResourceType.Fan)){ 118 dev.getAirThroughputInterface().setAirThroughputState(StandardAirThroughputStateName.OFF); 119 } 120 } 121 } else if(new JobRegistryImpl(node.getFullName()).getRunningTasks().size() > 1){ 122 for(Device dev : devices){ 123 if(dev.getType().equals(StandardResourceType.Fan)){ 124 dev.getAirThroughputInterface().setAirThroughputState(new UserAirThroughputStateName("FAN_ON_TURBO")); 125 } 126 } 127 } 128 else { 129 for(Device dev : devices){ 130 if(dev.getType().equals(StandardResourceType.Fan)){ 131 dev.getAirThroughputInterface().setAirThroughputState(StandardAirThroughputStateName.ON); 132 } 133 } 134 } 106 135 } 107 136 }
Note: See TracChangeset
for help on using the changeset viewer.