C2110 UNIX operating system and programming basics 1st lesson Getting Started Petr Kulhánek kulhanek@chemi.muni.cz National Centre for Biomolecular Research, Faculty of Science, Masaryk University, Kamenice 5, CZ-62500 Brno UNIX operating system and programming basics 1st lesson Content > Aims of the course • Motivation, discussed topics, practical examples > Organization • Schedule, form of teaching • Assessment, completing a course > Cluster WOLF • Room 1.18, structure, usage rules, administrators > Getting started • Local login, standard applications, command line, scientific and technical applications, desktop environments UNIX operating system and programming basics 1st lesson Aims of the course > Motivation > Discussed topics UNIX operating system and programming basics 1st lesson Motivation - Supercomputing MetaCentrum a CERIT-SC (http://metavo.metacentrum.cz) Valid in 2016 • National Grid infrastructure, OS Debian • ca 11000 CPU cores, 1100 TiB disk array, 17 PiB hierarchical storage Any college student in the Czech Republic can get access. IT4lnnovations (http://it4i.cz) • National Supercomputing Centre, OS CentOS and Bullx • Salomon (cca 24192 CPU cores, 129TB RAM, Intel Xeon Phi MIC) • 40th place (TOP500,139th place in 06/2018)) • anselm (approximately 3000 CPU cores, RAM 15Tb) The machine time is sought through grant competitions. Local computing clusters at NCBR and CEITEC-MU Follow-Up Course (fall semester - block lectures): C2115 Practical Introduction to Supercomputing UNIX operating system and programming basics 1st lesson Motivation - desktop system Oracle VM VirtualBox r ■4 Hcs ffl S tl 4)) 10:47AM <> Advantages: free, flexible and extensible, scripting capabilities UNIX operating system and programming basics 1st lesson Discussed topics > Basic work with OS > Virtualization > Using the command line > Scripting language bash gnuplot awk UNIX operating system and programming basics 1st lesson Virtualization Oracle VM VirtualBox m 10 Host: Ubuntu 12.04 Guest: Windows XP (virtual machine) UNIX operating system and programming basics 1st lesson Processing of text files NSTEP = 6000 TIME(PS) = 206.000 TEMP(K) = 291.69 PRESS = 0.0 142.3142 13.5633 1.5430 0.0000 206.000 291.69 Data:/home/kulhanek/Documents/2013/C2110_UNIX/data/rst.out $ grep TIME rst.out | awk '{ print $6, $9 }' $ awk '/TIME/{ print $6, $9 }' rst.out UNIX operating system and programming basics 1st lesson -8- Visualization of results minimum QM / ABF 4x500ps / variable Rewald T 0.0 0.5 1.0 DD (A) Displaying of the extracted data in graphs (gnuplot). Data: /home/kulhanek/Documents/2013/C2110_UNIX/video BsoBI: Ivo Kabelka UNIX operating system and programming basics 1st lesson Organization of lectures > Schedule, form of teaching > Assessment, completing a course UNIX operating system and programming basics 1st lesson Schedule, form of teaching Lesson: September 17, 2018 - December 17, 2018 Examination period: January 2, 2 019 - February 12, 2 019 Completion: colloquium (2 credits) Total number of presented hours: 13 x 2 hours = 26 hours total hourly load of the course: 1 ECTS credit -> 26 hours workload 2 credits -> 2 x 26 hours = 52 hours of workload ©Self, homework, exam preparations: 26 hours Voluntary practice: ROPOT once per 14 days, open two weeks after the publication unlimited number of opening and evaluation randomly generated set of questions two excused absences in advance are allowed! (via mail or via the information system) UNIX operating system and programming basics 1st lesson Completion - knowledge assessme Two written tests: Completion: - final test (1 hodina) - Script by assignment (1 hour) (20 minutes) 2x10 points 50 points 30 points Total: Passed: 100 points >= 80 points You are allowed to use all study materials, any books and the Internet. When writing a test or script creation and will be allowed to use a computer, you can use scripts from exercises or from homeworks. However, you are not allowed to cooperate with other people (Facebook, mobile, etc.). UNIX operating system and programming basics 1st lesson Cluster WOLF > Classroom 1.18 > Structure > Terms of Use > Administrators UNIX operating system and programming basics 1st lesson Room 1.18 Basic information: > Room with 23 PCs >3D Visualization > Organized as computational cluster Safety rules http://wolf.ncbr.muni.cz The room is freely accessible to students who are working on projects at NCBR, and students who have lectures in the semester take place in the room. UNIX operating system and programming basics 1st lesson Cluster WOLF - structure University network Computational nodes 0.18 wolf30 wolf31 wolf32 ■ ■ ■ ■ i wolfYY All nodes are directly accessible from the public network. Domain: ncbr.muni.cz wolf03 ■ ■ ■ i 1.18 2.11 server/frontend Místnosti: 0.18 Server room A4/UKB 1.18 Computer lab A4/UKB 2.11 Seminar room A4/UKB work stations (computational nodes) Operation system: Ubuntu 16.04 (Xenial) LTS (http://www.ubuntu.com/) UNIX operating system and programming basics 1st lesson Terms of use The cluster WOLF is exclusively intended for educational purposes and/or for scientific work within National Centre for Biomolecular Research. The cluster WOLF is excplicitly forbidden to use for: > downloading of illegal content (copyrighted works, etc.). > sending out viruses, spam and similar materials > breaking protection of other computers > reading, deleting or changing unprotected contents of other users Binding rules for the use of computer network of Masaryk University: https://is.munixz/auth/do/mu/Uredni_de The login name and password form your identity and, therefore, it is fundamental to keep it safe and hidden form third parties. Do not store or send it (by e-mail) in unencrypted form! UNIX operating system and programming basics 1st lesson Terms of use The cluster WOLF is also explicitly forbidden to use for: > executing computational jobs on the frontend (wolf.ncbr.muni.cz) > running jobs anywhere in your home directory (especially data-intensive tasks) > executing tasks on work stations during the lesson (if a teacher does not say otherwise) Time demanding jobs must be run through a batch system: More information in C2115 Practical introduction to Supercomputing. UNIX operating system and programming basics 1st lesson Cluster administrators - problems Before contacting administrator, consult your problem with your colleagues, teacher or supervisor. If the problem is not resolved, report the problem to the administrators via e-mail support@lcc.ncbr.muni.cz In your report: > Describe the problem, the command name > Your user name, name of the machine > Copy error output (from the award of the entire command) UNIX operating system and programming basics 1st lesson Getting started > Local login > Standard applications > Command line > Scientific and technical applications > Desktop environments > Change of your password UNIX operating system and programming basics 1st lesson Local sessions Local terminals: • six text terminals (Fl... F6) • graphical terminal (F7, F8,...) • switching between them by Ctrl + Alt + Fl... Ctrl + Alt + F7 Login: • you have to enter your username and the password to log in Linux operating system is very flexible and allows other ways of local login, eg. by identification cards or cryptographic keys. More can be found in the help of system PAM (Pluggable Authentication Modules). $ man 8 pam UNIX operating system and programming basics 1st lesson Local sessions Text terminals (F1-F6): > these terminals provide a command-line interface (CLI - Command Line Interface) > the default directory is /home/username (home directory) > graphics applications (Xll) are possible to run only by exporting display to a remote graphic terminal > session termination: exit Graphical terminal (F7): > this terminal starts an Xll server and with a window manager (KDE, Unity, GNOME, etc.) > a window manager (desktop environment) can be selected before login > it allows to run directly graphical programs (GUI - Graphical User Interface) > a command line is available by special applications > xterm > konsole > gnome-terminal > session termination: use an option from the menu of a windows manager UNIX operating system and programming basics 1st lesson Log in - lightdm X manager Selection of desktop environment Username (Enter) Password (Enter) Default keyboard is English (EN). Check if the Num Lock is activated when using a numeric keypad. UNIX operating system and programming basics 1st lesson Exercise 1. Log in to the desktop environment Unity (Ubuntu option in the menu environment option) 2. Log in to the text terminal number 03 3. Enter the command Is in it. Guess what is a purpose of the command 4. Log off from the text terminal and go back to the graphical terminal. 5. Open your Web browser and portal cluster WOLF in it. Log into the inner part. Display occupancy of the cluster. 6. Log in to the Information System and open this presentation in the study materials. UNIX operating system and programming basics 1st lesson Standard Applications Main menu Results filtering Submenu ^ • <\ V catch Applications Gf Ret«ntly Uied IS S 'T. !• Firefox f i ref ox LibreOffice libreoffice Gimp Inkscape Okular gimp inkscape okular t web browser text processor (Writer), spreadsheet (Calc), presentation (Impress) editor of rastrer graphics editor of vector graphics PDF viewer name of command that launches the application NIX operating system and programming basics 1st lesson Terminals Command line is accessible directly from text terminals. In a graphical environment Xll must be run in the appropriate application emulating a text terminal: > gnome-terminal (Terminal) > konsole > xterm Default directory is: /home/username gnome-terminal * - □ Terminal [kulhanek(Jpes ~]$ | m .-. kulhanek: bash v - X File Edit View Scrollback Bookmarks Settings Help kulhanek@pes:~$ pwd /home/kulhanek kulhanek@pes:~$ | simple, but highly cc mfigurable - common : kwrite H) vs-server : kate H kulhanek : bash < > xterm x @wolf01:- <@wolf01> [kulhanekGuolfOl "]$ simple, standard on al UNIX and UNIX-like systems UNIX operating system and programming basics 1st lesson Command line Prompt - user type / calls ($ normal user, # super user, another possibilities %, >) V [kulhanek@wolf ~]$ _ place for commands username machinename default directory (~ is your home directory /home/username) command is executed by hitting Enter. History: using the arrow keys up and down is possible to scroll through the list of previously used commands. The command from history can be reused or modified to use. History is also accessible by command history. Autocompletion: hitting Tab (TAB) is a command line interpreter trying to complete itemized word. It can be use for completion of command names, paths and filenames (if one press does not cause anything, there are more options additions are displayed by repeated press). Text copying: Not using Ctrl + C! To copy text from the terminal just mark a text, for subsequent insertion press the mouse wheel (the middle button). UNIX operating system and programming basics 1st lesson Scientific and technical applicatioi Scientific and technical applications, that are installed in several versions (version, compilation type, parallel versions) are available as modules. Before using it is necessary to active appropriate module. List of available applications: $ module in the command line, the text is written without the $ List of available versions of the application: $ module versions vmd Activation of application: $ module add vmd Version number and the name of module is separated by colon Launch vmd: $ vmd $ module add vmd:1.9.0 activate default version of module name of module and application can differs. UNIX operating system and programming basics 1st lesson File managers WinXP [Running] - Oracle Vr lomů Vložení Návrh M Vyjmout 1 Kopírovat 1 Kopírovat formát t3 Nový snímek ■ jránka ^ bsnova Kazová řádka ■ >cko-technické aplikaci :'-^Í.......rr [ Správce souborů !!!! Do not use!!!! At supercomputer centers, there is mostly graphical interface not available During exercise, unless otherwise stated, use only command line. Prior preparation prevents poor performance UNIX operating system and programming basics 1st lesson Exercise 1. Start gimp using Unity menu. In the program, draw a house with one pen line. The resulting triangles fill by various colors. 2. Start Inkscape from the command line. In a program, draw the flag of Czech Republic. Try to estimate the fundamental difference between this two programs. 3. Start nemesis by adding nemesis from the modules. Model the molecule of acetic acid and run geometry optimization in the program. 4. Start LibreOffice. In spreadsheet, shows the course of the sine function in the range of 0-360 °. More in C2150 Information processing and visualization in chemistry UNIX operating system and programming basics 1st lesson Conclusions UNIX operating system and programming basics 1st lesson Conclusions > Ubuntu is a modern desktop environment (this also applies to other distributions based on OS Unix). > Ubuntu includes alternatives of standard applications: office packages (Writer, Calc, Impress), programs for creating vector (Inkscape) or raster (Gimp) graphics, programs for viewing web pages (Firefox). > It has native support for command line. UNIX operating system and programming basics 1st lesson Desktop environments Desktopová prostředí kulhanek: bash Rle Edit View Scrollback Bookmarks Settings Help kulhanek@wolfl2:-$ Is Desktop Downloads Pictures Templat Documents Music Public Videos kulhanek@*olfl2:~$ | rnfih-iflnw * © O kulhanek : bash File Edit view Scrollback Bookmarks Settings Help kulrianek@volfl2:~$ Is Desktop Downloads Pictures Template' Documents Husic Public Videos kulr,anek@wolfl2:-$ | KDE GNOME Unity (in menu option Ubuntu) UNIX operating system and programming basics Homeworks 1. Gradually, log in to different desktop environments, which are available on workstations of cluster WOLF. 2. When you choose to work in any other desktop environment than Unity. Get familiar with it. 3. If you are used to work with Czech keyboard, install it into desktop environment of your choice. UNIX operating system and programming basics 1st lesson Acknowledgement On course preparation participated: Zora Střelcová, Jakub Štěpán, Tomáš Trnka, Tomáš Bouchal, Pavel Janoš üf evropský Sociální , ■ M|N|$TERSTvC> ŠKOLSTVÍ, OPVnSUiMFir lOndVCR EVHÖPSKAUNIE MLÁDEŽ E A TĚLOVÝCHOVA |K* kettkiiMiictubtpíMt INVtSl ICt DO ROZVOJt VZDĚLÁVÁNÍ UNIX operating system and programming basics 1st lesson