How to let SBATCH send stdout via email?

天涯浪子 提交于 2020-02-24 05:29:58

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!