User Tools

Site Tools


exercises:2017_uzh_cmest:login

This is an old revision of the document!


First Login

In this exercise you will learn how to login and run commands on our infrastructure.

Part I: Login

Required software

As mentioned in the lecture, you absolutely need a terminal emulator:

  • on Linux: this can be one of programs Konsole, Gnome Terminal, Terminal, XTerm, …
  • on Mac OS X/OSX/macOS Sierra: use the pre-installed Terminal application, iTerm2 or the X-Windows terminal from XQuartz (see instructions below)
  • on Windows: use Putty

optionally you may want:

  • a X11-Server, to be able to start graphical applications on the server and have the output on your computer:
    • on Linux: it is enough to be logged-in in a graphical environment (Unity, Gnome, KDE, …)
    • on Mac OS X/OSX/macOS Sierra: you need to install XQuartz
    • on Microsoft Windows: you need to install XMing
  • a file transfer tool to copy files from/to the server:
    • on Linux: put sftp://tcopt3.chem.uzh.ch as the address in your file browser and you should be able to browse your home directory after logging in
    • on Mac OS X/OSX/macOS Sierra: use Cyberduck
    • one Windows: use WinSCP or Cyberduck
  • a plain text editor to edit input files if you are uncomfortable with using vim, nano or emacs via SSH. Please note: It is important that your editor supports Unix line endings. If in doubt, use one of the mentioned editors on the server, or an advanced plain text editor like Atom (plus the line-ending-selector-unix plugin) or Notepad++ on your local machine.

Login using Linux

  • Connect to Internet (use VPN when not on the UZH network)
  • Open a terminal (Konsole, xterm or similar)
  • Connect to the server by entering the command: ssh -X studentXX@tcopt3.chem.uzh.ch

Login using macOS

  • Connect to Internet (use VPN when not on the UZH network)
  • Open a X-Windows terminal in the X11 application if you want to run graphical applications on the server, otherwise use the pre-installed Terminal application or an alternative like iTerm2
  • Connect to the server by entering the command: ssh -X studentXX@tcopt3.chem.uzh.ch

Login using Windows

First configure Putty (only required on the first run) as follows:

  1. Start the application PuTTY from the Windows menu (in the folder PuTTY)
  2. Fill in the Host Name: tcopt3.chem.uzh.ch
  3. Set Connection type to SSH
  4. Type tcopt3 as the name of the session below Saved Sessions and save the settings a first time
  5. In the Category tree on the left side, select Connection > Data and enter the username you have been given in the lecture in the field Auto-login username
  6. Select the tab Connection > SSH > X11 from the Category list and enable the option Enable X11 Forwarding
  7. Go to Session again and
  8. Choose Session from the Category list and click Save again

Then continue as follows to login:

  • Connect to Internet (use VPN when not on the UZH network)
  • Start Xming (optional, only required if you want to run graphical applications on the server)
  • Start Putty
  • Double click the session tcopt3 to start the connection
  • Enter (username and) password as requested

First steps

Change the password of your account after your first login, using:
$ passwd

Part II: Loading and running a program

Module loading

Since there are numerous applications with different and possibly conflicting requirements, the module system is used. This means that only basic commands are available until explicitly loaded.

To list all available modules:

$ module avail

while using

$ module list

gives the list of loaded moules.

To load the CP2K module used in this course, use:

$ module load cp2k/r18057_2017_09_18

When you list the loaded modules again at this point (see command above), you will notice that the list has changed.

Now run the following command to verify that the CP2K executable is available:

$ cp2k.sopt --help

Which should give you the output

 cp2k.sopt [-c|--check] [-e|--echo] [-h|--help] [--html-manual]
           [-i] <input_file>
           [-mpi-mapping|--mpi-mapping] <method>
           [-o] <output_file>
           [-r|-run] [--xml]

 starts the CP2K program, see <https://www.cp2k.org/>

 The easiest way is cp2k.sopt <input_file>

 The following options can be used:

  -i <input_file>   : provides an input file name, if it is the last
                      argument, the -i flag is not needed
  -o <output_file>  : provides an output file name [default: screen]

 These switches skip the simulation, unless [-r|-run] is specified:

  --check, -c       : performs a syntax check of the <input_file>
  --echo, -e        : echos the <input_file>, and make all defaults explicit
                      The input is also checked, but only a failure is reported
  --help, -h        : writes this message
  --html-manual     : writes a HTML reference manual of the CP2K input
                      in the current directory. The file index.html is a good
                      starting point for browsing
  --license         : prints the CP2K license
  --mpi-mapping     : applies a given MPI reordering to CP2K
  --run, -r         : forces a CP2K run regardless of other specified flags
  --version, -v     : prints the CP2K version and the SVN revision number
  --xml             : dumps the whole CP2K input structure as a XML file
                      xml2htm generates a HTML manual from this XML file

Another program we need for visualization is VMD.

Load the respective module (since there is only one version available, the shorthand vmd can be used when specifying the module to load) and start it using:

$ vmd

Two new windows named VMD Main and VMD 1.9.2 … Display should open on your local machine while the server shows:

Info) VMD for LINUXAMD64, version 1.9.2 (December 29, 2014)
Info) http://www.ks.uiuc.edu/Research/vmd/                         
Info) Email questions and bug reports to vmd@ks.uiuc.edu           
Info) Please include this reference in published work using VMD:   
Info)    Humphrey, W., Dalke, A. and Schulten, K., `VMD - Visual   
Info)    Molecular Dynamics', J. Molec. Graphics 1996, 14.1, 33-38.
Info) -------------------------------------------------------------
Info) Multithreading available, 32 CPUs detected.
Info) Free system memory: 256213MB (99%)
Warning) Detected a mismatch between CUDA runtime and GPU driver
Warning) Check to make sure that GPU drivers are up to date.
Info) No CUDA accelerator devices available.
Warning) Detected X11 'Composite' extension: if incorrect display occurs
Warning) try disabling this X server option.  Most OpenGL drivers
Warning) disable stereoscopic display when 'Composite' is enabled.
libGL error: failed to load driver: swrast
libGL error: Try again with LIBGL_DEBUG=verbose for more details.
Info) OpenGL renderer: GeForce GTX 760 (192-bit)/PCIe/SSE2
Info)   Features: STENCIL MSAA(4) MDE MTX NPOT PP PS 
Info)   GLSL rendering mode is NOT available.
Info)   Textures: 2-D (16384x16384), 3-D (2048x2048x2048), Multitexture (4)
Info) Dynamically loaded 2 plugins in directory:
Info) /sw/build/generic/app/vmd/vmd-1.9.2/lib/vmd/plugins/LINUXAMD64/molfile
vmd >

If you only get the output on the server but not the 2 windows there is something wrong with your setup and you should check the lecture notes again. You can exit VMD by either closing the VMD Main or by giving the quit command at the vmd > prompt:

vmd > quit
The module loading is not persistent. You have to reload the modules every time you log back in.

Part III: Advanced account configuration

Make module loading persistent

Upon login, the shell (bash in our case) executes a number of files if they exist. One of them is the .bashrc. To prepare it for management using the the module command, simply execute the following once:

$ echo 'module load ' >> ~/.bashrc

after that you can add and remove modules to be loaded at startup using module initadd or module initrm.

To add vmd and cp2k, run for example:

$ module initadd vmd
$ module initadd cp2k/r18057_2017_09_18

to remove vmd again from the list of modules to load:

$ module initrm vmd

Alternatively you can of course simply edit .bashrc using your favorite editor and add a line like module load vmd cp2k/r18057_2017_09_18 by yourself.

Setup key-based authentication

To avoid having to type the password every time you log in (and to increase the security), a public-private key pair can be used for authentication instead.

Instructions for macOS and Linux

First generate a key-pair on your local machine by running the following in a terminal/shell:

$ ssh-keygen

and accept the defaults proposed and do no set a password.

Upload the public key from your local machine to tcopt3:

$ scp ~/.ssh/id_rsa.pub studentXX@tcopt3.chem.uzh.ch:~/

Now login to tcopt3.chem.uzh.ch and move the uploaded public key to the right place and set the access permissions correct:

$ mkdir -p .ssh
$ chmod 0700 .ssh
$ mv id_rsa.pub .ssh/authorized_keys

When connecting to the server from your local machine now, use:

$ ssh -i ~/.ssh/id_rsa studentXX@tcopt3.chem.uzh.ch

Instructions for Windows using PuTTY

First login to the server as above and leave the terminal window open.

Then generate a key-pair on your local machine as follows:

  1. Start the application PuTTYgen which was installed alongside PuTTY itself
  2. Click on Generate to generate a new key (move the mouse to generate randomness, as instructed)
  3. Do not set a Key passphrase
  4. Click on Save private key and store the private key as condensed_matter.ppk
  5. On the server (in the PuTTY terminal window), run the following commands:
    $ mkdir -p .ssh
    $ chmod 0700 .ssh
    $ nano -w .ssh/authorized_keys
    
  1. Now copy & paste the content in the field Public key for pasting into OpenSSH authorized_keys file from PuTTYgen into the terminal. Pasting in PuTTY is done by a right mouse click.
  2. Exit nano by using CTRL+X, press Y to save the file and confirm the name by pressing ENTER
  3. Enter exit to close the connection
  4. Close the PuTTYgen application

Reconfigure PuTTY to use the generate key:

  1. Restart PuTTY
  2. Select the Session tcopt3 and press Load
  3. Select Connection > SSH > Auth
  4. Use the Browse… button in Authentication parameters to selected the condensed_matter.ppk you generated earlier
  5. Go back to Session and click Save, then Open to login
  6. Now PuTTY should directly login (given that you have saved the username as well as described above) without asking for a password

Simplify the login

The following instructions apply to OSX and Linux.

On your local machine add the following part to the file .ssh/config in your home directory:

Host tcopt3
  HostName tcopt3.chem.uzh.ch
  User studentXX

after which you will be able to connect to tcopt3 simply by using

$ ssh tcopt3

If you have setup key-based authentication as shown above, augment the entry to the following instead, to always use key-based authentication without having to specify -i ~/.ssh/id_rsa manually:

Host tcopt3
  HostName tcopt3.chem.uzh.ch
  User studentXX
  IdentityFile ~/.ssh/id_rsa
  IdentitiesOnly yes
  PreferredAuthentications publickey
exercises/2017_uzh_cmest/login.1506337847.txt.gz · Last modified: 2020/08/21 10:15 (external edit)