Ignore:
Timestamp:
03/19/14 18:22:27 (11 years ago)
Author:
wojtekp
Message:
 
Location:
DCWoRMS/branches/coolemall/src/schedframe/resources/computing
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • DCWoRMS/branches/coolemall/src/schedframe/resources/computing/ComputingResource.java

    r1207 r1299  
    33import gridsim.GridSimTags; 
    44import gridsim.dcworms.DCWormsTags; 
     5import gridsim.dcworms.filter.ResourceEventFilter; 
    56 
    67import java.util.ArrayList; 
     
    2425import schedframe.resources.computing.profiles.energy.EnergyEventType; 
    2526import schedframe.resources.computing.profiles.energy.EnergyExtension; 
     27import schedframe.resources.computing.profiles.load.LoadExtension; 
     28import schedframe.resources.computing.profiles.load.ResourceLoadCalendar; 
     29import schedframe.resources.computing.profiles.load.TimestampUtilization; 
     30import schedframe.resources.computing.profiles.load.ui.LoadInterface; 
    2631import schedframe.resources.computing.properties.DefaultPropertiesBuilder; 
    2732import schedframe.resources.computing.properties.PropertiesDirector; 
     
    3439import schedframe.resources.devices.PhysicalResource; 
    3540import schedframe.scheduling.Scheduler; 
     41import simulator.DataCenterWorkloadSimulator; 
    3642 
    3743public class ComputingResource extends PhysicalResource{ 
     
    5157                this.extensionList = new ExtensionListImpl(1); 
    5258                initCharacteristics(resDesc); 
     59                accept(new LoadExtension(resDesc.getLoadProfile(), this)); 
    5360                accept(new EnergyExtension.Builder().resource(this).powerProfile(resDesc.getPowerProfile()).airFlowProfile(resDesc.getAirThroughputProfile()).thermalProfile(resDesc.getThermalProfile()).build());      
    5461        } 
     
    6774        public void setParent(ComputingResource newParent) { 
    6875                parent = newParent; 
     76                if(this.getLoadInterface().getLoadCalendar().getLoadDistribution().size() == 0){ 
     77                        this.getLoadInterface().getLoadCalendar().getLoadDistribution().addAll(parent.getLoadInterface().getLoadCalendar().getLoadDistribution()); 
     78                } 
    6979        } 
    7080 
     
    220230                public void handleResourceEvent(Event event){ 
    221231                        if (extensionList != null) { 
    222                                 for (Extension extension : extensionList) { 
     232                                for (Extension extension: extensionList) { 
    223233                                        if (extension.supportsEvent(event)) { 
    224234                                                extension.handleEvent(event); 
     
    227237                                 
    228238                                for (Device device: ((ComputingResourceCharacteristics)resourceCharacteristic).getDevices()) { 
    229                                         for (Extension extension : device.getExtensionList()) { 
     239                                        for (Extension extension: device.getExtensionList()) { 
    230240                                                if (extension.supportsEvent(event)) { 
    231                                                         //extension.handleEvent(event); 
     241                                                        extension.handleEvent(event); 
    232242                                                } 
    233243                                        } 
     
    242252                        if(scheduler != null && (parent != null && scheduler != parent.getScheduler())/*scheduler.getResources().contains(this)*/){ 
    243253                                String src = event.getSource() != null ? event.getSource() : name; 
     254                                ResourceEventFilter filter = new ResourceEventFilter(src.hashCode(), DCWormsTags.UPDATE_PROCESSING); 
     255                                scheduler.sim_cancel(filter, null); 
    244256                                scheduler.sendInternal(GridSimTags.SCHEDULE_NOW, DCWormsTags.UPDATE_PROCESSING, src); 
    245257                        } else if(parent != null) 
     
    274286                rec.execute(event); 
    275287                 
     288                LoadInterface li = getLoadInterface(); 
     289                if(li != null){ 
     290                        ResourceLoadCalendar rlc = li.getLoadCalendar(); 
     291                        LinkedList<TimestampUtilization> ll = rlc.getLoadDistribution(); 
     292                        for(TimestampUtilization tu: ll){ 
     293                                DataCenterWorkloadSimulator.getEventManager().sendToResource(getFullName(), tu.getStartTime(), new EnergyEvent(EnergyEventType.RESOURCE_UTILIZATION_CHANGED, getFullName())); 
     294                                DataCenterWorkloadSimulator.getEventManager().sendToResource(getFullName(), tu.getEndTime(), new EnergyEvent(EnergyEventType.RESOURCE_UTILIZATION_CHANGED, getFullName())); 
     295                        }                                        
     296                } 
    276297                //alternative way 
    277298                //getEventHandler().handleResourceEvent(new EnergyEvent(EnergyEventType.AIRFLOW_STATE_CHANGED, "Resource controller")); 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/computing/coolemall/NodeGroup.java

    r1247 r1299  
    11package schedframe.resources.computing.coolemall; 
    22 
     3import java.util.ArrayList; 
    34import java.util.List; 
    45 
     
    89import schedframe.resources.computing.Processor; 
    910import schedframe.resources.computing.description.ComputingResourceDescription; 
     11import schedframe.resources.computing.description.ResourceDescription; 
     12import schedframe.resources.devices.Device; 
     13import schedframe.resources.devices.Fan; 
     14import test.Node_Fan_Mapping; 
    1015 
    1116public class NodeGroup extends ComputingResource{ 
     
    1318        public NodeGroup(ComputingResourceDescription resDesc) { 
    1419                super(resDesc); 
     20                initNodes_FansMapping(resDesc); 
    1521        } 
    1622 
     
    2531        } 
    2632 
     33         
     34        private void initNodes_FansMapping(ComputingResourceDescription resDesc){ 
     35                Node_Fan_Mapping.init(); 
     36                for(Device dev: this.getResourceCharacteristic().getDevices()){ 
     37                        if(dev.getType().equals(StandardResourceType.Fan) || dev.getType().equals(StandardResourceType.Inlet) | dev.getType().equals(StandardResourceType.Outlet)){ 
     38                                Fan fan = (Fan) dev; 
     39                                List<String> chilledResources = new ArrayList<String>(); 
     40                                for(ResourceDescription nodeDesc: resDesc.getChildren()){ 
     41                                        String nodeName = this.getFullName() + "/" + nodeDesc.getId(); 
     42                                        if(!Node_Fan_Mapping.getNode_fan().containsKey(nodeName)){ 
     43                                                chilledResources.add(nodeName); 
     44                                        } else if(Node_Fan_Mapping.getNode_fan().get(nodeName).equals(fan.getFullName())){ 
     45                                                chilledResources.add(nodeName); 
     46                                        } else { 
     47                                                //if mapping present but there is no match do nothing 
     48                                        } 
     49                                } 
     50                                fan.setChilledResources(chilledResources); 
     51                        } 
     52                } 
     53        } 
    2754} 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/ui/ProcessorPowerInterface.java

    r1281 r1299  
    2020                super(resource, pp); 
    2121                currentPowerState = StandardPowerStateName.ON; 
    22                 currentPState = getHighestPState(); 
     22                currentPState = getLowestPState(); 
    2323        } 
    2424         
Note: See TracChangeset for help on using the changeset viewer.