Section outline

  • To cancel a queued or running job, use scancel <JOBID>. The job ID is what sbatch printed when you submitted; you can also find it via squeue -u $USER.

    $ scancel 38759
    $ squeue -u $USER
    # (job is gone within a few seconds)

    Sometimes you don't want a batch job — you want a shell on a compute node so you can poke at things interactively. Use salloc:

    salloc --account=nn9970k --time=30:00 --ntasks=1 --mem=4G

    The session lives as long as you stay connected. Drop your laptop's network for too long and the job dies. To survive disconnects, wrap your work in tmux on the login node before calling salloc — you can re-attach with tmux attach after reconnecting.

    One catch on NRIS clusters: each tmux session is bound to the specific login node where you started it. If you ssh in and get a different login node, ssh again specifying the one your session is on (ssh login-1).

    Read the canonical section →

    • scancel, salloc, and the tmux trick.