#!/bin/bash

fun_name="a6_automatic_artifact_correction"
job_name="eegmp_art"

mkdir ./logs

rootpath="$(pwd)/../.."
rootpath=$(builtin cd $rootpath; pwd)

for subj in $(seq 1 33); do
	echo "#!/bin/bash"                    			> job.slurm
	echo "#SBATCH --job-name ${job_name}_${subj}" 	>> job.slurm
	echo "#SBATCH --cpus-per-task 4"				>> job.slurm
	echo "#SBATCH --mem 8gb" 						>> job.slurm
	echo "#SBATCH --time 01:00:00" 					>> job.slurm
	echo "#SBATCH --output ./logs/${job_name}_${subj}.out"			>> job.slurm
	echo "#SBATCH --workdir ." 										>> job.slurm
	echo "./${fun_name}_run.sh /opt/matlab/R2016b ${subj} ${rootpath}" 	>> job.slurm
	sbatch job.slurm
	rm -f job.slurm
done