问题
I would like to let the slurm system send myprogram
output via email when the computing is done. So I wrote the SBATCH
as following
#!/bin/bash -l
#SBATCH -J MyModel
#SBATCH -n 1 # Number of cores
#SBATCH -t 1-00:00 # Runtime in D-HH:MM
#SBATCH -o JOB%j.out # File to which STDOUT will be written
#SBATCH -e JOB%j.err # File to which STDERR will be written
#SBATCH --mail-type=END
#SBATCH --mail-user=my@email.com
echo $SLURM_JOB_ID
echo $SLURM_JOB_NAME
/usr/bin/mpirun -np 1 ./myprogram
/usr/bin/mail -s $SLURM_JOB_NAME my@email.com < JOB${SLURM_JOB_ID}.out
The mail system reports
file .out not found
How can I construct the mail command to let the subject line be $SLURM_JOB_NAME
and the mail contents from STDOUT
file, e.g. JOB${SLURM_JOBID}.out
in my case?
来源:https://stackoverflow.com/questions/32109171/how-to-let-sbatch-send-stdout-via-email