From e9d3af0a7248fc4bf9fc2badbddcad4d00c878d9 Mon Sep 17 00:00:00 2001 From: hector-baez Date: Fri, 15 Dec 2023 10:01:53 -0600 Subject: [PATCH] change to arrays --- scheduler/ben.sh | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/scheduler/ben.sh b/scheduler/ben.sh index 5e586c3..ba405c6 100755 --- a/scheduler/ben.sh +++ b/scheduler/ben.sh @@ -27,11 +27,13 @@ done declare -A SERVER_MAP SERVER_MAP=( - ["/tmp/ben-ecopcr"]="/tmp/ben-blast" - ["/tmp/ben-blast"]="/tmp/ben-ac" - ["/tmp/ben-ac"]="/tmp/ben-newick" - ["/tmp/ben-newick"]="/tmp/ben-tronko" - ["/tmp/ben-qc"]="/tmp/ben-assign" + ["/tmp/ben-ecopcr"]=("/tmp/ben-blast") + ["/tmp/ben-blast"]=("/tmp/ben-ac") + ["/tmp/ben-ac"]=("/tmp/ben-newick") + ["/tmp/ben-newick"]=("/tmp/ben-tronko") + ["/tmp/ben-qc"]=("/tmp/ben-assign" "/tmp/ben-assignxl") + ["/tmp/ben-assign"]=("/tmp/ben-assignxl") + ["/tmp/ben-assignxl"]=("/tmp/ben-assign") ) # make tmp hosts file for parallel-ssh script. only lines after $START @@ -53,15 +55,10 @@ do host="$NAME$counter" /etc/ben/ben client -r $host -n $NODES --remote-path $REMOTE_PATH -s $BENSERVER --remote-socket $BENSERVER -d if [[ -v SERVER_MAP[${BENSERVER}] ]]; then - # add socket connection to add job after - BENSERVERSECOND="${SERVER_MAP[${BENSERVER}]}" - /etc/ben/ben client -r "$host" -n 0 --remote-path "$REMOTE_PATH" -s "$BENSERVERSECOND" --remote-socket "$BENSERVERSECOND" -d - - # add assign XL socket - if [[ $BENSERVERSECOND == *assign* ]]; then - BENSERVERSECOND="${BENSERVERSECOND}xl" - /etc/ben/ben client -r "$host" -n 0 --remote-path "$REMOTE_PATH" -s "$BENSERVERSECOND" --remote-socket "$BENSERVERSECOND" -d - fi + # add socket connections to queue jobs + for socket in "${SERVER_MAP[${BENSERVER}]}"; do + /etc/ben/ben client -r "$host" -n 0 --remote-path "$REMOTE_PATH" -s "$socket" --remote-socket "$socket" -d + done fi counter=$(( 10#$counter + 1 )) done