Changeset 192 for xssim/trunk/src/example/localplugin
- Timestamp:
- 03/26/12 12:03:27 (13 years ago)
- Location:
- xssim/trunk/src/example/localplugin
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
xssim/trunk/src/example/localplugin/FCFSCPUFreqScalingClusterLocalPlugin.java
r172 r192 46 46 SchedulingPlanNew plan = new SchedulingPlanNew(); 47 47 // our tasks are placed only in first queue (see 48 // BaseLocalPlugin.place TasksInQueues() method)48 // BaseLocalPlugin.placeJobsInQueues() method) 49 49 Queue q = queues.get(0); 50 50 // chose the events types to serve. -
xssim/trunk/src/example/localplugin/FCFSClusterLocalPlugin.java
r169 r192 49 49 case TIMER: 50 50 // our tasks are placed only in first queue (see 51 // BaseLocalPlugin.place TasksInQueues() method)51 // BaseLocalPlugin.placeJobsInQueues() method) 52 52 Queue q = queues.get(0); 53 53 // check all tasks in queue 54 55 54 56 55 for (int i = 0; i < q.size(); i++) { … … 64 63 /****************3 ways to schedule task****************/ 65 64 66 / /1. Choosing particular resources to perform execution65 /****************1. Choosing particular resources to perform execution****************/ 67 66 Map<ResourceParameterName, ResourceUnit> choosenResources = chooseResourcesForExecution(resourceManager, subTask); 68 67 if (choosenResources != null) { … … 70 69 } 71 70 72 / /2. Choosing resource scheduler/provider to submit task. If the given resource doesn't contains/isn't73 //a scheduler, random resources from the given resource will be chosen in order to perform execution71 /****************2. Choosing resource scheduler/provider to submit task. If the given resource doesn't contains/isn't 72 a scheduler, random resources from the given resource will be chosen in order to perform execution****************/ 74 73 /*String provName = chooseProviderForExecution(resourceManager); 75 74 if (provName != null) { … … 77 76 }*/ 78 77 79 / /3. Scheduler will choose random resources to perform execution78 /****************3. Scheduler will choose random resources to perform execution****************/ 80 79 //addToSchedulingPlan(plan, task); 81 82 80 } 83 81 } … … 141 139 142 140 if (node.getFreeMemory() >= memoryRequest) { 143 memory = new Memory(node.getMemory (), memoryRequest, memoryRequest);141 memory = new Memory(node.getMemoryUnit(), memoryRequest, memoryRequest); 144 142 } else 145 143 return null; … … 151 149 } 152 150 151 @SuppressWarnings("unchecked") 153 152 private String chooseProviderForExecution(ResourceManagerInterface unitsManager) { 154 153 List<ComputingResource> processingElements; -
xssim/trunk/src/example/localplugin/FCFSConsolidationClusterLocalPlugin.java
r163 r192 2 2 3 3 import gridsim.Gridlet; 4 import gridsim.gssim.ResourceHistoryItem;5 import gridsim.gssim.SubmittedTask;6 4 7 5 import java.util.ArrayList; … … 17 15 import schedframe.scheduling.TaskInterface; 18 16 import schedframe.scheduling.events.SchedulingEvent; 19 import schedframe.scheduling.events.TaskFinishedEvent;20 17 import schedframe.scheduling.plugin.grid.ModuleList; 21 18 import schedframe.scheduling.utils.ResourceParameterName; 22 19 import test.rewolucja.GSSIMJobInterface; 23 import test.rewolucja.energy.profile.PStateType;24 20 import test.rewolucja.resources.ProcessingElements; 25 21 import test.rewolucja.resources.ResourceStatus; 26 import test.rewolucja.resources.ResourceType;27 22 import test.rewolucja.resources.manager.implementation.ClusterResourceManager; 28 23 import test.rewolucja.resources.manager.interfaces.ResourceManagerInterface; 29 24 import test.rewolucja.resources.physical.base.ComputingResource; 30 import test.rewolucja.resources.physical.implementation.CPU;31 25 import test.rewolucja.resources.physical.implementation.ComputingNode; 32 26 import test.rewolucja.scheduling.JobRegistryInterface; … … 52 46 case TASK_FINISHED: 53 47 // our tasks are placed only in first queue (see 54 // BaseLocalPlugin.place TasksInQueues() method)48 // BaseLocalPlugin.placeJobsInQueues() method) 55 49 Queue q = queues.get(0); 56 50 // check all tasks in queue … … 111 105 } 112 106 if (memoryRequest != 0) { 113 Memory memory = new Memory(node.getMemory (), memoryRequest, memoryRequest);107 Memory memory = new Memory(node.getMemoryUnit(), memoryRequest, memoryRequest); 114 108 map.put(ResourceParameterName.MEMORY, memory); 115 109 } … … 132 126 memoryRequest = 0; 133 127 } 134 List<ComputingNode> avNodes = new ArrayList<ComputingNode>();128 List<ComputingNode> suitableNodes = new ArrayList<ComputingNode>(); 135 129 for(ComputingNode node: nodes){ 136 130 if(node.getFreeProcessorsNumber() >= cpuRequest && node.getFreeMemory() >= memoryRequest){ 137 avNodes.add(node);131 suitableNodes.add(node); 138 132 } 139 133 } 140 return avNodes;134 return suitableNodes; 141 135 } 142 136 -
xssim/trunk/src/example/localplugin/FCFSEnergyAwareClusterLocalPlugin.java
r163 r192 38 38 case TASK_FINISHED: 39 39 // our tasks are placed only in first queue (see 40 // BaseLocalPlugin.place TasksInQueues() method)40 // BaseLocalPlugin.placeJobsInQueues() method) 41 41 Queue q = queues.get(0); 42 42 // check all tasks in queue -
xssim/trunk/src/example/localplugin/FCFSNodePowerManagementClusterLocalPlugin.java
r163 r192 46 46 case TASK_FINISHED: 47 47 // our tasks are placed only in first queue (see 48 // BaseLocalPlugin.place TasksInQueues() method)48 // BaseLocalPlugin.placeJobsInQueues() method) 49 49 Queue q = queues.get(0); 50 50 // check all tasks in queue … … 60 60 addToSchedulingPlan(plan, task, choosenResources); 61 61 } else { 62 if(harness NodestoWork(task, resourceManager.getComputingNodes()))62 if(harnessIdleNodesToWork(task, resourceManager.getComputingNodes())) 63 63 i--; 64 64 } … … 130 130 } 131 131 132 private boolean harness NodestoWork(TaskInterface<?> task, List<ComputingNode> nodes){132 private boolean harnessIdleNodesToWork(TaskInterface<?> task, List<ComputingNode> nodes){ 133 133 int cpuRequest; 134 134 try { -
xssim/trunk/src/example/localplugin/FCFSRandomClusterLocalPlugin.java
r163 r192 39 39 case TASK_FINISHED: 40 40 // our tasks are placed only in first queue (see 41 // BaseLocalPlugin.place TasksInQueues() method)41 // BaseLocalPlugin.placeJobsInQueues() method) 42 42 Queue q = queues.get(0); 43 43 // check all tasks in queue
Note: See TracChangeset
for help on using the changeset viewer.