## site.mhpcc.pro : example configuration script for the MHPCC IPP cluster : -*- sh -*-

## a site configuration needs to define the following pieces of information:
## 1) the machines used for processing
## 2) the default_host and workdir_template variables
## 3) the chiphost table

macro init.cluster.mhpcc
  $PARALLEL = 1
  controller exit true
  controller host add ipp005
  controller host add ipp006
  controller host add ipp007
  controller host add ipp008
  controller host add ipp009
  controller host add ipp010
  controller host add ipp011
  controller host add ipp016
  controller host add ipp020
  controller host add ipp021
end

## override the basic inits set in pantasks.pro
macro init.copy.mhpcc
 if ($0 != 2)
   echo "USAGE: init.copy.mhpcc (nebulous)"
   echo "nebulous may be 'on' or 'off'"
   break
 end

 if (("$1" != "on") && ("$1" != "off")) 
   echo "USAGE: init.copy.mhpcc (nebulous)"
   echo "nebulous may be 'on' or 'off'"
   break
 end
 
 # XXX this is only used by summit.copy.pro.  move this as a check into summit.copy.pro?
 $COMPRESS = 1

 # the templates are used if we have a class_id/host relationship; 
 # if none is found, the default values are used
 # XXX not sure how to handle the .N value if we need to use more than one

 if ("$1" == "on")
  $NEBULOUS = 1
  $default_host     = ipp004
  $workdir_template = neb://@HOST@.0
 else
  $NEBULOUS = 0
  $default_host     = ipp004
  $workdir_template = /data/@HOST@.0
 end
end

macro init.site
  init.cluster.mhpcc
  init.copy.mhpcc on

  queueload tmp -x "cat $MODULES:0/chiphosts.mhpcc.config"
  ipptool2book tmp chiphosts -key camera
end

macro init.site.nohosts
  init.copy.mhpcc on

  queueload tmp -x "cat $MODULES:0/chiphosts.mhpcc.config"
  ipptool2book tmp chiphosts -key camera
end
