I am encountering difficulties using a (Bash) HEREDOC with a SLURM sbatch
submission, via --wrap
.
I would like the following to work:
SBATCH_PARAMS=('--nodes=1' '--time=24:00:00' '--mem=64000' '--mail-type=ALL')
sbatch ${SBATCH_PARAMS[@]} --job-name="MWE" -o "MWE.log" --wrap <<EOF
SLURM_CPUS_ON_NODE=\${SLURM_CPUS_ON_NODE:-8}
SLURM_CPUS_PER_TASK=\${SLURM_CPUS_PER_TASK:-\$SLURM_CPUS_ON_NODE}
export OMP_NUM_THREADS=\$SLURM_CPUS_PER_TASK
parallel --joblog "MWE-jobs.log" --resume --resume-failed -k --linebuffer -j \$((\$OMP_NUM_THREADS/4)) --link "MWE.sh {1} {2}" ::: "./"*R1*.fastq.gz ::: "./"*R2*.fastq.gz
EOF
On my current cluster, sbatch
returns the below error, refusing to submit this job:
ERROR: option --wrap requires argument
Might anyone know how I can get this to work?