Difference between revisions of "Introduction to Linux in HPC/Linux in HPC"
Introduction to Linux in HPC/Linux in HPC
Jump to navigation
Jump to search
(Created page with "__TOC__ === Video === <!--T:5--> <youtube width="600" height="400" right>IfD9IPixgpo</youtube> [https://git-ce.rwth-aachen.de/hpc.nrw/ap2/tutorials/linux/-/blob/master/Slid...") |
|||
(22 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | [[Category:Tutorials]] | ||
+ | {{DISPLAYTITLE:<span style="position:absolute; top:-9999px;">Introduction to Linux in HPC/</span>Linux in HPC}} | ||
+ | |||
__TOC__ | __TOC__ | ||
+ | |||
+ | {{Infobox_linux_introduction}} | ||
+ | |||
=== Video === <!--T:5--> | === Video === <!--T:5--> | ||
Line 5: | Line 11: | ||
<youtube width="600" height="400" right>IfD9IPixgpo</youtube> | <youtube width="600" height="400" right>IfD9IPixgpo</youtube> | ||
− | |||
− | === | + | === Quiz === <!--T:5--> |
+ | |||
+ | |||
+ | {{hidden begin | ||
+ | |title = 1. Which command you can use to do a secure copy from the Cluster to you local Linux machine?</br> | ||
+ | Hint:<code>man scp</code> | ||
+ | }} | ||
+ | <quiz display=simple> | ||
+ | { | ||
+ | |type="()"} | ||
+ | + Click and submit to see the answer | ||
+ | || <code>scp</code> | ||
+ | || Example usage: <code>scp your_username@remotehost.edu:foobar.txt /some/local/directory</code> | ||
+ | </quiz> | ||
+ | {{hidden end}} | ||
+ | |||
+ | {{hidden begin | ||
+ | |title = 2. Label the interface elements in the terminal: | ||
+ | }} | ||
+ | <quiz display=simple> | ||
+ | { [[File:Linux_hpc_quiz.png|frame|500px]] | ||
+ | | type="()" } | ||
+ | - 1. shell command | ||
+ | - 2. current prompt | ||
+ | - 3. previous prompt | ||
+ | - 4. cursor | ||
+ | - 5. login message | ||
+ | - 6. command output | ||
+ | + Click and submit to get answer | ||
+ | || [[File:Linux_quiz_answer.png|frame|500px]] | ||
+ | </quiz> | ||
+ | {{hidden end}} | ||
+ | |||
+ | |||
+ | {{Warning|mode=info|text= '''Integrated in slides'''}} | ||
+ | |||
+ | {{Warning|mode=warn|text= '''Integrated in slides'''}} | ||
+ | |||
+ | === Exercises for Linux in HPC: GO CP2K GO! === <!--T:5--> | ||
+ | |||
+ | |||
+ | CP2K is a quantum chemistry and solid state physics software package that can perform atomistic simulations of solid state, liquid, molecular, periodic, material, crystal, and biological systems. In this exercise we are going to | ||
+ | 1. create CP2K input files with different cutoff values from a template input for simulation of 32 water molecules in a box using density functional theory (DFT) calculation. | ||
+ | 2 .analyse the simulation output files and summarize some important results. | ||
+ | |||
+ | '''Create CP2K input files''' | ||
+ | The CP2K template input file for simulation of 32 water molecules in a box using DFT calculation can be found in the <code>Ex_LinuxHPC/01_CreateInput</code> directory and the file name is <code>template.inp</code>. | ||
+ | A placeholder <code>__CUTOFF__</code> is set on line 7 of this file. | ||
+ | |||
+ | <code>CUTOFF __CUTOFF__</code> | ||
+ | |||
+ | With smaller cutoff value the DFT calculation runs faster, but the results may be less accurate. With larger cutoff value, on the other hand, the results become more accurate, but the DFT calculation can be slower. | ||
+ | In this exercise we create the CP2K input files based on the template (<code>template.inp</code>) for a range of different cutoff values, e.g. from 250 to 350 with a step size of 10. Please write a bash script that: | ||
+ | 1. creates individual subdirectories for the simulations with different cutoff values | ||
+ | 2. in each subdirectory creates the CP2K input file from the template file with the placeholder <code>__CUTOFF__</code> being replaced by an appropriate cutoff value. The cutoff values are from 250 to 350 and the increment | ||
+ | is 10. e.g. the cutoff in the first input file may have | ||
+ | |||
+ | <code>CUTOFF 250</code> | ||
+ | |||
+ | and the cutoff in the second input file may look like | ||
+ | |||
+ | <code>CUTOFF 260</code> | ||
+ | |||
+ | and so on until <code>CUTOFF 350</code> in the last CP2K input file. | ||
+ | |||
+ | Note: Due to the time limitation we cannot perform all these CP2K simulations during this exercise. However, the example CP2K input (<code>run.inp</code>) and output (<code>run.out</code>) files with different cutoff values can be | ||
+ | found in <code>Ex_LinuxHPC/02_AnalyseOutput</code>. | ||
+ | |||
+ | '''Analyse CP2K output files''' | ||
+ | |||
+ | In the CP2K output file, e.g.<code>run.out</code>, the most important information is printed after every simulation step. For example: | ||
+ | |||
+ | <syntaxhighlight lang="bash"> | ||
+ | ******************************************************************************* | ||
+ | ENSEMBLE TYPE = NVE | ||
+ | STEP NUMBER = 1 | ||
+ | TIME [fs] = 0.500000 | ||
+ | CONSERVED QUANTITY [hartree] = -0.545718508103E+03 | ||
+ | |||
+ | INSTANTANEOUS AVERAGES | ||
+ | CPU TIME [s] = 8.34 8.34 | ||
+ | ENERGY DRIFT PER ATOM [K] = -0.172713513639E+02 0.000000000000E+00 | ||
+ | POTENTIAL ENERGY[hartree] = -0.545966997800E+03 -0.545966997800E+03 | ||
+ | KINETIC ENERGY [hartree] = 0.248489696633E+00 0.248489696633E+00 | ||
+ | TEMPERATURE [K] = 550.644 550.644 | ||
+ | ******************************************************************************* | ||
+ | </syntaxhighlight> | ||
+ | for step number 1 (see the line of <code>STEP NUMBER</code> above). Among these data the most useful results are: | ||
+ | 1. the time step for the simulation on the line beginning with <code>TIME [fs]</code>. | ||
+ | 2. the potential energy for the step on the line beginning with <code>POTENTIAL ENERGY[hartree]</code>. Please note the energy value given in the column of <code>INSTANTANEOUS</code> is relevant. | ||
+ | In this exercise please: | ||
+ | 1. write a script that summarizes and prints the time step and potential energy for the CP2K output file. | ||
+ | 2. create a bash script to loop through all CP2K output files and print the time step and potential energy for each one automatically. | ||
− | + | <div style='text-align: left;float:left;width:33%;'>{{Clickable button|[[Introduction_to_Linux_in_HPC/Beyond_the_cluster | Previous Page]]|color=white}}</div> | |
− | + | <div style='text-align: center;float:left;width:33%;'>{{Clickable button|[[Introduction_to_Linux_in_HPC | Main Menu Page]]|color=white}}</div> | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Latest revision as of 15:34, 3 November 2020
HPC.NRW | |
---|---|
Other HPC Courses | |
1. | Gprof Tutorial |
2. | OpenMP in Small Bites |
Introduction to Linux in HPC | |
1. | Background and History |
2. | The Command Line |
3. | Directory structure |
4. | Files |
5. | Text display and search |
6. | Users and permissions |
7. | Processes |
8. | The vim text editor |
9. | Shell scripting |
10. | Environment variables |
11. | System configuration |
12. | SSH Connections |
13. | SSH: Graphics and File Transfer |
14. | Various tips |
Video
Quiz
1. Which command you can use to do a secure copy from the Cluster to you local Linux machine?
Hint:
Hint:
man scp
2. Label the interface elements in the terminal:
Info: | Integrated in slides |
Warning: | Integrated in slides |
Exercises for Linux in HPC: GO CP2K GO!
CP2K is a quantum chemistry and solid state physics software package that can perform atomistic simulations of solid state, liquid, molecular, periodic, material, crystal, and biological systems. In this exercise we are going to 1. create CP2K input files with different cutoff values from a template input for simulation of 32 water molecules in a box using density functional theory (DFT) calculation. 2 .analyse the simulation output files and summarize some important results. Create CP2K input files The CP2K template input file for simulation of 32 water molecules in a box using DFT calculation can be found in theEx_LinuxHPC/01_CreateInput
directory and the file name istemplate.inp
. A placeholder__CUTOFF__
is set on line 7 of this file.
CUTOFF __CUTOFF__
With smaller cutoff value the DFT calculation runs faster, but the results may be less accurate. With larger cutoff value, on the other hand, the results become more accurate, but the DFT calculation can be slower. In this exercise we create the CP2K input files based on the template (template.inp
) for a range of different cutoff values, e.g. from 250 to 350 with a step size of 10. Please write a bash script that: 1. creates individual subdirectories for the simulations with different cutoff values 2. in each subdirectory creates the CP2K input file from the template file with the placeholder__CUTOFF__
being replaced by an appropriate cutoff value. The cutoff values are from 250 to 350 and the increment is 10. e.g. the cutoff in the first input file may have
CUTOFF 250
and the cutoff in the second input file may look like
CUTOFF 260
and so on until CUTOFF 350
in the last CP2K input file.
Note: Due to the time limitation we cannot perform all these CP2K simulations during this exercise. However, the example CP2K input (run.inp
) and output (run.out
) files with different cutoff values can be found inEx_LinuxHPC/02_AnalyseOutput
.
Analyse CP2K output files
In the CP2K output file, e.g.run.out
, the most important information is printed after every simulation step. For example:
*******************************************************************************
ENSEMBLE TYPE = NVE
STEP NUMBER = 1
TIME [fs] = 0.500000
CONSERVED QUANTITY [hartree] = -0.545718508103E+03
INSTANTANEOUS AVERAGES
CPU TIME [s] = 8.34 8.34
ENERGY DRIFT PER ATOM [K] = -0.172713513639E+02 0.000000000000E+00
POTENTIAL ENERGY[hartree] = -0.545966997800E+03 -0.545966997800E+03
KINETIC ENERGY [hartree] = 0.248489696633E+00 0.248489696633E+00
TEMPERATURE [K] = 550.644 550.644
*******************************************************************************
for step number 1 (see the line ofSTEP NUMBER
above). Among these data the most useful results are: 1. the time step for the simulation on the line beginning withTIME [fs]
. 2. the potential energy for the step on the line beginning withPOTENTIAL ENERGY[hartree]
. Please note the energy value given in the column ofINSTANTANEOUS
is relevant.
In this exercise please: 1. write a script that summarizes and prints the time step and potential energy for the CP2K output file. 2. create a bash script to loop through all CP2K output files and print the time step and potential energy for each one automatically.