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

hig*_*dth 7 bash cluster-computing pbs sungridengine slurm

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

qsub -b y -cwd echo hello
Run Code Online (Sandbox Code Playgroud)

将提交一个名为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
Run Code Online (Sandbox Code Playgroud)

或使用pseuodo 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
'
Run Code Online (Sandbox Code Playgroud)

我不想写脚本,放在#!/bin/bash顶部,我的命令在下一行,然后将它们提交给sbatch.有没有办法避免这项额外的工作?必须有一种更有成效的方式.

Car*_*noy 12

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

就像是:

sbatch --wrap="echo hello"