#!/bin/bash

mkdir -p output
mkdir -p all/{baseball,mpg,solder}
mkdir -p other/{baseball,mpg,solder}

export SLURM_ARRAY_TASK_ID=1

for df in data/bbdata.txt data/mpgdata.txt data/solder.data
do
    export DATA_FILE=$df

    R CMD BATCH --no-save --no-restore all_ss.R output/$SLURM_ARRAY_TASK_ID.out $SLURM_ARRAY_TASK_ID
    rm *.out

    R CMD BATCH --no-save --no-restore other_ss.R output/$SLURM_ARRAY_TASK_ID.out $SLURM_ARRAY_TASK_ID
    rm *.out
done

