blob: 0e7e6eff02d1cf988c01e578f1077bf45ce86c2d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#!/bin/bash
NODES=$PBS_SERVER_HOME/server_priv/nodes
CLUSTER_CONF=%%CONFPATH/%%CONFIG_FILE
. $CLUSTER_CONF
# cat fails if NODES doesn't exist
touch $NODES
# $4 == hostname $5 == number of procs
grep -v $4 $NODES > $NODES.$$
if [[ -z "$5" && -z $NODENP ]]; then
echo $4 >> $NODES.$$
elif [[ ! -z $5 ]]; then
echo $4 np=$5 >> $NODES.$$
else
echo $4 np=$NODENP >> $NODES.$$
fi
cat $NODES.$$ | sort -g | uniq | egrep -v "(^$|^\W$)" > $NODES.
mv $NODES. $NODES
rm -f $NODES.$$
|