Changeset 204 for xssim/trunk/src
- Timestamp:
- 03/26/12 12:32:16 (13 years ago)
- Location:
- xssim/trunk/src/example/localplugin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
xssim/trunk/src/example/localplugin/FCFSCPUFreqScalingClusterLocalPlugin.java
r192 r204 25 25 import test.rewolucja.resources.manager.interfaces.ResourceManagerInterface; 26 26 import test.rewolucja.resources.physical.base.ComputingResource; 27 import test.rewolucja.resources.physical.implementation. CPU;27 import test.rewolucja.resources.physical.implementation.Processor; 28 28 import test.rewolucja.scheduling.JobRegistryInterface; 29 29 import test.rewolucja.scheduling.UsedResourceList; … … 35 35 public class FCFSCPUFreqScalingClusterLocalPlugin extends BaseLocalPlugin { 36 36 37 List< CPU> allocatedCPUs;37 List<Processor> allocatedCPUs; 38 38 public FCFSCPUFreqScalingClusterLocalPlugin () { 39 allocatedCPUs = new ArrayList< CPU>();39 allocatedCPUs = new ArrayList<Processor>(); 40 40 } 41 41 … … 65 65 addToSchedulingPlan(plan, task, choosenResources); 66 66 ProcessingElements pes = (ProcessingElements)choosenResources.get(ResourceParameterName.PROCESSINGELEMENTS); 67 List< CPU> processors = new ArrayList<CPU>();67 List<Processor> processors = new ArrayList<Processor>(); 68 68 for(ComputingResource res : pes){ 69 processors.add(( CPU) res);69 processors.add((Processor) res); 70 70 } 71 71 adjustFrequency(ResourceStatus.BUSY,processors); … … 80 80 UsedResourceList<ResourceHistoryItem> usedResourcesList = subTask.getUsedResources(); 81 81 ProcessingElements pes = (ProcessingElements)usedResourcesList.getLast().getResourceUnits().get(ResourceParameterName.PROCESSINGELEMENTS); 82 List< CPU> processors = new ArrayList<CPU>();82 List<Processor> processors = new ArrayList<Processor>(); 83 83 for(ComputingResource res : pes){ 84 processors.add(( CPU) res);85 allocatedCPUs.add(( CPU) res);84 processors.add((Processor) res); 85 allocatedCPUs.add((Processor) res); 86 86 } 87 87 adjustFrequency(ResourceStatus.FREE, processors); … … 93 93 usedResourcesList = subTask.getUsedResources(); 94 94 pes = (ProcessingElements)usedResourcesList.getLast().getResourceUnits().get(ResourceParameterName.PROCESSINGELEMENTS); 95 processors = new ArrayList< CPU>();95 processors = new ArrayList<Processor>(); 96 96 for(ComputingResource res : pes){ 97 allocatedCPUs.remove(( CPU) res);97 allocatedCPUs.remove((Processor) res); 98 98 } 99 99 // check all tasks in queue … … 108 108 addToSchedulingPlan(plan, task, choosenResources); 109 109 pes = (ProcessingElements)choosenResources.get(ResourceParameterName.PROCESSINGELEMENTS); 110 processors = new ArrayList< CPU>();110 processors = new ArrayList<Processor>(); 111 111 for(ComputingResource res : pes){ 112 processors.add(( CPU) res);112 processors.add((Processor) res); 113 113 } 114 114 adjustFrequency(ResourceStatus.BUSY, processors); … … 135 135 if (cpuRequest != 0) { 136 136 List<ComputingResource> choosenResources = null; 137 List< CPU> processors = resourceManager.getProcessors();137 List<Processor> processors = resourceManager.getProcessors(); 138 138 processors.removeAll(allocatedCPUs); 139 139 if (processors.size() < cpuRequest) { … … 163 163 } 164 164 165 private void adjustFrequency(ResourceStatus status, List< CPU> processors){165 private void adjustFrequency(ResourceStatus status, List<Processor> processors){ 166 166 switch(status){ 167 167 case BUSY: 168 for( CPUcpu: processors){168 for(Processor cpu: processors){ 169 169 if(cpu.getPowerInterface().getSupportedPStates().containsKey(PStateType.P0)) 170 170 cpu.getPowerInterface().setPState(PStateType.P0); … … 172 172 break; 173 173 case FREE: 174 for( CPUcpu: processors){174 for(Processor cpu: processors){ 175 175 if(cpu.getPowerInterface().getSupportedPStates().containsKey(PStateType.P3)) 176 176 cpu.getPowerInterface().setPState(PStateType.P3); -
xssim/trunk/src/example/localplugin/FCFSClusterLocalPlugin.java
r192 r204 24 24 import test.rewolucja.resources.manager.interfaces.ResourceManagerInterface; 25 25 import test.rewolucja.resources.physical.base.ComputingResource; 26 import test.rewolucja.resources.physical.implementation. CPU;26 import test.rewolucja.resources.physical.implementation.Processor; 27 27 import test.rewolucja.resources.physical.implementation.ComputingNode; 28 28 import test.rewolucja.scheduling.JobRegistryInterface; … … 100 100 if (cpuRequest != 0) { 101 101 List<ComputingResource> choosenResources = null; 102 List< CPU> processors = null;102 List<Processor> processors = null; 103 103 processors = resourceManager.getProcessors(); 104 104 if (processors.size() < cpuRequest) {
Note: See TracChangeset
for help on using the changeset viewer.