##
# Sample Power Management configuration
##

##
# Turn on power management, and poll every 300 seconds 
# (5 minutes) for availability. (Simply setting 
# the update interval turns the hibernation feature on.)
# 
# NOTE: Once a machine has entered a hibernation state
# and subsequently woken, the defined policies will not be 
# honored for about a hour.  This is to keep machines
# from cycling in and out of a state of hibernation in
# the case when the HIBERNATE expression evaluates to
# a non-zero value very frequently.
##
HIBERNATE_CHECK_INTERVAL = 300

##
# Enter hibernation level 3 (sleep) after 2 hours
##
HibernateState 	= 3
TimeToWait      = (2 * $(HOUR))

##
# Enter hibernation if:
# 1) the keyboard has been idle long enough, AND
# 2) the cpu is idle, AND 
# 3) we've been "Unclaimed" for more than $(TimeToWait) minutes
##
ShouldHibernate = ( (KeyboardIdle > $(StartIdleTime)) \
                    && $(CPUIdle) \
                    && ($(StateTimer) > $(TimeToWait)) )

##
# Actual hibernation expression: if it should enter hibernation
# it evaluates to the level of hibernation we defined above; 
# otherwise, 0, which tells Condor to leave the machine up.
##
HIBERNATE = ifThenElse($(ShouldHibernate), $(HibernateState), 0)
