diff --git a/RTCP/Run/src/CNProcessing.sh b/RTCP/Run/src/CNProcessing.sh index 1f1602a84531b2dc54ac572200b310a6d469975e..f0dd935a58f09fbc3d514c935a87458275fc665b 100755 --- a/RTCP/Run/src/CNProcessing.sh +++ b/RTCP/Run/src/CNProcessing.sh @@ -3,6 +3,8 @@ source locations.sh function start() { + set_psetinfo + TMPDIR="`mktemp -d`" PIDFILE="$TMPDIR/pid" @@ -23,6 +25,8 @@ function start() { } function stop() { + set_psetinfo + # graceful exit alarm 10 gracefullyStopBGProcessing.sh diff --git a/RTCP/Run/src/IONProcessing.sh b/RTCP/Run/src/IONProcessing.sh index f53e822b0902d3e97a6e51af7c94370c3cc59568..edafb9922c138b7694b3e255a63cd1a8a968e25a 100755 --- a/RTCP/Run/src/IONProcessing.sh +++ b/RTCP/Run/src/IONProcessing.sh @@ -3,6 +3,8 @@ source locations.sh function start() { + set_psetinfo + # create a new log dir rm -f "$LOGSYMLINK" || true mkdir -p "$LOGDIR" diff --git a/RTCP/Run/src/LOFAR/Partitions.py b/RTCP/Run/src/LOFAR/Partitions.py index 7fbdea5b80aaa4cc38a4dfa1a5a36d15d06512e4..d19ecd8a61ac6f2ff96e1e39a3dd1e6fa8fa39ab 100755 --- a/RTCP/Run/src/LOFAR/Partitions.py +++ b/RTCP/Run/src/LOFAR/Partitions.py @@ -50,6 +50,8 @@ for R in xrange(3): # a rack PartitionPsets[rack] = PartitionPsets["%s-M0" % rack] + PartitionPsets["%s-M1" % rack] +PartitionPsets["R00R01"] = PartitionPsets["R00"] + PartitionPsets["R01"] + if __name__ == "__main__": from optparse import OptionParser,OptionGroup import sys diff --git a/RTCP/Run/src/gracefullyStopBGProcessing.sh b/RTCP/Run/src/gracefullyStopBGProcessing.sh index 4d004fba2ebdf91328e7fcbad2001d4d587bf5b0..81757ac2d5b826e19d3615bf0d29d138bd8e956a 100644 --- a/RTCP/Run/src/gracefullyStopBGProcessing.sh +++ b/RTCP/Run/src/gracefullyStopBGProcessing.sh @@ -2,6 +2,8 @@ source locations.sh +set_psetinfo + echo "cancel all" > /dev/tcp/$FIRSTPSET/4000 2>/dev/null && echo "quit" > /dev/tcp/$FIRSTPSET/4000 2>/dev/null && sleep 5 # allow processes to quit diff --git a/RTCP/Run/src/locations.sh.in b/RTCP/Run/src/locations.sh.in index 06104765296f6743ca1ed14671b4b479a93931c8..16fe5a4bb6f4d630ef1fe8583080f3e4f5d733fd 100644 --- a/RTCP/Run/src/locations.sh.in +++ b/RTCP/Run/src/locations.sh.in @@ -32,14 +32,21 @@ then . $ETCDIR/BlueGeneControl.conf fi -# list both the partition directly (small partitions) and recursively (large partitions) to get all -32 subpartitions -# bghierarchy needs a valid stdin for some reason and will read from it, so provide a fake one -SUBPARTITIONS="`(bghierarchy -s $PARTITION;bghierarchy -s \`bghierarchy -s $PARTITION\`) </dev/null`" - -# a comma-separated list of all psets in $PARTITION -# xxx-32 means both xxx-J00 and xxx-J01 -PSETS=`for i in $SUBPARTITIONS; do echo $i; done|grep -- "-32$"|sort -u|sed 's/-32$/-J00/;p;s/-J00$/-J01/'|xargs -L 1 host -4|cut -d\ -f 4|tr '\n' ','` - -# the address of the first pset in the $PARTITION -FIRSTPSET=`for i in $SUBPARTITIONS; do echo $i; done|grep -- "-32$"|sort -u|sed 's/-32$/-J00/;p;s/-J00$/-J01/'|xargs -L 1 host -4|cut -d\ -f 4|head -n 1` +function set_psetinfo() { + # list both the partition directly (small partitions) and recursively (large partitions) to get all -32 subpartitions + # bghierarchy needs a valid stdin for some reason and will read from it, so provide a fake one + if [ "$PARTITION" == "R00R01" ] + then + SUBPARTITIONS="`(bghierarchy -s R00 R01;bghierarchy -s \`bghierarchy -s R00 R01\`) </dev/null`" + else + SUBPARTITIONS="`(bghierarchy -s $PARTITION;bghierarchy -s \`bghierarchy -s $PARTITION\`) </dev/null`" + fi + + # a comma-separated list of all psets in $PARTITION + # xxx-32 means both xxx-J00 and xxx-J01 + PSETS=`for i in $SUBPARTITIONS; do echo $i; done|grep -- "-32$"|sort -u|sed 's/-32$/-J00/;p;s/-J00$/-J01/'|xargs -L 1 host -4|cut -d\ -f 4|tr '\n' ','` + + # the address of the first pset in the $PARTITION + FIRSTPSET=`for i in $SUBPARTITIONS; do echo $i; done|grep -- "-32$"|sort -u|sed 's/-32$/-J00/;p;s/-J00$/-J01/'|xargs -L 1 host -4|cut -d\ -f 4|head -n 1` +}