问题
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