#! /bin/bash
#
# Gets a top display from all nodes running a job as listed
# in a hostlist file. Output to file named in FILE. Run as:
#
#   $ ./gettop hostlist.NNNNNN

FILE=tops
cat /dev/null > $FILE
for h in `cat $1`; do
   echo $h >> $FILE
   ssh $h top -n 1 -u $USER -b >> $FILE
done
