#!/bin/bash
#SBATCH -p short
#SBATCH -t 01:00:00
#SBATCH --mem-per-cpu=2G
#SBATCH --array=0-999

export PATH=/workspace/software/R-3.6.1/bin:$PATH
module load R/R-3.6.1

export DM=D1
export SIGMA=1

mkdir -p output # save log
mkdir -p data # save results

for om in E0 E1 E2 E3 E4 E5
do
    export OM=$om
	R CMD BATCH --no-save --no-restore simu.R output/$om\_$SLURM_ARRAY_TASK_ID.out $SLURM_ARRAY_TASK_ID
	rm *.out
done