Running a binary without a top level script in SLURM

心不动则不痛 提交于 2021-02-18 11:08:22

问题


In SGE/PBS, I can submit binary executables to the cluster just like I would locally. For example:

qsub -b y -cwd echo hello

would submit a job named echo, which writes the word "hello" to its output file.

How can I submit a similar job to SLURM. It expects the file to have a hash-bang interpreter on the first line. On SLURM I get

$ 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

or using the 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
'

I don't want to write script, put #!/bin/bash at the top and my command in the next line and then submit them to sbatch. Is there a way to avoid this extra work? There has to be a more productive way.


回答1:


you can use the --wrap parameter to automatically wrap the command in a script.

something like:

sbatch --wrap="echo hello"



来源:https://stackoverflow.com/questions/33400769/running-a-binary-without-a-top-level-script-in-slurm

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