Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running a binary without a top level script in SLURM

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.

like image 280
highBandWidth Avatar asked Oct 28 '15 20:10

highBandWidth


1 Answers

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

something like:

sbatch --wrap="echo hello"

like image 103
Carles Fenoy Avatar answered Sep 21 '22 01:09

Carles Fenoy