Running binary without top level script in SLURM

In SGE / PBS, I can send binary executables to the cluster, as well as locally. For instance:

qsub -by -cwd echo hello 

will send a job called echo, which writes the word β€œhello” to the output file.

How to send a similar job to SLURM. He expects the file to have a hash-bang interpreter in 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 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 do not want to write a script, put #!/bin/bash at the top and my command in the next line, and then send them to sbatch. Is there any way to avoid this extra work? There must be a more productive way.

+5
source share
1 answer

you can use the -wrap option to automatically transfer the command to a script.

sort of:

sbatch --wrap="echo hello"

+7
source

Source: https://habr.com/ru/post/1234734/


All Articles