aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Thibodeau <kyron@neuralbs.com>2008-08-18 14:42:43 -0400
committerEric Thibodeau <kyron@neuralbs.com>2008-08-18 14:42:43 -0400
commitbbc13d7ee3ff0101cea485384d7f6266fc9e27d7 (patch)
tree1b63dc156bbeef22e15fbee40b3b6aef127231f9
parentA crude snapshot switching script (diff)
downloadclustering-livecd-bbc13d7ee3ff0101cea485384d7f6266fc9e27d7.tar.gz
clustering-livecd-bbc13d7ee3ff0101cea485384d7f6266fc9e27d7.tar.bz2
clustering-livecd-bbc13d7ee3ff0101cea485384d7f6266fc9e27d7.zip
Added compensation for missing DNSMASQ_USER_CLASSn under certain circumbstances from within the dnsmasq script callback.
- esentially add a default number of procs/node in the config file
-rw-r--r--overlay/sys-cluster/beowulf-head/files/cluster.conf4
-rwxr-xr-xoverlay/sys-cluster/beowulf-head/files/node-manager48
-rwxr-xr-xoverlay/sys-cluster/beowulf-head/files/torque-add23
3 files changed, 49 insertions, 26 deletions
diff --git a/overlay/sys-cluster/beowulf-head/files/cluster.conf b/overlay/sys-cluster/beowulf-head/files/cluster.conf
index 2148a2a..af2fb28 100644
--- a/overlay/sys-cluster/beowulf-head/files/cluster.conf
+++ b/overlay/sys-cluster/beowulf-head/files/cluster.conf
@@ -61,3 +61,7 @@ NFSEPORTOPTS="no_root_squash,async,no_subtree_check"
# Again, NO ro/rw
NFSMOUNTOPTS="rsize=8192,wsize=8192,soft,intr,actimeo=120,timeo=14"
+# Set this to the default Number of Processors on your nodes
+# This is a temporary measure until a more robust detection/communication
+# method is put in place (dnsmasq DNSMASQ_USER_CLASS0 variables aren't always set).
+NODENP=1
diff --git a/overlay/sys-cluster/beowulf-head/files/node-manager b/overlay/sys-cluster/beowulf-head/files/node-manager
index 9ae348c..509a9df 100755
--- a/overlay/sys-cluster/beowulf-head/files/node-manager
+++ b/overlay/sys-cluster/beowulf-head/files/node-manager
@@ -6,12 +6,25 @@
MODULESPATH=%%MODULESPATH
BEEPS=%%BEEPS
+beeps(){
+ ### Beeps:
+ PAUSE=20
+ START=200
+ STOP=2000
+ STEP=200
+ BEEP_add="$(for I in `seq $START $STEP $STOP`; do echo -n " -f $I -l $PAUSE -r 1 -n"; done)"
+ BEEP_del="$(for I in `seq $STOP -$STEP $START`; do echo -n " -f $I -l $PAUSE -r 1 -n"; done)"
+ BEEP_add="beep ${BEEP_add%%-n}"
+ BEEP_del="beep ${BEEP_del%%-n}"
+ eval \$BEEP_$COMMAND
+}
+
run_modules(){
for I in ${MODULESPATH}/*-${COMMAND}
do
$I $@
done
- [ $BEEPS ] && eval \$BEEP_$COMMAND
+ [ $BEEPS ] && beeps
}
# Yes, it's crude but we'll elaborate later on something more functionnal
@@ -34,33 +47,16 @@ old_node(){
usage(){
echo "$0 is called as follows:"
- echo "$0 <add|del|old> <MAC address> <IP address> <hostname>"
+ echo "$0 <add|del> <MAC address> <IP address> <hostname> <processor count> [number of processors]"
+ echo "If [number of processors] is not set, the default one is used from the clustering config file when needed."
}
-
-if [[ $# != 4 ]]; then
-# We just ignore the call without a hostname
-# usage;
-#
- exit 0;
-fi
-
-
##### Variables #######
COMMAND=$1
MACADDR=$2
IP=$3
HNAME=$4
-### Beeps:
-PAUSE=20
-START=200
-STOP=2000
-STEP=200
-BEEP_add="$(for I in `seq $START $STEP $STOP`; do echo -n " -f $I -l $PAUSE -r 1 -n"; done)"
-BEEP_del="$(for I in `seq $STOP -$STEP $START`; do echo -n " -f $I -l $PAUSE -r 1 -n"; done)"
-BEEP_add="beep ${BEEP_add%%-n}"
-BEEP_del="beep ${BEEP_del%%-n}"
##### Variables END ###
@@ -68,9 +64,17 @@ if [[ $COMMAND == "old" ]]
then
# we background this since it performs a ping with a 1second timeout
# on a 256 node system, those seconds add up...
- old_node $@ &
+ if [[ $# -lt 5 ]]; then
+ # We ignore calls made with odl and only 4 args as we're missing the
+ # processor count. This can be caused by dnsmasq reloading
+ # or dnsmasq not setting DNSMASQ_USER_CLASS0 as it seems to happen often
+ # on subsequent dhcp requests made by the client.
+ exit 0
+ else
+ old_node $@ $DNSMASQ_USER_CLASS0 &
+ fi
else
- run_modules $@
+ run_modules $@ $DNSMASQ_USER_CLASS0
fi
exit 0
diff --git a/overlay/sys-cluster/beowulf-head/files/torque-add b/overlay/sys-cluster/beowulf-head/files/torque-add
index 01f251d..0e7e6ef 100755
--- a/overlay/sys-cluster/beowulf-head/files/torque-add
+++ b/overlay/sys-cluster/beowulf-head/files/torque-add
@@ -1,7 +1,22 @@
#!/bin/bash
-TMP=/tmp/$(basename $0)-$$
NODES=$PBS_SERVER_HOME/server_priv/nodes
+CLUSTER_CONF=%%CONFPATH/%%CONFIG_FILE
-echo $4 >> $TMP
-cat $NODES $TMP | sort -g | uniq | egrep -v "(^$|^\W$)" > $NODES.
-mv $NODES.$$ $NODES
+. $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.$$