Instead of entering slurm options in a script with #SBATCH
, you can add them as arguments in the command line, e.g.:
sbatch --time 05:00:00 --ntasks 2 --mem 1G /my/code/to/run.sh
After this sbatch command, slurm allocates 2 CPU cores and 1GB RAM memory for up to 5 hours. The code in the path will run when these resources become available.
You can also use the wrap option to submit a command or a few commands separated with a semicolon, e.g.
sbatch --time 05:00:00 --ntasks 2 --mem 1G --wrap=”first_command;second_command”
If you need to load modules in your job then you must create a script and submit it with sbatch command:
The Moriah cluster doesn't support the the flag --module (unlike some other clusters) .
Using the flag --wrap in the sbatch command also won't work, because this flag wraps your commands in an sh shell - which also doesn't support the module command.