Changeset 1374 for DCWoRMS/branches
- Timestamp:
- 06/05/14 15:24:38 (11 years ago)
- Location:
- DCWoRMS/branches/coolemall/src
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
DCWoRMS/branches/coolemall/src/gridsim/dcworms/DCWormsTags.java
r1362 r1374 57 57 public static final int NEW_EXEC_PHASE = 5; 58 58 59 public static final int PAUSED = 6; 59 public static final int PAUSING = 6; 60 61 public static final int PAUSED = 7; 60 62 61 public static final int RESUM ED = 7;63 public static final int RESUMING = 8; 62 64 63 public static final int SUCCESS = 8; 65 public static final int RESUMED = 9; 66 67 public static final int IN_MIGRATION = 10; 68 69 public static final int SUCCESS = 11; 64 70 65 public static final int CANCELED = 9;71 public static final int CANCELED = 12; 66 72 67 public static final int FAILED = 10; 73 public static final int FAILED = 13; 74 75 68 76 } -
DCWoRMS/branches/coolemall/src/schedframe/resources/computing/ComputingResource.java
r1330 r1374 158 158 } 159 159 160 public ComputingResource getDescendantByName(String resourceName) throws ResourceException{160 public ComputingResource getDescendantByName(String resourceName){ 161 161 List<ResourceValidator> validators = new ArrayList<ResourceValidator>(); 162 162 validators.add(new ResourceNameValidator(resourceName)); -
DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/ui/ComputingResourcePowerInterface.java
r1321 r1374 64 64 } 65 65 66 public List<PowerState> getSupportedPowerStates() throws NoSuchFieldException{66 public List<PowerState> getSupportedPowerStates(){ 67 67 List<PowerState> powerStates = new ArrayList<PowerState>(); 68 68 for(PowerState powerState: powerProfile.getSupportedPowerStates()){ … … 74 74 public boolean supportPowerState(PowerStateName state) { 75 75 for(PowerState powerState: powerProfile.getSupportedPowerStates()){ 76 if(powerState.getName(). equals(state)){76 if(powerState.getName().getName().equals(state.getName())){ 77 77 return true; 78 78 } … … 86 86 if(supportPowerState(state)){ 87 87 for(PowerState powerState: powerProfile.getSupportedPowerStates()){ 88 if(powerState.getName(). equals(state)){88 if(powerState.getName().getName().equals(state.getName())){ 89 89 powerConsumption = powerState.getPowerUsage(); 90 90 break; -
DCWoRMS/branches/coolemall/src/schedframe/scheduling/manager/resources/LocalResourceManager.java
r1280 r1374 134 134 } 135 135 136 public ComputingResource getResourceByName(String resourceName) throws ResourceException{136 public ComputingResource getResourceByName(String resourceName) { 137 137 ComputingResource resourceWithName = null; 138 138 for (int i = 0; i < computingResources.size() && resourceWithName == null; i++) { … … 269 269 resourceWithName = resource; 270 270 else 271 try { 272 resourceWithName = resource.getDescendantByName(resName); 273 } catch (ResourceException e) { 274 return null; 275 } 271 resourceWithName = resource.getDescendantByName(resName); 272 276 273 } 277 274 if(resourceWithName == null) -
DCWoRMS/branches/coolemall/src/schedframe/scheduling/manager/resources/ResourceManager.java
r517 r1374 19 19 public List<? extends ComputingResource> getResourcesOfType(ResourceType type) throws ResourceException; 20 20 21 public ComputingResource getResourceByName(String resourceName) throws ResourceException;21 public ComputingResource getResourceByName(String resourceName); 22 22 23 23 public List<? extends ComputingResource> getResourcesByTypeWithStatus(ResourceType type, ResourceStatus status) throws ResourceException; -
DCWoRMS/branches/coolemall/src/schedframe/scheduling/manager/tasks/AbstractJobRegistry.java
r1362 r1374 11 11 import schedframe.resources.units.ResourceUnit; 12 12 import schedframe.resources.units.ResourceUnitName; 13 import schedframe.scheduling.manager.resources.utils.ResourceManagerUtils; 13 14 import schedframe.scheduling.tasks.Job; 14 15 import schedframe.scheduling.tasks.JobInterface; … … 65 66 public List<JobInterface<?>> getJobs(){ 66 67 List<JobInterface<?>> jobList = new ArrayList<JobInterface<?>>(); 67 for(String jobId: jobs.keySet()) {68 for(String jobId: jobs.keySet()) { 68 69 jobList.add(jobs.get(jobId)); 69 70 } … … 74 75 List<JobInterface<?>> jobList = new ArrayList<JobInterface<?>>(); 75 76 synchronized (jobs) { 76 for(String jobId: jobs.keySet()){77 for(String jobId: jobs.keySet()){ 77 78 JobInterface<?> job = jobs.get(jobId); 78 79 if (job.getStatus() == status) { … … 90 91 return false; 91 92 }else{ 93 try { 94 execTask.setStatus(DCWormsTags.PAUSING); 95 } catch (Exception e) { 96 // TODO Auto-generated catch block 97 e.printStackTrace(); 98 } 92 99 String[] ids = new String[2]; 93 100 ids[0] = new String(jobId); … … 116 123 return false; 117 124 }else{ 125 try { 126 execTask.setStatus(DCWormsTags.IN_MIGRATION); 127 } catch (Exception e) { 128 return false; 129 } 130 if(choosenResources != null){ 131 ResourceManagerUtils.setPendingResources(choosenResources); 132 } 118 133 Object[] data = new Object[3]; 119 134 data[0] = new String(jobId); -
DCWoRMS/branches/coolemall/src/schedframe/scheduling/policy/local/LocalManagementSystem.java
r1362 r1374 213 213 if (pluginSupportsEvent(tag)) { 214 214 SchedulingEvent event = new SchedulingEvent(SchedulingEventType.POWER_LIMIT_EXCEEDED); 215 String source; 216 try{ 217 source = ev.get_data().toString(); 218 } catch(Exception e){ 219 source = null; 220 } 221 event.setSource(source); 215 222 SchedulingPlanInterface<?> decision = schedulingPlugin.schedule(event, 216 223 queues, getJobRegistry(), getResourceManager(), moduleList); … … 412 419 getAllocationManager().freeResources(lastUsed); 413 420 421 //TODO calculate the value of completion 414 422 saveExecutionHistory(exec, 100,0); 415 423 … … 556 564 LocalResourceManager resourceManager = getResourceManager(); 557 565 if(resourceName != null){ 558 ComputingResource resource = null; 559 try { 560 resource = resourceManager.getResourceByName(resourceName); 561 } catch (ResourceException e) { 566 ComputingResource resource = resourceManager.getResourceByName(resourceName); 567 if(resource == null){ 562 568 return null; 563 569 } -
DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/Job.java
r1207 r1374 229 229 if(w.getAnd() != null) { 230 230 parCnt = w.getAnd().getParentOpTypeItemCount(); 231 if(parCnt == 0) 232 { 231 if(parCnt == 0){ 233 232 availableTasks.add(task); 234 } 235 else 233 }else 236 234 { 237 235 for(int j = 0; j < parCnt; j++){ … … 251 249 else if(w.getOr() != null) { 252 250 parCnt = w.getOr().getParentOpTypeItemCount(); 253 if(parCnt == 0) 254 { 251 if(parCnt == 0){ 255 252 availableTasks.add(task); 256 253 } 257 else 258 { 254 else{ 259 255 for(int j = 0; j < parCnt; j++){ 260 256 ParentType par = w.getOr().getParentOpTypeItem(j).getParent(); … … 273 269 else { 274 270 parCnt = w.getParentCount(); 275 if(parCnt == 0) 276 { 271 if(parCnt == 0){ 277 272 availableTasks.add(task); 278 } 279 else 280 { 273 }else{ 281 274 for(int j = 0; j < parCnt; j++){ 282 275 ParentType par = w.getParent(j); -
DCWoRMS/branches/coolemall/src/simulator/reader/ResourceReader.java
r1346 r1374 376 376 for(String resourceName : resIdList){ 377 377 ComputingResource computingResource; 378 try { 379 if(mainCompRes.getFullName().contains(resourceName)) 380 computingResource = mainCompRes; 381 else 382 computingResource = mainCompRes.getDescendantByName(resourceName); 383 } catch (ResourceException e) { 384 continue; 385 } 378 379 if(mainCompRes.getFullName().contains(resourceName)) 380 computingResource = mainCompRes; 381 else 382 computingResource = mainCompRes.getDescendantByName(resourceName); 383 386 384 if(computingResource != null) 387 385 { -
DCWoRMS/branches/coolemall/src/simulator/stats/implementation/DCWormsStatistics.java
r1362 r1374 955 955 int cnt = 0; 956 956 for(String resName: basicStats.keySet()){ 957 try { 958 if(resource.getDescendantByName(resName) != null || resource.getFullName().compareTo(resName) == 0){ 959 createResourceLoadData(usageStats, basicStats.get(resName)); 960 cnt++; 961 } 962 } catch (ResourceException e) { 963 // TODO Auto-generated catch block 964 e.printStackTrace(); 957 958 if(resource.getDescendantByName(resName) != null || resource.getFullName().compareTo(resName) == 0){ 959 createResourceLoadData(usageStats, basicStats.get(resName)); 960 cnt++; 965 961 } 966 962 } … … 1593 1589 for(String resName: peLoad.keySet()){ 1594 1590 1595 try { 1596 if(resource.getDescendantByName(resName) != null || resource.getFullName().compareTo(resName) == 0){ 1597 Double load = peLoad.get(resName); 1598 sum += load; 1599 peCnt++; 1600 } 1601 } catch (ResourceException e) { 1602 // TODO Auto-generated catch block 1603 e.printStackTrace(); 1591 if(resource.getDescendantByName(resName) != null || resource.getFullName().compareTo(resName) == 0){ 1592 Double load = peLoad.get(resName); 1593 sum += load; 1594 peCnt++; 1604 1595 } 1605 1596 }
Note: See TracChangeset
for help on using the changeset viewer.