运行 SLURM 中没有顶级脚本的二进制文件

Running a binary without a top level script in SLURM

在 SGE/PBS 中,我可以像在本地一样将二进制可执行文件提交到集群。例如:

qsub -b y -cwd echo hello

将提交一个名为 echo 的作业,它将单词 "hello" 写入其输出文件。

如何向 SLURM 提交类似的工作。它期望文件在第一行有一个 hash-bang 解释器。在 SLURM 上我得到

$ sbatch echo hello
sbatch: error: This does not look like a batch script.  The first
sbatch: error: line must start with #! followed by the path to an interpreter.
sbatch: error: For instance: #!/bin/sh

或者使用伪qsub:

$ qsub echo hello
There was an error running the SLURM sbatch command.
The command was:
'/cm/shared/apps/slurm/14.11.3/bin/sbatch echo hello  2>&1'
and the output was:
'sbatch: error: This does not look like a batch script.  The first
 sbatch: error: line must start with #! followed by the path to an interpreter.
 sbatch: error: For instance: #!/bin/sh
'

我不想写脚本,把#!/bin/bash放在最上面,我的命令放在下一行,然后提交给sbatch。有没有办法避免这种额外的工作?必须有一种更有成效的方式。

您可以使用 --wrap 参数自动将命令包装在脚本中。

类似于:

sbatch --wrap="echo hello"