Skip to content

Commit

Permalink
Improve tune_on_slum.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
ernestum committed Jan 18, 2024
1 parent d9c4b57 commit be085d3
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tuning/tune_on_slurm.sh
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
#!/bin/bash
#SBATCH --array=1-10
#SBATCH --array=1-100
# Avoid cluttering the root directory with log files:
#SBATCH --output=slurm/%A_%a.out
#SBATCH --output=%A/%a/cout.txt
#SBATCH --cpus-per-task=8
#SBATCH --gpus=0
#SBATCH --mem=8gb
#SBATCH --time=70:00:00
#SBATCH --qos=scavenger
#SBATCH --export=ALL

# This script assumes that you set up imitation in your NAS home directory and
# installed it in a venv located in the imitation directory.

# Call this script with the <algo> <env_named_config> parameters to be passed to the
# tune.py script.

cd "/nas/ucb/$(whoami)/" || exit
source imitation/venv/bin/activate
source "/nas/ucb/$(whoami)/imitation/venv/bin/activate"

# Note: we run each worker in a separate working directory to avoid race
# conditions when writing sacred outputs to the same folder.
mkdir workdir_"$1"_"$2"_"$SLURM_ARRAY_TASK_ID"
cd workdir_"$1"_"$2"_"$SLURM_ARRAY_TASK_ID" || exit
mkdir -p "$SLURM_ARRAY_JOB_ID"/"$SLURM_ARRAY_TASK_ID"
cd "$SLURM_ARRAY_JOB_ID"/"$SLURM_ARRAY_TASK_ID" || exit

srun python ../imitation/tuning/tune.py -j ../"$1"_"$2".log "$1" "$2"
srun python ../../tune.py --num_trials 400 -j ../"$1"_"$2".log "$1" "$2"

0 comments on commit be085d3

Please sign in to comment.