Ignore:
Timestamp:
01/15/13 10:17:40 (12 years ago)
Author:
wojtekp
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/ui/ProcessorPowerInterface.java

    r512 r782  
    2121                super(resource, pp); 
    2222                currentPowerState = StandardPowerStateName.ON; 
    23                 currentPState = getSupportedPStates().get("P0"); 
     23                currentPState = getLowestPState(); 
    2424        } 
    2525         
     
    100100                                } 
    101101                        } 
     102                }  
     103                else throw new NoSuchFieldException(); 
     104                return powerConsumption; 
     105        } 
     106         
     107        public PState getLowestPState(){ 
     108                PState lowPState = null; 
     109                double highestFreq = Double.MIN_VALUE; 
     110                for(String key: getSupportedPStates() .keySet()){ 
     111                        PState pState = getSupportedPStates().get(key); 
     112                        if(pState.getFrequency() > highestFreq){ 
     113                                highestFreq = pState.getFrequency(); 
     114                                lowPState = pState; 
     115                        } 
    102116                } 
    103                 return powerConsumption; 
     117                return lowPState; 
     118        } 
     119         
     120        public PState getHighestPState(){ 
     121                PState highPState = null; 
     122                double lowestFreq = Double.MAX_VALUE; 
     123                for(String key: getSupportedPStates() .keySet()){ 
     124                        PState pState = getSupportedPStates().get(key); 
     125                        if(pState.getFrequency() < lowestFreq){ 
     126                                lowestFreq = pState.getFrequency(); 
     127                                highPState = pState; 
     128                        } 
     129                } 
     130                return highPState; 
    104131        } 
    105132 
Note: See TracChangeset for help on using the changeset viewer.