
macro setup
  module pantasks.pro

#  module chip.pro
#  module camera.pro
#  module fake.pro
  module warp.pro
#  module diff.pro

  # module survey.pro

  module site.mhpcc.pro

  init.copy.mhpcc on
  queueload tmp -x "cat $MODULES:0/ipphosts.mhpcc.config"
  ipptool2book tmp ipphosts -key camera

  # XXX merge the above into init.site more cleanly (careful with summit copy stuff)
  # init.site (we do not use init.site because it loads the hosts)

  add.database gpc1
  add.label dummy
  set.poll 100
end

macro set.poll
  if ($0 != 2)
    echo "USAGE:set.poll (value)"
    break
  end
 
  $POLLLIMIT = $1
end

macro get.poll
  echo "poll limit: $POLLLIMIT"
end

macro load.hosts
  controller host add ipp005 -threads 4
  controller host add ipp006 -threads 4
  controller host add ipp007 -threads 4
# controller host add ipp008 (flaky)
  controller host add ipp009 -threads 4
  controller host add ipp010 -threads 4
  controller host add ipp011 -threads 4
  controller host add ipp012 -threads 4
  controller host add ipp013 -threads 4
# controller host add ipp014 (flaky)
  controller host add ipp015 -threads 4
# controller host add ipp016 (flaky)
  controller host add ipp017 -threads 4
  controller host add ipp018 -threads 4
# controller host add ipp019 (nebulous)
  controller host add ipp020 -threads 4
  controller host add ipp021 -threads 4
  controller host add ipp023 -threads 4
  controller host add ipp024 -threads 4
  controller host add ipp025 -threads 4
  controller host add ipp026 -threads 4
  controller host add ipp027 -threads 4
  controller host add ipp028 -threads 4
  controller host add ipp029 -threads 4
  controller host add ipp030 -threads 4
  controller host add ipp031 -threads 4
  controller host add ipp032 -threads 4
  controller host add ipp033 -threads 4
  controller host add ipp034 -threads 4
  controller host add ipp035 -threads 4
  controller host add ipp036 -threads 4
end

macro load.hosts.wave2
  controller host add ipp015 -threads 4
  controller host add ipp017 -threads 4
  controller host add ipp023 -threads 4
  controller host add ipp024 -threads 4
  controller host add ipp026 -threads 4
  controller host add ipp027 -threads 4
  controller host add ipp028 -threads 4
  controller host add ipp029 -threads 4
  controller host add ipp030 -threads 4
  controller host add ipp031 -threads 4
  controller host add ipp032 -threads 4
  controller host add ipp033 -threads 4
  controller host add ipp034 -threads 4
  controller host add ipp035 -threads 4
  controller host add ipp036 -threads 4
end

macro show.book
  if ($0 != 2)
   echo "USAGE: show.book (book)"
   break
  end

  book npages $1 -var npages
  for i 0 $npages
    book getpage $1 $i -var pagename
    book listpage $1 $pagename
  end

  echo "npages: $npages"
end

macro del.page.from.book
  if ($0 != 3)
   echo "USAGE: show.book (book) (page)"
   break
  end

  book delpage $1 $2
end
