Changeset 1377 for DCWoRMS/branches


Ignore:
Timestamp:
06/06/14 10:48:32 (11 years ago)
Author:
wojtekp
Message:
 
Location:
DCWoRMS/branches/coolemall/src
Files:
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • DCWoRMS/branches/coolemall/src/schedframe/scheduling/manager/resources/LocalResourceManager.java

    r1374 r1377  
    2929import schedframe.resources.units.StandardResourceUnitName; 
    3030import schedframe.scheduling.Scheduler; 
    31 import schedframe.scheduling.plugin.local.ResourceAllocation; 
    3231 
    3332 
     
    297296        } 
    298297         
    299         public boolean allocateResources(Map<ResourceUnitName, ResourceUnit> resources) { 
     298 
     299        public boolean allocateResources(Map<ResourceUnitName, ResourceUnit> resources, boolean exclusive) { 
    300300                 
    301301                if (resources == null) { 
     
    303303                } 
    304304                 
    305                 for(ResourceUnitName resUnitName: resources.keySet()){ 
    306                         ResourceUnit resUnit = resources.get(resUnitName); 
    307                         resUnit.getProvisioner().setState(ResourceUnitState.BUSY); 
    308                 } 
    309                 return true; 
    310         } 
    311  
    312  
    313         public void freeResources(Map<ResourceUnitName, ResourceUnit> resources) { 
     305                if(exclusive){ 
     306                        for(ResourceUnitName resUnitName: resources.keySet()){ 
     307                                ResourceUnit resUnit = resources.get(resUnitName); 
     308                                if(resUnit.getName().getName().equals(StandardResourceUnitName.PE.getName())){ 
     309                                        ProcessingElements pe = (ProcessingElements)resUnit; 
     310                                        for(ComputingResource cr: pe){ 
     311                                                if(cr.getStatus().equals(ResourceStatus.BUSY)){ 
     312                                                        return false; 
     313                                                } 
     314                                        } 
     315                                } 
     316                                resUnit.getProvisioner().setState(ResourceUnitState.BUSY); 
     317                        } 
     318                         
     319                        return true; 
     320                } else { 
     321                        for(ResourceUnitName resUnitName: resources.keySet()){ 
     322                                ResourceUnit resUnit = resources.get(resUnitName); 
     323                                resUnit.getProvisioner().setState(ResourceUnitState.BUSY); 
     324                        } 
     325                        return true;     
     326                } 
     327        } 
     328 
     329        public void freeResources(Map<ResourceUnitName, ResourceUnit> resources, boolean exclusive) { 
    314330                 
    315331                for(ResourceUnitName resUnitName: resources.keySet()){ 
  • DCWoRMS/branches/coolemall/src/schedframe/scheduling/manager/resources/ResourceAllocation.java

    r477 r1377  
    11package schedframe.scheduling.manager.resources; 
    22 
    3 import java.util.List; 
     3import java.util.Map; 
    44 
    5 import schedframe.resources.computing.ComputingResource; 
     5import schedframe.resources.units.ResourceUnit; 
     6import schedframe.resources.units.ResourceUnitName; 
    67 
    78public interface ResourceAllocation { 
    8         public void allocateResources(List<ComputingResource> resources); 
     9         
     10        /** 
     11         * Allocates resource units( marks as used) on the basis of given resource 
     12         * units. 
     13         *  
     14         * @param freeRes 
     15         *            resource units to be consumed 
     16         * @param exclusive 
     17         *           allocate resources in exclusive mode 
     18         */ 
     19        public boolean allocateResources(Map<ResourceUnitName, ResourceUnit> freeRes, boolean exclusive); 
    920 
     21        /** 
     22         * Frees given resource units. 
     23         *  
     24         * @param lastUsedResources 
     25         *            resource units to be free 
     26         * @param exclusive 
     27         *            free resources allocated in exclusive mode 
     28         */ 
     29        public void freeResources(Map<ResourceUnitName, ResourceUnit> lastUsedResources, boolean exclusive); 
    1030 
    11         public void freeResources(List<ComputingResource> resources); 
    1231         
    1332} 
  • DCWoRMS/branches/coolemall/src/schedframe/scheduling/policy/AbstractManagementSystem.java

    r1362 r1377  
    2626import schedframe.scheduling.plugin.estimation.ExecutionTimeEstimationPlugin; 
    2727import schedframe.scheduling.plugin.grid.ModuleList; 
    28 import schedframe.scheduling.plugin.local.ResourceAllocation; 
     28import schedframe.scheduling.manager.resources.ResourceAllocation; 
    2929import schedframe.scheduling.queue.TaskQueue; 
    3030import schedframe.scheduling.queue.TaskQueueList; 
  • DCWoRMS/branches/coolemall/src/schedframe/scheduling/policy/local/LocalManagementSystem.java

    r1374 r1377  
    238238                                Executable exec = (Executable) execTask; 
    239239                                Map<ResourceUnitName, ResourceUnit> lastUsed = exec.getAllocatedResources().getLast().getResourceUnits(); 
    240                                 getAllocationManager().freeResources(lastUsed); 
     240                                getAllocationManager().freeResources(lastUsed, true); 
    241241                                 
    242242                                saveExecutionHistory(exec, exec.getCompletionPercentage(), exec.getEstimatedDuration()); 
     
    262262                                Executable exec = (Executable) execTask; 
    263263 
    264                                 boolean status = allocateResources(exec, resources); 
     264                                boolean status = allocateResources(exec, resources, true); 
    265265                                if(status == false){ 
    266266                                        TaskList newTasks = new TaskListImpl(); 
     
    332332 
    333333                Executable exec = (Executable)task; 
    334                 boolean allocationStatus = allocateResources(exec, choosenResources); 
     334                boolean allocationStatus = allocateResources(exec, choosenResources, false); 
    335335                if(allocationStatus == false){ 
    336336                        log.info("Task " + task.getJobId() + "_" + task.getId() + " requires more resources than is available at this moment."); 
     
    417417 
    418418                Map<ResourceUnitName, ResourceUnit> lastUsed = exec.getAllocatedResources().getLast().getResourceUnits(); 
    419                 getAllocationManager().freeResources(lastUsed); 
     419                getAllocationManager().freeResources(lastUsed, true); 
    420420                 
    421421                //TODO calculate the value of completion 
     
    727727        } 
    728728         
    729         public boolean allocateResources(Executable exec, Map<ResourceUnitName, ResourceUnit> choosenResources){ 
    730                 boolean allocationStatus = getAllocationManager().allocateResources(choosenResources); 
     729        public boolean allocateResources(Executable exec, Map<ResourceUnitName, ResourceUnit> choosenResources, boolean exclusive){ 
     730                boolean allocationStatus = getAllocationManager().allocateResources(choosenResources, exclusive); 
    731731                if(allocationStatus){ 
    732732                        ResourceHistoryItem resourceHistoryItem = new ResourceHistoryItem(choosenResources); 
  • DCWoRMS/branches/coolemall/src/simulator/stats/DCwormsMetricsCalculator.java

    r1278 r1377  
    4848                                roomPower = roomPower + acc.getSum(); 
    4949                        } 
    50                         metric = new MetricsStats("CoolEmAllTestbed", "Total_energy_consumption", roomPower, timestamp, "Wh"); 
    51                 } catch (Exception e){ 
    52                         metric = new MetricsStats("CoolEmAllTestbed", "Total_energy_consumption", -1, timestamp, "Wh"); 
     50                         
     51                        metric = new MetricsStats("CoolEmAllTestbed", "Total_energy_consumption - not implemented yet", 0, timestamp, "Wh"); 
     52                } catch (Exception e){ 
     53                        metric = new MetricsStats("CoolEmAllTestbed", "Total_energy_consumption - not implemented yet", -1, timestamp, "Wh"); 
    5354                } 
    5455                return metric; 
     
    6364                                itComputingPower = itComputingPower + acc.getSum(); 
    6465                        } 
    65                         metric = new MetricsStats("CoolEmAllTestbed", "Total_processors_energy_consumption", (itComputingPower), timestamp, "Wh"); 
    66                 } catch (Exception e){ 
    67                         metric = new MetricsStats("CoolEmAllTestbed", "Total_processors_energy_consumption", -1, timestamp, "Wh"); 
     66                        metric = new MetricsStats("CoolEmAllTestbed", "Total_processors_energy_consumption - not implemented yet", 0, timestamp, "Wh"); 
     67                } catch (Exception e){ 
     68                        metric = new MetricsStats("CoolEmAllTestbed", "Total_processors_energy_consumption - not implemented yet", -1, timestamp, "Wh"); 
    6869                } 
    6970                return metric; 
     
    8788                        } 
    8889                        double fanPowerConumspion = nodeComputingPower - itComputingPower; 
    89                         metric = new MetricsStats("CoolEmAllTestbed", "Total_IT_energy_consumption", (totalSitePower * CoolEmAllTestbedMeasurements.POWER_SUPPLY_EFFICIENCY - fanPowerConumspion), timestamp, "Wh"); 
    90                 } catch (Exception e){ 
    91                         metric = new MetricsStats("CoolEmAllTestbed", "Total_IT_energy_consumption", -1, timestamp, "Wh"); 
     90                        metric = new MetricsStats("CoolEmAllTestbed", "Total_IT_energy_consumption - not implemented yet", 0, timestamp, "Wh"); 
     91                } catch (Exception e){ 
     92                        metric = new MetricsStats("CoolEmAllTestbed", "Total_IT_energy_consumption - not implemented yet", -1, timestamp, "Wh"); 
    9293                } 
    9394                return metric; 
     
    120121                        double nodeGroupFansPowerConumspion = nodeComputingPower - itComputingPower; 
    121122 
    122                         metric = new MetricsStats("CoolEmAllTestbed", "PUE_Level_4", roomPower/(totalSitePower * CoolEmAllTestbedMeasurements.POWER_SUPPLY_EFFICIENCY - nodeGroupFansPowerConumspion), timestamp, ""); 
    123                 } catch (Exception e){ 
    124                         metric = new MetricsStats("CoolEmAllTestbed", "PUE_Level_4", -1, timestamp, ""); 
     123                        metric = new MetricsStats("CoolEmAllTestbed", "PUE_Level_4 - not implemented yet", 0, timestamp, ""); 
     124                } catch (Exception e){ 
     125                        metric = new MetricsStats("CoolEmAllTestbed", "PUE_Level_4 - not implemented yet", -1, timestamp, ""); 
    125126                } 
    126127                return metric; 
     
    143144 
    144145 
    145                         metric = new MetricsStats("CoolEmAllTestbed", "PUE", roomPower/totalSitePower, timestamp, ""); 
    146                 } catch (Exception e){ 
    147                         metric = new MetricsStats("CoolEmAllTestbed", "PUE", -1, timestamp, ""); 
     146                        metric = new MetricsStats("CoolEmAllTestbed", "PUE - not implemented yet", 0, timestamp, ""); 
     147                } catch (Exception e){ 
     148                        metric = new MetricsStats("CoolEmAllTestbed", "PUE - not implemented yet", -1, timestamp, ""); 
    148149                } 
    149150                return metric; 
     
    162163                                } 
    163164                        } 
    164                         metric = new MetricsStats("CoolEmAllTestbed", "Useful_Work", usefulWork, timestamp, "UW units"); 
    165                 } catch (Exception e){ 
    166                         metric = new MetricsStats("CoolEmAllTestbed", "Useful_Work", -1, timestamp, "UW units"); 
     165                        metric = new MetricsStats("CoolEmAllTestbed", "Useful_Work - not implemented yet", 0, timestamp, "UW units"); 
     166                } catch (Exception e){ 
     167                        metric = new MetricsStats("CoolEmAllTestbed", "Useful_Work - not implemented yet", -1, timestamp, "UW units"); 
    167168                } 
    168169                 
     
    187188                        } 
    188189                         
    189                         metric = new MetricsStats("CoolEmAllTestbed", "Productivity", usefulWork/totalSitePower, timestamp, "UW units/Wh"); 
    190                 } catch (Exception e){ 
    191                         metric = new MetricsStats("CoolEmAllTestbed", "Productivity", -1, timestamp, "UW units/Wh"); 
     190                        metric = new MetricsStats("CoolEmAllTestbed", "Productivity - not implemented yet", 0, timestamp, "UW units/Wh"); 
     191                } catch (Exception e){ 
     192                        metric = new MetricsStats("CoolEmAllTestbed", "Productivity - not implemented yet", -1, timestamp, "UW units/Wh"); 
    192193                } 
    193194                 
     
    207208                        } 
    208209 
    209                         metric = new MetricsStats("CoolEmAllTestbed", "Max_power", maxPower, timestamp, "W"); 
    210                 } catch (Exception e){ 
    211                         metric = new MetricsStats("CoolEmAllTestbed", "Max_power", -1, timestamp, "W"); 
     210                        metric = new MetricsStats("CoolEmAllTestbed", "Max_power - not implemented yet", 0, timestamp, "W"); 
     211                } catch (Exception e){ 
     212                        metric = new MetricsStats("CoolEmAllTestbed", "Max_power - not implemented yet", -1, timestamp, "W"); 
    212213                } 
    213214                 
     
    223224                                coolingDevicePower = coolingDevicePower + acc.getSum(); 
    224225                        } 
    225                         metric = new MetricsStats("CoolEmAllTestbed", "Total_cooling_device_energy_consumption", coolingDevicePower, timestamp, "Wh"); 
    226                 } catch (Exception e){ 
    227                         metric = new MetricsStats("CoolEmAllTestbed", "Total_cooling_device_energy_consumption", -1, timestamp, "Wh"); 
     226                        metric = new MetricsStats("CoolEmAllTestbed", "Total_cooling_device_energy_consumption - not implemented yet", 0, timestamp, "Wh"); 
     227                } catch (Exception e){ 
     228                        metric = new MetricsStats("CoolEmAllTestbed", "Total_cooling_device_energy_consumption - not implemented yet", -1, timestamp, "Wh"); 
    228229                } 
    229230                return metric; 
     
    239240                                roomPower = roomPower + acc.getSum(); 
    240241                        } 
    241                         metric = new MetricsStats("CoolEmAllTestbed", "Mean_power", roomPower/((this.endTime - this.startTime)/(SEC_IN_HOUR * MILLI_SEC)), timestamp, "W"); 
    242                 } catch (Exception e){ 
    243                         metric = new MetricsStats("CoolEmAllTestbed", "Mean_power", -1, timestamp, "W"); 
     242                        metric = new MetricsStats("CoolEmAllTestbed", "Mean_power - not implemented yet", 0, timestamp, "W"); 
     243                } catch (Exception e){ 
     244                        metric = new MetricsStats("CoolEmAllTestbed", "Mean_power - not implemented yet", -1, timestamp, "W"); 
    244245                } 
    245246                return metric; 
     
    256257                        double itEnergy = calculateITEnergyConsumption().getValue(); 
    257258                         
    258                         metric = new MetricsStats("CoolEmAllTestbed", "Energy_waste_rate", (1 - itComputingEnergy/itEnergy) * 100, timestamp, "%"); 
    259                 } catch (Exception e){ 
    260                         metric = new MetricsStats("CoolEmAllTestbed", "Energy_waste_rate", -1, timestamp, "%"); 
     259                        metric = new MetricsStats("CoolEmAllTestbed", "Energy_waste_rate - not implemented yet", 0, timestamp, "%"); 
     260                } catch (Exception e){ 
     261                        metric = new MetricsStats("CoolEmAllTestbed", "Energy_waste_rate - not implemented yet", -1, timestamp, "%"); 
    261262                } 
    262263                return metric; 
Note: See TracChangeset for help on using the changeset viewer.