srun command allows you to run a command now.
med-login:~$ srun --pty bash -i
The command will perform a resource allocation with the scheduler (and wait until it has allocated the requested resources) first.
Most importantly, you can specify the
--pty argument which will connect the current terminal's standard output, error, and input to your current one.
This allows you to run interactive jobs such as shells with
srun --pty bash -i.
Slurm Documentation: srun
Please also see the official Slurm documentation on srun.
Also see all important arguments of the
--pty-- Connect current terminal to the job's stdoud/stderr/stdin.
--x11-- Setup X11 forwarding.
--immediate-- Immediately terminate if the resources to run the job are not available, do not wait.
--test-only-- Don't run anything, but only estimate when the job would be scheduled.
- This is the primary entry point for creating interactive shell sessions on the cluster.
- As with all jobs allocated by Slurm, interactive sessions executed with
srunare governed by resource allocations, in particular:
srunjobs have a maximal running time set,
srunjobs have a maximal memory and number of cores set, and
- also see
scontrol show job JOBID.