From 1e1569561f56ee1c18c152b90498c812dd876107 Mon Sep 17 00:00:00 2001
From: Jan David Mol <mol@astron.nl>
Date: Mon, 16 Feb 2015 19:38:39 +0000
Subject: [PATCH] Task #7336: Forward QUEUE_PREFIX to outputProc as well, and
 corrected comments in MessageFuncs.sh (non-empty queues are also deleted on
 exit)

---
 LCS/MessageBus/test/MessageFuncs.sh.in            | 9 +++++----
 RTCP/Cobalt/GPUProc/src/scripts/runObservation.sh | 8 ++++++--
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/LCS/MessageBus/test/MessageFuncs.sh.in b/LCS/MessageBus/test/MessageFuncs.sh.in
index 1ddf2d29264..5ca71eda18a 100644
--- a/LCS/MessageBus/test/MessageFuncs.sh.in
+++ b/LCS/MessageBus/test/MessageFuncs.sh.in
@@ -16,8 +16,9 @@ function _on_exit() {
 
 function _generate_prefix() {
   # Generate a unique prefix for this test
-  NOW=`date +"%FT%T"`
-  mktemp -u test-$NOW-XXXXXXXXXX.
+  NOW=`date +"%FT%T.%N"`
+
+  echo test-$NOW.
 }
 
 # Generate an unique prefix for all queues in this test
@@ -54,7 +55,7 @@ function delete_queue() {
   # Usage:
   #   delete_queue queue
   #
-  # Will not remove non-empty or used queues
+  # Will not remove used queues
   QUEUE_NAME="$1"
 
   if have_qpid; then
@@ -76,7 +77,7 @@ function delete_all_queues() {
   done
 }
 
-# Automatically delete all empty, non-used queues on EXIT
+# Automatically delete all unused queues (created by create_queue) on EXIT
 _on_exit delete_all_queues
 
 function recv_msg() {
diff --git a/RTCP/Cobalt/GPUProc/src/scripts/runObservation.sh b/RTCP/Cobalt/GPUProc/src/scripts/runObservation.sh
index 710d122818b..fde6a641e02 100755
--- a/RTCP/Cobalt/GPUProc/src/scripts/runObservation.sh
+++ b/RTCP/Cobalt/GPUProc/src/scripts/runObservation.sh
@@ -376,11 +376,13 @@ touch $PID_LIST_FILE
 
 LIST_OF_HOSTS=$(getOutputProcHosts $PARSET)
 RANK=0
+VARS="QUEUE_PREFIX=$QUEUE_PREFIX" # Variables to forward to outputProc
 for HOST in $LIST_OF_HOSTS
 do
-  COMMAND="ssh -tt -l $SSH_USER_NAME $KEY_STRING $SSH_USER_NAME@$HOST $OUTPUT_PROC_EXECUTABLE $OBSERVATIONID $RANK"
+  COMMAND="ssh -tt -l $SSH_USER_NAME $KEY_STRING $SSH_USER_NAME@$HOST $VARS $OUTPUT_PROC_EXECUTABLE $OBSERVATIONID $RANK"
+  echo "Starting $COMMAND"
   # keep a counter to allow determination of the rank (needed for binding to rtcp)
-  RANK=$(($RANK + 1))   
+  RANK=$(($RANK + 1))
   
   command_retry "$COMMAND" &  # Start retrying function in the background
   PID=$!                      # get the pid 
@@ -395,8 +397,10 @@ done
 # Run in the background to allow signals to propagate
 #
 # -x LOFARROOT    Propagate $LOFARROOT for rtcp to find GPU kernels, config files, etc.
+# -x QUEUE_PREFIX Propagate $QUEUE_PREFIX for test-specific interaction over the message bus
 # -H              The host list to run on, derived earlier.
 mpirun.sh -x LOFARROOT="$LOFARROOT" \
+          -x QUEUE_PREFIX="$QUEUE_PREFIX" \
           -H "$HOSTS" \
           $MPIRUN_PARAMS \
           $CHECK_TOOL \
-- 
GitLab