16.0 Green computing > How-to's > Enabling green computing

Conventions

16.1 Enabling green computing

To enable green computing

  1. Edit moab.cfg to enable green computing. There are four things you must configure for basic functionality of green computing:

    1. Configure the POWERPOLICY attribute of the NODECFG parameter. The default value is STATIC. Set it to OnDemand.
    2. Configure a power provisioning resource manager to be TYPE=NATIVE and RESOURCETYPE=PROV. The resource type of PROV means the RM works only with node hardware and not workloads.
    3. Configure a CLUSTERQUERYURL attribute of the power provisioning RM to point to the power query script you'd like to use. Moab uses this script to query the current power state of the nodes. CLUSTERQUERYURL is traditionally used as a workload query but is also used by green computing for the node power state query. Adaptive Computing provides a reference IPMI script you can use.
    4. Configure a NODEPOWERURL attribute of the power provisioning RM to point to the power action script you'd like to use. Moab uses this script to turn nodes on or off. Adaptive Computing provides a reference IPMI script you can use.
    NODECFG[DEFAULT] POWERPOLICY=OnDemand
    RMCFG[ipmi] TYPE=NATIVE RESOURCETYPE=PROV
    RMCFG[ipmi] CLUSTERQUERYURL=exec://$TOOLSDIR/ipmi/ipmi.mon.py
    RMCFG[ipmi] NODEPOWERURL=exec://$TOOLSDIR/ipmi/ipmi.power.py

Sample moab.cfg for green computing

Below is a sample moab.cfg configuration file of a green computing setup using the Adaptive Computing IPMI scripts.

################################################################################
#
#  Use 'mdiag -C' to validate config file parameters
#
################################################################################

SCHEDCFG[Moab]        SERVER=myhostname:5150
ADMINCFG[1]           USERS=myusername,root
TOOLSDIR              /$HOME/tools
LOGLEVEL              1

################################################################################
#                                                                             
#  Basic Resource Manager configuration
#
#  For more information on configuring a Resource Manager, see:
#  docs.adaptivecomputing.com
#                                                        
################################################################################

RMCFG[local]	TYPE=NATIVE
RMCFG[local]	CLUSTERQUERYURL=exec://$HOME/scripts/query.resource
RMCFG[local]	WORKLOADQUERYURL=exec://$HOME/scripts/query.workload

RMCFG[local]	JOBSUBMITURL=exec://$HOME/scripts/submit.pl
RMCFG[local]	JOBSTARTURL=exec://$HOME/scripts/job.start
RMCFG[local]	JOBCANCELURL=exec://$HOME/scripts/job.cancel
RMCFG[local]	JOBMODIFYURL=exec://$HOME/scripts/job.modify
RMCFG[local]	JOBREQUEUEURL=exec://$HOME/scripts/job.requeue
RMCFG[local]	JOBSUSPENDURL=exec://$HOME/scripts/job.suspend
RMCFG[local]	JOBRESUMEURL=exec://$HOME/scripts/job.resume

##################################
# GREEN configuration:
##################################
# Turn on "green" policy. (This is the policy that enables green computing).
# Here we are doing it for all nodes, but it can be controlled on a node-by-node basis
# Default is STATIC, which means green computing is disabled.
#NODECFG[DEFAULT]  POWERPOLICY=STATIC
NODECFG[DEFAULT]  POWERPOLICY=OnDemand

# Configure the power provisioning and power state query scripts for the power
# management system.
# Note that this is an entirely different RM (with a name of power in this case 
# and a type of 'PROV').
# The PROV type RM is the only one that uses a NODEPOWERURL.  Additionally, the 
# output of the CLUSTERQUERYURL for this type of RM is different.  (See docs)
RMCFG[power]  TYPE=NATIVE RESOURCETYPE=PROV
RMCFG[power]  NODEPOWERURL=exec://$TOOLSDIR/ipmi/ipmi.power.py
RMCFG[power]  CLUSTERQUERYURL=exec://$TOOLSDIR/ipmi/ipmi.mon.py

# We want green policy to work so it allocates jobs to compute nodes already
# powered on and will power on powered-off compute nodes only when there are
# no powered-on compute nodes available. This requires using the PRIORITY 
# node allocation policy with a PRIORITYF function that has the POWER variable
# as the greatest contributing factor to the function (1 = powered-on,
# 0 = powered-off).
# If we want all compute nodes to operate under green policy, we can assign
# the PRIORITYF function to the default node configuration, which is easier
# than assigning it to individual compute nodes. If only some compute nodes
# should operate under green policy, then the PRIORITYF function must be
# configured for the individual nodes. Note the POWER variable must be the 
# largest factor in the function below; it is assigned the largest multiplier,
# which should be greater than the sum of all other factors! Doing so forces
# Moab to use all eligible powered-on nodes for workload placement before
# powering on any eligible powered-off nodes.

# Enable PRIORITYF functionality
NODEALLOCATIONPOLICY  PRIORITY

# Use a priority function that uses power as the major factor (plus some other imaginary factors)
#NODECFG[DEFAULT]      PRIORITYF='1000000*POWER + 1000*factor2 + 100*factor3...'
# Use a priority function where power is the only factor.
#NODECFG[DEFAULT]      PRIORITYF='10000*POWER'
# Use a priority function that adds some randomness but uses power as the major factor.
NODECFG[DEFAULT]      PRIORITYF='10000*POWER + 10*RANDOM'

# Set a priority function that specifies the order nodes should be chosen to power 
# up/down. By default, Moab will start at the top of the node list and go down. Some
# installations want to rotate power cycles among nodes in a different order.
# The configuration below forces Moab to power on/off random nodes, which 
# eventually guarantees all nodes occasionally go through a power cycle.
GREENPOOLPRIORITYF '10*RANDOM'

# Ensure we are recording power management events
# (powering on and off nodes are recorded as "node modification" events).
RECORDEVENTLIST +NODEMODIFY

# Set the size of the standby pool. This is the number of idle nodes that will
# be powered on and idle. As the workload changes, Moab turns nodes on 
# or off to try to meet this goal.
# Default value is 0
MAXGREENSTANDBYPOOLSIZE 5

# Set the length of time that it takes to power a node on/off. This will be the 
# walltime of the system job that performs the power operation and should be the
# maximum expected time. If Moab detects (via the power RM) that the power
# operations have all completed, the system job will finish early.
# Default value is 10 minutes (600)
#PARCFG[ALL]      NODEPOWEROFFDURATION=600
#PARCFG[ALL]      NODEPOWERONDURATION=600

# Set the length of time a node should remain idle before it is powered off.
# This prevents Moab from immediately powering off nodes that have just finished 
# a job. Increasing this number should decrease power on/off thrashing
# This should be set higher than NODEPOWEROFFDURATION and/or NODEPOWERONDURATION
#NODEIDLEPOWERTHRESHOLD 660

# If a node fails to power on, we need to remove it from the available nodes so
# Moab won't keep [re-]trying to power it on. Do this by setting a reservation 
# on the failed node to give time for manual investigation.
#RMCFG[torque] NODEFAILURERSVPROFILE=failure
#RSVPROFILE[failure] DURATION=3600

Related topics