Ignore:
Timestamp:
06/23/14 16:57:26 (11 years ago)
Author:
wojtekp
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • DCWoRMS/branches/coolemall/src/schedframe/scheduling/policy/local/LocalManagementSystem.java

    r1385 r1392  
    353353                 
    354354                PEUnit peUnit = (PEUnit)choosenResources.get(StandardResourceUnitName.PE); 
    355                 updateComputingResources(peUnit, EnergyEventType.TASK_STARTED, exec); 
     355                updateComputingResources(peUnit, EnergyEventType.RESOURCE_UTILIZATION_CHANGED, exec); 
    356356                 
    357357 
     
    435435                log.debug(execTask.getJobId() + "_" + execTask.getId() + " finished execution on " + new DateTime()); 
    436436                log.info(DCWormsConstants.USAGE_MEASURE_NAME + ": " + calculateTotalLoad()); 
     437                 
     438                updateComputingResources(peUnit, EnergyEventType.RESOURCE_UTILIZATION_CHANGED, exec); 
    437439        } 
    438440         
     
    702704         
    703705         
    704         public void saveExecutionHistory(Executable exec, double completionPercentage, double estimatedDuration){ 
     706        private void saveExecutionHistory(Executable exec, double completionPercentage, double estimatedDuration){ 
    705707 
    706708                ExecutionHistoryItem execHistoryItem = new ExecutionHistoryItem(new DateTime()); 
     
    711713                exec.addExecHistory(execHistoryItem); 
    712714                 
     715        } 
     716         
     717        public boolean allocateResources(Executable exec, Map<ResourceUnitName, ResourceUnit> choosenResources, boolean exclusive){ 
     718                boolean allocationStatus = getAllocationManager().allocateResources(choosenResources, exclusive); 
     719                if(allocationStatus){ 
     720                        ResourceHistoryItem resourceHistoryItem = new ResourceHistoryItem(choosenResources); 
     721                        exec.addAllocatedResources(resourceHistoryItem); 
     722                        saveResourceHistory(exec); 
     723                        return true; 
     724                } 
     725                return false; 
     726        } 
     727         
     728        private void saveResourceHistory(Executable exec){ 
    713729                ProcessingElements pes = (ProcessingElements) exec.getAllocatedResources().getLast().getResourceUnits().get(StandardResourceUnitName.PE); 
    714730                for (ComputingResource resource : pes) { 
     
    735751        } 
    736752         
    737         public boolean allocateResources(Executable exec, Map<ResourceUnitName, ResourceUnit> choosenResources, boolean exclusive){ 
    738                 boolean allocationStatus = getAllocationManager().allocateResources(choosenResources, exclusive); 
    739                 if(allocationStatus){ 
    740                         ResourceHistoryItem resourceHistoryItem = new ResourceHistoryItem(choosenResources); 
    741                         exec.addAllocatedResources(resourceHistoryItem); 
    742                         return true; 
    743                 } 
    744                 return false; 
    745         } 
    746753} 
Note: See TracChangeset for help on using the changeset viewer.