- Timestamp:
- 06/26/14 14:18:01 (11 years ago)
- Location:
- DCWoRMS/branches/coolemall/src/schedframe/scheduling/policy
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
DCWoRMS/branches/coolemall/src/schedframe/scheduling/policy/AbstractManagementSystem.java
r1377 r1396 23 23 import schedframe.scheduling.plan.AllocationInterface; 24 24 import schedframe.scheduling.plan.SchedulingPlanInterface; 25 import schedframe.scheduling.plugin.ModuleList; 25 26 import schedframe.scheduling.plugin.SchedulingPlugin; 26 27 import schedframe.scheduling.plugin.estimation.ExecutionTimeEstimationPlugin; 27 import schedframe.scheduling.plugin.grid.ModuleList;28 28 import schedframe.scheduling.manager.resources.ResourceAllocation; 29 29 import schedframe.scheduling.queue.TaskQueue; -
DCWoRMS/branches/coolemall/src/schedframe/scheduling/policy/global/GridBroker.java
r1385 r1396 12 12 import schedframe.scheduling.Scheduler; 13 13 import schedframe.scheduling.manager.resources.ManagedResources; 14 import schedframe.scheduling.plugin.ModuleListImpl; 14 15 import schedframe.scheduling.plugin.SchedulingPlugin; 15 16 import schedframe.scheduling.plugin.estimation.ExecutionTimeEstimationPlugin; 16 import schedframe.scheduling.plugin.grid.ModuleListImpl;17 17 import schedframe.scheduling.queue.TaskQueueList; 18 18 -
DCWoRMS/branches/coolemall/src/schedframe/scheduling/policy/local/LocalManagementSystem.java
r1392 r1396 4 4 import java.util.HashMap; 5 5 import java.util.Iterator; 6 import java.util.LinkedList;7 6 import java.util.List; 8 7 import java.util.Map; 9 import java.util.Set;10 8 11 9 import org.apache.commons.logging.Log; … … 33 31 import schedframe.resources.units.StandardResourceUnitName; 34 32 import schedframe.scheduling.ExecutionHistoryItem; 35 import schedframe.scheduling.Resource HistoryItem;33 import schedframe.scheduling.ResourceItem; 36 34 import schedframe.scheduling.Scheduler; 37 35 import schedframe.scheduling.TaskList; … … 44 42 import schedframe.scheduling.plan.ScheduledTaskInterface; 45 43 import schedframe.scheduling.plan.SchedulingPlanInterface; 44 import schedframe.scheduling.plugin.ModuleListImpl; 46 45 import schedframe.scheduling.plugin.SchedulingPlugin; 47 46 import schedframe.scheduling.plugin.estimation.ExecutionTimeEstimationPlugin; 48 import schedframe.scheduling.plugin.grid.ModuleListImpl;49 47 import schedframe.scheduling.policy.AbstractManagementSystem; 50 48 import schedframe.scheduling.queue.TaskQueueList; … … 56 54 import schedframe.scheduling.tasks.WorkloadUnit; 57 55 import simulator.DCWormsConstants; 58 import simulator.stats. GSSAccumulator;56 import simulator.stats.DCwormsAccumulator; 59 57 import simulator.utils.DoubleMath; 60 58 import dcworms.schedframe.scheduling.ExecTask; … … 382 380 383 381 saveExecutionHistory(exec, exec.getCompletionPercentage(), phaseDuration); 384 if(exec.get ResourceConsumptionProfile().isLast()){382 if(exec.getExecutionProfile().isLast()){ 385 383 scheduler.sendInternal(phaseDuration, DCWormsTags.TASK_EXECUTION_FINISHED, execTask);; 386 384 } else { … … 451 449 ExecTask task = iter.next(); 452 450 Executable exec = (Executable)task; 453 ExecutionHistoryItem execHistItem = exec.getExec History().getLast();451 ExecutionHistoryItem execHistItem = exec.getExecutionHistory().getLast(); 454 452 //System.out.println("--- upadteProgressX: " + Sim_system.sim_clock() ); 455 453 //System.out.println("taskId: " + exec.getId() + "; completion percentage: " + exec.getCompletionPercentage() + "; timespan: " + timeSpan + "; estimatedDuration: " + execHistItem.getCompletionPercentage()); … … 496 494 execTask, choosenResources, exec.getCompletionPercentage())).intValue(); 497 495 498 ExecutionHistoryItem execHistItem = exec.getExec History().getLast();496 ExecutionHistoryItem execHistItem = exec.getExecutionHistory().getLast(); 499 497 double lastTimeStamp = execHistItem.getTimeStamp().getMillis()/1000; 500 498 if(DoubleMath.subtract((lastTimeStamp + execHistItem.getEstimatedDuration()), (new DateTime().getMillis()/1000 + phaseDuration)) == 0.0){ … … 508 506 saveExecutionHistory(exec, exec.getCompletionPercentage(), phaseDuration); 509 507 510 if(exec.get ResourceConsumptionProfile().isLast()){508 if(exec.getExecutionProfile().isLast()){ 511 509 ExecTaskFilter filter = new ExecTaskFilter(exec.getUniqueId(), DCWormsTags.TASK_EXECUTION_FINISHED); 512 510 scheduler.sim_cancel(filter, null); … … 542 540 saveExecutionHistory(exec, exec.getCompletionPercentage(), phaseDuration); 543 541 544 if(exec.get ResourceConsumptionProfile().isLast()){542 if(exec.getExecutionProfile().isLast()){ 545 543 scheduler.sendInternal(phaseDuration, DCWormsTags.TASK_EXECUTION_FINISHED, execTask); 546 544 } else { … … 555 553 public double calculateTotalLoad() { 556 554 557 GSSAccumulator loadAcc = new GSSAccumulator();555 DCwormsAccumulator loadAcc = new DCwormsAccumulator(); 558 556 try { 559 557 for(ComputingResource compRes: getResourceManager().getResourcesOfType(StandardResourceType.Node)){ … … 718 716 boolean allocationStatus = getAllocationManager().allocateResources(choosenResources, exclusive); 719 717 if(allocationStatus){ 720 Resource HistoryItem resourceHistoryItem = new ResourceHistoryItem(choosenResources);718 ResourceItem resourceHistoryItem = new ResourceItem(choosenResources); 721 719 exec.addAllocatedResources(resourceHistoryItem); 722 saveResourceHistory(exec);723 720 return true; 724 721 } … … 726 723 } 727 724 728 private void saveResourceHistory(Executable exec){ 729 ProcessingElements pes = (ProcessingElements) exec.getAllocatedResources().getLast().getResourceUnits().get(StandardResourceUnitName.PE); 730 for (ComputingResource resource : pes) { 731 732 LinkedList<ComputingResource> toExamine = new LinkedList<ComputingResource>(); 733 toExamine.push(resource); 734 735 while (!toExamine.isEmpty()) { 736 ComputingResource compResource = toExamine.pop(); 737 List<ComputingResource> resources = compResource.getChildren(); 738 if(resources.isEmpty()){ 739 Set<String> visitedResources = exec.getAllocatedResources().getLast().getVisitedResources(); 740 if(!visitedResources.contains(compResource.getFullName())){ 741 exec.getAllocatedResources().getLast().trackResource(compResource.getFullName()); 742 } 743 } else { 744 for (int i = 0; i < resources.size(); i++) { 745 ComputingResource resourceChild = resources.get(i); 746 toExamine.addLast(resourceChild); 747 } 748 } 749 } 750 } 751 } 725 752 726 753 727 }
Note: See TracChangeset
for help on using the changeset viewer.