11

在 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。有没有办法避免这种额外的工作?必须有一种更有成效的方法。

4

1 回答 1

20

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

就像是:

sbatch --wrap="echo hello"

于 2015-10-28T21:39:58.937 回答