PageRenderTime 27ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 0ms

/doc/summerschools/summerschool16.rst

https://gitlab.com/marcindulak/gpaw
ReStructuredText | 254 lines | 165 code | 89 blank | 0 comment | 0 complexity | b70f8b1255385af2c2b620d85f285df2 MD5 | raw file
  1. .. _summerschool16:
  2. =======================
  3. CAMd Summer School 2016
  4. =======================
  5. Announcement:
  6. http://www.fysik.dtu.dk/english/Research/CAMD/Events/Summer-school-2016
  7. .. highlight:: bash
  8. Logging in to the databar
  9. =========================
  10. The software (mainly Python, ASE and GPAW) that you need for the
  11. computer exercises are available in the databar. You are expected to
  12. access the databar from your own laptops. There are essentially two
  13. ways for doing that: ThinLinc and Secure Shell. ThinLinc will give
  14. you a Linux desktop, Secure Shell will open windows on your normal
  15. desktop.
  16. :Linux and Mac users:
  17. We recommend using Secure Shell.
  18. :Windows users:
  19. ThinLinc is easier to install, many find that Secure Shell is nicer
  20. to work with.
  21. Using Secure Shell on Linux and Mac computers
  22. ---------------------------------------------
  23. ..
  24. **Mac users**: You need to install the semi-official X-server for
  25. MacOS: http://xquartz.macosforge.org/
  26. To log in, open a Terminal window. On Ubuntu Linux click on the Dash Home
  27. and search for Terminal - we recommend dragging it to the dock. In Mac OS X,
  28. find it in Spotlight, again we suggest dragging it to the dock.
  29. In the terminal window, type::
  30. $ ssh -X login.gbar.dtu.dk
  31. and once you are logged in, proceed to log in to one of the Linux machines
  32. with::
  33. $ linuxsh -X
  34. Note that first you log in to a login server that cannot run our
  35. software, the second command then logs you on to one of the least
  36. loaded Linux servers where the software is expected to
  37. work. **Forgetting to run the ``linuxsh -X`` command every time you
  38. login is the most common source of errors!**
  39. You now need to read `Setting up your UNIX environment`_.
  40. Installing and using Secure Shell on Windows computers
  41. ------------------------------------------------------
  42. To log in to the databar and display the applications on your Windows
  43. desktop, you need to install an X11 server on your Windows machine.
  44. We recommend installing `MobaXterm <http://mobaxterm.mobatek.net/>`_.
  45. See also :ref:`mobaxterm`.
  46. The server name is login.gbar.dtu.dk
  47. Once you have an xterm terminal window open on the gbar login server, type::
  48. $ linuxsh -X
  49. to proceed to one of the Linux servers, where the course software is installed.
  50. You now need to read `Setting up your UNIX environment`_.
  51. Installing and using ThinLinc
  52. -----------------------------
  53. **This is an alternative way to access the computers from Macs and
  54. Windows machines, if for some reasons you do not wish to use SSH.**
  55. Information on how to install and use ThinLinc is available here:
  56. http://gbar.dtu.dk/index.php/faq/43-thinlinc
  57. Set the server name to thinlinc.gbar.dtu.dk. User name and password is
  58. your DTU login. When loggin in, you are asked to choose between
  59. different desktops, we recommend choosing Xfce (some of the other
  60. choices will cause trouble).
  61. You need to open a terminal window to use gpaw. Click on the
  62. Applications Menu, then on Terminal Emulator.
  63. *Hint*: Before you log in the first time, click on Options, choose the
  64. Screen tab, and select "Work area (maximized)". Then thinlinc will
  65. open a window filling the whole screen, but will not go into
  66. full-screen mode which many people find annoying to get out of again.
  67. Setting up your UNIX environment
  68. ================================
  69. The first time you use the databar computers, you must configure your
  70. environment. Add the following line to the very end of your
  71. ``.bashrc`` file::
  72. source ~mikst/camd2016.bashrc
  73. This will set up the environment for you so that you can use ASE, GPAW and
  74. matplotlib.
  75. Note that the file ``.bashrc`` starts with a period, making it a hidden file in Unix.
  76. If you would like to setup the text editors ``nedit`` and ``vim`` in a python
  77. friendly way you can execute the command::
  78. $ sh ~mikst/python_friendly.sh
  79. This may take about a minute or so.
  80. Running GPAW calculations
  81. =========================
  82. **Warning** do not use spaces in the directory/file names!
  83. GPAW calculations are written as Python scripts, which can be run with
  84. the command::
  85. $ python filename.py
  86. If the calculation lasts more than a few seconds, submit it to the
  87. queue instead of running it directly::
  88. $ gpaw-qsub filename.py
  89. This will allow the script to be executed on a different host, so the
  90. jobs will be distributed efficiently even if many users logged on to
  91. the same computer. The output from your script will be written to the
  92. files :samp:`filename.py.oNNNNNN` and :samp:`filename.py.eNNNNNN`
  93. where :samp:`NNNNNN` is a job number. Normal output (stdout) goes to
  94. the :samp:`.oNNNNNN` file, whereas error messages (stderr) goes to
  95. :samp:`.eNNNNNN`. Unlike some queue systems these files appear when
  96. the job starts, so you can follow job progress by looking at them.
  97. You can run jobs in parallel, using more CPUs for
  98. increased speed, by specifying e.g. 4 CPUs like this::
  99. $ gpaw-qsub -p 4 filename.py
  100. The ``qstat`` or :samp:`qstat -u {USERNAME}` commands can be used to
  101. monitor running jobs, and :samp:`qdel {JOB_ID}` to delete jobs if
  102. necessary. On the joblist from ``qstat``, you can find the JOB_ID.
  103. You can also see the status of the jobs, Q means queued, R means
  104. running, C means completed (jobs remain on the list for a while after
  105. completing).
  106. Exercises and Tutorials
  107. =======================
  108. You are now ready to embark on the :ref:`exercises` and :ref:`tutorials`.
  109. Have fun.
  110. Accessing databar files on your laptop
  111. ======================================
  112. The databar has its own file system, separate from your laptop
  113. (obviously). If you want to keep your scripts and/or results, the
  114. files should be transferred to your own computer.
  115. * If you use MobaXTerm on Windows, you can access your databar files
  116. by dragging and dropping in the file window to the left.
  117. * If you use ssh to log in, and are familiar with the scp command, you
  118. can use it to copy files back and forth::
  119. scp camd16XXX@login.gbar.dtu.dk:myfolder/myfile .
  120. scp localfile camd16XXX@login.gbar.dtu.dk:myfolder
  121. * You can map your databar home folder as a network drive:
  122. - **On a MAC**: From Finder select Go / Connect to Server (K) and
  123. enter the following as the Server Address::
  124. smb://home.cc.dtu.dk/camd16XXX
  125. - **On Windows**: Tools | Map Network drive
  126. And select any unused drive letter and enter the following as path::
  127. \\home.cc.dtu.dk\camd16XXX
  128. - **On Linux**: It depends on the Linux distribution and on what
  129. software is installed. If you have samba installed, you should be
  130. able to mount the drive using the smb protocol, use the same
  131. address as on a Mac (see above).
  132. Another option that may work is the sshfs command. Create an empty
  133. directory, and mount the remove file system there::
  134. mkdir databar
  135. sshfs camd16XXX@transfer.gbar.dtu.dk: databar
  136. If you fumble, you may leave the folder in a half-mounted state,
  137. and get a "Device or resource not ready" or "Transport endpoint is
  138. not connected" error when you try again. In those case, either create a new folder
  139. with a new name, or reboot your linux machine.
  140. Cannot open new windows after 20 minutes
  141. ========================================
  142. If you use SSH to log in from a Mac (and from *some* Linux
  143. distributions), an over-zealous security measure prevents the databar
  144. computer from opening new windows if it is more than 20 minutes since
  145. you logged in.
  146. To fix it, edit the file /etc/ssh/ssh_config as the super-user, and
  147. add a magic line to it::
  148. cd /etc/ssh
  149. sudo nano ssh_config
  150. This opens a primitive editor. Use the arrow keys to go to the end of
  151. the file, and add this line::
  152. ForwardX11Timeout 36000
  153. (it is case sensitive, so use copy-paste).
  154. Save the file and exit (Control-X). This increases the time-out to 36000 seconds, i.e. ten hours.
  155. Notes and hints
  156. ===============
  157. * Editor: Several editors are available including emacs, vim and gedit.
  158. * Printer: There is a printer in each databar, the name is written on
  159. the printer. To use it from a terminal: :samp:`lp -d {printename}
  160. {filename}`. Read more about printing `here
  161. <http://www.gbar.dtu.dk/wiki/Printing>`_.
  162. * To open a pdf-file: :samp:`evince {filename.pdf}`
  163. * The normal tilde (~) key combination is not functional on the
  164. databar computers. Use :kbd:`Alt Graph + 5` to type a tilde.
  165. .. * How to `use USB sticks <http://www.gbar.dtu.dk/wiki/USB_Access>`_.