Changeset 1374 for DCWoRMS


Ignore:
Timestamp:
06/05/14 15:24:38 (11 years ago)
Author:
wojtekp
Message:
 
Location:
DCWoRMS/branches/coolemall/src
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • DCWoRMS/branches/coolemall/src/gridsim/dcworms/DCWormsTags.java

    r1362 r1374  
    5757    public static final int NEW_EXEC_PHASE = 5; 
    5858     
    59     public static final int PAUSED = 6; 
     59    public static final int PAUSING = 6; 
     60     
     61    public static final int PAUSED = 7; 
    6062 
    61     public static final int RESUMED = 7; 
     63    public static final int RESUMING = 8; 
    6264     
    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; 
    6470 
    65     public static final int CANCELED = 9; 
     71    public static final int CANCELED = 12; 
    6672 
    67     public static final int FAILED = 10; 
     73    public static final int FAILED = 13; 
     74     
     75 
    6876} 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/computing/ComputingResource.java

    r1330 r1374  
    158158        } 
    159159 
    160         public ComputingResource getDescendantByName(String resourceName) throws ResourceException { 
     160        public ComputingResource getDescendantByName(String resourceName){ 
    161161                List<ResourceValidator> validators = new ArrayList<ResourceValidator>(); 
    162162                validators.add(new ResourceNameValidator(resourceName)); 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/ui/ComputingResourcePowerInterface.java

    r1321 r1374  
    6464        } 
    6565 
    66         public List<PowerState> getSupportedPowerStates() throws NoSuchFieldException { 
     66        public List<PowerState> getSupportedPowerStates(){ 
    6767                List<PowerState> powerStates = new ArrayList<PowerState>(); 
    6868                for(PowerState powerState: powerProfile.getSupportedPowerStates()){ 
     
    7474        public boolean supportPowerState(PowerStateName state) { 
    7575                for(PowerState powerState: powerProfile.getSupportedPowerStates()){ 
    76                         if(powerState.getName().equals(state)){ 
     76                        if(powerState.getName().getName().equals(state.getName())){ 
    7777                                return true; 
    7878                        } 
     
    8686                if(supportPowerState(state)){ 
    8787                        for(PowerState powerState: powerProfile.getSupportedPowerStates()){ 
    88                                 if(powerState.getName().equals(state)){ 
     88                                if(powerState.getName().getName().equals(state.getName())){ 
    8989                                        powerConsumption = powerState.getPowerUsage(); 
    9090                                        break; 
  • DCWoRMS/branches/coolemall/src/schedframe/scheduling/manager/resources/LocalResourceManager.java

    r1280 r1374  
    134134        } 
    135135 
    136         public ComputingResource getResourceByName(String resourceName) throws ResourceException { 
     136        public ComputingResource getResourceByName(String resourceName) { 
    137137                ComputingResource resourceWithName = null; 
    138138                for (int i = 0; i < computingResources.size() && resourceWithName == null; i++) { 
     
    269269                                resourceWithName = resource; 
    270270                        else 
    271                                 try { 
    272                                         resourceWithName = resource.getDescendantByName(resName); 
    273                                 } catch (ResourceException e) { 
    274                                         return null; 
    275                                 } 
     271                                resourceWithName = resource.getDescendantByName(resName); 
     272 
    276273                } 
    277274                if(resourceWithName == null) 
  • DCWoRMS/branches/coolemall/src/schedframe/scheduling/manager/resources/ResourceManager.java

    r517 r1374  
    1919        public List<? extends ComputingResource> getResourcesOfType(ResourceType type) throws ResourceException; 
    2020 
    21         public ComputingResource getResourceByName(String resourceName) throws ResourceException; 
     21        public ComputingResource getResourceByName(String resourceName); 
    2222 
    2323        public List<? extends ComputingResource> getResourcesByTypeWithStatus(ResourceType type, ResourceStatus status) throws ResourceException; 
  • DCWoRMS/branches/coolemall/src/schedframe/scheduling/manager/tasks/AbstractJobRegistry.java

    r1362 r1374  
    1111import schedframe.resources.units.ResourceUnit; 
    1212import schedframe.resources.units.ResourceUnitName; 
     13import schedframe.scheduling.manager.resources.utils.ResourceManagerUtils; 
    1314import schedframe.scheduling.tasks.Job; 
    1415import schedframe.scheduling.tasks.JobInterface; 
     
    6566        public List<JobInterface<?>> getJobs(){ 
    6667                List<JobInterface<?>> jobList = new ArrayList<JobInterface<?>>(); 
    67                 for(String jobId:jobs.keySet()) { 
     68                for(String jobId: jobs.keySet()) { 
    6869                        jobList.add(jobs.get(jobId)); 
    6970                } 
     
    7475                List<JobInterface<?>> jobList = new ArrayList<JobInterface<?>>(); 
    7576                synchronized (jobs) { 
    76                         for(String jobId:jobs.keySet()){ 
     77                        for(String jobId: jobs.keySet()){ 
    7778                                JobInterface<?> job = jobs.get(jobId); 
    7879                                if (job.getStatus() == status) { 
     
    9091                        return false; 
    9192                }else{ 
     93                        try { 
     94                                execTask.setStatus(DCWormsTags.PAUSING); 
     95                        } catch (Exception e) { 
     96                                // TODO Auto-generated catch block 
     97                                e.printStackTrace(); 
     98                        } 
    9299                        String[] ids = new String[2]; 
    93100                        ids[0] = new String(jobId); 
     
    116123                        return false; 
    117124                }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                        } 
    118133                        Object[] data = new Object[3]; 
    119134                        data[0] = new String(jobId); 
  • DCWoRMS/branches/coolemall/src/schedframe/scheduling/policy/local/LocalManagementSystem.java

    r1362 r1374  
    213213                        if (pluginSupportsEvent(tag)) { 
    214214                                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); 
    215222                                SchedulingPlanInterface<?> decision = schedulingPlugin.schedule(event, 
    216223                                                queues,  getJobRegistry(), getResourceManager(), moduleList); 
     
    412419                getAllocationManager().freeResources(lastUsed); 
    413420                 
     421                //TODO calculate the value of completion 
    414422                saveExecutionHistory(exec, 100,0); 
    415423                 
     
    556564                LocalResourceManager resourceManager = getResourceManager(); 
    557565                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){ 
    562568                                return null; 
    563569                        } 
  • DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/Job.java

    r1207 r1374  
    229229                        if(w.getAnd() != null) { 
    230230                                parCnt = w.getAnd().getParentOpTypeItemCount(); 
    231                                 if(parCnt == 0) 
    232                                 { 
     231                                if(parCnt == 0){ 
    233232                                        availableTasks.add(task); 
    234                                 } 
    235                                 else 
     233                                }else 
    236234                                { 
    237235                                        for(int j = 0; j < parCnt; j++){ 
     
    251249                        else if(w.getOr() != null) { 
    252250                                parCnt = w.getOr().getParentOpTypeItemCount(); 
    253                                 if(parCnt == 0) 
    254                                 { 
     251                                if(parCnt == 0){ 
    255252                                        availableTasks.add(task); 
    256253                                } 
    257                                 else 
    258                                 { 
     254                                else{ 
    259255                                        for(int j = 0; j < parCnt; j++){ 
    260256                                                ParentType par = w.getOr().getParentOpTypeItem(j).getParent(); 
     
    273269                        else { 
    274270                                parCnt = w.getParentCount(); 
    275                                 if(parCnt == 0) 
    276                                 { 
     271                                if(parCnt == 0){ 
    277272                                        availableTasks.add(task); 
    278                                 } 
    279                                 else 
    280                                 { 
     273                                }else{ 
    281274                                        for(int j = 0; j < parCnt; j++){ 
    282275                                                ParentType par = w.getParent(j); 
  • DCWoRMS/branches/coolemall/src/simulator/reader/ResourceReader.java

    r1346 r1374  
    376376                        for(String resourceName : resIdList){ 
    377377                                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 
    386384                                if(computingResource != null) 
    387385                                { 
  • DCWoRMS/branches/coolemall/src/simulator/stats/implementation/DCWormsStatistics.java

    r1362 r1374  
    955955                int cnt = 0; 
    956956                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++; 
    965961                        } 
    966962                } 
     
    15931589                for(String resName: peLoad.keySet()){ 
    15941590 
    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++; 
    16041595                        } 
    16051596                } 
Note: See TracChangeset for help on using the changeset viewer.