Ignore:
Timestamp:
11/28/13 11:41:33 (11 years ago)
Author:
wojtekp
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • DCWoRMS/branches/coolemall/src/example/timeestimation/coolemall/PhaseTimeEstimationPlugin.java

    r910 r1253  
    55 
    66import schedframe.events.scheduling.SchedulingEvent; 
    7 import schedframe.resources.units.PEUnit; 
    87import schedframe.resources.units.ResourceUnit; 
    98import schedframe.resources.units.ResourceUnitName; 
    10 import schedframe.resources.units.StandardResourceUnitName; 
    119import schedframe.scheduling.tasks.phases.ResourceConsumption; 
    1210import dcworms.schedframe.scheduling.ExecTask; 
     
    2018         * Requested calculation should be done based on the resources allocated for the task, 
    2119         * task description and task completion percentage. 
    22          *  
    23          * Example implementation calculate the estimation based on cpu processing power. 
    24          * There is also a simple assumption, that cpu processing power is a linear function 
    25          * of number of allocated cpus and their speed. 
    2620         */ 
    2721        public double execTimeEstimation(SchedulingEvent event, ExecTask task, 
     
    3024 
    3125                Executable exec = (Executable) task; 
    32                 // System.out.println(exec.getJobId() +":"+ exec.getApplicationName()); 
    33                 // collect all information necessary to do the calculation 
    34                 PEUnit peUnit = (PEUnit) allocatedResources.get(StandardResourceUnitName.PE); 
    35                  
    36                 // obtain single pe speed 
    37                 int speed = peUnit.getSpeed(); 
    3826 
    39                 // number of used pe   
    40                 int cnt = peUnit.getUsedAmount(); 
    41  
    42                 // estimate remainingTaskLength 
    4327                ResourceConsumption resConsumption = exec.getResourceConsumptionProfile().getCurrentResourceConsumption(); 
    4428 
    45                 // do the calculation 
    4629                double execTime = (1 - completionPercentage/100) * resConsumption.getDuration(); 
    4730 
Note: See TracChangeset for help on using the changeset viewer.