SLURM - 将所有输出打印到单个文件

SLURM - Print all output to single out file

我希望将所有作业的输出打印到同一个输出文件 "o.out",而不覆盖它。

特别是,我希望它与作业数组一起使用:

#!/bin/bash
#SBATCH --array=1-3
#SBATCH -J vo_job
#SBATCH -o o.out
#SBATCH -e e.out

使用sbatch的--open-mode选项:

#SBATCH --open-mode=append

来自documentation

Open the output and error files using append or truncate mode as specified. The default value is specified by the system configuration parameter JobFileAppend.

默认为truncate,确实会删除文件中之前的内容。