Ignore:
Timestamp:
06/26/14 14:18:01 (11 years ago)
Author:
wojtekp
Message:
 
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  
    2323import schedframe.scheduling.plan.AllocationInterface; 
    2424import schedframe.scheduling.plan.SchedulingPlanInterface; 
     25import schedframe.scheduling.plugin.ModuleList; 
    2526import schedframe.scheduling.plugin.SchedulingPlugin; 
    2627import schedframe.scheduling.plugin.estimation.ExecutionTimeEstimationPlugin; 
    27 import schedframe.scheduling.plugin.grid.ModuleList; 
    2828import schedframe.scheduling.manager.resources.ResourceAllocation; 
    2929import schedframe.scheduling.queue.TaskQueue; 
  • DCWoRMS/branches/coolemall/src/schedframe/scheduling/policy/global/GridBroker.java

    r1385 r1396  
    1212import schedframe.scheduling.Scheduler; 
    1313import schedframe.scheduling.manager.resources.ManagedResources; 
     14import schedframe.scheduling.plugin.ModuleListImpl; 
    1415import schedframe.scheduling.plugin.SchedulingPlugin; 
    1516import schedframe.scheduling.plugin.estimation.ExecutionTimeEstimationPlugin; 
    16 import schedframe.scheduling.plugin.grid.ModuleListImpl; 
    1717import schedframe.scheduling.queue.TaskQueueList; 
    1818 
  • DCWoRMS/branches/coolemall/src/schedframe/scheduling/policy/local/LocalManagementSystem.java

    r1392 r1396  
    44import java.util.HashMap; 
    55import java.util.Iterator; 
    6 import java.util.LinkedList; 
    76import java.util.List; 
    87import java.util.Map; 
    9 import java.util.Set; 
    108 
    119import org.apache.commons.logging.Log; 
     
    3331import schedframe.resources.units.StandardResourceUnitName; 
    3432import schedframe.scheduling.ExecutionHistoryItem; 
    35 import schedframe.scheduling.ResourceHistoryItem; 
     33import schedframe.scheduling.ResourceItem; 
    3634import schedframe.scheduling.Scheduler; 
    3735import schedframe.scheduling.TaskList; 
     
    4442import schedframe.scheduling.plan.ScheduledTaskInterface; 
    4543import schedframe.scheduling.plan.SchedulingPlanInterface; 
     44import schedframe.scheduling.plugin.ModuleListImpl; 
    4645import schedframe.scheduling.plugin.SchedulingPlugin; 
    4746import schedframe.scheduling.plugin.estimation.ExecutionTimeEstimationPlugin; 
    48 import schedframe.scheduling.plugin.grid.ModuleListImpl; 
    4947import schedframe.scheduling.policy.AbstractManagementSystem; 
    5048import schedframe.scheduling.queue.TaskQueueList; 
     
    5654import schedframe.scheduling.tasks.WorkloadUnit; 
    5755import simulator.DCWormsConstants; 
    58 import simulator.stats.GSSAccumulator; 
     56import simulator.stats.DCwormsAccumulator; 
    5957import simulator.utils.DoubleMath; 
    6058import dcworms.schedframe.scheduling.ExecTask; 
     
    382380 
    383381                saveExecutionHistory(exec, exec.getCompletionPercentage(), phaseDuration); 
    384                 if(exec.getResourceConsumptionProfile().isLast()){ 
     382                if(exec.getExecutionProfile().isLast()){ 
    385383                        scheduler.sendInternal(phaseDuration, DCWormsTags.TASK_EXECUTION_FINISHED, execTask);; 
    386384                } else { 
     
    451449                        ExecTask task = iter.next(); 
    452450                        Executable exec = (Executable)task; 
    453                         ExecutionHistoryItem execHistItem = exec.getExecHistory().getLast(); 
     451                        ExecutionHistoryItem execHistItem = exec.getExecutionHistory().getLast(); 
    454452                        //System.out.println("--- upadteProgressX: " + Sim_system.sim_clock() ); 
    455453                        //System.out.println("taskId: " + exec.getId() + "; completion percentage: " + exec.getCompletionPercentage() + "; timespan: " + timeSpan + "; estimatedDuration: " +  execHistItem.getCompletionPercentage()); 
     
    496494                                        execTask, choosenResources, exec.getCompletionPercentage())).intValue(); 
    497495 
    498                         ExecutionHistoryItem execHistItem = exec.getExecHistory().getLast(); 
     496                        ExecutionHistoryItem execHistItem = exec.getExecutionHistory().getLast(); 
    499497                        double lastTimeStamp = execHistItem.getTimeStamp().getMillis()/1000; 
    500498                        if(DoubleMath.subtract((lastTimeStamp + execHistItem.getEstimatedDuration()), (new DateTime().getMillis()/1000 + phaseDuration)) == 0.0){ 
     
    508506                        saveExecutionHistory(exec, exec.getCompletionPercentage(), phaseDuration); 
    509507                         
    510                         if(exec.getResourceConsumptionProfile().isLast()){ 
     508                        if(exec.getExecutionProfile().isLast()){ 
    511509                                ExecTaskFilter filter = new ExecTaskFilter(exec.getUniqueId(), DCWormsTags.TASK_EXECUTION_FINISHED); 
    512510                                scheduler.sim_cancel(filter, null); 
     
    542540                        saveExecutionHistory(exec, exec.getCompletionPercentage(), phaseDuration); 
    543541                         
    544                         if(exec.getResourceConsumptionProfile().isLast()){ 
     542                        if(exec.getExecutionProfile().isLast()){ 
    545543                                scheduler.sendInternal(phaseDuration, DCWormsTags.TASK_EXECUTION_FINISHED, execTask); 
    546544                        } else { 
     
    555553        public double calculateTotalLoad() { 
    556554 
    557                 GSSAccumulator loadAcc = new GSSAccumulator(); 
     555                DCwormsAccumulator loadAcc = new DCwormsAccumulator(); 
    558556                try { 
    559557                        for(ComputingResource compRes: getResourceManager().getResourcesOfType(StandardResourceType.Node)){ 
     
    718716                boolean allocationStatus = getAllocationManager().allocateResources(choosenResources, exclusive); 
    719717                if(allocationStatus){ 
    720                         ResourceHistoryItem resourceHistoryItem = new ResourceHistoryItem(choosenResources); 
     718                        ResourceItem resourceHistoryItem = new ResourceItem(choosenResources); 
    721719                        exec.addAllocatedResources(resourceHistoryItem); 
    722                         saveResourceHistory(exec); 
    723720                        return true; 
    724721                } 
     
    726723        } 
    727724         
    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 
    752726         
    753727} 
Note: See TracChangeset for help on using the changeset viewer.