From 49857ec462cf0de2127edca7eea1b5284b7c0160 Mon Sep 17 00:00:00 2001 From: Dusan Jovic Date: Thu, 16 May 2024 14:48:23 +0000 Subject: [PATCH] Print 'ECFLOW Tasks Remaining' message only when the number of tasks changes --- tests/rt_utils.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/rt_utils.sh b/tests/rt_utils.sh index cc375c189c..239419e271 100755 --- a/tests/rt_utils.sh +++ b/tests/rt_utils.sh @@ -712,6 +712,7 @@ ecflow_run() { max_active_tasks=$( grep "task " <<< "${max_active_tasks}" ) max_active_tasks=$( grep -cP 'state:active|state:submitted|state:queued' <<< "${max_active_tasks}" ) echo "rt_utils.sh: Total number of tasks processed -- ${max_active_tasks}" + prev_active_tasks=${active_tasks} while [[ "${active_tasks}" -ne 0 ]] do sleep 10 & wait $! @@ -720,7 +721,13 @@ ecflow_run() { active_tasks=$( grep "task " <<< "${active_tasks}" ) active_tasks=$( grep -cP 'state:active|state:submitted|state:queued' <<< "${active_tasks}" ) set -e - echo "ECFLOW Tasks Remaining: ${active_tasks}/${max_active_tasks}" + if [[ ${active_tasks} -ne ${prev_active_tasks} ]]; then + echo + echo -n "ECFLOW Tasks Remaining: ${active_tasks}/${max_active_tasks} " + prev_active_tasks=${active_tasks} + else + echo -n "." + fi "${PATHRT}/abort_dep_tasks.py" done