Skip to main content

smux

smux is a custom command for running interactive Slurm jobs on M3, based on tmux sessions. It lets you gain access to the compute and GPU resources of M3, but in an interactive command line where you can iterate on your work, rather than a predefined batch job or a full-on Strudel desktop.

Usage

To quickly start an interactive session with smux with default parameters, simply run

smux new-session

If you aren't connected right away, you may need to wait for your job to start, then you can run the command below to attach to your job:

smux a

For more details on how to use smux, just run smux --help! Run smux <subcommand> --help to get help for a particular subcommand, e.g. smux new-session --help.

[lexg@m3-login3 ~]$ smux --help
usage: smux [-h] {attach-session,a,new-session,n,list-sessions,l,why-are-we-waiting} ...

A tool to created and reconnect to interactive sessions

Use "smux new-session" to create a new session
Use "smux list-sessions" to list existing sessions
Use "smux attach-session -t <ID>" to connect to an existing session

When in a session, use the keys control+b then press d to dettach from the session

Short forms (n, l and a) are also accepted. <ID> is optional if you only have one job.

For more detailed help on each subcommand you can smux <subcommand> --help,
for example smux n --help will display additional options for starting a new session

positional arguments:
{attach-session,a,new-session,n,list-sessions,l,why-are-we-waiting}

optional arguments:
-h, --help show this help message and exit

[lexg@m3-login3 ~]$ smux new-session --help
usage: smux new-session [-h] [--ntasks <n>] [--nodes <n>] [--mem <n>] [--cpuspertask <n>] [--qos <n>] [-J <n>] [-A <n>] [-p PARTITION] [-r RESERVATION] [-t TIME] [--gres <n>]
[-o <n>] [-e <n>] [--mail-type <n>] [--mail-user <n>]

optional arguments:
-h, --help show this help message and exit
--ntasks <n> The number of tasks you will launch
--nodes <n> The number of nodes you need
--mem <n> The amount of memory you need
--cpuspertask <n> The number of cpus needed for each task
--qos <n> The QoS (Quality of Service) used for the task (certain QoS are only valid on some partitiotns)
-J <n>, --jobname <n>
The name of your job
-A <n>, --account <n>
Specify your account
-p PARTITION, --partition PARTITION
The partition to execute on
-r RESERVATION, --reservation RESERVATION
The reservation to use
-t TIME, --time TIME The amount of time to run for
--gres <n> The type and number of gpus needed for each task
-o <n>, --output <n> Standard output file name
-e <n>, --error <n> Error output file name
--mail-type <n> Notify user by email when certain event types occur (https://slurm.schedmd.com/srun.html#OPT_mail-type)
--mail-user <n> User to receive email notification of state changes as defined by --mail-type (https://slurm.schedmd.com/srun.html#OPT_mail-user)

How do I quit my smux session?

If you are happy to terminate your smux session, just type Ctrl+d. If you wish to temporarily exit your smux session, wishing to come back to it later, do Ctrl+b, then d. See the official tmux wiki for details on using tmux itself, but you don't really need to know tmux to use smux.

I can't scroll up or down in smux!

This is an issue with tmux. See superuser - How do I scroll in tmux? for advice on scrolling in tmux.