I found references to srun --pty bash -i (see https://slurm.schedmd.com/faq.html#prompt) but when I run that on my cluster it exits immediately.
$ srun --pty bash -i
$ squeue
JOBID PARTITION NAME USER ST TIME NODES NODELIST(REASON)
1 team bash schmmd R 0:02 1 team-server1
I can get an interactive session with srun bash, but I don't have a shell prompt (e.g. $) and my session just looks like the following:
$ srun bash
ls
miniconda3
Miniconda3-latest-Linux-x86_64.sh
test
Is something misconfigured on my installation or should I be running a different command?
$ srun --version
slurm 19.05.0
srun (Synchronous)This interactive session exits immediately when you close the current terminal.
srun --time=30:00 --pty /bin/bash
salloc (Asynchronous)This creates a job on the cluster which you can connect to using ssh. WARNING: This job will not terminate until it is explicitly canceled or it reaches its time limit!
$ salloc --nodes=1 --time=30:00
Output:
salloc: Granted job allocation 1234567 salloc: Nodes evc1 are ready for job
$ ssh evc1
You can add additional requirements to the srun and salloc commands as needed. For instance, to request one node and one task for 30 minutes with 10GB of memory and X11 forwarding type:
srun --export=ALL --nodes=1 --ntasks=1 --x11 --mem=10G --time=00:30:00 --pty /bin/bash
Try with salloc and the requirements for your job. It will forward you to a new session prompt with the requested resources.
For instance:
salloc -N1
to request one node.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With