Difference between revisions of "User:Mukund-pondkule-6a11@uni-paderborn.de"

From HPC Wiki
Jump to navigation Jump to search
 
(262 intermediate revisions by 2 users not shown)
Line 1: Line 1:
An Introduction to the Linux Operating System and Command Line. The course provides students with a hands-on approach for learning Linux through assignments and projects. 
+
Introduction text here.  
  
 
__TOC__
 
__TOC__
  
=== Historical Background === <!--T:8-->
+
{{YouTube|id=IfD9IPixgpo|time=3m2s}}
 +
 
 +
{{Infobox table
 +
| REAL-NAME    = HPC.NRW
 +
| image  = Dhnrw_logo.png
 +
| Feldnamehead1 = table name
 +
| Feldname1 = Kontakt            | Daten2 = RWTH Aachen
 +
| Feldname2 = Bundesland        | Daten3 = Nord Rhein Wesfallen
 +
| Feldname3 = Beginn            | Daten4 = 2019
 +
| Feldname4 = Ende              | Daten5 = 2021
 +
| Feldnamehead2 = activities
 +
| Feldname5 = AP2                | Daten6 = Arbeitspaket 2
 +
| Feldname6 = AP3                | Daten7 = Arbeitspaket 3
 +
| Feldname7 = AP4                | Daten8 = Arbeitspaket 4
 +
| Feldname8 = Institutes        | Daten9 = 13
 +
| Feldname9 = -                  | Daten10 = ***
 +
| Feldname10 = -                 | Daten11 = ***
 +
| Feldname11 = -                 | Daten12 = ***
 +
| Feldname12 = -                 | Daten13 = ***
 +
| Feldname13 = -                 | Daten14 = ***
 +
}}
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
  
Video: Slide 17 - 23 (7 pages), 5 min 45 sec (Text) + 15 sec (Quiz)
 
  
<gallery mode="border" heights="150" perrow="1">
 
NUMA Architecture.png|
 
</gallery>
 
  
Text and slides path
 
  
  
function dynamicallyLoadScript(url) {
 
    var script = document.createElement("script");  // create a script DOM node
 
    script.src = url; //"https://hpc-calendar.gauss-allianz.de/js/dfx_ajax.js";  // set its src to the provided URL
 
console.log("executing");
 
    document.head.appendChild(script);  // add it to the end of the head section of the page (could change 'head' to 'body' to add it to the end of the body section instead)
 
}
 
$('#hpccalendar').append("<script id='dfxbox' data-kid=1' data-locale='en' data-template='kurz' data-default-show-items-count='10' data-dfx-url='https://hpc-calendar.gauss-allianz.de' src='https://hpc-calendar.gauss-allianz.de/js/dfx_terminbox.js'></script>");
 
$('#hpccalendar').append("<div id='datefix'></div>");
 
  
  
Quiz:
 
1. Are all Top 500 supercomputers using Linux in HPC?
 
  A: Yes
 
  B: No
 
  {| role="presentation" class="wikitable mw-collapsible mw-collapsed"
 
    | <strong>Answer:</strong>
 
    |-
 
    | A
 
    | Explanation: see https://top500.org/statistics/list (access on 27.08.2020) List in June 2020 shows all Top 500 supercomputers are using Linux.
 
    |}
 
           
 
2. What does GNU stands for?
 
  A. GNU's Not Unix
 
  B. Geek Needed Unix
 
  C. General Unix
 
  D. General Unix
 
  E. None of the Above
 
  Answer: a)
 
  {| role="presentation" class="wikitable mw-collapsible mw-collapsed"
 
    | <strong>Answer:</strong>
 
    |-
 
    | A
 
    |}
 
Exercises in Terminal: no exercises in this section
 
  
=== The Command Line === <!--T:8-->
 
  
Video: Slide 17 - 23 (7 pages), 5 min 45 sec (Text) + 15 sec (Quiz)
 
  
Text and slides path
 
  
  
  
Quiz:
 
1. Which keys can be used for command history?
 
  A: up- and down-arrow keys
 
  B: Page-up and Page-down keys
 
  {| role="presentation" class="wikitable mw-collapsible mw-collapsed"
 
    | <strong>Answer:</strong>
 
    |-
 
    | A
 
    | Explanation: up- and down-arrow keys (↑ and ↓) can be used for command history. The behavior of Page-up and Page-down keys depends on the setting of a terminal. But normally the command history is not available by using the Page-up and Page-down keys.
 
    |}
 
{{Warning|mode=info|text=Working directory in console reminds user, where they are. (page 3)}}
 
{{Warning|mode=warn|
 
  text=In command line user may forget where they are (page 2).
 
  Child processes may stop, if parent shell exits (page 2).}}
 
  
Exercises in Terminal:
 
1. What's your username on a Linux computer?
 
  There are two ways to find your username on a Linux computer
 
  {| role="presentation" class="wikitable mw-collapsible mw-collapsed"
 
    | <strong>Answer:</strong>
 
    |-
 
    |
 
      1. In the command line prompt, e.g. [username@hostname ~]$ , you can find your username as username directly.
 
      2. The Linux command whoami can also show your username.
 
    |}
 
2. What's the hostname of a Linux computer?
 
  There are two ways to find the hostname on a Linux computer.
 
  {| role="presentation" class="wikitable mw-collapsible mw-collapsed"
 
    | <strong>Answer:</strong>
 
    |-
 
    |
 
      1. In the command line prompt, e.g. [username@hostname ~]$ , you can find the hostname as hostname directly.
 
      2. The Linux command hostname can also give you the hostname.
 
    |}
 
           
 
3. What's your current working directory on a Linux computer?
 
    There are two ways to find your current working directory on a Linux computer.
 
    {| role="presentation" class="wikitable mw-collapsible mw-collapsed"
 
    | <strong>Answer:</strong>
 
    |-
 
    |
 
      1. In the command line prompt, e.g. [username@hostname ~]$ , you can find your current working directory is ~, which means your $HOME directory.
 
      2. The Linux command pwd can also show your current working directory.
 
    |}
 
           
 
4.  Use up- and down-arrow keys to see the command history.
 
    {| role="presentation" class="wikitable mw-collapsible mw-collapsed"
 
    | <strong>Explanation:</strong>
 
    |-
 
    |
 
      The up- and down- arrow keys can be used to navigate command history.
 
    |}
 
       
 
5.  Run sleep 1h command and wait, then use Ctrl-C to kill it.
 
    {| role="presentation" class="wikitable mw-collapsible mw-collapsed"
 
    | <strong>Explanation:</strong>
 
    |-
 
    |
 
      sleep 1h puts the terminal into idle, e.g. terminal is doing nothing, for 1 hour.
 
      Ctrl-C kills the current command. In this exercise it's sleep 1h.
 
    |}
 
  
=== Directory structure === <!--T:8-->
 
         
 
Video: Slide 33 - 48 (16 pages), 5 min 45 sec (Text + Demo + Quiz) + 15 sec (Tips and Warning)
 
  
Text and slides path
 
  
  
  
Quiz:
 
1. Which one is the top directory in Linux?
 
  A: /
 
  B: /home
 
  C: C:\
 
  {| role="presentation" class="wikitable mw-collapsible mw-collapsed"
 
    | <strong>Answer:</strong>
 
    |-
 
    |    A
 
    | Explanation: The tree structure for directory is used in Linux system. Therefore the top directory in Linux is /. The /home directory may be an upper level directory for all non-root users. The last option C:\ represents the C drive on Windows.
 
    |}
 
  
2. The command 'cd ' without arguments : if you start in var/log/ and run cd with no arguments, what do you expect will happen?
 
  A: Nothing it stays in /var/log/.
 
  B: It goes to your home directory.
 
  C: It goes to the filesystem root
 
  D: The shell prompt turns into a shark and eats you.
 
  E: It’s an error.
 
  F: The shell stops having a working directory.
 
  {| role="presentation" class="wikitable mw-collapsible mw-collapsed"
 
    | <strong>Answer:</strong>
 
    |-
 
    |    B
 
    | It goes to your home directory. cd without arguments is a shortcut to take you home. As long as your home directory exists, you can always go home.
 
    |}
 
{{Warning|mode=warn|text=no undo and make sure what you want to do (page 16)}}
 
  
Exercises in Terminal (slide 49):
 
1. Go to a specific subfolder of a folder (example: cd Documents/courses/ ) and get back to the home directory using cd command. List 3 different ways to do it using one command. check after every action your path with pwd command.
 
  {| role="presentation" class="wikitable mw-collapsible mw-collapsed"
 
    | <strong>Answer:</strong>
 
    |-
 
    |
 
        cd
 
        cd ~
 
        cd $HOME
 
        the last option $HOME is an enviornment variable. You will learn about enviornment variables later.
 
    |}
 
     
 
2. Go to the directory /tmp and jump between /tmp and your home directory back and forth. check after every action your path with pwd command.
 
  {| role="presentation" class="wikitable mw-collapsible mw-collapsed"
 
    | <strong>Answer:</strong>
 
    |-
 
    |
 
        cd /tmp
 
        cd -
 
        cd - with cd - you change back to the previous working directory, pass the dash (-) character as an argument to the cd command.
 
    |}
 
  
 +
=== Template === <!--T:8-->
  
=== Files === <!--T:8-->
+
<youtube width="600" height="400" right>IfD9IPixgpo</youtube>
  
Video: Slide 51 - 56 (6 pages), 5 min 30 sec (Text + Demo + Quiz) + 15 sec (Tips and Warning)
 
  
Text and slides path
+
[https://www.isc-hpc.com/ THE EVENT FOR HIGH PERFORMANCE COMPUTING, MACHINE LEARNING AND DATA ANALYTICS]
  
 +
{{Clickable button|:en:Wikipedia:Manual of Style/Layout|'''Wikipedia's manual of Style'''|class=ui-button-green ui-button-large}}
  
Quiz:
+
{{Warning|mode=warn|text= no warning in this section}}
1. Can you copy directory with </code>cp <old_dir> <new_dir></code> ?
 
  A: Yes
 
  B: No, -r option is needed for copying directory
 
  {| role="presentation" class="wikitable mw-collapsible mw-collapsed"
 
    | <strong>Answer:</strong>
 
    |-
 
    | B
 
    | Explanation: Without any option the cp command can only be used to copy files (text files as well as binary files). To copy a directory, the -r option must be used and it means to copy a given directory in a recursive manner e.g. one file after another in a directory.
 
    |}
 
{{Warning|mode=warn|text= rm -f: no confirmation! Use with care (page 3).
 
    Wildcards expand before given to program (page 6).}}
 
  
Exercises in Terminal:
+
{{Warning|mode=info|text= no tips in this section}}
1. Use the find command to search for files, whose name ends with dat, in your home directory.
 
  {| role="presentation" class="wikitable mw-collapsible mw-collapsed"
 
    | <strong>Answer:</strong>
 
    |-
 
    |
 
      The complete command is find $HOME -type f -name "*dat"
 
          find can be used to search files and directories.
 
          $HOME is your home directory.
 
          -type f means only file (not directory) will be shown.
 
          -name "*dat" specifies the required filename and "*dat" restricts the filename ends with dat, while it can begin with any characters (the * wild cards).
 
    |}
 
2. Use the find command to search for directories, whose name begins with test and ends with _dir, in your home directory.
 
  {| role="presentation" class="wikitable mw-collapsible mw-collapsed"
 
    | <strong>Answer:</strong>
 
    |-
 
    |
 
      The complete command is find $HOME -type d -name "test*_dir"
 
          find can be used to search files and directories.
 
          $HOME is your home directory.
 
          -type d means only directory (not file) will be shown.
 
          -name "test*_dir" specifies the required directory name, which begins with test and ends with _dir. The wild card * matches any characters in between.
 
    |}
 
  
=== Text display, search === <!--T:8-->
 
  
Video: Slide 58 - 64 (7 pages), 5 min 40 sec (Text + Demo) + 15 sec (Quiz)
+
[[File:Tip.png]]
 +
'''Tips: no tips in this section'''
  
Text and slides path
+
[[File:Important.png]]
 +
'''Warning: no warning in this section'''
  
Quiz:
+
[[File:Info.png]]
1. Which command can be used to append text to filename?
+
'''Exercises in Terminal: no exercises in this section'''
  A: command > filename
 
  B: command >> filename
 
  {| role="presentation" class="wikitable mw-collapsible mw-collapsed"
 
    | <strong>Answer:</strong>
 
    |-
 
    | B
 
    | Explanation: The > operator redirects the output of command into filename. If filename exists already, its contents will be overwritten. The >> operator can redirect the output of command into filename as well, except that if filename exists, the new data are appended instead of overwritten.
 
    |}
 
  
2. How do I find all files containing specific text on Linux?
+
{{example box| Solve the following system. }}
    HINT: use grep command
 
    {| role="presentation" class="wikitable mw-collapsible mw-collapsed"
 
    | <strong>Answer:</strong>
 
    |-
 
    |
 
      grep -rnw '/path/to/somewhere/' -e 'pattern'
 
            -r or -R is recursive.
 
            -n is line number.
 
            -w stands for match the whole word.
 
            -l (lower-case L) can be added to just give the file name of matching files.
 
    |}
 
 
 
Exercises in Terminal (slide 65):
 
1. Create a file using cat (some filename) and write some text in it as below. than use grep to find and display the line number and the line with the word Alan in the file.
 
        the best way to predict
 
        the future is to invent it
 
        –  Alan Kay
 
    {| role="presentation" class="wikitable mw-collapsible mw-collapsed"
 
    | <strong>Answer:</strong>
 
    |-
 
    |
 
      $ cat > quote.txt <<"EOF" \ > the best way to predict \ > the future is to invent it
 
      >  - Alan Kay
 
      > EOF
 
      EOF mean end of file. Press enter to get a new line while writing text. With cat > filename you write the file content in the file quote.txt.
 
  
      Further use grep as below
+
{{Note|Again, it may be true}}
      $ grep -in alan quote.txt
 
      3: - Alan Kay
 
      grep command option -
 
            - i to ignore case distinctions, so that characters that differ only in case match each other.
 
            - n for line number   
 
    |}
 
  
=== Processes and permissions === <!--T:8-->
+
=== Quizes ===
  
Video: Slide 67 - 88 (22 pages), 7 min 40 sec (Text + Demo)
+
<quiz>
 +
{Bulgaria and Rumania joined the
 +
European Union in 2007.
 +
|type="()"}
 +
+ TRUE.
 +
- FALSE.
 +
</quiz>
  
Text and slides path 
+
{| border=0 cellspacing=0 cellpadding=5|| style="width:700px"
 +
| bgcolor=#ccf |
 +
<quiz display=simple>
 +
{Complete the text from the Wikipedia article on [[w:Aristotle|Aristotle]].
 +
|type="{}"}
 +
<big>'''Early Years:'''</big>
 +
Aristotle was born in { Stageira|stageira _8 } in Chalcidice. His parents were
 +
{ Phaestis|phaestis _8 } and { Nicomachus|nicomachus _10 }, who became physician
 +
to King Amyntas of Macedon.
  
Quiz:
+
Aristotle was educated as a member of the aristocracy. At about the age of
1. Which command can prevent other users not in your group from writing to input.dat?
+
{ eighteen|18 _8}, he went to { Athens|athens _6 } to continue his education
  A: chmod u-w input.dat
+
at { Plato|pluto _5 }'s Academy.
  B: chmod o-w input.dat
+
<br>
  C: chmod g-w input.dat
 
  {| role="presentation" class="wikitable mw-collapsible mw-collapsed"
 
    | <strong>Answer:</strong>
 
    |-
 
    | B
 
    | Explanation: The chmod command changes file permission.  
 
            u represents the user who owns the file.
 
            g means other users in your group.
 
            o stands for other users not in your group.
 
            -w means to remove the write permission.
 
      Therefore B is the correct answer.
 
    |}
 
  
Exercises in Terminal (slide 89):
+
<big>'''Later Years:'''</big>
1. Create an empty file, make it read-only, make it executable.
+
Aristotle remained at the Academy for nearly twenty years, not leaving until
  {| role="presentation" class="wikitable mw-collapsible mw-collapsed"
+
after Plato's death in { 347 _3 } BC.
    | <strong>Answer:</strong>
+
</quiz>
    |-
+
|}
    |  
 
      Create an empty file: touch file.txt.
 
      make it read-only: chmod a-w file.txt; chmod a-x file.txt; chmod a+r file.txt.
 
      make it executable: chmod a+x file.txt.
 
  
      Explanation: The touch command can be used to create an empty file. In this example it is file.txt.
+
Select only one correct answer and no incorrect answers.
          chmod a-w file.txt; chmod a-x file.txt; chmod a+r file.txt means to execute the three commands subsequently.
 
          chmod a-w file.txt removes the write permission for all users.
 
          chmod a-x file.txt removes the executable permission for all users.
 
          chmod a+r file.txt adds the read permission for all users.
 
          chmod a+x file.txt makes file.txt executable for all users.
 
    |}
 
  
2. Start a process (e.g. sleep 10m)
+
'''Type 1'''
  {| role="presentation" class="wikitable mw-collapsible mw-collapsed"
+
{{Question_Temp|box1|title=What kind of fish are these?|collapsed=yes}}
    | <strong>Answer:</strong>
+
{{Question_Temp|box2|title=How many HPC center's are participating within the scope of #HPC.NRW project?}}
    |-
+
{{Question_Temp|box3|title=How many HPC center's are participating within the scope of #HPC.NRW project?}}
    |
+
{{Question_Temp|box4|title=What kind of fish are these?|collapsed=yes}}
      Use a second console to look at it in top.
 
      Kill it.
 
      Hint:
 
        To kill the started process (e.g. sleep 10m):
 
        1. Go to the terminal that started the process.
 
        2. Press Ctrl-C to kill it.
 
    |}
 
  
3. Start a process, bring it into background/foreground.
+
'''Type 2'''
  {| role="presentation" class="wikitable mw-collapsible mw-collapsed"
+
<div class="toccolours mw-collapsible mw-collapsed" style="width:1000px; overflow:auto;">
    | <strong>Hint:</strong>
+
<div style="font-weight:bold;line-height:1.6;"> What kind of fish are these?</div>
    |-
+
<div class="mw-collapsible-content">
    |
+
<quiz display=simple>
      To bring a process to background:
+
{<youtube>https://www.youtube.com/watch?v=DvjeIqkFMaE</youtube>
        Press Ctrl-Z (pause the process).
+
| type="()" }
        Type bg (bring it to background).
+
+ Herring
      To bring a process to foreground:
+
||This is many Herring swimming in uniform formation in the Bearing Sea by the light of the silvery moon.  This swarm was photographed by the great artic explorer who fell overboard in 1887 with his camera and took this flash picture of the fish of the sea.
        Type fg (bring it to foreground).
+
- Salmon
    |}
+
- Tunafish
 +
- Goldfish
 +
</quiz>
 +
</div></div>
  
  
=== The vim text editor === <!--T:8-->
+
'''Type 3'''
 +
<quiz display=simple>
 +
{<youtube>https://www.youtube.com/watch?v=DvjeIqkFMaE</youtube>
 +
What kind of fish are these?
 +
| type="()" }
 +
+ Herring
 +
||This is many Herring swimming in uniform formation in the Bearing Sea by the light of the silvery moon.  This swarm was photographed by the great artic explorer who fell overboard in 1887 with his camera and took this flash picture of the fish of the sea.
 +
- Salmon
 +
- Tunafish
 +
- Goldfish
  
 +
{How many HPC center's are participating within the scope of #HPC.NRW project?
 +
|type="()"}
 +
+ 12
 +
|| There are 3 Tier-2 centers and 9 Tier-3 centers paticipating.
 +
- 13
 +
|| Check the https://www.dh.nrw/ #HPC.NRW website and count correctly
 +
- 3
 +
|| Are you for real?
 +
- N/A
 +
|| Thats impossible as otherwise we won't be having this conversation.
 +
</quiz>
  
Video: Slide 91 - 99 (9 pages), 5 min 0 sec (Text + Demo) + 15 sec (Quiz)
+
'''Type 4'''
  
Text and slides path
+
Answer A: The no of HPC center's are:
 +
{| role="presentation" class="wikitable mw-collapsible mw-collapsed"
 +
| <strong>#HPC.NRW</strong>
 +
|-
 +
| There are 3 Tier-2 centers and 9 Tier-3 centers paticipating.
 +
|}
  
Quiz:
+
<div class="toccolours mw-collapsible mw-collapsed" style="width:400px; overflow:auto;" data-expandtext="Expand" data-collapsetext="Collapse">
1. How to enter the insert mode of vim ?
+
<div style="font-weight:bold;line-height:1.6;">#HPC.NRW</div>
  A: press <code>enter</code> key
+
<div class="mw-collapsible-content">
  B: press <code>i</code> key
+
There are 3 Tier-2 centers and 9 Tier-3 centers paticipating.  
  C: press <code>Esc</code> key
+
</div></div>
  {| role="presentation" class="wikitable mw-collapsible mw-collapsed"
 
    | <strong>Answer:</strong>
 
    |-
 
    | B
 
    | Explanation: If you are not in the insert mode, the <code>i</code> key means insert and by pressing it you can enter the insert mode. On the other hand, the <code>Esc</code> key brings you out of the insert mode. The behavior of the <code>enter</code> key depends on in which mode of vim you are. If you are in the normal mode, you navigate to the next line. If you are in the insert mode already, you start a new line.
 
    |}
 
  
2. How would you open a file in read-only mode using the vim editor ?
+
  A sample question to be used for quiz?
  Hint: In terminal <code>man vim</code>
+
  A. option a
  {| role="presentation" class="wikitable mw-collapsible mw-collapsed"
+
  B. option b
    | <strong>Answer:</strong>
+
  C. option c
    |-
+
  {| role="presentation" class="wikitable mw-collapsible mw-collapsed"
    | <code>$ vim -R filename</code>
+
  | <strong>Answer</strong>
    | 
+
  |-
    |}
+
  |  
 +
    B
 +
    Explanation -  
 +
        1. ......
 +
        2. ......
 +
  |}
  
 +
  A sample question to be used for quiz?
 +
  A. option a
 +
  B. option b
 +
  C. option c
  
   Tips-If you forget which mode you are in while using vim, just keep pressing Esc.
+
   <div class="toccolours mw-collapsible mw-collapsed" style="width:400px; overflow:auto;" data-expandtext="Expand" data-collapsetext="Collapse">
 +
  <div style="font-weight:bold;line-height:1.6;">Answer</div>
 +
  <div class="mw-collapsible-content">
 +
    B
 +
    Explanation -
 +
        1. ......
 +
        2. ......
 +
  </div></div>
  
 +
{{Collapse|1=Discussion text to be put into box.|float=left|width=30em}}
  
Exercises in Terminal (slide 100):
+
'''Example Code:'''
1.  Create a vim file and write some text in it with insert (pressing <code>i</code>) and than undo and redo the changes.
 
  {| role="presentation" class="wikitable mw-collapsible mw-collapsed"
 
    | <strong>Answer:</strong>
 
    |-
 
    |
 
      <code>$ vim test.txt</code>
 
      In <code>vim</code> editor press <code>i</code> to insert text and write few lines.
 
      Press <code>Esc</code> than press <code>u</code> (for undo) after that press <code>ctrl + r</code> on keyboard for redo.
 
        - <code>u</code>: undo last change (can be repeated to undo preceding commands).
 
        - <code>Ctrl-r</code>: Redo changes which were undone (undo the undos).
 
    |}
 
  
=== Shell scripting, environment variables === <!--T:8-->
+
<syntaxhighlight lang="c">
 +
for(int i=0; i<4; i++){
 +
    dosomething();
 +
}
 +
</syntaxhighlight>
  
 +
<syntaxhighlight lang="bash">
 +
STR="HELLO WORLD!"
 +
echo ${STR,}  #=> "hELLO WORLD!" (lowercase 1st letter)
 +
echo ${STR,,}  #=> "hello world!" (all lowercase)
  
Video: Slide 102 - 114 (13 pages), 7 min 0 sec (Text + Demo)
+
STR="hello world!"
 +
echo ${STR^}  #=> "Hello world!" (uppercase 1st letter)
 +
echo ${STR^^}  #=> "HELLO WORLD!" (all uppercase)
 +
</syntaxhighlight>
  
Text and Slides
+
'''Example Table '''
 +
{| class="wikitable" style=""
 +
!colspan="2" | Linux ([[Debian]]) || colspan="2"| Windows ([[10]])
 +
|-
 +
! Pros || Cons || Pros || Cons
 +
|-
 +
| Linux is better || No cons || Looks colourful || will cost money
 +
|-
 +
| Linux || No cons || windows || slow
 +
|-
 +
|  Linux || No cons || windows | windows down
 +
| slow to start with
 +
|-
 +
|  || || complicated start-up
 +
|}
  
Quiz:
+
{{information table
1. Which bash command below assigns <code>"value"</code> to variable <code>var</code>?
+
|description= table to use
  A: <code>var="value"</code>
+
|date={{Hpccalendar}}
  B: <code>var = "value"</code>
+
|source= '''HPC.NRW'''
  C: <code>var=="value"</code>
+
|author= '''HPC.NRW'''
  {| role="presentation" class="wikitable mw-collapsible mw-collapsed"
+
|permission=no
    | <strong>Answer:</strong>
+
|other_versions= no
    |-
+
|license-information-permission=no
    |    A
+
}}
    | Explanation: The space character in bash is important. To assign value to a variable, there must not be any space characters in the assignment. Therefore, A is correct. B results in a bash syntax error. C assigns the value <code>=value</code> to variable <code>var</code>. The first <code>=</code> sign means assignment. The second <code>=</code> sign is part of the value. The two double-quotes around <code>value</code> state that <code>value</code> is a character string.
 
    |}
 
  
Exercises in Terminal (slides 115 - 116) and solution (slide 117):
+
==Graphs==
1. a. Write a script that
 
    b. Prints an environment variable
 
    c. Saves the output of the date command to a variable
 
    d. Sleeps briefly
 
    e. Prints the new and old date and time
 
  {| role="presentation" class="wikitable mw-collapsible mw-collapsed"
 
    | <strong>Answer:</strong>
 
    |-
 
    |
 
      One possible way to write the script is
 
      <syntaxhighlight lang="c">
 
      #!/bin/bash
 
  
       echo "I am $USER, my home directory is $HOME"
+
What is your role? Show with a Piechart
 +
{{Graph:Piechart|legend=Roles|radius=75|innerradius=45|values= [
 +
      {"x": "Bachelor/Master student (18%)","y": 0.18},
 +
      {"x": "PhD student (43%)","y": 0.43},
 +
      {"x": "Postdoc/Senior researcher (29%)","y": 0.29},
 +
       {"x": "Professor (3%)","y": 0.03},
 +
      {"x": "Other (7%)","y": 0.07}
 +
    ]|rangeliteral={{ColourScheme3}}
 +
}}
  
      olddate=$(date)
+
In which field are you working? Show with a Barchart
      sleep 10s
+
{{Graph:Barchart|width=320|height=200|color="rgb(102,138,255)"|values= [
      echo "old date: ${olddate}"
+
        {"x": "Architecture",  "y": 0.00},
      echo "new date: $(date)"
+
        {"x": "Engineering",  "y": 0.28},
      </syntaxhighlight>
+
        {"x": "Life sciences",  "y": 0.17},
 +
        {"x": "Math/Computer science",  "y": 0.24},
 +
        {"x": "Medicine",  "y": 0.03},
 +
        {"x": "Natural sciences",  "y": 0.47},
 +
        {"x": "Social sciences",  "y": 0.06},
 +
        {"x": "Other",  "y": 0.05}
 +
]
 +
}}
  
       Explanation:
+
How important are the following programming languages for your work? Show with a Piechart
        <code>#!/bin/bash</code>: the shebang line for bash script
+
{|
        <code>echo "I am $USER, my home directory is $HOME"</code>: the variables <code>$USER</code> and <code>$HOME</code> are your username and home directory, respectively. This line prints a sentence embedded with your username and home directory.
+
|style="width:340px;display:inline-block;"|{{Graph:Piechart|legend=Aachen|radius=60|innerradius=0|values= [
        <code>olddate=$(date)</code> assigns the output of the date command to the variable olddate as a string.
+
      {"x": "Physik (24)","y": 13.71},
        <code>sleep 10s</code> puts the terminal into idle for 10 seconds.
+
      {"x": "Informatik, System- und Elektrotechnik (56)","y": 32},
        <code>echo "old date: ${olddate}"</code> prints the previously saved date in the olddate variable. The form of <code>${olddate}</code> is for using (or referencing) this variable.
+
      {"x": "Chemie (21)","y": 12},
        <code>echo "new date: $(date)"</code> prints the current date, in which the output of the command date will take the place of <code>$(date)</code>.
+
      {"x": "Biologie (6)","y": 3.43},
    |}
+
      {"x": "Maschinenbau  und  Wirtschaftsingenieurwesen (26)","y": 14.86},
 +
      {"x": "Wärme- und Verfahrenstechnik (18)","y": 10.29}, 
 +
      {"x": "Mathematik (2)","y": 1.14},
 +
      {"x": "Geowissenschaften (5)","y": 2.86},
 +
      {"x": "Materialwissenschaft und Werkstofftechnik (9)","y": 5.14},
 +
      {"x": "Medizin (3)","y": 1.71},
 +
      {"x": "Geisteswissenschaften (1)","y": 0.57},
 +
      {"x": "Bauingenieurwesen und Architektur (1)","y": 0.57}
 +
    ]|rangeliteral={{ColourScheme1}}
 +
}}
 +
|style="width:420px;display:inline-block;"|{{Graph:Piechart|legend=Paderborn|radius=60|innerradius=0|values= [
 +
       {"x": "Physik (9)","y": 15.52},
 +
      {"x": "Informatik, System- und Elektrotechnik (24)","y": 41.38},
 +
      {"x": "Chemie (11)","y": 18.97},
 +
      {"x": "Maschinenbau  und  Wirtschaftsingenieurwesen (5)","y": 8.62},
 +
      {"x": "Wärme- und Verfahrenstechnik (5)","y": 8.62}, 
 +
      {"x": "Mathematik (2)","y": 3.45},
 +
      {"x": "Materialwissenschaft und Werkstofftechnik (1)","y": 1.72},
 +
      {"x": "Sozial-  und  Verhaltenswissenschafte (1)","y": 1.72},
 +
    ]|rangeliteral={{ColourScheme1}}
 +
}}
 +
|style="width:420px;display:inline-block;"|{{Graph:Piechart|legend=Fortran|radius=50|innerradius=0|values= [
 +
      {"x": "Not important (50.29%)","y": 50.29},
 +
      {"x": "Not that important (6.86%)","y": 6.86},
 +
      {"x": "Neutral (11.43%)","y": 11.43},
 +
      {"x": "Important (8%)","y": 8},
 +
      {"x": "Very important (23.43%)","y": 23.43}
 +
    ]|rangeliteral={{ColourScheme3}}
 +
}}
 +
|-
 +
|style="width:340px;display:inline-block;"|{{Graph:Piechart|legend=Java|radius=50|innerradius=0|values= [
 +
      {"x": "Not important (60.59%)","y": 60.59},
 +
      {"x": "Not that important (10%)","y": 10},
 +
      {"x": "Neutral (15.29%)","y": 15.29},
 +
      {"x": "Important (2.94%)","y": 2.94},
 +
      {"x": "Very important (11.18%)","y": 11.18}
 +
    ]|rangeliteral={{ColourScheme4}}
 +
}}
 +
|style="width:340px;display:inline-block;"|{{Graph:Piechart|legend=Julia|radius=50|innerradius=0|values= [
 +
      {"x": "Not important (76.33%)","y": 76.33},
 +
      {"x": "Not that important (7.69%)","y": 7.69},
 +
      {"x": "Neutral (7.1%)","y": 7.1},
 +
      {"x": "Important (3.55%)","y": 3.55},
 +
      {"x": "Very important (5.33%)","y": 5.33}
 +
    ]|rangeliteral={{ColourScheme5}}
 +
}}
 +
|style="width:340px;display:inline-block;"|{{Graph:Piechart|legend=Matlab|radius=50|innerradius=0|values= [
 +
      {"x": "Not important (41.9%)","y": 41.9},
 +
      {"x": "Not that important (6.7%)","y": 6.7},
 +
      {"x": "Neutral (12.85%)","y": 12.85},
 +
      {"x": "Important (12.29%)","y": 12.29},
 +
      {"x": "Very important (26.26%)","y": 26.26}
 +
    ]|rangeliteral={{ColourScheme6}}
 +
}}
 +
|-
 +
|style="width:340px;display:inline-block;"|{{Graph:Piechart|legend=OpenCL|radius=50|innerradius=0|values= [
 +
      {"x": "Not important (69.94%)","y": 69.94},
 +
      {"x": "Not that important (9.82%)","y": 9.82},
 +
      {"x": "Neutral (15.34%)","y": 15.34},
 +
      {"x": "Important (1.84%)","y": 1.84},
 +
      {"x": "Very important (3.07%)","y": 3.07}
 +
    ]|rangeliteral={{ColourScheme1}}
 +
}}
 +
|style="width:340px;display:inline-block;"|{{Graph:Piechart|legend=Python|radius=50|innerradius=0|values= [
 +
      {"x": "Not important (3.23%)","y": 3.23},
 +
      {"x": "Not that important (5.38%)","y": 5.38},
 +
      {"x": "Neutral (8.6%)","y": 8.6},
 +
      {"x": "Important (16.67%)","y": 16.67},
 +
      {"x": "Very important (66.13%)","y": 66.13}
 +
    ]|rangeliteral={{ColourScheme2}}
 +
}}
 +
|style="width:340px;display:inline-block;"|{{Graph:Piechart|legend=R|radius=50|innerradius=0|values= [
 +
      {"x": "Not important (43.6%)","y": 43.6},
 +
      {"x": "Not that important (11.05%)","y": 11.05},
 +
      {"x": "Neutral (12.79%)","y": 12.79},
 +
      {"x": "Important (15.12%)","y": 15.12},
 +
      {"x": "Very important (17.44%)","y": 17.44}
 +
    ]|rangeliteral={{ColourScheme3}}
 +
}}
 +
|-
 +
|style="width:340px;display:inline-block;"|{{Graph:Piechart|legend=Other|radius=50|innerradius=0|values= [
 +
      {"x": "Not important (65.67%)","y": 65.67},
 +
      {"x": "Not that important (2.99%)","y": 2.99},
 +
      {"x": "Neutral (23.13%)","y": 23.13},
 +
      {"x": "Important (1.49%)","y": 1.49},
 +
      {"x": "Very important (6.72%)","y": 6.72}
 +
    ]|rangeliteral={{ColourScheme4}}
 +
}}
 +
|}

Latest revision as of 17:28, 13 October 2020

Introduction text here.

Video

HPC.NRW
HPC.NRW
table name
Kontakt RWTH Aachen
Bundesland Nord Rhein Wesfallen
Beginn 2019
Ende 2021
activities
AP2 Arbeitspaket 2
AP3 Arbeitspaket 3
AP4 Arbeitspaket 4
Institutes 13
- ***
- ***
- ***
- ***
- ***






























Template


THE EVENT FOR HIGH PERFORMANCE COMPUTING, MACHINE LEARNING AND DATA ANALYTICS

:en:Wikipedia:Manual of Style/Layout


Warning:  no warning in this section


Info:  no tips in this section


Tip.png Tips: no tips in this section

Important.png Warning: no warning in this section

Info.png Exercises in Terminal: no exercises in this section

Example
Example:
Solve the following system. 

Note: Again, it may be true

Quizes

  

Bulgaria and Rumania joined the European Union in 2007.

TRUE.
FALSE.


Complete the text from the Wikipedia article on Aristotle.

Early Years:
Aristotle was born in

in Chalcidice. His parents were

and

, who became physician
to King Amyntas of Macedon.
Aristotle was educated as a member of the aristocracy. At about the age of

, he went to

to continue his education
at

's Academy.

Later Years:
Aristotle remained at the Academy for nearly twenty years, not leaving until
after Plato's death in

BC.

Select only one correct answer and no incorrect answers.

Type 1


How many HPC center's are participating within the scope of #HPC.NRW project? (edit)

12
13
3
N/A



How many HPC center's are participating within the scope of #HPC.NRW project? (edit)



Type 2

What kind of fish are these?

Herring
Salmon
Tunafish
Goldfish


Type 3

1

What kind of fish are these?

Herring
Salmon
Tunafish
Goldfish

2 How many HPC center's are participating within the scope of #HPC.NRW project?

12
13
3
N/A


Type 4

Answer A: The no of HPC center's are:

#HPC.NRW

There are 3 Tier-2 centers and 9 Tier-3 centers paticipating.

 A sample question to be used for quiz?
 A. option a
 B. option b
 C. option c
 A sample question to be used for quiz?
 A. option a
 B. option b
 C. option c
Answer
    B
    Explanation - 
       1. ......
       2. ......

Example Code:

for(int i=0; i<4; i++){ 
    dosomething();
}
STR="HELLO WORLD!"
echo ${STR,}   #=> "hELLO WORLD!" (lowercase 1st letter)
echo ${STR,,}  #=> "hello world!" (all lowercase)

STR="hello world!"
echo ${STR^}   #=> "Hello world!" (uppercase 1st letter)
echo ${STR^^}  #=> "HELLO WORLD!" (all uppercase)

Example Table

Linux (Debian) Windows (10)
Pros Cons Pros Cons
Linux is better No cons Looks colourful will cost money
Linux No cons windows slow
Linux No cons windows down slow to start with
complicated start-up


Description table to use
Date
File source HPC.NRW
Author HPC.NRW
license-information-permission
no
Other Versions

no

Graphs

What is your role? Show with a Piechart

In which field are you working? Show with a Barchart

How important are the following programming languages for your work? Show with a Piechart