nesi / APSIM-HPC

Deploy APSIM (Agricultural Production Systems sIMulator - https://www.apsim.info/) on high performance computing clusters.
https://nesi.github.io/APSIM-HPC/
MIT License
0 stars 0 forks source link

split_configfiles_to_sets.sh needs a confirmation at the start to say the "splitting is in progress" #40

Closed DininduSenanayake closed 1 month ago

DininduSenanayake commented 1 month ago

Current iteration of split_configfiles_to_sets.sh does exactly what is supposed to do without any errors. However, launching the script doesn't trigger any useful feedback at the beginning ( this during the .txt spliting) which might force someone to believe it is stalled. I suppose we have can a message along the lines of "Process had started" or so

DininduSenanayake commented 1 month ago

I think this can be done with few modifications

# Function to display progress message
show_progress() {
    local message="$1"
    echo -ne "\r$message..."
}

and modify the function to move files to sets as

# Function to move files to a set
move_files_to_set() {
    local set_number=$1
    local start_index=$2
    local end_index=$3
    for ((i=start_index; i<end_index; i++)); do
        mv "${txt_files[i]}" "set-$set_number/"
        show_progress "Splitting in Progress"
    done
}

and add echo "Starting to split files..." after that