diff --git a/tuning/tune_on_slurm.sh b/tuning/tune_on_slurm.sh index a7750a4bb..b7f34f920 100644 --- a/tuning/tune_on_slurm.sh +++ b/tuning/tune_on_slurm.sh @@ -1,12 +1,13 @@ #!/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. @@ -14,12 +15,11 @@ # Call this script with the 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" \ No newline at end of file