Running a binary without a top level script in SLURM
Asked Answered
H

1

13

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.

Hewe answered 28/10, 2015 at 20:14 Comment(0)
T
25

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

something like:

sbatch --wrap="echo hello"

Turnbull answered 28/10, 2015 at 21:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.