I am using sdev
to quickly grab an interactive node, but it kicks me off after an hour. I’d really like longer time. How can I do this?
Good question! Using sdev
if you do sdev -h
you can see a number of different options, for example:
$ sdev -h
sdev: start an interactive shell on a compute node.
Usage: sdev [OPTIONS]
Optional arguments:
-c number of CPU cores to request (OpenMP/pthreads, default: 1)
-n number of tasks to request (MPI ranks, default: 1)
-N number of nodes to request (default: 1)
-m memory amount to request (default: 4GB)
-p partition to run the job in (default: dev)
-t time limit (default: 01:00:00)
-r allocate resources from the named reservation (default: none)
-J job name (default: sdev)
-q quality of service to request for the job (default: normal)
Note: the default partition only allows for limited amount of resources.
If you need more, your job will be rejected unless you specify an
alternative partition with -p.
And these may be enough to customize your session. What I like to do is use srun
instead to create the same session, giving me all the same job submission arguments afforded by srun
. Here is an example:
srun --partition owners --mem=32000 --time=48:00:00 --x11 --pty bash
In the above I am asking for an interactive node (bash) with x11 and 32GB memory for 2 days on the owners partition. I get:
srun: job 32900943 queued and waiting for resources
srun: job 32900943 has been allocated resources
[vsochat@sh-27-06 ~]$ squeue -u vsochat
JOBID PARTITION NAME USER ST TIME NODES NODELIST(REASON)
32900943 owners bash vsochat R 0:21 1 sh-27-06
And no comment if you are supposed to do this or not, but I typically start a screen session before the srun
command so if I disconnect I don’t lose the session. This would work for sdev too!
screen
sdev
# lose connection, see screen sessions
screen -ls
# copy past the id, and use -r to reattach
screen -r <long id>