Changeset 497 for DCWoRMS/trunk/src/schedframe/scheduling/policy/local
- Timestamp:
- 10/11/12 09:07:11 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
DCWoRMS/trunk/src/schedframe/scheduling/policy/local/LocalManagementSystem.java
r493 r497 6 6 import eduni.simjava.Sim_system; 7 7 import gridsim.Accumulator; 8 import gridsim.GridSimTags; 8 9 import gridsim.ResourceCalendar; 9 10 import gridsim.dcworms.DCWormsTags; … … 115 116 116 117 case DCWormsTags.TASK_READY_FOR_EXECUTION: 117 118 118 ExecTask execTask = (ExecTask) ev.get_data(); 119 119 try { … … 347 347 ExecTask task = iter.next(); 348 348 Executable exec = (Executable)task; 349 exec.setCompletionPercentage(exec.getCompletionPercentage() + 100 * timeSpan/exec.getEstimatedDuration()); 350 349 351 UsedResourcesList usedResourcesList = exec.getUsedResources(); 350 352 PEUnit peUnit = (PEUnit)usedResourcesList.getLast().getResourceUnits() 351 353 .get(StandardResourceUnitName.PE); 352 353 354 double load = getMIShare(timeSpan, peUnit); 354 exec.setCompletionPercentage(100 * timeSpan/exec.getEstimatedDuration());355 355 addTotalLoad(load); 356 356 } … … 401 401 402 402 Map<ResourceUnitName, ResourceUnit> choosenResources = exec.getUsedResources().getLast().getResourceUnits(); 403 double time =execTimeEstimationPlugin.execTimeEstimation(new SchedulingEvent(SchedulingEventType.RESOURCE_STATE_CHANGED),404 execTask, choosenResources, exec.getCompletionPercentage()) ;403 int time = Double.valueOf(execTimeEstimationPlugin.execTimeEstimation(new SchedulingEvent(SchedulingEventType.RESOURCE_STATE_CHANGED), 404 execTask, choosenResources, exec.getCompletionPercentage())).intValue(); 405 405 406 406 //check if the new estimated end time is equal to the previous one; if yes the continue without update … … 408 408 continue; 409 409 } 410 exec.setEstimatedDuration(time); 410 411 ExecTaskFilter filter = new ExecTaskFilter(exec.getUniqueId(), DCWormsTags.TASK_EXECUTION_FINISHED); 411 412 scheduler.sim_cancel(filter, null); … … 449 450 450 451 Map<ResourceUnitName, ResourceUnit> map = new HashMap<ResourceUnitName, ResourceUnit>(); 451 ResourceManager resourceManager = this.resourceManager;452 LocalResourceManager resourceManager = getResourceManager(); 452 453 if(resourceName != null){ 453 454 ComputingResource resource = null; … … 471 472 List<ResourceUnit> availableUnits = null; 472 473 try { 473 availableUnits = getResourceManager().getPE();474 availableUnits = resourceManager.getPE(); 474 475 } catch (ResourceException e) { 475 476 return null;
Note: See TracChangeset
for help on using the changeset viewer.