Changeset 129 for xssim/trunk
- Timestamp:
- 03/15/12 11:14:52 (13 years ago)
- Location:
- xssim/trunk/src/example/localplugin
- Files:
-
- 6 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
xssim/trunk/src/example/localplugin/BaseLocalPlugin.java
r104 r129 89 89 } 90 90 91 public void addToSchedulingPlan(SchedulingPlanNew plan, TaskInterface<?> task){ 92 93 AllocationNew allocation = new AllocationNew(); 94 allocation.setProcessesCount(1); 95 allocation.setProviderName(null); 96 97 ScheduledTaskNew scheduledTask = new ScheduledTaskNew(task); 98 scheduledTask.setTaskId(task.getId()); 99 scheduledTask.setJobId(task.getJobId()); 100 scheduledTask.addAllocation(allocation); 101 102 plan.addTask(scheduledTask); 103 } 91 104 92 105 } -
xssim/trunk/src/example/localplugin/FCFSClusterLocalPlugin.java
r104 r129 62 62 63 63 SubmittedTask subTask = (SubmittedTask) task; 64 Map<ResourceParameterName, ResourceUnit> choosenResources = null; 65 choosenResources = chooseResourcesForExecution(resourceManager, subTask); 66 //String provname = chooseProviderForExecution(resourceManager); 64 65 /****************3 ways to schedule task****************/ 66 67 //1. Choosing particular resources to perform execution 68 Map<ResourceParameterName, ResourceUnit> choosenResources = chooseResourcesForExecution(resourceManager, subTask); 67 69 if (choosenResources != null) { 68 70 addToSchedulingPlan(plan, task, choosenResources); 69 71 } 72 73 //2. Choosing resource scheduler/provider to submit task. If the given resource doesn't contains/isn't 74 //a scheduler, random resources from the given resource will be chosen in order to perform execution 75 /*String provName = chooseProviderForExecution(resourceManager); 76 if (provName != null) { 77 addToSchedulingPlan(plan, task, provName); 78 }*/ 79 80 //3. Scheduler will choose random resources to perform execution 81 //addToSchedulingPlan(plan, task); 70 82 71 83 } … … 77 89 } 78 90 79 p ublicHashMap<ResourceParameterName, ResourceUnit> chooseResourcesForExecution(91 private HashMap<ResourceParameterName, ResourceUnit> chooseResourcesForExecution( 80 92 ClusterResourceManager resourceManager, ExecTaskInterface task) { 81 93 … … 140 152 } 141 153 154 private String chooseProviderForExecution(ResourceManagerInterface unitsManager) { 155 List<ComputingResource> processingElements; 156 Properties properties = new Properties(); 157 properties.setProperty("type", ResourceType.COMPUTING_NODE.toString()); 158 // properties.setProperty("status", ResourceStatus.FREE.toString()); 159 processingElements = (List<ComputingResource>) unitsManager.filterResources(properties); 160 return processingElements.get(0).getName(); 161 } 162 142 163 public String getName() { 143 164 return getClass().getName(); … … 148 169 } 149 170 150 public String chooseProviderForExecution(ResourceManagerInterface unitsManager) {151 List<ComputingResource> processingElements;152 Properties properties = new Properties();153 properties.setProperty("type", ResourceType.COMPUTING_NODE.toString());154 // properties.setProperty("status", ResourceStatus.FREE.toString());155 processingElements = (List<ComputingResource>) unitsManager.filterResources(properties);156 return processingElements.get(0).getName();157 }158 159 171 }
Note: See TracChangeset
for help on using the changeset viewer.