#!/bin/bash
#SBATCH --job-name=ThorCollect
#SBATCH --partition=ckpt
#SBATCH --account=cse-ckpt
#SBATCH --nodes=1
#SBATCH --mem=150G
#SBATCH --gres=gpu:1
#SBATCH --cpus-per-gpu=15
#SBATCH --time=24:00:00
#SBATCH -e /gscratch/raivn/mcw244/gen_slurm_outs/slurm-%j.err
#SBATCH -o /gscratch/raivn/mcw244/gen_slurm_outs/slurm-%j.out
#SBATCH --export=ALL,MPLCONFIGDIR=/gscratch/raivn/mcw244/tmps/

cat $0
echo "--------------------"
source activate /gscratch/raivn/mcw244/anaconda3/envs/thor
cd /gscratch/raivn/mcw244/world_model

echo $1
echo $2
# export MPLCONFIGDIR=/gscratch/raivn/mcw244/tmps/
# gpus='0,1,2,3'
# export MPLCONFIGDIR='/home/mcw244'
result_root=rollouts
ext=.tar.gz
tar_file="$result_root$1-$2$ext"
for i in $(seq $1 $2)
do
    echo $i
    python ThorWalkthrough2.py --gpu 1 --sf $i
done
tar -czvf $tar_file /tmp/rollouts2