echo"This script replaces lines in a template file (submit_template.sh) and create a workspace for the jobs submission."
echo"You need to specify/have:"
echo"- a template file 'submit_template.sh' in the directory where you are executing the script"
echo"- a python executable file in your working directory"
echo"- a set of inputs for your jobs, meaning: model, partition (CPU or GPU), memory, input data folder, test dataset, nr. nodes for the ML algorithm."
echo"By invoking this script you will create a workspace with files having the righ formatting for the submission on sbatch system."
## == Creating a script (run.sh) in the workspace for the sbatch submission (N.B. not executing, just creating)
cd workspace_$MODEL\_$DATA\_$QUERY\/
suffix=".sh"
if[ ! -f run.sh ]; then
echo"#!/bin/bash" >> run.sh
chmod +x run.sh
fi
for f in ./*_*.sh; do
name=$(basename "$f")
echo"sbatch -J"${name%$suffix}$name >> run.sh
done
cd ../
## == Terminating
echo"[DONE] The file(s) "$PART"_"$MEM"_<nodes>.sh and relative script for the submission on batch queues have been created inside workspace_"$MODEL"_"$DATA"_"$QUERY"/"