Skip to content

Instantly share code, notes, and snippets.

@JCGoran
Last active November 29, 2023 08:52
Show Gist options
  • Save JCGoran/998776afba6e5aff1b1538ded81c8bb9 to your computer and use it in GitHub Desktop.
Save JCGoran/998776afba6e5aff1b1538ded81c8bb9 to your computer and use it in GitHub Desktop.
Running tmux on CSCS Piz Daint

Since tmux is not available by default on Piz Daint, here's a short guide on how to install and use it there (as of 2020-01-16).

Load the necessary modules:

module load daint-gpu EasyBuild-custom/cscs

Now you can build tmux using:

eb tmux-2.9.eb -r

Note that the version number may change in the future, you can use eb --search tmux to find the one you want to install, and give it the full path of the .eb file in the above. Also keep in mind that some currently loaded modules may interfere with the build process, so it's best to unload all of them first using module purge. Don't forget to reload the EasyBuild-custom/cscs module though!

Load tmux on startup by putting the following in your shell file (~/.bashrc or ~/.bash_profile):

module use $EASYBUILD_PREFIX/modules/all
module load tmux/2.9

Note that the $EASYBUILD_PREFIX env variable is only set if the EasyBuild-custom/cscs module is actually loaded, so if you don't need it at all, or use it rarely, you can just load the module once and then echo $EASYBUILD_PREFIX to figure out what is the default directory for builds (this may not be very future-proof though as the default may change).

Since Piz Daint has more than one node you can use to run jobs, just running ssh username@daint doesn't guarantee that the node you enter is the one with your tmux session on it. To get around this, you need to specifically enter the node number (for instance, ssh username@daint101). To spare yourself all of the additional keystrokes, you can put this is your ~/.ssh/config file:

Host [SOME_NAME]
    HostName daint101
    User [YOUR_USERNAME_HERE]
    IdentityFile [PATH_TO_IDENTITY_FILE]

Then you can just run ssh [SOME_NAME] to login. Note that the IdentityFile line in the above is optional, and can be used when you're logging in using ssh keys instead of a password (highly recommended).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment