Changeset 1357 for DCWoRMS/branches
- Timestamp:
- 04/23/14 14:35:44 (11 years ago)
- Location:
- DCWoRMS/branches/coolemall/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
DCWoRMS/branches/coolemall/src/schedframe/scheduling/policy/global/GlobalManagementSystem.java
r493 r1357 250 250 } 251 251 252 class GlobalWorkloadUnitHandler implements 252 class GlobalWorkloadUnitHandler implements WorkloadUnitHandler{ 253 253 254 254 public void handleJob(JobInterface<?> job){ -
DCWoRMS/branches/coolemall/src/schedframe/scheduling/policy/local/LocalManagementSystem.java
r1332 r1357 256 256 257 257 PEUnit peUnit = (PEUnit)choosenResources.get(StandardResourceUnitName.PE); 258 notifyComputingResources(peUnit, EnergyEventType.TASK_STARTED, exec);258 updateComputingResources(peUnit, EnergyEventType.TASK_STARTED, exec); 259 259 260 260 updateTaskExecution(exec, SchedulingEventType.START_TASK_EXECUTION); … … 311 311 312 312 PEUnit peUnit = (PEUnit)lastUsed.get(StandardResourceUnitName.PE); 313 notifyComputingResources(peUnit, EnergyEventType.TASK_FINISHED, exec);313 updateComputingResources(peUnit, EnergyEventType.TASK_FINISHED, exec); 314 314 } 315 315 … … 342 342 } 343 343 344 private void notifyComputingResources(PEUnit peUnit, EnergyEventType eventType, Object obj){344 private void updateComputingResources(PEUnit peUnit, EnergyEventType eventType, Object obj){ 345 345 if(peUnit instanceof ProcessingElements){ 346 346 ProcessingElements pes = (ProcessingElements) peUnit; … … 427 427 scheduler.sendInternal(phaseDuration, DCWormsTags.TASK_EXECUTION_FINISHED, execTask); 428 428 PEUnit peUnit = (PEUnit)exec.getUsedResources().getLast().getResourceUnits().get(StandardResourceUnitName.PE); 429 notifyComputingResources(peUnit, EnergyEventType.RESOURCE_UTILIZATION_CHANGED, exec);429 updateComputingResources(peUnit, EnergyEventType.RESOURCE_UTILIZATION_CHANGED, exec); 430 430 } else { 431 431 scheduler.sendInternal(phaseDuration, DCWormsTags.TASK_EXECUTION_CHANGED, execTask); 432 432 PEUnit peUnit = (PEUnit)exec.getUsedResources().getLast().getResourceUnits().get(StandardResourceUnitName.PE); 433 notifyComputingResources(peUnit, EnergyEventType.RESOURCE_UTILIZATION_CHANGED, exec);433 updateComputingResources(peUnit, EnergyEventType.RESOURCE_UTILIZATION_CHANGED, exec); 434 434 } 435 435 } -
DCWoRMS/branches/coolemall/src/simulator/stats/implementation/DCWormsStatistics.java
r1337 r1357 862 862 } 863 863 864 private ResourceUsageStats gatherResourceOccupancyStatsNew(ComputingResource resource, Map<String, List<ResStat>> basicStats) { 865 866 String usageType = null; 867 if(resource.getResourceCharacteristic().getParameters().get("load-sensor")!= null){ 868 usageType = resource.getResourceCharacteristic().getParameters().get("load-sensor").get(0).getContent(); 869 } 870 ResourceUsageStats usageStats = new ResourceUsageStats(resource.getFullName(), resource.getType(), usageType); 871 int cnt = 0; 872 873 ResourceType resType = null; 874 875 for(String key: basicStats.keySet()){ 876 List<ResStat> resStats = basicStats.get(key); 877 resType = resStats.get(0).getResType(); 878 break; 879 } 880 List<ComputingResource> resources = null; 881 try { 882 resources = new ArrayList<ComputingResource>(); 883 for(ComputingResource compRes: resourceController.getComputingResources()){ 884 resources.addAll(compRes.getDescendantsByType(resType)); 885 } 886 } catch (Exception e) { 887 888 } 889 890 List<String> resourcesNames = new ArrayList<String>(resources.size()); 891 for(ComputingResource compRes: resources){ 892 resourcesNames.add(compRes.getFullName()); 893 } 894 895 896 for(String resName: basicStats.keySet()){ 897 if( resourcesNames.contains(resName) || resource.getFullName().compareTo(resName) == 0){ 898 createResourceLoadData(usageStats, basicStats.get(resName)); 899 cnt++; 900 } 901 } 902 for(Long key: usageStats.getHistory().keySet()){ 903 Double value = usageStats.getHistory().get(key)/cnt; 904 usageStats.getHistory().put(key, value); 905 } 906 return usageStats; 907 } 908 864 909 private ResourceAvailabilityStats gatherResourceAvailabilityStats(ComputingResource resource) { 865 910 String usageType = new String ("usedNodes"); -
DCWoRMS/branches/coolemall/src/simulator/workload/WorkloadLoader.java
r1207 r1357 9 9 import java.util.ArrayList; 10 10 import java.util.Date; 11 import java.util.LinkedHashMap; 11 12 import java.util.List; 12 13 import java.util.Locale; … … 70 71 this.generatedJobsCnt = 0; 71 72 this.generatedTasksCnt = 0; 72 this.jobsMap = new TreeMap<String, JobDescription>();73 this.jobsMap = new LinkedHashMap<String, JobDescription>(); 73 74 this.appProfilesFolder = appProfilesFolder; 74 75 this.applicationProfiles = new TreeMap<String, ApplicationProfileDescription>();
Note: See TracChangeset
for help on using the changeset viewer.