/usr/bin/pbs_submit_workers is in coop-computing-tools 4.0-1.1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | #!/bin/sh
show_help()
{
echo "Use: pbs_submit_workers [options] <servername> <port> <num-workers>"
echo "where options are:"
echo " -M <name> Name of the preferred master for worker."
echo " -N <name> Same as -M (backwards compatibility)."
echo " -c <num> Set the number of cores each worker should use (0=auto). (default=1)"
echo " -C <catalog> Set catalog server to <catalog>. <catalog> format: HOSTNAME:PORT."
echo " -t <time> Abort after this amount of idle time. (default=900s)."
echo " -d <subsystem> Enable debugging on worker for this subsystem (try -d all to start)."
echo " -w <size> Set TCP window size."
echo " -i <time> Set initial value for backoff interval when worker fails to connect to a master. (default=1s)"
echo " -b <time> Set maxmimum value for backoff interval when worker fails to connect to a master. (default=60s)"
echo " -z <size> Set available disk space threshold (in MB). When exceeded worker will clean up and reconnect. (default=100MB)"
echo " -A <arch> Set architecture string for the worker to report to master instead of the value in uname."
echo " -O <os> Set operating system string for the worker to report to master instead of the value in uname."
echo " -s <path> Set the location for creating the working directory of the worker."
echo " -j Use job array to submit workers."
echo " -p <parameters> PBS qsub parameters."
echo " -h Show this help message."
exit 1
}
arguments=""
use_auto=0
use_jobarray=0
parameters=""
cores=1
while getopts aM:N:c:C:t:d:w:i:b:z:A:O:s:jp:h opt
do
case "$opt" in
a) arguments="$arguments -a"; use_auto=1;; # backwards compatibility
M) arguments="$arguments -M $OPTARG"; use_auto=1;;
N) arguments="$arguments -M $OPTARG"; use_auto=1;;
c) arguments="$arguments --cores $OPTARG"; cores=$OPTARG;;
C) arguments="$arguments -C $OPTARG";;
t) arguments="$arguments -t $OPTARG";;
d) arguments="$arguments -d $OPTARG";;
w) arguments="$arguments -w $OPTARG";;
i) arguments="$arguments -i $OPTARG";;
b) arguments="$arguments -b $OPTARG";;
z) arguments="$arguments -z $OPTARG";;
A) arguments="$arguments -A $OPTARG";;
O) arguments="$arguments -O $OPTARG";;
s) arguments="$arguments -s $OPTARG";;
j) use_jobarray=1;;
p) parameters="$parameters $OPTARG";;
h) show_help;;
\?) show_help;;
esac
done
shift $(expr $OPTIND - 1)
if [ $use_auto = 0 ]; then
if [ X$3 = X ]
then
show_help
fi
host=$1
port=$2
count=$3
else
if [ X$1 = X ]
then
show_help
fi
host=
port=
count=$1
fi
worker=`which work_queue_worker 2>/dev/null`
if [ $? != 0 ]
then
echo "$0: please add 'work_queue_worker' to your PATH."
exit 1
fi
qsub=`which qsub 2>/dev/null`
if [ $? != 0 ]
then
echo "$0: please add 'qsub' to your PATH."
exit 1
fi
mkdir -p ${USER}-workers
cd ${USER}-workers
cp $worker .
cat >worker.sh <<EOF
#!/bin/sh
#PBS -l nodes=1:ppn=$cores
cd $PWD
./work_queue_worker $arguments $host $port
EOF
chmod 755 worker.sh
if [ $use_jobarray = 1 ]
then
qsub -J 1-$count:1 $parameters worker.sh
else
for n in `seq 1 $count`
do
qsub $parameters worker.sh
done
fi
return_status=$?
exit $return_status
|