Changeset 1253 for DCWoRMS/branches/coolemall/src/example/timeestimation
- Timestamp:
- 11/28/13 11:41:33 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
DCWoRMS/branches/coolemall/src/example/timeestimation/coolemall/PhaseTimeEstimationPlugin.java
r910 r1253 5 5 6 6 import schedframe.events.scheduling.SchedulingEvent; 7 import schedframe.resources.units.PEUnit;8 7 import schedframe.resources.units.ResourceUnit; 9 8 import schedframe.resources.units.ResourceUnitName; 10 import schedframe.resources.units.StandardResourceUnitName;11 9 import schedframe.scheduling.tasks.phases.ResourceConsumption; 12 10 import dcworms.schedframe.scheduling.ExecTask; … … 20 18 * Requested calculation should be done based on the resources allocated for the task, 21 19 * 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 function25 * of number of allocated cpus and their speed.26 20 */ 27 21 public double execTimeEstimation(SchedulingEvent event, ExecTask task, … … 30 24 31 25 Executable exec = (Executable) task; 32 // System.out.println(exec.getJobId() +":"+ exec.getApplicationName());33 // collect all information necessary to do the calculation34 PEUnit peUnit = (PEUnit) allocatedResources.get(StandardResourceUnitName.PE);35 36 // obtain single pe speed37 int speed = peUnit.getSpeed();38 26 39 // number of used pe40 int cnt = peUnit.getUsedAmount();41 42 // estimate remainingTaskLength43 27 ResourceConsumption resConsumption = exec.getResourceConsumptionProfile().getCurrentResourceConsumption(); 44 28 45 // do the calculation46 29 double execTime = (1 - completionPercentage/100) * resConsumption.getDuration(); 47 30
Note: See TracChangeset
for help on using the changeset viewer.