Ignore:
Timestamp:
11/26/13 11:56:07 (11 years ago)
Author:
wojtekp
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • DCWoRMS/branches/coolemall/src/example/localplugin/FCFSBF_FanManagementClusterPlugin.java

    r778 r1207  
    88 
    99import schedframe.events.scheduling.SchedulingEvent; 
     10import schedframe.resources.StandardResourceType; 
    1011import schedframe.resources.computing.ComputingNode; 
    1112import schedframe.resources.computing.profiles.energy.airthroughput.StandardAirThroughputStateName; 
    1213import schedframe.resources.computing.profiles.energy.airthroughput.UserAirThroughputStateName; 
     14import schedframe.resources.devices.Device; 
    1315import schedframe.scheduling.manager.resources.ClusterResourceManager; 
    1416import schedframe.scheduling.manager.resources.ResourceManager; 
     
    5456                                        if (node != null) { 
    5557                                                //if there are two or more tasks ( running on the given node then 
    56                                                 if(new JobRegistryImpl(node.getName()).getRunningTasks().size() > 0) 
    57                                                         node.getAirThroughputInterface().setAirThroughputState(new UserAirThroughputStateName("FAN_ON_TURBO")); 
    58                                                 else  
    59                                                         node.getAirThroughputInterface().setAirThroughputState(StandardAirThroughputStateName.FAN_ON); 
     58                                                if(new JobRegistryImpl(node.getFullName()).getRunningTasks().size() > 0){ 
     59                                                        List<Device> devices = node.getResourceCharacteristic().getDevices(); 
     60                                                        for(Device dev : devices){ 
     61                                                                if(dev.getType().equals(StandardResourceType.Fan)){ 
     62                                                                        dev.getAirThroughputInterface().setAirThroughputState(new UserAirThroughputStateName("FAN_ON_TURBO")); 
     63                                                                } 
     64                                                        } 
     65                                                } 
     66                                                else { 
     67                                                        List<Device> devices = node.getResourceCharacteristic().getDevices(); 
     68                                                        for(Device dev : devices){ 
     69                                                                if(dev.getType().equals(StandardResourceType.Fan)){ 
     70                                                                        dev.getAirThroughputInterface().setAirThroughputState(StandardAirThroughputStateName.ON);        
     71                                                                } 
     72                                                        } 
     73                                                } 
    6074                                                notSelectedNodes.remove(node); 
    61                                                 addToSchedulingPlan(plan, task, node.getName()); 
     75                                                addToSchedulingPlan(plan, task, node.getFullName()); 
    6276                                        } 
    6377                                } 
     
    98112        private void adjustOtherFans(List<ComputingNode> nodes){ 
    99113                for(ComputingNode node : nodes){ 
     114                        List<Device> devices = node.getResourceCharacteristic().getDevices(); 
    100115                        if(node.getFreeProcessorsNumber() == node.getProcessorsNumber()){ 
    101                                 node.getAirThroughputInterface().setAirThroughputState(StandardAirThroughputStateName.FAN_OFF); 
    102                         } else if(new JobRegistryImpl(node.getName()).getRunningTasks().size() > 1) 
    103                                 node.getAirThroughputInterface().setAirThroughputState(new UserAirThroughputStateName("FAN_ON_TURBO")); 
    104                         else  
    105                                 node.getAirThroughputInterface().setAirThroughputState(StandardAirThroughputStateName.FAN_ON); 
     116                                for(Device dev : devices){ 
     117                                        if(dev.getType().equals(StandardResourceType.Fan)){ 
     118                                                dev.getAirThroughputInterface().setAirThroughputState(StandardAirThroughputStateName.OFF); 
     119                                        } 
     120                                } 
     121                        } else if(new JobRegistryImpl(node.getFullName()).getRunningTasks().size() > 1){ 
     122                                for(Device dev : devices){ 
     123                                        if(dev.getType().equals(StandardResourceType.Fan)){ 
     124                                                dev.getAirThroughputInterface().setAirThroughputState(new UserAirThroughputStateName("FAN_ON_TURBO")); 
     125                                        } 
     126                                } 
     127                        } 
     128                        else { 
     129                                for(Device dev : devices){ 
     130                                        if(dev.getType().equals(StandardResourceType.Fan)){ 
     131                                                dev.getAirThroughputInterface().setAirThroughputState(StandardAirThroughputStateName.ON); 
     132                                        } 
     133                                } 
     134                        } 
    106135                } 
    107136        } 
Note: See TracChangeset for help on using the changeset viewer.