Skip to content

Commit

Permalink
Shellcheck fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
ernestum committed Feb 29, 2024
1 parent f4bcbdc commit 60fc75a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tuning/rerun_on_slurm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# <tune_folder>/reruns/<seed>
# The output of each worker is written to a cout.txt.


# shellcheck disable=SC1090
source "/nas/ucb/$(whoami)/imitation/venv/bin/activate"

worker_dir="$SLURM_JOB_NAME/reruns/$SLURM_ARRAY_TASK_ID/"
Expand Down
3 changes: 2 additions & 1 deletion tuning/tune_on_slurm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
# with the --array=101-150 (for another 50 workers). For this you do not need to modify
# this file. You can pass it to sbatch to override.

# shellcheck disable=SC1090
source "/nas/ucb/$(whoami)/imitation/venv/bin/activate"

if [ -f "$SLURM_JOB_NAME/$SLURM_ARRAY_TASK_ID/cout.txt" ]; then
Expand All @@ -62,7 +63,7 @@ if [ -f "$SLURM_JOB_NAME/$SLURM_ARRAY_TASK_ID/cout.txt" ]; then
# so it is not very useful information.
echo "The study folder for $SLURM_JOB_NAME already contains a folder for job $SLURM_ARRAY_TASK_ID!"
echo "Are you trying to continue on an existing study? Then adapt the sbatch array range!"
echo "E.g. if the highest folder number in $SLURM_JOB_NAME/ is 100 and you want to continue the study with another 50 runners, start this script using `sbatch --job-name=$SLURM_JOB_NAME --array=101-50 tune_on_slurm.sh $1 $2`"
echo "E.g. if the highest folder number in \"$SLURM_JOB_NAME/\" is 100 and you want to continue the study with another 50 runners, start this script using \"sbatch --job-name=$SLURM_JOB_NAME --array=101-150 tune_on_slurm.sh $1 $2\""
exit 1
else
# Note: we run each worker in a separate working directory to avoid race
Expand Down

0 comments on commit 60fc75a

Please sign in to comment.