Changeset 1377 for DCWoRMS/branches
- Timestamp:
- 06/06/14 10:48:32 (11 years ago)
- Location:
- DCWoRMS/branches/coolemall/src
- Files:
-
- 1 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
DCWoRMS/branches/coolemall/src/schedframe/scheduling/manager/resources/LocalResourceManager.java
r1374 r1377 29 29 import schedframe.resources.units.StandardResourceUnitName; 30 30 import schedframe.scheduling.Scheduler; 31 import schedframe.scheduling.plugin.local.ResourceAllocation;32 31 33 32 … … 297 296 } 298 297 299 public boolean allocateResources(Map<ResourceUnitName, ResourceUnit> resources) { 298 299 public boolean allocateResources(Map<ResourceUnitName, ResourceUnit> resources, boolean exclusive) { 300 300 301 301 if (resources == null) { … … 303 303 } 304 304 305 for(ResourceUnitName resUnitName: resources.keySet()){ 306 ResourceUnit resUnit = resources.get(resUnitName); 307 resUnit.getProvisioner().setState(ResourceUnitState.BUSY); 308 } 309 return true; 310 } 311 312 313 public void freeResources(Map<ResourceUnitName, ResourceUnit> resources) { 305 if(exclusive){ 306 for(ResourceUnitName resUnitName: resources.keySet()){ 307 ResourceUnit resUnit = resources.get(resUnitName); 308 if(resUnit.getName().getName().equals(StandardResourceUnitName.PE.getName())){ 309 ProcessingElements pe = (ProcessingElements)resUnit; 310 for(ComputingResource cr: pe){ 311 if(cr.getStatus().equals(ResourceStatus.BUSY)){ 312 return false; 313 } 314 } 315 } 316 resUnit.getProvisioner().setState(ResourceUnitState.BUSY); 317 } 318 319 return true; 320 } else { 321 for(ResourceUnitName resUnitName: resources.keySet()){ 322 ResourceUnit resUnit = resources.get(resUnitName); 323 resUnit.getProvisioner().setState(ResourceUnitState.BUSY); 324 } 325 return true; 326 } 327 } 328 329 public void freeResources(Map<ResourceUnitName, ResourceUnit> resources, boolean exclusive) { 314 330 315 331 for(ResourceUnitName resUnitName: resources.keySet()){ -
DCWoRMS/branches/coolemall/src/schedframe/scheduling/manager/resources/ResourceAllocation.java
r477 r1377 1 1 package schedframe.scheduling.manager.resources; 2 2 3 import java.util. List;3 import java.util.Map; 4 4 5 import schedframe.resources.computing.ComputingResource; 5 import schedframe.resources.units.ResourceUnit; 6 import schedframe.resources.units.ResourceUnitName; 6 7 7 8 public interface ResourceAllocation { 8 public void allocateResources(List<ComputingResource> resources); 9 10 /** 11 * Allocates resource units( marks as used) on the basis of given resource 12 * units. 13 * 14 * @param freeRes 15 * resource units to be consumed 16 * @param exclusive 17 * allocate resources in exclusive mode 18 */ 19 public boolean allocateResources(Map<ResourceUnitName, ResourceUnit> freeRes, boolean exclusive); 9 20 21 /** 22 * Frees given resource units. 23 * 24 * @param lastUsedResources 25 * resource units to be free 26 * @param exclusive 27 * free resources allocated in exclusive mode 28 */ 29 public void freeResources(Map<ResourceUnitName, ResourceUnit> lastUsedResources, boolean exclusive); 10 30 11 public void freeResources(List<ComputingResource> resources);12 31 13 32 } -
DCWoRMS/branches/coolemall/src/schedframe/scheduling/policy/AbstractManagementSystem.java
r1362 r1377 26 26 import schedframe.scheduling.plugin.estimation.ExecutionTimeEstimationPlugin; 27 27 import schedframe.scheduling.plugin.grid.ModuleList; 28 import schedframe.scheduling. plugin.local.ResourceAllocation;28 import schedframe.scheduling.manager.resources.ResourceAllocation; 29 29 import schedframe.scheduling.queue.TaskQueue; 30 30 import schedframe.scheduling.queue.TaskQueueList; -
DCWoRMS/branches/coolemall/src/schedframe/scheduling/policy/local/LocalManagementSystem.java
r1374 r1377 238 238 Executable exec = (Executable) execTask; 239 239 Map<ResourceUnitName, ResourceUnit> lastUsed = exec.getAllocatedResources().getLast().getResourceUnits(); 240 getAllocationManager().freeResources(lastUsed );240 getAllocationManager().freeResources(lastUsed, true); 241 241 242 242 saveExecutionHistory(exec, exec.getCompletionPercentage(), exec.getEstimatedDuration()); … … 262 262 Executable exec = (Executable) execTask; 263 263 264 boolean status = allocateResources(exec, resources );264 boolean status = allocateResources(exec, resources, true); 265 265 if(status == false){ 266 266 TaskList newTasks = new TaskListImpl(); … … 332 332 333 333 Executable exec = (Executable)task; 334 boolean allocationStatus = allocateResources(exec, choosenResources );334 boolean allocationStatus = allocateResources(exec, choosenResources, false); 335 335 if(allocationStatus == false){ 336 336 log.info("Task " + task.getJobId() + "_" + task.getId() + " requires more resources than is available at this moment."); … … 417 417 418 418 Map<ResourceUnitName, ResourceUnit> lastUsed = exec.getAllocatedResources().getLast().getResourceUnits(); 419 getAllocationManager().freeResources(lastUsed );419 getAllocationManager().freeResources(lastUsed, true); 420 420 421 421 //TODO calculate the value of completion … … 727 727 } 728 728 729 public boolean allocateResources(Executable exec, Map<ResourceUnitName, ResourceUnit> choosenResources ){730 boolean allocationStatus = getAllocationManager().allocateResources(choosenResources );729 public boolean allocateResources(Executable exec, Map<ResourceUnitName, ResourceUnit> choosenResources, boolean exclusive){ 730 boolean allocationStatus = getAllocationManager().allocateResources(choosenResources, exclusive); 731 731 if(allocationStatus){ 732 732 ResourceHistoryItem resourceHistoryItem = new ResourceHistoryItem(choosenResources); -
DCWoRMS/branches/coolemall/src/simulator/stats/DCwormsMetricsCalculator.java
r1278 r1377 48 48 roomPower = roomPower + acc.getSum(); 49 49 } 50 metric = new MetricsStats("CoolEmAllTestbed", "Total_energy_consumption", roomPower, timestamp, "Wh"); 51 } catch (Exception e){ 52 metric = new MetricsStats("CoolEmAllTestbed", "Total_energy_consumption", -1, timestamp, "Wh"); 50 51 metric = new MetricsStats("CoolEmAllTestbed", "Total_energy_consumption - not implemented yet", 0, timestamp, "Wh"); 52 } catch (Exception e){ 53 metric = new MetricsStats("CoolEmAllTestbed", "Total_energy_consumption - not implemented yet", -1, timestamp, "Wh"); 53 54 } 54 55 return metric; … … 63 64 itComputingPower = itComputingPower + acc.getSum(); 64 65 } 65 metric = new MetricsStats("CoolEmAllTestbed", "Total_processors_energy_consumption ", (itComputingPower), timestamp, "Wh");66 } catch (Exception e){ 67 metric = new MetricsStats("CoolEmAllTestbed", "Total_processors_energy_consumption ", -1, timestamp, "Wh");66 metric = new MetricsStats("CoolEmAllTestbed", "Total_processors_energy_consumption - not implemented yet", 0, timestamp, "Wh"); 67 } catch (Exception e){ 68 metric = new MetricsStats("CoolEmAllTestbed", "Total_processors_energy_consumption - not implemented yet", -1, timestamp, "Wh"); 68 69 } 69 70 return metric; … … 87 88 } 88 89 double fanPowerConumspion = nodeComputingPower - itComputingPower; 89 metric = new MetricsStats("CoolEmAllTestbed", "Total_IT_energy_consumption ", (totalSitePower * CoolEmAllTestbedMeasurements.POWER_SUPPLY_EFFICIENCY - fanPowerConumspion), timestamp, "Wh");90 } catch (Exception e){ 91 metric = new MetricsStats("CoolEmAllTestbed", "Total_IT_energy_consumption ", -1, timestamp, "Wh");90 metric = new MetricsStats("CoolEmAllTestbed", "Total_IT_energy_consumption - not implemented yet", 0, timestamp, "Wh"); 91 } catch (Exception e){ 92 metric = new MetricsStats("CoolEmAllTestbed", "Total_IT_energy_consumption - not implemented yet", -1, timestamp, "Wh"); 92 93 } 93 94 return metric; … … 120 121 double nodeGroupFansPowerConumspion = nodeComputingPower - itComputingPower; 121 122 122 metric = new MetricsStats("CoolEmAllTestbed", "PUE_Level_4 ", roomPower/(totalSitePower * CoolEmAllTestbedMeasurements.POWER_SUPPLY_EFFICIENCY - nodeGroupFansPowerConumspion), timestamp, "");123 } catch (Exception e){ 124 metric = new MetricsStats("CoolEmAllTestbed", "PUE_Level_4 ", -1, timestamp, "");123 metric = new MetricsStats("CoolEmAllTestbed", "PUE_Level_4 - not implemented yet", 0, timestamp, ""); 124 } catch (Exception e){ 125 metric = new MetricsStats("CoolEmAllTestbed", "PUE_Level_4 - not implemented yet", -1, timestamp, ""); 125 126 } 126 127 return metric; … … 143 144 144 145 145 metric = new MetricsStats("CoolEmAllTestbed", "PUE ", roomPower/totalSitePower, timestamp, "");146 } catch (Exception e){ 147 metric = new MetricsStats("CoolEmAllTestbed", "PUE ", -1, timestamp, "");146 metric = new MetricsStats("CoolEmAllTestbed", "PUE - not implemented yet", 0, timestamp, ""); 147 } catch (Exception e){ 148 metric = new MetricsStats("CoolEmAllTestbed", "PUE - not implemented yet", -1, timestamp, ""); 148 149 } 149 150 return metric; … … 162 163 } 163 164 } 164 metric = new MetricsStats("CoolEmAllTestbed", "Useful_Work ", usefulWork, timestamp, "UW units");165 } catch (Exception e){ 166 metric = new MetricsStats("CoolEmAllTestbed", "Useful_Work ", -1, timestamp, "UW units");165 metric = new MetricsStats("CoolEmAllTestbed", "Useful_Work - not implemented yet", 0, timestamp, "UW units"); 166 } catch (Exception e){ 167 metric = new MetricsStats("CoolEmAllTestbed", "Useful_Work - not implemented yet", -1, timestamp, "UW units"); 167 168 } 168 169 … … 187 188 } 188 189 189 metric = new MetricsStats("CoolEmAllTestbed", "Productivity ", usefulWork/totalSitePower, timestamp, "UW units/Wh");190 } catch (Exception e){ 191 metric = new MetricsStats("CoolEmAllTestbed", "Productivity ", -1, timestamp, "UW units/Wh");190 metric = new MetricsStats("CoolEmAllTestbed", "Productivity - not implemented yet", 0, timestamp, "UW units/Wh"); 191 } catch (Exception e){ 192 metric = new MetricsStats("CoolEmAllTestbed", "Productivity - not implemented yet", -1, timestamp, "UW units/Wh"); 192 193 } 193 194 … … 207 208 } 208 209 209 metric = new MetricsStats("CoolEmAllTestbed", "Max_power ", maxPower, timestamp, "W");210 } catch (Exception e){ 211 metric = new MetricsStats("CoolEmAllTestbed", "Max_power ", -1, timestamp, "W");210 metric = new MetricsStats("CoolEmAllTestbed", "Max_power - not implemented yet", 0, timestamp, "W"); 211 } catch (Exception e){ 212 metric = new MetricsStats("CoolEmAllTestbed", "Max_power - not implemented yet", -1, timestamp, "W"); 212 213 } 213 214 … … 223 224 coolingDevicePower = coolingDevicePower + acc.getSum(); 224 225 } 225 metric = new MetricsStats("CoolEmAllTestbed", "Total_cooling_device_energy_consumption ", coolingDevicePower, timestamp, "Wh");226 } catch (Exception e){ 227 metric = new MetricsStats("CoolEmAllTestbed", "Total_cooling_device_energy_consumption ", -1, timestamp, "Wh");226 metric = new MetricsStats("CoolEmAllTestbed", "Total_cooling_device_energy_consumption - not implemented yet", 0, timestamp, "Wh"); 227 } catch (Exception e){ 228 metric = new MetricsStats("CoolEmAllTestbed", "Total_cooling_device_energy_consumption - not implemented yet", -1, timestamp, "Wh"); 228 229 } 229 230 return metric; … … 239 240 roomPower = roomPower + acc.getSum(); 240 241 } 241 metric = new MetricsStats("CoolEmAllTestbed", "Mean_power ", roomPower/((this.endTime - this.startTime)/(SEC_IN_HOUR * MILLI_SEC)), timestamp, "W");242 } catch (Exception e){ 243 metric = new MetricsStats("CoolEmAllTestbed", "Mean_power ", -1, timestamp, "W");242 metric = new MetricsStats("CoolEmAllTestbed", "Mean_power - not implemented yet", 0, timestamp, "W"); 243 } catch (Exception e){ 244 metric = new MetricsStats("CoolEmAllTestbed", "Mean_power - not implemented yet", -1, timestamp, "W"); 244 245 } 245 246 return metric; … … 256 257 double itEnergy = calculateITEnergyConsumption().getValue(); 257 258 258 metric = new MetricsStats("CoolEmAllTestbed", "Energy_waste_rate ", (1 - itComputingEnergy/itEnergy) * 100, timestamp, "%");259 } catch (Exception e){ 260 metric = new MetricsStats("CoolEmAllTestbed", "Energy_waste_rate ", -1, timestamp, "%");259 metric = new MetricsStats("CoolEmAllTestbed", "Energy_waste_rate - not implemented yet", 0, timestamp, "%"); 260 } catch (Exception e){ 261 metric = new MetricsStats("CoolEmAllTestbed", "Energy_waste_rate - not implemented yet", -1, timestamp, "%"); 261 262 } 262 263 return metric;
Note: See TracChangeset
for help on using the changeset viewer.