2. Getting Started
If you are not familiar with the use of HPC clusters, we recommend that you first study the HPC-intro tutorial .
2.1. Login
An ssh client is required to connect to the tux cluster. On a Linux or OSX system, the command is usually:
$ ssh <username>@tux.phys.ntnu.no
Here you need to replace <username>
with your username on the tux cluster.
If you try to log into tux from a windows system, you will need to install an ssh client and we in particular recommend MobaXterm, Windows Subsystem for Linux (WSL2) [version 2], or putty. The former two have the additional advantage that they have X windows built in and X forwarded by default so no additional user steps are required to run GUI applications.
If you plan to run GUI applications on the login node, e.g. run a text editor, replace ssh ssh
in the above command with ssh -X
or ssh -Y
to enable X forwarding.
An example of the process can look like this (here baym is the local machine):
baym:~$ ssh -X aturing@tux.phys.ntnu.no
aturing@tux.phys.ntnu.no's password:
Linux tux 5.10.0-19-amd64 #1 SMP Debian 5.10.149-1 (2022-10-17) x86_64
Welcome to the
_____ _ ___ __ _ _
|_ _| | | \ \/ / ___| |_ _ ___| |_ ___ _ __
| | | | | |\ / / __| | | | / __| __/ _ \ '__|
| | | |_| |/ \ | (__| | |_| \__ \ || __/ |
|_| \___//_/\_\ \___|_|\__,_|___/\__\___|_|
Last login: Mon Oct 24 18:11:48 2022 from 129.241.48.90
tux:~$
There are actually two login nodes for the cluster and you may choose any of them; they are called tux.phys.ntnu.no
and tuxlogin-1.phys.ntnu.no
.
Note
It is a good idea to set up passwordless login to tux from the machine where you execute the ssh command.
This can done using ssh-copy-id
and this tutorial explains how.
To connect to the cluster, you must log in to the login node from inside the university network. If you want to connect from a remote location (e.g. from your computer at home) you must first establish a VPN connection to get access to the university network.
Warning
Never run heavy calculations, i.e. CPU-time- or RAM-consuming processes, on the login nodes. For this purpose, one should allocate a compute node.
2.2. Editing Files
To edit text files on the cluster you will need to use a text editor. Here we would like to mention the following editors which are all installed on tux
Editor |
Comment |
---|---|
emacs |
If in text mode, pressing F10 brings up the menu |
vim |
|
nano |
ctrl-O to save; ctrl-X to exit |
To learning one of those three is a must! If you want super editing powers (read features), try both vim and emacs; they are so different that you'll soon feel one of them is your preferred choice. Then learn it inside out.
If you want very quick time to market (read ease of use), go for nano.
2.3. Transferring Files & Data
When using the cluster you will, sooner or later, need to move files and data to or from it. To this end, we recommend that you use the command secure copy or scp
. It allows you to securely transfer files between local and remote hosts. The command scp uses ssh for transferring data and managing authentication. Scp performs a plain linear copy of the specified files, while replacing already existing files with the same name.
Let us give some examples of how file transfer with scp can be done. To copy the file ~/dir/file01 from your local machine (here called baym) to your home directory on tux do:
baym:~$ scp ~/dir/file01 <username>@tux.phys.ntnu.no:
file01 100% 14KB 726.5KB/s 00:00
Note
If you have the same username on both the local and remote machine, you can disregard <username>@ in the command above!
Copy the file ~/bar/file01 on tux to the current working directory on your local machine:
baym:~$ scp <username>@tux.phys.ntnu.no:bar/file01 .
file01 100% 14KB 623.4KB/s 00:00
If you want to copy the content of the local directory ~/dir to the home directory on tux, you can use the command:
baym:~$ scp -r ~/dir <username>@tux.phys.ntnu.no:
This command will first create the directory ~/dir on tux if it does not already exist, before copying the local content of the directory into the corresponding remote directory. The option -r
means recursive and, therefore, the whole directory tree will be copied.
Note
If you need more sophisticated control over your copying process, consider using rsync
.