https://hpc-wiki.info/hpc/api.php?action=feedcontributions&user=Lech-nieroda-2eba%40uni-koeln.de&feedformat=atomHPC Wiki - User contributions [en]2024-03-28T22:49:35ZUser contributionsMediaWiki 1.35.9https://hpc-wiki.info/hpc/index.php?title=Admin_Guide_Scheduling_Algorithms&diff=4975Admin Guide Scheduling Algorithms2023-02-13T10:54:51Z<p>Lech-nieroda-2eba@uni-koeln.de: /* Backfilling Scheduler */</p>
<hr />
<div>[[Category:HPC-Admin|Scheduling Algorithms]]<nowiki /><br />
[[Category:HPC.NRW-Best-Practices|Scheduling Algorithms]]<nowiki /><br />
[[Category:Slurm]]<nowiki /><br />
{{DISPLAYTITLE:Scheduling Algorithms (Admin Guide)}}<nowiki /><br />
<br />
Unfortunately, this article is currently only available in German but will be translated soon.<br />
<br />
= Problemstellung =<br />
<br />
SLURM bietet eine Vielzahl an Konfigurationsmöglichkeiten, um auf verschiedene Art und Weise das Schedulen von Jobs zu beeinflussen. Die Anzahl an Parameters ist zunächst einmal etwas überwältigend. Daher sollen diese hier etwas erläutert werden und was in Aachen warum gesetzt wurde.<br />
<br />
= Scheduling Algorithmen =<br />
<br />
== SchedulerType ==<br />
<br />
* sched/builtin - der Standard [https://slurm.schedmd.com/priority_multifactor.html FIFO Scheduler] von SLURM, wobei FIFO hier die Prioritäten meint, als höchste Priorität ist first, niedrigste last<br />
* sched/hold - wie builtin, aber alle neuen Jobs werden auf hold gesetzt, wenn die Datei “/etc/slurm.hold” existiert<br />
* sched/backfill - In Aachen und Köln eingesetzt, da der Scheduler hier versucht Tetris zu spielen, also Lücken aufzufüllen die z.B. “vor” großen Jobs entstehen.<br />
** [https://slurm.schedmd.com/sched_config.html Slurm scheduling Configuration Guide]<br />
<br />
[[File:Scheduler-Tetris.png|500px|Scheduler-Tetris]]<br />
<br />
== SelectType ==<br />
<br />
* select/serial - “No” HPC but HTC, just serial jobs<br />
* select/cray - For sites with a [https://slurm.schedmd.com/cray.html CRAY system]<br />
* select/linear - For BIG Sites, e.g. Research Center Jülich, just node wise scheduling<br />
** pro : Erheblich geringerer Scheduling Aufwand<br />
** contra : Viel Verschnitt, z.B. serielle Jobs auf 48 Core Knoten<br />
* select/cons_tres - ab SLURM 19.05, wird select/cons_res zukünftig ersetzen, auch GPUs sind jetzt consumable resources, keine generic resources mehr<br />
* select/cons_res - CPU und Speicher sind “Consumable Resources”, Rechenknoten können zwischen Jobs geshared werden, das Setup in Aachen<br />
<br />
== Main- und Backfilling-Scheduler ==<br />
<br />
=== Main Scheduler ===<br />
<br />
Selbst wenn der Backfilling Scheduler mittels <code>sched/backfill</code> ausgewählt wird, so verrichtet der "Main Scheduler" immer noch seinen Dienst:<br />
<br />
* sehr schnell mit einfacher Zuweisungslogik, z.B. bei leeren Knoten, Laufzeit höchstens ein paar Sekunden<br />
* scannt nacheinander alle Partitionen und bricht jeweils beim ersten Zuweisungsproblem (Job bleibt im Pending Zustand) einer Partition ab <br />
* analog bei Job Arrays: nach der ersten nicht zuweisbaren Instanz werden keine weiteren Instanzen des Arrays betrachtet<br />
* event-triggered: versucht bei bestimmten events zu schedulen, z.B. direkt nach Job Submit oder nach Job Beendingung (siehe <code>defer</code>) aber kann bestimmte Zeit zwischen Aufrufen warten (siehe <code>sched_min_interval</code>), checkt dabei höchstens <code>default_queue_depth</code> pending Jobs<br />
* interval-triggered: unabhängig von den events wird die gesamte queue (alle pending Jobs) in bestimmten Intervallen (<code>sched_interval</code>) gescannt<br />
* in den logs erkennbar an der Meldung: <code>sched: Allocate JobId=...</code><br />
* wichtige Parameter:<br />
** <code>defer</code>: jobs werden nicht mehr einzeln, direkt nach Submission, sondern später, in Gruppen, zugewiesen. Hilfreich wenn (manchmal) Hunderte von Jobs gleichzeitig submittiert werden. Erhöht Server Responsiveness zum Preis einer geringfügig verschobenen Zuweisung<br />
** <code>sched_min_interval</code>: erzwingt Wartezeit zwischen Aufrufen. Wie bei <code>defer</code> wird damit Responsiveness erhöht. Default: 2us, in Köln: 2sec<br />
** <code>sched_interval</code>: alle pending Jobs werden gescannt, der default von 60sec ist sinnvoll <br />
** <code>default_queue_depth</code>: anzahl pending Jobs die beim trigger-event gecheckt werden, default: 100, in Köln: 300<br />
<br />
=== Backfilling Scheduler ===<br />
<br />
* langsam, umfassende Zuweisungslogik, je nach Config/Jobmix kann die Laufzeit auch Minuten dauern<br />
* kann Jobs mit niedriger Priorität zuweisen, falls dadurch höher priorisierte Jobs nicht beeinflusst werden (das können Top-Nutzer mit niedrigem FairShare ausnutzen indem sie viele sehr kleine Jobs submittieren)<br />
* interval-triggered: läuft im starren Zeitintervall (siehe <code>bf_interval</code>) <br />
* in den logs erkennbar an der Meldung: <code>backfill: Started JobId=...</code><br />
* Parameter können die Laufzeit stark beeinflussen, hier die wichtigen:<br />
** <code>bf_window</code>: Planungshorizont, sollte mindestens so lang wie die längste erlaubte Laufzeit sein (default: 1 Tag, Köln: 30 Tage), je grösser der Horizont desto grösser der Overhead sowie die Laufzeit und entspr. schlechtere Responsiveness<br />
** <code>bf_resolution</code>: Planungsgenauigkeit, bei grossen Planungshorizont muss sie entspr. verringert werden (default: 1 Min, Köln: 30 Min), je ungenauer bzw. grösser, desto bessere Responsiveness<br />
** <code>bf_busy_nodes</code>: weist Jobs den Knoten zu, die bereits belegt sind, um Fragmentierung zu verringern bzw. freie Knoten für die Jobs freizuhalten, die ganze Knoten brauchen<br />
** <code>bf_continue</code>: der Backfiller ist so langsam, dass er manchmal unterbrochen werden muss, in dem Fall fängt er beim nächsten Aufruf wieder von vorn an. Mit dieser Option macht er da weiter wo er aufgehört hat. Vorteil: kein Starving, Nachteil: neue Jobs werden langsamer zugewiesen. Sehr sinnvoller Parameter<br />
** <code>bf_interval</code>: bestimmt die Abstände zw. Aufrufen, sollte ein Erfahrungswert sein, nicht zu niedrig (da schlechte Responsiveness und Starving, da dies zugleich die maximale Laufzeit ist), auch nicht zu hoch (interaktive Jobs warten!), default: 30sec, Köln: 2 Min<br />
** <code>bf_max_job_user</code>: Joblimit per Nutzer um zu vermeiden, dass ein Nutzer das Scheduling einer Iteration dominiert, default: keiner, Köln=30 Jobs<br />
** <code>max_rpc_cnt</code>: wichtig für Responsiveness. Bei <code>max_rpc_cnt</code> aktiven Serverthreads legt der Backfiller eine Pause ein um anderen RPC Anfragen eine Chance zu geben. Ein Erfahrungswert, muss niedrig genug sein damit der Server schnell reagieren kann und hoch genug um zeitnahes Scheduling zu ermöglichen.</div>Lech-nieroda-2eba@uni-koeln.dehttps://hpc-wiki.info/hpc/index.php?title=Admin_Guide_Scheduling_Algorithms&diff=4974Admin Guide Scheduling Algorithms2023-02-13T10:47:50Z<p>Lech-nieroda-2eba@uni-koeln.de: /* Main Scheduler */</p>
<hr />
<div>[[Category:HPC-Admin|Scheduling Algorithms]]<nowiki /><br />
[[Category:HPC.NRW-Best-Practices|Scheduling Algorithms]]<nowiki /><br />
[[Category:Slurm]]<nowiki /><br />
{{DISPLAYTITLE:Scheduling Algorithms (Admin Guide)}}<nowiki /><br />
<br />
Unfortunately, this article is currently only available in German but will be translated soon.<br />
<br />
= Problemstellung =<br />
<br />
SLURM bietet eine Vielzahl an Konfigurationsmöglichkeiten, um auf verschiedene Art und Weise das Schedulen von Jobs zu beeinflussen. Die Anzahl an Parameters ist zunächst einmal etwas überwältigend. Daher sollen diese hier etwas erläutert werden und was in Aachen warum gesetzt wurde.<br />
<br />
= Scheduling Algorithmen =<br />
<br />
== SchedulerType ==<br />
<br />
* sched/builtin - der Standard [https://slurm.schedmd.com/priority_multifactor.html FIFO Scheduler] von SLURM, wobei FIFO hier die Prioritäten meint, als höchste Priorität ist first, niedrigste last<br />
* sched/hold - wie builtin, aber alle neuen Jobs werden auf hold gesetzt, wenn die Datei “/etc/slurm.hold” existiert<br />
* sched/backfill - In Aachen und Köln eingesetzt, da der Scheduler hier versucht Tetris zu spielen, also Lücken aufzufüllen die z.B. “vor” großen Jobs entstehen.<br />
** [https://slurm.schedmd.com/sched_config.html Slurm scheduling Configuration Guide]<br />
<br />
[[File:Scheduler-Tetris.png|500px|Scheduler-Tetris]]<br />
<br />
== SelectType ==<br />
<br />
* select/serial - “No” HPC but HTC, just serial jobs<br />
* select/cray - For sites with a [https://slurm.schedmd.com/cray.html CRAY system]<br />
* select/linear - For BIG Sites, e.g. Research Center Jülich, just node wise scheduling<br />
** pro : Erheblich geringerer Scheduling Aufwand<br />
** contra : Viel Verschnitt, z.B. serielle Jobs auf 48 Core Knoten<br />
* select/cons_tres - ab SLURM 19.05, wird select/cons_res zukünftig ersetzen, auch GPUs sind jetzt consumable resources, keine generic resources mehr<br />
* select/cons_res - CPU und Speicher sind “Consumable Resources”, Rechenknoten können zwischen Jobs geshared werden, das Setup in Aachen<br />
<br />
== Main- und Backfilling-Scheduler ==<br />
<br />
=== Main Scheduler ===<br />
<br />
Selbst wenn der Backfilling Scheduler mittels <code>sched/backfill</code> ausgewählt wird, so verrichtet der "Main Scheduler" immer noch seinen Dienst:<br />
<br />
* sehr schnell mit einfacher Zuweisungslogik, z.B. bei leeren Knoten, Laufzeit höchstens ein paar Sekunden<br />
* scannt nacheinander alle Partitionen und bricht jeweils beim ersten Zuweisungsproblem (Job bleibt im Pending Zustand) einer Partition ab <br />
* analog bei Job Arrays: nach der ersten nicht zuweisbaren Instanz werden keine weiteren Instanzen des Arrays betrachtet<br />
* event-triggered: versucht bei bestimmten events zu schedulen, z.B. direkt nach Job Submit oder nach Job Beendingung (siehe <code>defer</code>) aber kann bestimmte Zeit zwischen Aufrufen warten (siehe <code>sched_min_interval</code>), checkt dabei höchstens <code>default_queue_depth</code> pending Jobs<br />
* interval-triggered: unabhängig von den events wird die gesamte queue (alle pending Jobs) in bestimmten Intervallen (<code>sched_interval</code>) gescannt<br />
* in den logs erkennbar an der Meldung: <code>sched: Allocate JobId=...</code><br />
* wichtige Parameter:<br />
** <code>defer</code>: jobs werden nicht mehr einzeln, direkt nach Submission, sondern später, in Gruppen, zugewiesen. Hilfreich wenn (manchmal) Hunderte von Jobs gleichzeitig submittiert werden. Erhöht Server Responsiveness zum Preis einer geringfügig verschobenen Zuweisung<br />
** <code>sched_min_interval</code>: erzwingt Wartezeit zwischen Aufrufen. Wie bei <code>defer</code> wird damit Responsiveness erhöht. Default: 2us, in Köln: 2sec<br />
** <code>sched_interval</code>: alle pending Jobs werden gescannt, der default von 60sec ist sinnvoll <br />
** <code>default_queue_depth</code>: anzahl pending Jobs die beim trigger-event gecheckt werden, default: 100, in Köln: 300<br />
<br />
=== Backfilling Scheduler ===<br />
<br />
* langsam, umfassende Zuweisungslogik, je nach Config/Jobmix kann die Laufzeit auch Minuten dauern<br />
* kann Jobs mit niedriger Priorität zuweisen, falls dadurch höher priorisierte Jobs nicht beeinflusst werden (das können Top-Nutzer mit niedrigem FairShare ausnutzen indem sie viele sehr kleine Jobs submittieren)<br />
* interval-triggered: läuft im starren Zeitintervall (siehe <code>bf_interval</code>) <br />
* in den logs erkennbar an der Meldung: <code>backfill: Started JobId=...</code><br />
* Parameter können die Laufzeit stark beeinflussen, hier die wichtigen:<br />
** <code>bf_window</code>: Planungshorizont, sollte mindestens so lang wie die längste erlaubte Laufzeit sein (default: 1 Tag, Köln: 30 Tage), je grösser der Horizont desto grösser der Overhead sowie die Laufzeit und entspr. schlechtere Responsiveness<br />
** <code>bf_resolution</code>: Planungsgenauigkeit, bei grossen Planungshorizont muss sie entspr. verringert werden (default: 1 Min, Köln: 30 Min), je ungenauer bzw. grösser, desto bessere Responsiveness<br />
** <code>bf_busy_nodes</code>: weist Jobs den Knoten zu, die bereits belegt sind, um Fragmentierung zu verringern bzw. freie Knoten für die Jobs freizuhalten, die ganze Knoten brauchen<br />
** <code>bf_continue</code>: der Backfiller ist so langsam, dass er manchmal unterbrochen werden muss, in dem Fall fängt er beim nächsten Aufruf wieder von vorn an. Mit dieser Option macht er da weiter wo er aufgehört hat. Vorteil: kein Starving, Nachteil: neue Jobs werden langsamer zugewiesen. Sehr sinnvoller Parameter<br />
** <code>bf_interval</code>: bestimmt die Abstände zw. Aufrufen, sollte ein Erfahrungswert sein, nicht zu niedrig (da schlechte Responsiveness und Starving, da dies zugleich die maximale Laufzeit ist), auch nicht zu hoch (interaktive Jobs warten!), default: 30sec, Köln: 2 Min<br />
** <code>bf_max_job_user</code>: Joblimit per Nutzer um zu vermeiden, dass ein Nutzer das Scheduling einer Iteration dominiert, default: keiner, Köln=30 Jobs<br />
** <code>max_rpc_cnt</code>: wichtig für Responsiveness. Bei <code>max_rpc_cnt</code> aktiven Serverthreads legt der Backfiller eine Pause ein um anderen RPC Anfragen eine Change zu geben. Ein Erfahrungswert, muss niedrig genug sein damit der Server schnell reagieren kann und hoch genug um zeitnahes Scheduling zu ermöglichen.</div>Lech-nieroda-2eba@uni-koeln.dehttps://hpc-wiki.info/hpc/index.php?title=Admin_Guide_Scheduling_Algorithms&diff=4586Admin Guide Scheduling Algorithms2021-05-29T21:33:48Z<p>Lech-nieroda-2eba@uni-koeln.de: /* Main- und Backfilling-Scheduler */</p>
<hr />
<div>[[Category:HPC-Admin|Scheduling Algorithms]]<nowiki /><br />
[[Category:HPC.NRW-Best-Practices|Scheduling Algorithms]]<nowiki /><br />
[[Category:Slurm]]<nowiki /><br />
{{DISPLAYTITLE:Scheduling Algorithms (Admin Guide)}}<nowiki /><br />
<br />
Unfortunately, this article is currently only available in German but will be translated soon.<br />
<br />
= Problemstellung =<br />
<br />
SLURM bietet eine Vielzahl an Konfigurationsmöglichkeiten, um auf verschiedene Art und Weise das Schedulen von Jobs zu beeinflussen. Die Anzahl an Parameters ist zunächst einmal etwas überwältigend. Daher sollen diese hier etwas erläutert werden und was in Aachen warum gesetzt wurde.<br />
<br />
= Scheduling Algorithmen =<br />
<br />
== SchedulerType ==<br />
<br />
* sched/builtin - der Standard [https://slurm.schedmd.com/priority_multifactor.html FIFO Scheduler] von SLURM, wobei FIFO hier die Prioritäten meint, als höchste Priorität ist first, niedrigste last<br />
* sched/hold - wie builtin, aber alle neuen Jobs werden auf hold gesetzt, wenn die Datei “/etc/slurm.hold” existiert<br />
* sched/backfill - In Aachen und Köln eingesetzt, da der Scheduler hier versucht Tetris zu spielen, also Lücken aufzufüllen die z.B. “vor” großen Jobs entstehen.<br />
** [https://slurm.schedmd.com/sched_config.html Slurm scheduling Configuration Guide]<br />
<br />
[[File:Scheduler-Tetris.png|500px|Scheduler-Tetris]]<br />
<br />
== SelectType ==<br />
<br />
* select/serial - “No” HPC but HTC, just serial jobs<br />
* select/cray - For sites with a [https://slurm.schedmd.com/cray.html CRAY system]<br />
* select/linear - For BIG Sites, e.g. Research Center Jülich, just node wise scheduling<br />
** pro : Erheblich geringerer Scheduling Aufwand<br />
** contra : Viel Verschnitt, z.B. serielle Jobs auf 48 Core Knoten<br />
* select/cons_tres - ab SLURM 19.05, wird select/cons_res zukünftig ersetzen, auch GPUs sind jetzt consumable resources, keine generic resources mehr<br />
* select/cons_res - CPU und Speicher sind “Consumable Resources”, Rechenknoten können zwischen Jobs geshared werden, das Setup in Aachen<br />
<br />
== Main- und Backfilling-Scheduler ==<br />
<br />
=== Main Scheduler ===<br />
<br />
Selbst wenn der Backfilling Scheduler mittels <code>sched/backfill</code> ausgewählt wird, so verrichtet der "Main Scheduler" immer noch seinen Dienst:<br />
<br />
* sehr schnell mit einfacher Zuweisungslogik, z.B. bei leeren Knoten, Laufzeit höchstens ein paar Sekunden<br />
* scannt nacheinander alle Partitionen und bricht jeweils beim ersten Zuweisungsproblem (Job bleibt im Pending Zustand) einer Partition ab <br />
* analog bei Job Arrays: nach der ersten nicht zuweisbaren Instanz werden keine weiteren Instanzen des Arrays betrachtet<br />
* event-triggered: versucht bei bestimmten events zu schedulen, z.B. direkt nach Job Submit oder nach Job Beendingung (siehe <code>defer</code>) aber kann bestimmte Zeit zwischen Aufrufen warten (siehe <code>sched_min_interval</code>), checkt dabei höchstens <code>default_queue_depth</code> pending Jobs<br />
* interval-triggered: unabhängig von den events wird die gesamte queue (alle pending Jobs) in bestimmten Intervallen (<code>sched_interval</code>) gescannt<br />
* in den logs erkennbar an der Meldung: <code>sched: Allocate JobId=...</code><br />
* wichtige Parameter:<br />
** <code>defer</code>: jobs werden nicht mehr einzeln, direkt nach Submission, sondern später, in Gruppen, zugewiesen. Hilfreich wenn (manchmal) Hunderte von Jobs gleichzeitig submittiert werden. Erhöht Server Responsiveness zum Preis einer geringfügig verschobenen Zuweisung<br />
** <code>sched_min_interval</code>: erzwingt Wartezeit zwischen Aufrufen. Wie bei <code>defer</code> wird damit Responsiveness erhöht. Default: 2us, in Köln: 30sec<br />
** <code>sched_interval</code>: alle pending Jobs werden gescannt, der default von 60sec ist sinnvoll <br />
** <code>default_queue_depth</code>: anzahl pending Jobs die beim trigger-event gecheckt werden, default: 100, in Köln: 300 <br />
<br />
=== Backfilling Scheduler ===<br />
<br />
* langsam, umfassende Zuweisungslogik, je nach Config/Jobmix kann die Laufzeit auch Minuten dauern<br />
* kann Jobs mit niedriger Priorität zuweisen, falls dadurch höher priorisierte Jobs nicht beeinflusst werden (das können Top-Nutzer mit niedrigem FairShare ausnutzen indem sie viele sehr kleine Jobs submittieren)<br />
* interval-triggered: läuft im starren Zeitintervall (siehe <code>bf_interval</code>) <br />
* in den logs erkennbar an der Meldung: <code>backfill: Started JobId=...</code><br />
* Parameter können die Laufzeit stark beeinflussen, hier die wichtigen:<br />
** <code>bf_window</code>: Planungshorizont, sollte mindestens so lang wie die längste erlaubte Laufzeit sein (default: 1 Tag, Köln: 30 Tage), je grösser der Horizont desto grösser der Overhead sowie die Laufzeit und entspr. schlechtere Responsiveness<br />
** <code>bf_resolution</code>: Planungsgenauigkeit, bei grossen Planungshorizont muss sie entspr. verringert werden (default: 1 Min, Köln: 30 Min), je ungenauer bzw. grösser, desto bessere Responsiveness<br />
** <code>bf_busy_nodes</code>: weist Jobs den Knoten zu, die bereits belegt sind, um Fragmentierung zu verringern bzw. freie Knoten für die Jobs freizuhalten, die ganze Knoten brauchen<br />
** <code>bf_continue</code>: der Backfiller ist so langsam, dass er manchmal unterbrochen werden muss, in dem Fall fängt er beim nächsten Aufruf wieder von vorn an. Mit dieser Option macht er da weiter wo er aufgehört hat. Vorteil: kein Starving, Nachteil: neue Jobs werden langsamer zugewiesen. Sehr sinnvoller Parameter<br />
** <code>bf_interval</code>: bestimmt die Abstände zw. Aufrufen, sollte ein Erfahrungswert sein, nicht zu niedrig (da schlechte Responsiveness und Starving, da dies zugleich die maximale Laufzeit ist), auch nicht zu hoch (interaktive Jobs warten!), default: 30sec, Köln: 2 Min<br />
** <code>bf_max_job_user</code>: Joblimit per Nutzer um zu vermeiden, dass ein Nutzer das Scheduling einer Iteration dominiert, default: keiner, Köln=30 Jobs<br />
** <code>max_rpc_cnt</code>: wichtig für Responsiveness. Bei <code>max_rpc_cnt</code> aktiven Serverthreads legt der Backfiller eine Pause ein um anderen RPC Anfragen eine Change zu geben. Ein Erfahrungswert, muss niedrig genug sein damit der Server schnell reagieren kann und hoch genug um zeitnahes Scheduling zu ermöglichen.</div>Lech-nieroda-2eba@uni-koeln.dehttps://hpc-wiki.info/hpc/index.php?title=Admin_Guide_Scheduling_Algorithms&diff=4585Admin Guide Scheduling Algorithms2021-05-29T21:20:55Z<p>Lech-nieroda-2eba@uni-koeln.de: </p>
<hr />
<div>[[Category:HPC-Admin|Scheduling Algorithms]]<nowiki /><br />
[[Category:HPC.NRW-Best-Practices|Scheduling Algorithms]]<nowiki /><br />
[[Category:Slurm]]<nowiki /><br />
{{DISPLAYTITLE:Scheduling Algorithms (Admin Guide)}}<nowiki /><br />
<br />
Unfortunately, this article is currently only available in German but will be translated soon.<br />
<br />
= Problemstellung =<br />
<br />
SLURM bietet eine Vielzahl an Konfigurationsmöglichkeiten, um auf verschiedene Art und Weise das Schedulen von Jobs zu beeinflussen. Die Anzahl an Parameters ist zunächst einmal etwas überwältigend. Daher sollen diese hier etwas erläutert werden und was in Aachen warum gesetzt wurde.<br />
<br />
= Scheduling Algorithmen =<br />
<br />
== SchedulerType ==<br />
<br />
* sched/builtin - der Standard [https://slurm.schedmd.com/priority_multifactor.html FIFO Scheduler] von SLURM, wobei FIFO hier die Prioritäten meint, als höchste Priorität ist first, niedrigste last<br />
* sched/hold - wie builtin, aber alle neuen Jobs werden auf hold gesetzt, wenn die Datei “/etc/slurm.hold” existiert<br />
* sched/backfill - In Aachen und Köln eingesetzt, da der Scheduler hier versucht Tetris zu spielen, also Lücken aufzufüllen die z.B. “vor” großen Jobs entstehen.<br />
** [https://slurm.schedmd.com/sched_config.html Slurm scheduling Configuration Guide]<br />
<br />
[[File:Scheduler-Tetris.png|500px|Scheduler-Tetris]]<br />
<br />
== SelectType ==<br />
<br />
* select/serial - “No” HPC but HTC, just serial jobs<br />
* select/cray - For sites with a [https://slurm.schedmd.com/cray.html CRAY system]<br />
* select/linear - For BIG Sites, e.g. Research Center Jülich, just node wise scheduling<br />
** pro : Erheblich geringerer Scheduling Aufwand<br />
** contra : Viel Verschnitt, z.B. serielle Jobs auf 48 Core Knoten<br />
* select/cons_tres - ab SLURM 19.05, wird select/cons_res zukünftig ersetzen, auch GPUs sind jetzt consumable resources, keine generic resources mehr<br />
* select/cons_res - CPU und Speicher sind “Consumable Resources”, Rechenknoten können zwischen Jobs geshared werden, das Setup in Aachen<br />
<br />
== Main- und Backfilling-Scheduler ==<br />
<br />
=== Main Scheduler ===<br />
<br />
Selbst wenn der Backfilling Scheduler mittels <code>sched/backfill</code> ausgewählt wird, so verrichtet der "Main Scheduler" immer noch seinen Dienst:<br />
<br />
* sehr schnell mit einfacher Zuweisungslogik, z.B. bei leeren Knoten, Laufzeit höchstens ein paar Sekunden<br />
* scannt nacheinander alle Partitionen und bricht jeweils beim ersten Zuweisungsproblem (Job bleibt im Pending Zustand) einer Partition ab <br />
* analog bei Job Arrays: nach der ersten nicht zuweisbaren Instanz werden keine weiteren Instanzen des Arrays betrachtet<br />
* event-triggered: versucht bei bestimmten events zu schedulen, z.B. direkt nach Job Submit oder nach Job Beendingung (siehe <code>defer</code>) aber kann bestimmte Zeit zwischen Aufrufen warten (siehe <code>sched_min_interval</code>), checkt dabei höchstens <code>default_queue_depth</code> pending Jobs<br />
* interval-triggered: scannt die gesamte queue (alle pending Jobs) in bestimmten Intervallen (<code>sched_interval</code>)<br />
* in den logs erkennbar an der Meldung: <code>sched: Allocate JobId=...</code><br />
* wichtige Parameter:<br />
** <code>defer</code>: jobs werden nicht mehr einzeln, direkt nach Submission, sondern später, in Gruppen, zugewiesen. Hilfreich wenn (manchmal) Hunderte von Jobs gleichzeitig submittiert werden. Erhöht Server Responsiveness zum Preis einer geringfügig verschobenen Zuweisung<br />
** <code>sched_min_interval</code>: erzwingt Wartezeit zwischen Aufrufen. Wie bei <code>defer</code>: wird damit Responsiveness erhöht. Default: 2us, in Köln: 30sec<br />
** <code>sched_interval</code>: alle pending Jobs werden gescannt, der default von 60sec ist sinnvoll <br />
** <code>default_queue_depth</code>: anzahl pending Jobs die beim trigger-event gecheckt werden, default: 100, in Köln: 300 <br />
<br />
=== Backfilling Scheduler ===<br />
<br />
* langsam, umfassende Zuweisungslogik, je nach Config/Jobmix kann die Laufzeit auch Minuten dauern<br />
* kann Jobs mit niedriger Priorität zuweisen, falls dadurch höher priorisierte Jobs nicht beeinflusst werden (das können Top-Nutzer mit "ausgenutztem" FairShare ausnutzen indem sie viele sehr kleine Jobs submittieren)<br />
* interval-triggered: läuft im starren Zeitintervall (siehe <code>bf_interval</code>) <br />
* in den logs erkennbar an der Meldung: <code>backfill: Started JobId=...</code><br />
* Parameter können die Laufzeit stark beeinflussen, hier die wichtigen:<br />
** <code>bf_window</code>: Planungshorizont, sollte mindestens so lang wie die längste erlaubte Laufzeit sein (default: 1 Tag, Köln: 30 Tage), je grösser der Horizont desto grösser der Overhead und schlechtere Responsiveness<br />
** <code>bf_resolution</code>: Planungsgenauigkeit, bei grossen Planungshorizont muss sie entspr. verringert werden (default: 1 Min, Köln: 30 Min), je ungenauer bzw. grösser, desto bessere Responsiveness<br />
** <code>bf_busy_nodes</code>: weise Jobs den Knoten zu, die bereits belegt sind, um Fragmentierung zu verringern bzw. freie Knoten für die Jobs freizuhalten, die ganze Knoten brauchen<br />
** <code>bf_continue</code>: der Backfiller ist so langsam, dass er manchmal unterbrochen werden muss, in dem Fall fängt er beim nächsten Aufruf wieder von vorn an. Mit dieser Option macht er da weiter wo er aufgehört hat. Vorteil: kein Starving, Nachteil: neue Jobs werden langsamer zugewiesen. Sehr sinnvoller Parameter<br />
** <code>bf_interval</code>: bestimmt die Abstände zw. Aufrufen, sollte ein Erfahrungswert sein, nicht zu niedrig (da schlechte Responsiveness und Starving, da dies zugleich die maximale Laufzeit ist), auch nicht zu hoch (interaktive Jobs warten!), default: 30sec, Köln: 2 Min<br />
** <code>bf_max_job_user</code>: Nutzerlimit um zu vermeiden, dass ein Nutzer das Scheduling einer Iteration dominiert, default: keiner, Köln=30 Jobs<br />
** <code>max_rpc_cnt</code>: wichtig für Responsiveness. Bei <code>max_rpc_cnt</code> aktiven Serverthreads legt der Backfiller eine Pause ein um anderen RPC Anfragen eine Change zu geben</div>Lech-nieroda-2eba@uni-koeln.dehttps://hpc-wiki.info/hpc/index.php?title=Admin_Guide_Scheduling_Algorithms&diff=4584Admin Guide Scheduling Algorithms2021-05-29T21:14:03Z<p>Lech-nieroda-2eba@uni-koeln.de: Main- und Backfilling Scheduler hinzugefügt</p>
<hr />
<div>[[Category:HPC-Admin|Scheduling Algorithms]]<nowiki /><br />
[[Category:HPC.NRW-Best-Practices|Scheduling Algorithms]]<nowiki /><br />
[[Category:Slurm]]<nowiki /><br />
{{DISPLAYTITLE:Scheduling Algorithms (Admin Guide)}}<nowiki /><br />
<br />
Unfortunately, this article is currently only available in German but will be translated soon.<br />
<br />
= Problemstellung =<br />
<br />
SLURM bietet eine Vielzahl an Konfigurationsmöglichkeiten, um auf verschiedene Art und Weise das Schedulen von Jobs zu beeinflussen. Die Anzahl an Parameters ist zunächst einmal etwas überwältigend. Daher sollen diese hier etwas erläutert werden und was in Aachen warum gesetzt wurde.<br />
<br />
= Scheduling Algorithmen =<br />
<br />
== SchedulerType ==<br />
<br />
* sched/builtin - der Standard [https://slurm.schedmd.com/priority_multifactor.html FIFO Scheduler] von SLURM, wobei FIFO hier die Prioritäten meint, als höchste Priorität ist first, niedrigste last<br />
* sched/hold - wie builtin, aber alle neuen Jobs werden auf hold gesetzt, wenn die Datei “/etc/slurm.hold” existiert<br />
* sched/backfill - In Aachen und Köln eingesetzt, da der Scheduler hier versucht Tetris zu spielen, also Lücken aufzufüllen die z.B. “vor” großen Jobs entstehen.<br />
** [https://slurm.schedmd.com/sched_config.html Slurm scheduling Configuration Guide]<br />
<br />
[[File:Scheduler-Tetris.png|500px|Scheduler-Tetris]]<br />
<br />
== SelectType ==<br />
<br />
* select/serial - “No” HPC but HTC, just serial jobs<br />
* select/cray - For sites with a [https://slurm.schedmd.com/cray.html CRAY system]<br />
* select/linear - For BIG Sites, e.g. Research Center Jülich, just node wise scheduling<br />
** pro : Erheblich geringerer Scheduling Aufwand<br />
** contra : Viel Verschnitt, z.B. serielle Jobs auf 48 Core Knoten<br />
* select/cons_tres - ab SLURM 19.05, wird select/cons_res zukünftig ersetzen, auch GPUs sind jetzt consumable resources, keine generic resources mehr<br />
* select/cons_res - CPU und Speicher sind “Consumable Resources”, Rechenknoten können zwischen Jobs geshared werden, das Setup in Aachen<br />
<br />
== Main- und Backfilling-Scheduler ==<br />
<br />
=== Main Scheduler ===<br />
<br />
Selbst wenn der Backfilling Scheduler mittels ```sched/backfill``` ausgewählt wird, so verrichtet der "Main Scheduler" immer noch seinen Dienst:<br />
<br />
* sehr schnell mit einfacher Zuweisungslogik, z.B. bei leeren Knoten, Laufzeit höchstens ein paar Sekunden<br />
* scannt nacheinander alle Partitionen und bricht jeweils beim ersten Zuweisungsproblem (Job bleibt im Pending Zustand) einer Partition ab <br />
* analog bei Job Arrays: nach der ersten nicht zuweisbaren Instanz werden keine weiteren Instanzen des Arrays betrachtet<br />
* event-triggered: versucht bei bestimmten events zu schedulen, z.B. direkt nach Job Submit oder nach Job Beendingung (siehe ```defer```) aber kann bestimmte Zeit zwischen Aufrufen warten (siehe ```sched_min_interval```), checkt dabei höchstens ```default_queue_depth``` pending Jobs<br />
* interval-triggered: scannt die gesamte queue (alle pending Jobs) in bestimmten Intervallen (```sched_interval```)<br />
* in den logs erkennbar an der Meldung: ```sched: Allocate JobId=...```<br />
* wichtige Parameter:<br />
** ```defer```: jobs werden nicht mehr einzeln, direkt nach Submission, sondern später, in Gruppen, zugewiesen. Hilfreich wenn (manchmal) Hunderte von Jobs gleichzeitig submittiert werden. Erhöht Server Responsiveness zum Preis einer geringfügig verschobenen Zuweisung<br />
** ```sched_min_interval```: erzwingt Wartezeit zwischen Aufrufen. Wie bei ```defer``` wird damit Responsiveness erhöht. Default: 2us, in Köln: 30sec<br />
** ```sched_interval```: alle pending Jobs werden gescannt, der default von 60sec ist sinnvoll <br />
** ```default_queue_depth```: anzahl pending Jobs die beim trigger-event gecheckt werden, default: 100, in Köln: 300 <br />
<br />
=== Backfilling Scheduler ===<br />
<br />
* langsam, umfassende Zuweisungslogik, je nach Config/Jobmix kann die Laufzeit auch Minuten dauern<br />
* kann Jobs mit niedriger Priorität zuweisen, falls dadurch höher priorisierte Jobs nicht beeinflusst werden (das können Top-Nutzer mit "ausgenutztem" FairShare ausnutzen indem sie viele sehr kleine Jobs submittieren)<br />
* interval-triggered: läuft im starren Zeitintervall (siehe ```bf_interval```) <br />
* in den logs erkennbar an der Meldung: ```backfill: Started JobId=...```<br />
* Parameter können die Laufzeit stark beeinflussen, hier die wichtigen:<br />
** ```bf_window```: Planungshorizont, sollte mindestens so lang wie die längste erlaubte Laufzeit sein (default: 1 Tag, Köln: 30 Tage), je grösser der Horizont desto grösser der Overhead und schlechtere Responsiveness<br />
** ```bf_resolution```: Planungsgenauigkeit, bei grossen Planungshorizont muss sie entspr. verringert werden (default: 1 Min, Köln: 30 Min), je ungenauer bzw. grösser, desto bessere Responsiveness<br />
** ```bf_busy_nodes```: weise Jobs den Knoten zu, die bereits belegt sind, um Fragmentierung zu verringern bzw. freie Knoten für die Jobs freizuhalten, die ganze Knoten brauchen<br />
** ```bf_continue```: der Backfiller ist so langsam, dass er manchmal unterbrochen werden muss, in dem Fall fängt er beim nächsten Aufruf wieder von vorn an. Mit dieser Option macht er da weiter wo er aufgehört hat. Vorteil: kein Starving, Nachteil: neue Jobs werden langsamer zugewiesen. Sehr sinnvoller Parameter<br />
** ```bf_interval```: bestimmt die Abstände zw. Aufrufen, sollte ein Erfahrungswert sein, nicht zu niedrig (da schlechte Responsiveness und Starving, da dies zugleich die maximale Laufzeit ist), auch nicht zu hoch (interaktive Jobs warten!), default: 30sec, Köln: 2 Min<br />
** ```bf_max_job_user```: Nutzerlimit um zu vermeiden, dass ein Nutzer das Scheduling einer Iteration dominiert, default: keiner, Köln=30 Jobs<br />
** ```max_rpc_cnt```: wichtig für Responsiveness. Bei ```max_rpc_cnt``` aktiven Serverthreads legt der Backfiller eine Pause ein um anderen RPC Anfragen eine Change zu geben</div>Lech-nieroda-2eba@uni-koeln.dehttps://hpc-wiki.info/hpc/index.php?title=Introduction_to_Linux_in_HPC/The_vim_text_editor&diff=4322Introduction to Linux in HPC/The vim text editor2020-11-30T12:15:52Z<p>Lech-nieroda-2eba@uni-koeln.de: Slide Referenz entfernt</p>
<hr />
<div>[[Category:Tutorials]]<nowiki /><br />
{{DISPLAYTITLE:<span style="position:absolute; top:-9999px;">Introduction to Linux in HPC/</span>The vim text editor}}<nowiki /><br />
{{Syllabus Introduction to Linux}}<nowiki /><br />
__TOC__<br />
<br />
This part of the Linux tutorials introduces the vim text editor and describes its main features and use cases. A short explanation of the most important commands paired with examples on how to use them allow the user to delve right in. The tutorial demonstrates the basics, like opening/writing files or moving within the text as well as the most often employed tasks like search&replace or copy&paste which makes it interesting to both complete beginners and more intermediate users. The vim text editor's main advantage is that it's present in most unix operational systems, futhermore it's highly configurable and provides an extensive plugin system.<br />
<br />
=== Video === <!--T:5--><br />
<br />
<youtube width="600" height="340" right>QPWdUkgGd3I</youtube><br />
<br />
([[Media:HPC.NRW_Introduction_to_Linux_in_HPC_08_The_vim_Text_Editor.pdf | Slides as pdf]])<br />
<br />
=== Quiz === <!--T:5--> <br />
<br />
{{hidden begin <br />
|title = How many windows does vim use?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- it runs in the console and opens additional windows<br />
|| <br />
- it can start in the console but it requires the X window system and opens additional windows<br />
|| <br />
+ it runs completely inside the console<br />
|| Explanation: <code>vim</code> doesn't require the X window system or any additional windows, it runs completely inside the console.<br />
</quiz><br />
{{hidden end}}<br />
<br />
{{hidden begin <br />
|title = How many modes does vim have?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- it has only one mode <br />
|| <br />
- it has two modes<br />
|| <br />
+ it has at least three modes<br />
|| Explanation: <code>vi</code> has the modes normal, insert and command. In addition, <code>vim</code> hast the modes visual, select und ex-mode, not covered in this tutorial.<br />
</quiz><br />
{{hidden end}}<br />
<br />
{{hidden begin <br />
|title = How to enter the insert mode of <code>vim</code>?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- press <code>enter</code> key<br />
|| <br />
+ press <code>i</code> key<br />
|| 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 enter 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.<br />
- press <code>Esc</code> key<br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
{{hidden begin <br />
|title = How to save a file and exit during normal mode?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- press <code>:q!</code> keys and <code>enter</code><br />
|| <br />
+ press <code>:wq</code> keys and <code>enter</code> or <code>:X</code> keys and <code>enter</code> or <code>ZZ</code> keys<br />
|| Explanation: Any of the pressed key combinations will trigger a save and exit when in normal mode. The sequence <code>:q!</code> would exit without writing the file.<br />
- press <code>Ctrl-x Ctrl-s</code> keys<br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
{{hidden begin <br />
|title = How to copy and paste <code>5</code> entire lines in normal mode?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
+ press <code>5yy</code> keys, move the cursor and press <code>p</code><br />
|| Explanation: commands can be repeated by placing an integer value before them. In this case 5 lines are copied by pressing <code>5yy</code>. The paste command is executed by pressing <code>p</code>, pressing <code>5p</code> would have pasted 25 lines. <br />
- press <code>5yy</code> keys, move the cursor and press <code>5p</code><br />
|| <br />
- press <code>Ctrl-c Ctrl-v</code> keys<br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
{{hidden begin <br />
|title = How to perform a forward search for the pattern <code>foo</code>, afterwards a backward search for the pattern <code>bar</code> in normal mode?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- press <code>/foo</code> and <code>enter</code>, afterwards <code>//bar</code> and <code>enter</code><br />
|| <br />
+ press <code>/foo</code> and <code>enter</code>, afterwards <code>?bar</code> and <code>enter</code><br />
|| Explanation: the described commands will perform a search for a regex pattern, either forward (<code>/</code>) or backward (<code>?</code>), depending on the prefix<br />
- press <code>:f/foo/</code> and <code>enter</code>, afterwards <code>:r/bar/</code> and <code>enter</code><br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
<br />
{{hidden begin <br />
|title = How to search and replace all occurences of the pattern <code>foo</code> with <code>bar</code> in normal mode?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
+ press <code>:s%/foo/bar/g</code> keys and <code>enter</code><br />
|| Explanation: the command <code>:s%/foo/bar/g</code> will search and replace the pattern in the entire file. Without the <code>g</code> modifier, it would search the entire file as well but only the first occurence in each line would be replaced. The <code>c</code> modifier asks for a confirmation each time.<br />
- press <code>:s%/foo/bar/</code> keys and <code>enter</code><br />
|| <br />
- press <code>:sed%/foo/bar/</code> keys and <code>enter</code><br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
<br />
{{hidden begin <br />
|title = How would you open a file in read-only mode using the <code>vim</code> editor? </br><br />
Hint: In terminal <code>man vim</code> <br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- <code>$ vim -r filename</code><br />
||<br />
+ <code>$ vim -R filename</code><br />
|| Explanation: the <code>-R</code> option opens the file read-only. This can be overriden by pressing <code>:w!</code> or <code>:set noro</code><br />
- <code>$ vim -n filename</code><br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
<br />
{{Warning|mode=info|text= '''If you forget in which mode you are in while using vim, just keep pressing Esc.'''}}<br />
<br />
=== Exercises in Terminal === <!--T:5--> <br />
<br />
1. Create a vim file and write some text in it with insert (pressing <code>i</code>) and than undo and redo the changes. <br />
2. Copy (yank) multiple lines and paste them<br />
3. Search for a certain pattern and replace it with another<br />
{| role="presentation" class="wikitable mw-collapsible mw-collapsed"<br />
| <strong>Answer:</strong><br />
|-<br />
| <br />
<code>$ vim test.txt</code> <br />
In <code>vim</code> editor press <code>i</code> to insert text and write few lines.<br />
Press <code>Esc</code> than press <code>u</code> (for undo) after that press <code>ctrl + r</code> on keyboard for redo.<br />
- <code>u</code>: undo last change (can be repeated to undo preceding commands).<br />
- <code>Ctrl-r</code>: Redo changes which were undone (undo the undos).<br />
In order to copy a line press <code>yy</code>, for several lines preclude with the command with a number, e.g. <code>5yy</code>.<br />
For pasting simply press <code>p</code>. <br />
Search & Replace can be executed with the command <code>:s%/foo/bar/g</code>, it will search and replace the pattern <code>foo</code> <br />
and replace it with <code>bar</code> in the entire file. Without the <code>g</code> modifier, it would search the entire file as well but only<br />
the first occurence in each line would be replaced. The <code>c</code> modifier asks for a confirmation each time.<br />
|}<br />
<br />
<br />
{{Tutorial Navigation<br />
| previous = [[Introduction_to_Linux_in_HPC/Processes | Processes ]]<br />
| main = [[Introduction_to_Linux_in_HPC | Overview ]]<br />
| next = [[Introduction_to_Linux_in_HPC/Shell_scripting | Shell Scripting ]]<br />
}}</div>Lech-nieroda-2eba@uni-koeln.dehttps://hpc-wiki.info/hpc/index.php?title=Introduction_to_Linux_in_HPC/The_vim_text_editor&diff=4266Introduction to Linux in HPC/The vim text editor2020-11-26T13:01:17Z<p>Lech-nieroda-2eba@uni-koeln.de: </p>
<hr />
<div>[[Category:Tutorials]]<nowiki /><br />
{{DISPLAYTITLE:<span style="position:absolute; top:-9999px;">Introduction to Linux in HPC/</span>The vim text editor}}<nowiki /><br />
{{Syllabus Introduction to Linux}}<nowiki /><br />
__TOC__<br />
<br />
This part of the Linux tutorials introduces the vim text editor and describes its main features and use cases. A short explanation of the most important commands paired with examples on how to use them allow the user to delve right in. The tutorial demonstrates the basics, like opening/writing files or moving within the text as well as the most often employed tasks like search&replace or copy&paste which makes it interesting to both complete beginners and more intermediate users. The vim text editor's main advantage is that it's present in most unix operational systems, futhermore it's highly configurable and provides an extensive plugin system.<br />
<br />
=== Video === <!--T:5--><br />
<br />
<youtube width="600" height="340" right>QPWdUkgGd3I</youtube><br />
<br />
([[Media:HPC.NRW_Introduction_to_Linux_in_HPC_08_The_vim_Text_Editor.pdf | Slides as pdf]])<br />
<br />
=== Quiz === <!--T:5--> <br />
<br />
{{hidden begin <br />
|title = How many windows does vim use?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- it runs in the console and opens additional windows<br />
|| <br />
- it can start in the console but it requires the X window system and opens additional windows<br />
|| <br />
+ it runs completely inside the console<br />
|| Explanation: <code>vim</code> doesn't require the X window system or any additional windows, it runs completely inside the console.<br />
</quiz><br />
{{hidden end}}<br />
<br />
{{hidden begin <br />
|title = How many modes does vim have?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- it has only one mode <br />
|| <br />
- it has two modes<br />
|| <br />
+ it has at least three modes<br />
|| Explanation: <code>vi</code> has the modes normal, insert and command. In addition, <code>vim</code> hast the modes visual, select und ex-mode, not covered in this tutorial.<br />
</quiz><br />
{{hidden end}}<br />
<br />
{{hidden begin <br />
|title = How to enter the insert mode of <code>vim</code>?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- press <code>enter</code> key<br />
|| <br />
+ press <code>i</code> key<br />
|| 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 enter 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.<br />
- press <code>Esc</code> key<br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
{{hidden begin <br />
|title = How to save a file and exit during normal mode?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- press <code>:q!</code> keys and <code>enter</code><br />
|| <br />
+ press <code>:wq</code> keys and <code>enter</code> or <code>:X</code> keys and <code>enter</code> or <code>ZZ</code> keys<br />
|| Explanation: Any of the pressed key combinations will trigger a save and exit when in normal mode. The sequence <code>:q!</code> would exit without writing the file.<br />
- press <code>Ctrl-x Ctrl-s</code> keys<br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
{{hidden begin <br />
|title = How to copy and paste <code>5</code> entire lines in normal mode?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
+ press <code>5yy</code> keys, move the cursor and press <code>p</code><br />
|| Explanation: commands can be repeated by placing an integer value before them. In this case 5 lines are copied by pressing <code>5yy</code>. The paste command is executed by pressing <code>p</code>, pressing <code>5p</code> would have pasted 25 lines. <br />
- press <code>5yy</code> keys, move the cursor and press <code>5p</code><br />
|| <br />
- press <code>Ctrl-c Ctrl-v</code> keys<br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
{{hidden begin <br />
|title = How to perform a forward search for the pattern <code>foo</code>, afterwards a backward search for the pattern <code>bar</code> in normal mode?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- press <code>/foo</code> and <code>enter</code>, afterwards <code>//bar</code> and <code>enter</code><br />
|| <br />
+ press <code>/foo</code> and <code>enter</code>, afterwards <code>?bar</code> and <code>enter</code><br />
|| Explanation: the described commands will perform a search for a regex pattern, either forward (<code>/</code>) or backward (<code>?</code>), depending on the prefix<br />
- press <code>:f/foo/</code> and <code>enter</code>, afterwards <code>:r/bar/</code> and <code>enter</code><br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
<br />
{{hidden begin <br />
|title = How to search and replace all occurences of the pattern <code>foo</code> with <code>bar</code> in normal mode?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
+ press <code>:s%/foo/bar/g</code> keys and <code>enter</code><br />
|| Explanation: the command <code>:s%/foo/bar/g</code> will search and replace the pattern in the entire file. Without the <code>g</code> modifier, it would search the entire file as well but only the first occurence in each line would be replaced. The <code>c</code> modifier asks for a confirmation each time.<br />
- press <code>:s%/foo/bar/</code> keys and <code>enter</code><br />
|| <br />
- press <code>:sed%/foo/bar/</code> keys and <code>enter</code><br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
<br />
{{hidden begin <br />
|title = How would you open a file in read-only mode using the <code>vim</code> editor? </br><br />
Hint: In terminal <code>man vim</code> <br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- <code>$ vim -r filename</code><br />
||<br />
+ <code>$ vim -R filename</code><br />
|| Explanation: the <code>-R</code> option opens the file read-only. This can be overriden by pressing <code>:w!</code> or <code>:set noro</code><br />
- <code>$ vim -n filename</code><br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
<br />
{{Warning|mode=info|text= '''If you forget in which mode you are in while using vim, just keep pressing Esc.'''}}<br />
<br />
=== Exercises in Terminal (slide 100) === <!--T:5--> <br />
<br />
1. Create a vim file and write some text in it with insert (pressing <code>i</code>) and than undo and redo the changes. <br />
2. Copy (yank) multiple lines and paste them<br />
3. Search for a certain pattern and replace it with another<br />
{| role="presentation" class="wikitable mw-collapsible mw-collapsed"<br />
| <strong>Answer:</strong><br />
|-<br />
| <br />
<code>$ vim test.txt</code> <br />
In <code>vim</code> editor press <code>i</code> to insert text and write few lines.<br />
Press <code>Esc</code> than press <code>u</code> (for undo) after that press <code>ctrl + r</code> on keyboard for redo.<br />
- <code>u</code>: undo last change (can be repeated to undo preceding commands).<br />
- <code>Ctrl-r</code>: Redo changes which were undone (undo the undos).<br />
In order to copy a line press <code>yy</code>, for several lines preclude with the command with a number, e.g. <code>5yy</code>.<br />
For pasting simply press <code>p</code>. <br />
Search & Replace can be executed with the command <code>:s%/foo/bar/g</code>, it will search and replace the pattern <code>foo</code> <br />
and replace it with <code>bar</code> in the entire file. Without the <code>g</code> modifier, it would search the entire file as well but only<br />
the first occurence in each line would be replaced. The <code>c</code> modifier asks for a confirmation each time.<br />
|}<br />
<br />
<br />
{{Tutorial Navigation<br />
| previous = [[Introduction_to_Linux_in_HPC/Processes | Processes ]]<br />
| main = [[Introduction_to_Linux_in_HPC | Overview ]]<br />
| next = [[Introduction_to_Linux_in_HPC/Shell_scripting | Shell Scripting ]]<br />
}}</div>Lech-nieroda-2eba@uni-koeln.dehttps://hpc-wiki.info/hpc/index.php?title=Introduction_to_Linux_in_HPC/The_vim_text_editor&diff=4265Introduction to Linux in HPC/The vim text editor2020-11-26T12:59:44Z<p>Lech-nieroda-2eba@uni-koeln.de: Added some exercises</p>
<hr />
<div>[[Category:Tutorials]]<nowiki /><br />
{{DISPLAYTITLE:<span style="position:absolute; top:-9999px;">Introduction to Linux in HPC/</span>The vim text editor}}<nowiki /><br />
{{Syllabus Introduction to Linux}}<nowiki /><br />
__TOC__<br />
<br />
This part of the Linux tutorials introduces the vim text editor and describes its main features and use cases. A short explanation of the most important commands paired with examples on how to use them allow the user to delve right in. The tutorial demonstrates the basics, like opening/writing files or moving within the text as well as the most often employed tasks like search&replace or copy&paste which makes it interesting to both complete beginners and more intermediate users. The vim text editor's main advantage is that it's present in most unix operational systems, futhermore it's highly configurable and provides an extensive plugin system.<br />
<br />
=== Video === <!--T:5--><br />
<br />
<youtube width="600" height="340" right>QPWdUkgGd3I</youtube><br />
<br />
([[Media:HPC.NRW_Introduction_to_Linux_in_HPC_08_The_vim_Text_Editor.pdf | Slides as pdf]])<br />
<br />
=== Quiz === <!--T:5--> <br />
<br />
{{hidden begin <br />
|title = How many windows does vim use?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- it runs in the console and opens additional windows<br />
|| <br />
- it can start in the console but it requires the X window system and opens additional windows<br />
|| <br />
+ it runs completely inside the console<br />
|| Explanation: <code>vim</code> doesn't require the X window system or any additional windows, it runs completely inside the console.<br />
</quiz><br />
{{hidden end}}<br />
<br />
{{hidden begin <br />
|title = How many modes does vim have?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- it has only one mode <br />
|| <br />
- it has two modes<br />
|| <br />
+ it has at least three modes<br />
|| Explanation: <code>vi</code> has the modes normal, insert and command. In addition, <code>vim</code> hast the modes visual, select und ex-mode, not covered in this tutorial.<br />
</quiz><br />
{{hidden end}}<br />
<br />
{{hidden begin <br />
|title = How to enter the insert mode of <code>vim</code>?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- press <code>enter</code> key<br />
|| <br />
+ press <code>i</code> key<br />
|| 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 enter 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.<br />
- press <code>Esc</code> key<br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
{{hidden begin <br />
|title = How to save a file and exit during normal mode?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- press <code>:q!</code> keys and <code>enter</code><br />
|| <br />
+ press <code>:wq</code> keys and <code>enter</code> or <code>:X</code> keys and <code>enter</code> or <code>ZZ</code> keys<br />
|| Explanation: Any of the pressed key combinations will trigger a save and exit when in normal mode. The sequence <code>:q!</code> would exit without writing the file.<br />
- press <code>Ctrl-x Ctrl-s</code> keys<br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
{{hidden begin <br />
|title = How to copy and paste <code>5</code> entire lines in normal mode?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
+ press <code>5yy</code> keys, move the cursor and press <code>p</code><br />
|| Explanation: commands can be repeated by placing an integer value before them. In this case 5 lines are copied by pressing <code>5yy</code>. The paste command is executed by pressing <code>p</code>, pressing <code>5p</code> would have pasted 25 lines. <br />
- press <code>5yy</code> keys, move the cursor and press <code>5p</code><br />
|| <br />
- press <code>Ctrl-c Ctrl-v</code> keys<br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
{{hidden begin <br />
|title = How to perform a forward search for the pattern <code>foo</code>, afterwards a backward search for the pattern <code>bar</code> in normal mode?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- press <code>/foo</code> and <code>enter</code>, afterwards <code>//bar</code> and <code>enter</code><br />
|| <br />
+ press <code>/foo</code> and <code>enter</code>, afterwards <code>?bar</code> and <code>enter</code><br />
|| Explanation: the described commands will perform a search for a regex pattern, either forward (<code>/</code>) or backward (<code>?</code>), depending on the prefix<br />
- press <code>:f/foo/</code> and <code>enter</code>, afterwards <code>:r/bar/</code> and <code>enter</code><br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
<br />
{{hidden begin <br />
|title = How to search and replace all occurences of the pattern <code>foo</code> with <code>bar</code> in normal mode?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
+ press <code>:s%/foo/bar/g</code> keys and <code>enter</code><br />
|| Explanation: the command <code>:s%/foo/bar/g</code> will search and replace the pattern in the entire file. Without the <code>g</code> modifier, it would search the entire file as well but only the first occurence in each line would be replaced. The <code>c</code> modifier asks for a confirmation each time.<br />
- press <code>:s%/foo/bar/</code> keys and <code>enter</code><br />
|| <br />
- press <code>:sed%/foo/bar/</code> keys and <code>enter</code><br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
<br />
{{hidden begin <br />
|title = How would you open a file in read-only mode using the <code>vim</code> editor? </br><br />
Hint: In terminal <code>man vim</code> <br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- <code>$ vim -r filename</code><br />
||<br />
+ <code>$ vim -R filename</code><br />
|| Explanation: the <code>-R</code> option opens the file read-only. This can be overriden by pressing <code>:w!</code> or <code>:set noro</code><br />
- <code>$ vim -n filename</code><br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
<br />
{{Warning|mode=info|text= '''If you forget in which mode you are in while using vim, just keep pressing Esc.'''}}<br />
<br />
=== Exercises in Terminal (slide 100) === <!--T:5--> <br />
<br />
1. Create a vim file and write some text in it with insert (pressing <code>i</code>) and than undo and redo the changes. <br />
2. Copy (yank) multiple lines and paste them<br />
3. Search for a certain pattern and replace it with another<br />
{| role="presentation" class="wikitable mw-collapsible mw-collapsed"<br />
| <strong>Answer:</strong><br />
|-<br />
| <br />
<code>$ vim test.txt</code> <br />
In <code>vim</code> editor press <code>i</code> to insert text and write few lines.<br />
Press <code>Esc</code> than press <code>u</code> (for undo) after that press <code>ctrl + r</code> on keyboard for redo.<br />
- <code>u</code>: undo last change (can be repeated to undo preceding commands).<br />
- <code>Ctrl-r</code>: Redo changes which were undone (undo the undos).<br />
In order to copy a line press <code>yy</code>, for several lines preclude with the command with a number, e.g. <code>5yy</code>.<br />
For pasting simply press <code>p</code>. <br />
Search & Replace can be executed with the command <code>:s%/foo/bar/g</code>, it will search and replace the pattern <code>foo</code> and replace it with <code>bar</code> in the entire file. Without the <code>g</code> modifier, it would search the entire file as well but only the first occurence in each line would be replaced. The <code>c</code> modifier asks for a confirmation each time.<br />
|}<br />
<br />
<br />
{{Tutorial Navigation<br />
| previous = [[Introduction_to_Linux_in_HPC/Processes | Processes ]]<br />
| main = [[Introduction_to_Linux_in_HPC | Overview ]]<br />
| next = [[Introduction_to_Linux_in_HPC/Shell_scripting | Shell Scripting ]]<br />
}}</div>Lech-nieroda-2eba@uni-koeln.dehttps://hpc-wiki.info/hpc/index.php?title=Introduction_to_Linux_in_HPC/The_vim_text_editor&diff=4259Introduction to Linux in HPC/The vim text editor2020-11-26T10:34:42Z<p>Lech-nieroda-2eba@uni-koeln.de: </p>
<hr />
<div>[[Category:Tutorials]]<nowiki /><br />
{{DISPLAYTITLE:<span style="position:absolute; top:-9999px;">Introduction to Linux in HPC/</span>The vim text editor}}<nowiki /><br />
{{Syllabus Introduction to Linux}}<nowiki /><br />
__TOC__<br />
<br />
This part of the Linux tutorials introduces the vim text editor and describes its main features and use cases. A short explanation of the most important commands paired with examples on how to use them allow the user to delve right in. The tutorial demonstrates the basics, like opening/writing files or moving within the text as well as the most often employed tasks like search&replace or copy&paste which makes it interesting to both complete beginners and more intermediate users. The vim text editor's main advantage is that it's present in most unix operational systems, futhermore it's highly configurable and provides an extensive plugin system.<br />
<br />
=== Video === <!--T:5--><br />
<br />
<youtube width="600" height="340" right>QPWdUkgGd3I</youtube><br />
<br />
([[Media:HPC.NRW_Introduction_to_Linux_in_HPC_08_The_vim_Text_Editor.pdf | Slides as pdf]])<br />
<br />
=== Quiz === <!--T:5--> <br />
<br />
{{hidden begin <br />
|title = How many windows does vim use?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- it runs in the console and opens additional windows<br />
|| <br />
- it can start in the console but it requires the X window system and opens additional windows<br />
|| <br />
+ it runs completely inside the console<br />
|| Explanation: <code>vim</code> doesn't require the X window system or any additional windows, it runs completely inside the console.<br />
</quiz><br />
{{hidden end}}<br />
<br />
{{hidden begin <br />
|title = How many modes does vim have?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- it has only one mode <br />
|| <br />
- it has two modes<br />
|| <br />
+ it has at least three modes<br />
|| Explanation: <code>vi</code> has the modes normal, insert and command. In addition, <code>vim</code> hast the modes visual, select und ex-mode, not covered in this tutorial.<br />
</quiz><br />
{{hidden end}}<br />
<br />
{{hidden begin <br />
|title = How to enter the insert mode of <code>vim</code>?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- press <code>enter</code> key<br />
|| <br />
+ press <code>i</code> key<br />
|| 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 enter 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.<br />
- press <code>Esc</code> key<br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
{{hidden begin <br />
|title = How to save a file and exit during normal mode?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- press <code>:q!</code> keys and <code>enter</code><br />
|| <br />
+ press <code>:wq</code> keys and <code>enter</code> or <code>:X</code> keys and <code>enter</code> or <code>ZZ</code> keys<br />
|| Explanation: Any of the pressed key combinations will trigger a save and exit when in normal mode. The sequence <code>:q!</code> would exit without writing the file.<br />
- press <code>Ctrl-x Ctrl-s</code> keys<br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
{{hidden begin <br />
|title = How to copy and paste <code>5</code> entire lines in normal mode?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
+ press <code>5yy</code> keys, move the cursor and press <code>p</code><br />
|| Explanation: commands can be repeated by placing an integer value before them. In this case 5 lines are copied by pressing <code>5yy</code>. The paste command is executed by pressing <code>p</code>, pressing <code>5p</code> would have pasted 25 lines. <br />
- press <code>5yy</code> keys, move the cursor and press <code>5p</code><br />
|| <br />
- press <code>Ctrl-c Ctrl-v</code> keys<br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
{{hidden begin <br />
|title = How to perform a forward search for the pattern <code>foo</code>, afterwards a backward search for the pattern <code>bar</code> in normal mode?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- press <code>/foo</code> and <code>enter</code>, afterwards <code>//bar</code> and <code>enter</code><br />
|| <br />
+ press <code>/foo</code> and <code>enter</code>, afterwards <code>?bar</code> and <code>enter</code><br />
|| Explanation: the described commands will perform a search for a regex pattern, either forward (<code>/</code>) or backward (<code>?</code>), depending on the prefix<br />
- press <code>:f/foo/</code> and <code>enter</code>, afterwards <code>:r/bar/</code> and <code>enter</code><br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
<br />
{{hidden begin <br />
|title = How to search and replace all occurences of the pattern <code>foo</code> with <code>bar</code> in normal mode?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
+ press <code>:s%/foo/bar/g</code> keys and <code>enter</code><br />
|| Explanation: the command <code>:s%/foo/bar/g</code> will search and replace the pattern in the entire file. Without the <code>g</code> modifier, it would search the entire file as well but only the first occurence in each line would be replaced. The <code>c</code> modifier asks for a confirmation each time.<br />
- press <code>:s%/foo/bar/</code> keys and <code>enter</code><br />
|| <br />
- press <code>:sed%/foo/bar/</code> keys and <code>enter</code><br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
<br />
{{hidden begin <br />
|title = How would you open a file in read-only mode using the <code>vim</code> editor? </br><br />
Hint: In terminal <code>man vim</code> <br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- <code>$ vim -r filename</code><br />
||<br />
+ <code>$ vim -R filename</code><br />
|| Explanation: the <code>-R</code> option opens the file read-only. This can be overriden by pressing <code>:w!</code> or <code>:set noro</code><br />
- <code>$ vim -n filename</code><br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
<br />
{{Warning|mode=info|text= '''If you forget in which mode you are in while using vim, just keep pressing Esc.'''}}<br />
<br />
=== Exercises in Terminal (slide 100) === <!--T:5--> <br />
<br />
1. Create a vim file and write some text in it with insert (pressing <code>i</code>) and than undo and redo the changes. <br />
{| role="presentation" class="wikitable mw-collapsible mw-collapsed"<br />
| <strong>Answer:</strong><br />
|-<br />
| <br />
<code>$ vim test.txt</code> <br />
In <code>vim</code> editor press <code>i</code> to insert text and write few lines.<br />
Press <code>Esc</code> than press <code>u</code> (for undo) after that press <code>ctrl + r</code> on keyboard for redo.<br />
- <code>u</code>: undo last change (can be repeated to undo preceding commands).<br />
- <code>Ctrl-r</code>: Redo changes which were undone (undo the undos).<br />
|}<br />
<br />
<br />
{{Tutorial Navigation<br />
| previous = [[Introduction_to_Linux_in_HPC/Processes | Processes ]]<br />
| main = [[Introduction_to_Linux_in_HPC | Overview ]]<br />
| next = [[Introduction_to_Linux_in_HPC/Shell_scripting | Shell Scripting ]]<br />
}}</div>Lech-nieroda-2eba@uni-koeln.dehttps://hpc-wiki.info/hpc/index.php?title=Introduction_to_Linux_in_HPC/The_vim_text_editor&diff=4258Introduction to Linux in HPC/The vim text editor2020-11-25T18:37:47Z<p>Lech-nieroda-2eba@uni-koeln.de: </p>
<hr />
<div>[[Category:Tutorials]]<nowiki /><br />
{{DISPLAYTITLE:<span style="position:absolute; top:-9999px;">Introduction to Linux in HPC/</span>The vim text editor}}<nowiki /><br />
{{Syllabus Introduction to Linux}}<nowiki /><br />
__TOC__<br />
<br />
This part of the Linux tutorials introduces the vim text editor and describes its main features and use cases. A short explanation of the most important commands paired with examples on how to use them allow the user to delve right in. The tutorial demonstrates the basics, like opening/writing files or moving within the text as well as the most often employed tasks like search&replace or copy&paste which makes it interesting to both complete beginners and more intermediate users. The vim text editor's main advantage is that it's present in most unix operational systems, futhermore it's highly configurable and provides an extensive plugin system.<br />
<br />
=== Video === <!--T:5--><br />
<br />
<youtube width="600" height="340" right>QPWdUkgGd3I</youtube><br />
<br />
([[Media:HPC.NRW_Introduction_to_Linux_in_HPC_08_The_vim_Text_Editor.pdf | Slides as pdf]])<br />
<br />
=== Quiz === <!--T:5--> <br />
<br />
{{hidden begin <br />
|title = How many modes does vim have?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- it has only one mode <br />
|| <br />
- it has two modes<br />
|| <br />
+ it has at least three modes<br />
|| Explanation: <code>vi</code> has the modes normal, insert and command. In addition, <code>vim</code> hast the modes visual, select und ex-mode, not covered in this tutorial.<br />
</quiz><br />
{{hidden end}}<br />
<br />
{{hidden begin <br />
|title = How to enter the insert mode of <code>vim</code>?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- press <code>enter</code> key<br />
|| <br />
+ press <code>i</code> key<br />
|| 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 enter 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.<br />
- press <code>Esc</code> key<br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
{{hidden begin <br />
|title = How to save a file and exit during normal mode?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- press <code>:q!</code> keys and <code>enter</code><br />
|| <br />
+ press <code>:wq</code> keys and <code>enter</code> or <code>:X</code> keys and <code>enter</code> or <code>ZZ</code> keys<br />
|| Explanation: Any of the pressed key combinations will trigger a save and exit when in normal mode. The sequence <code>:q!</code> would exit without writing the file.<br />
- press <code>Ctrl-x Ctrl-s</code> keys<br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
{{hidden begin <br />
|title = How to copy and paste <code>5</code> entire lines in normal mode?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
+ press <code>5yy</code> keys, move the cursor and press <code>p</code><br />
|| Explanation: commands can be repeated by placing an integer value before them. In this case 5 lines are copied by pressing <code>5yy</code>. The paste command is executed by pressing <code>p</code>, pressing <code>5p</code> would have pasted 25 lines. <br />
- press <code>5yy</code> keys, move the cursor and press <code>5p</code><br />
|| <br />
- press <code>Ctrl-c Ctrl-v</code> keys<br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
{{hidden begin <br />
|title = How to perform a forward search for the pattern <code>foo</code>, afterwards a backward search for the pattern <code>bar</code> in normal mode?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- press <code>/foo</code> and <code>enter</code>, afterwards <code>//bar</code> and <code>enter</code><br />
|| <br />
+ press <code>/foo</code> and <code>enter</code>, afterwards <code>?bar</code> and <code>enter</code><br />
|| Explanation: the described commands will perform a search for a regex pattern, either forward (<code>/</code>) or backward (<code>?</code>), depending on the prefix<br />
- press <code>:f/foo/</code> and <code>enter</code>, afterwards <code>:r/bar/</code> and <code>enter</code><br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
<br />
{{hidden begin <br />
|title = How to search and replace all occurences of the pattern <code>foo</code> with <code>bar</code> in normal mode?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
+ press <code>:s%/foo/bar/g</code> keys and <code>enter</code><br />
|| Explanation: the command <code>:s%/foo/bar/g</code> will search and replace the pattern in the entire file. Without the <code>g</code> modifier, it would search the entire file as well but only the first occurence in each line would be replaced. The <code>c</code> modifier asks for a confirmation each time.<br />
- press <code>:s%/foo/bar/</code> keys and <code>enter</code><br />
|| <br />
- press <code>:sed%/foo/bar/</code> keys and <code>enter</code><br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
<br />
{{hidden begin <br />
|title = How would you open a file in read-only mode using the <code>vim</code> editor? </br><br />
Hint: In terminal <code>man vim</code> <br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- <code>$ vim -r filename</code><br />
||<br />
+ <code>$ vim -R filename</code><br />
|| Explanation: the <code>-R</code> opens the file read-only. This can be overriden by pressing <code>:w!</code> or <code>:set noro</code><br />
- <code>$ vim -n filename</code><br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
<br />
{{Warning|mode=info|text= '''If you forget in which mode you are in while using vim, just keep pressing Esc.'''}}<br />
<br />
=== Exercises in Terminal (slide 100) === <!--T:5--> <br />
<br />
1. Create a vim file and write some text in it with insert (pressing <code>i</code>) and than undo and redo the changes. <br />
{| role="presentation" class="wikitable mw-collapsible mw-collapsed"<br />
| <strong>Answer:</strong><br />
|-<br />
| <br />
<code>$ vim test.txt</code> <br />
In <code>vim</code> editor press <code>i</code> to insert text and write few lines.<br />
Press <code>Esc</code> than press <code>u</code> (for undo) after that press <code>ctrl + r</code> on keyboard for redo.<br />
- <code>u</code>: undo last change (can be repeated to undo preceding commands).<br />
- <code>Ctrl-r</code>: Redo changes which were undone (undo the undos).<br />
|}<br />
<br />
<br />
{{Tutorial Navigation<br />
| previous = [[Introduction_to_Linux_in_HPC/Processes | Processes ]]<br />
| main = [[Introduction_to_Linux_in_HPC | Overview ]]<br />
| next = [[Introduction_to_Linux_in_HPC/Shell_scripting | Shell Scripting ]]<br />
}}</div>Lech-nieroda-2eba@uni-koeln.dehttps://hpc-wiki.info/hpc/index.php?title=Introduction_to_Linux_in_HPC/The_vim_text_editor&diff=4257Introduction to Linux in HPC/The vim text editor2020-11-25T18:35:56Z<p>Lech-nieroda-2eba@uni-koeln.de: </p>
<hr />
<div>[[Category:Tutorials]]<nowiki /><br />
{{DISPLAYTITLE:<span style="position:absolute; top:-9999px;">Introduction to Linux in HPC/</span>The vim text editor}}<nowiki /><br />
{{Syllabus Introduction to Linux}}<nowiki /><br />
__TOC__<br />
<br />
This part of the Linux tutorials introduces the vim text editor and describes its main features and use cases. A short explanation of the most important commands paired with examples on how to use them allow the user to delve right in. The tutorial demonstrates the basics, like opening/writing files or moving within the text as well as the most often employed tasks like search&replace or copy&paste which makes it interesting to both complete beginners and more intermediate users. The vim text editor's main advantage is that it's present in most unix operational systems, futhermore it's highly configurable and provides an extensive plugin system.<br />
<br />
=== Video === <!--T:5--><br />
<br />
<youtube width="600" height="340" right>QPWdUkgGd3I</youtube><br />
<br />
([[Media:HPC.NRW_Introduction_to_Linux_in_HPC_08_The_vim_Text_Editor.pdf | Slides as pdf]])<br />
<br />
=== Quiz === <!--T:5--> <br />
<br />
{{hidden begin <br />
|title = How many modes does vim have?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- it has only one mode <br />
|| <br />
- it has two modes<br />
|| <br />
+ it has at least three modes<br />
|| Explanation: <code>vi</code> has the modes normal, insert and command. In addition, <code>vim</code> hast the modes visual, select und ex-mode, not covered in this tutorial.<br />
</quiz><br />
{{hidden end}}<br />
<br />
{{hidden begin <br />
|title = How to enter the insert mode of <code>vim</code>?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- press <code>enter</code> key<br />
|| <br />
+ press <code>i</code> key<br />
|| 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 enter 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.<br />
- press <code>Esc</code> key<br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
{{hidden begin <br />
|title = How to save a file and exit during normal mode?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- press <code>:q!</code> keys and <code>enter</code><br />
|| <br />
+ press <code>:wq</code> keys and <code>enter</code> or <code>:X</code> keys and <code>enter</code> or <code>ZZ</code> keys<br />
|| Explanation: Any of the pressed key combinations will trigger a save and exit when in normal mode. The sequence <code>:q!</code> would exit without writing the file.<br />
- press <code>Ctrl-x Ctrl-s</code> keys<br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
{{hidden begin <br />
|title = How to copy and paste <code>5</code> entire lines in normal mode?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
+ press <code>5yy</code> keys, move the cursor and press <code>p</code><br />
|| Explanation: commands can be repeated by placing an integer value before them. In this case 5 lines are copied by pressing <code>5yy</code>. The paste command is executed by pressing <code>p</code>, pressing <code>5p</code> would have pasted 25 lines. <br />
- press <code>5yy</code> keys, move the cursor and press <code>5p</code><br />
|| <br />
- press <code>Ctrl-c Ctrl-v</code> keys<br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
{{hidden begin <br />
|title = How to perform a forward search for the pattern <code>foo</code>, afterwards a backward search for the pattern <code>bar</code> in normal mode?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- press <code>/foo</code> and <code>enter</code>, afterward <code>//bar</code> and <code>enter</code><br />
|| <br />
+ press <code>/foo</code> and <code>enter</code>, afterward <code>?bar</code> and <code>enter</code><br />
|| Explanation: the described commands will perform a search for a regex pattern, either forward (<code>/</code>) or backward (<code>?</code>), depending on the prefix<br />
- press <code>:f/foo/</code> and <code>enter</code>, afterward <code>:r/bar/</code> and <code>enter</code><br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
<br />
{{hidden begin <br />
|title = How to search and replace all occurences of the pattern <code>foo</code> with <code>bar</code> in normal mode?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
+ press <code>:s%/foo/bar/g</code> keys and <code>enter</code><br />
|| Explanation: the command <code>:s%/foo/bar/g</code> will search and replace the pattern in the entire file. Without the <code>g</code> modifier, it would search the entire file as well but only the first occurence in each line would be replaced. The <code>c</code> modifier asks for a confirmation each time.<br />
- press <code>:s%/foo/bar/</code> keys and <code>enter</code><br />
|| <br />
- press <code>:sed%/foo/bar/</code> keys and <code>enter</code><br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
<br />
{{hidden begin <br />
|title = How would you open a file in read-only mode using the <code>vim</code> editor? </br><br />
Hint: In terminal <code>man vim</code> <br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- <code>$ vim -r filename</code><br />
||<br />
+ <code>$ vim -R filename</code><br />
|| Explanation: the <code>-R</code> opens the file read-only. This can be overriden by pressing <code>:w!</code> or <code>:set noro</code><br />
- <code>$ vim -n filename</code><br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
<br />
{{Warning|mode=info|text= '''If you forget in which mode you are in while using vim, just keep pressing Esc.'''}}<br />
<br />
=== Exercises in Terminal (slide 100) === <!--T:5--> <br />
<br />
1. Create a vim file and write some text in it with insert (pressing <code>i</code>) and than undo and redo the changes. <br />
{| role="presentation" class="wikitable mw-collapsible mw-collapsed"<br />
| <strong>Answer:</strong><br />
|-<br />
| <br />
<code>$ vim test.txt</code> <br />
In <code>vim</code> editor press <code>i</code> to insert text and write few lines.<br />
Press <code>Esc</code> than press <code>u</code> (for undo) after that press <code>ctrl + r</code> on keyboard for redo.<br />
- <code>u</code>: undo last change (can be repeated to undo preceding commands).<br />
- <code>Ctrl-r</code>: Redo changes which were undone (undo the undos).<br />
|}<br />
<br />
<br />
{{Tutorial Navigation<br />
| previous = [[Introduction_to_Linux_in_HPC/Processes | Processes ]]<br />
| main = [[Introduction_to_Linux_in_HPC | Overview ]]<br />
| next = [[Introduction_to_Linux_in_HPC/Shell_scripting | Shell Scripting ]]<br />
}}</div>Lech-nieroda-2eba@uni-koeln.dehttps://hpc-wiki.info/hpc/index.php?title=Introduction_to_Linux_in_HPC/The_vim_text_editor&diff=4256Introduction to Linux in HPC/The vim text editor2020-11-25T18:34:31Z<p>Lech-nieroda-2eba@uni-koeln.de: </p>
<hr />
<div>[[Category:Tutorials]]<nowiki /><br />
{{DISPLAYTITLE:<span style="position:absolute; top:-9999px;">Introduction to Linux in HPC/</span>The vim text editor}}<nowiki /><br />
{{Syllabus Introduction to Linux}}<nowiki /><br />
__TOC__<br />
<br />
This part of the Linux tutorials introduces the vim text editor and describes its main features and use cases. A short explanation of the most important commands paired with examples on how to use them allow the user to delve right in. The tutorial demonstrates the basics, like opening/writing files or moving within the text as well as the most often employed tasks like search&replace or copy&paste which makes it interesting to both complete beginners and more intermediate users. The vim text editor's main advantage is that it's present in most unix operational systems, futhermore it's highly configurable and provides an extensive plugin system.<br />
<br />
=== Video === <!--T:5--><br />
<br />
<youtube width="600" height="340" right>QPWdUkgGd3I</youtube><br />
<br />
([[Media:HPC.NRW_Introduction_to_Linux_in_HPC_08_The_vim_Text_Editor.pdf | Slides as pdf]])<br />
<br />
=== Quiz === <!--T:5--> <br />
<br />
{{hidden begin <br />
|title = How many modes does vim have?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- it has only one mode <br />
|| <br />
- it has two modes<br />
|| <br />
+ it has at least three modes<br />
|| Explanation: <code>vi</code> has the modes normal, insert and command. In addition, <code>vim</code> hast the modes visual, select und ex-mode, not covered in this tutorial.<br />
</quiz><br />
{{hidden end}}<br />
<br />
{{hidden begin <br />
|title = How to enter the insert mode of <code>vim</code>?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- press <code>enter</code> key<br />
|| <br />
+ press <code>i</code> key<br />
|| 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 enter 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.<br />
- press <code>Esc</code> key<br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
{{hidden begin <br />
|title = How to save a file and exit during normal mode?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- press <code>:q!</code> keys and Enter<br />
|| <br />
+ press <code>:wq</code> keys and Enter or <code>:X</code> keys and Enter or <code>ZZ</code> keys<br />
|| Explanation: Any of the pressed key combinations will trigger a save and exit when in normal mode. The sequence <code>:q!</code> would exit without writing the file.<br />
- press <code>Ctrl-x Ctrl-s</code> keys<br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
{{hidden begin <br />
|title = How to copy and paste <code>5</code> entire lines in normal mode?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
+ press <code>5yy</code> keys, move the cursor and press <code>p</code><br />
|| Explanation: commands can be repeated by placing an integer value before them. In this case 5 lines are copied by pressing <code>5yy</code>. The paste command is executed by pressing <code>p</code>, pressing <code>5p</code> would have pasted 25 lines. <br />
- press <code>5yy</code> keys, move the cursor and press <code>5p</code><br />
|| <br />
- press <code>Ctrl-c Ctrl-v</code> keys<br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
{{hidden begin <br />
|title = How to perform a forward search for the pattern <code>foo</code>, afterwards a backward search for the pattern <code>bar</code> in normal mode?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- press <code>/foo</code> and enter, afterward <code>//bar</code> and enter<br />
|| <br />
+ press <code>/foo</code> and enter, afterward <code>?bar</code> and enter<br />
|| Explanation: the described commands will perform a search for a regex pattern, either forward (<code>/</code>) or backward (<code>?</code>), depending on the prefix<br />
- press <code>:f/foo/</code> and enter, afterward <code>:r/bar/</code> and enter<br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
<br />
{{hidden begin <br />
|title = How to search and replace all occurences of the pattern <code>foo</code> with <code>bar</code> in normal mode?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
+ press <code>:s%/foo/bar/g</code> keys and enter<br />
|| Explanation: the command <code>:s%/foo/bar/g</code> will search and replace the pattern in the entire file. Without the <code>g</code> modifier, it would search the entire file as well but only the first occurence in each line would be replaced. The <code>c</code> modifier asks for a confirmation each time.<br />
- press <code>:s%/foo/bar/</code> keys and enter<br />
|| <br />
- press <code>:sed%/foo/bar/</code> keys and enter<br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
<br />
{{hidden begin <br />
|title = How would you open a file in read-only mode using the <code>vim</code> editor? </br><br />
Hint: In terminal <code>man vim</code> <br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- <code>$ vim -r filename</code><br />
||<br />
+ <code>$ vim -R filename</code><br />
|| Explanation: the <code>-R</code> opens the file read-only. This can be overriden by pressing <code>:w!</code> or <code>:set noro</code><br />
- <code>$ vim -n filename</code><br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
<br />
{{Warning|mode=info|text= '''If you forget in which mode you are in while using vim, just keep pressing Esc.'''}}<br />
<br />
=== Exercises in Terminal (slide 100) === <!--T:5--> <br />
<br />
1. Create a vim file and write some text in it with insert (pressing <code>i</code>) and than undo and redo the changes. <br />
{| role="presentation" class="wikitable mw-collapsible mw-collapsed"<br />
| <strong>Answer:</strong><br />
|-<br />
| <br />
<code>$ vim test.txt</code> <br />
In <code>vim</code> editor press <code>i</code> to insert text and write few lines.<br />
Press <code>Esc</code> than press <code>u</code> (for undo) after that press <code>ctrl + r</code> on keyboard for redo.<br />
- <code>u</code>: undo last change (can be repeated to undo preceding commands).<br />
- <code>Ctrl-r</code>: Redo changes which were undone (undo the undos).<br />
|}<br />
<br />
<br />
{{Tutorial Navigation<br />
| previous = [[Introduction_to_Linux_in_HPC/Processes | Processes ]]<br />
| main = [[Introduction_to_Linux_in_HPC | Overview ]]<br />
| next = [[Introduction_to_Linux_in_HPC/Shell_scripting | Shell Scripting ]]<br />
}}</div>Lech-nieroda-2eba@uni-koeln.dehttps://hpc-wiki.info/hpc/index.php?title=Introduction_to_Linux_in_HPC/The_vim_text_editor&diff=4255Introduction to Linux in HPC/The vim text editor2020-11-25T18:24:05Z<p>Lech-nieroda-2eba@uni-koeln.de: </p>
<hr />
<div>[[Category:Tutorials]]<nowiki /><br />
{{DISPLAYTITLE:<span style="position:absolute; top:-9999px;">Introduction to Linux in HPC/</span>The vim text editor}}<nowiki /><br />
{{Syllabus Introduction to Linux}}<nowiki /><br />
__TOC__<br />
<br />
This part of the Linux tutorials introduces the vim text editor and describes its main features and use cases. A short explanation of the most important commands paired with examples on how to use them allow the user to delve right in. The tutorial demonstrates the basics, like opening/writing files or moving within the text as well as the most often employed tasks like search&replace or copy&paste which makes it interesting to both complete beginners and more intermediate users. The vim text editor's main advantage is that it's present in most unix operational systems, futhermore it's highly configurable and provides an extensive plugin system.<br />
<br />
=== Video === <!--T:5--><br />
<br />
<youtube width="600" height="340" right>QPWdUkgGd3I</youtube><br />
<br />
([[Media:HPC.NRW_Introduction_to_Linux_in_HPC_08_The_vim_Text_Editor.pdf | Slides as pdf]])<br />
<br />
=== Quiz === <!--T:5--> <br />
<br />
{{hidden begin <br />
|title = How many modes does vim have?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- it has only one mode <br />
|| <br />
- it has two modes<br />
|| <br />
+ it has at least three modes<br />
|| Explanation: <code>vi</code> has the modes normal, insert and command. In addition, <code>vim</code> hast the modes visual, select und ex-mode, not covered in this tutorial.<br />
</quiz><br />
{{hidden end}}<br />
<br />
{{hidden begin <br />
|title = How to enter the insert mode of <code>vim</code>?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- press <code>enter</code> key<br />
|| <br />
+ press <code>i</code> key<br />
|| 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 enter 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.<br />
- press <code>Esc</code> key<br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
{{hidden begin <br />
|title = How to save a file and exit during normal mode?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- press <code>:q!</code> keys<br />
|| <br />
+ press <code>:wq</code> or <code>:X</code> or <code>ZZ</code> keys<br />
|| Explanation: Any of the pressed key combinations will trigger a save and exit when in normal mode. The sequence <code>:q!</code> would exit without writing the file.<br />
- press <code>Ctrl-x Ctrl-s</code> keys<br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
{{hidden begin <br />
|title = How to copy and paste <code>5</code> entire lines in normal mode?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
+ press <code>5yy</code> keys, move the cursor and press <code>p</code><br />
|| Explanation: commands can be repeated by placing an integer value before them. In this case 5 lines are copied by pressing <code>5yy</code>. The paste command is executed by pressing <code>p</code>, pressing <code>5p</code> would have pasted 25 lines. <br />
- press <code>5yy</code> keys, move the cursor and press <code>5p</code><br />
|| <br />
- press <code>Ctrl-c Ctrl-v</code> keys<br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
{{hidden begin <br />
|title = How to search and replace all occurences of the pattern <code>foo</code> with <code>bar</code> in normal mode?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
+ press <code>:s%/foo/bar/g</code> keys<br />
|| Explanation: the command <code>:s%/foo/bar/g</code> will search and replace the pattern in the entire file. Without the <code>g</code> modifier, it would search the entire file as well but only the first occurence in each line would be replaced. The <code>c</code> modifier asks for a confirmation each time.<br />
- press <code>:s%/foo/bar/</code> keys<br />
|| <br />
- press <code>:sed%/foo/bar/</code> keys<br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
<br />
{{hidden begin <br />
|title = How would you open a file in read-only mode using the <code>vim</code> editor? </br><br />
Hint: In terminal <code>man vim</code> <br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- <code>$ vim -r filename</code><br />
||<br />
+ <code>$ vim -R filename</code><br />
|| Explanation: the <code>-R</code> opens the file read-only. This can be overriden by pressing <code>:w!</code> or <code>:set noro</code><br />
- <code>$ vim -n filename</code><br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
<br />
{{Warning|mode=info|text= '''If you forget in which mode you are in while using vim, just keep pressing Esc.'''}}<br />
<br />
=== Exercises in Terminal (slide 100) === <!--T:5--> <br />
<br />
1. Create a vim file and write some text in it with insert (pressing <code>i</code>) and than undo and redo the changes. <br />
{| role="presentation" class="wikitable mw-collapsible mw-collapsed"<br />
| <strong>Answer:</strong><br />
|-<br />
| <br />
<code>$ vim test.txt</code> <br />
In <code>vim</code> editor press <code>i</code> to insert text and write few lines.<br />
Press <code>Esc</code> than press <code>u</code> (for undo) after that press <code>ctrl + r</code> on keyboard for redo.<br />
- <code>u</code>: undo last change (can be repeated to undo preceding commands).<br />
- <code>Ctrl-r</code>: Redo changes which were undone (undo the undos).<br />
|}<br />
<br />
<br />
{{Tutorial Navigation<br />
| previous = [[Introduction_to_Linux_in_HPC/Processes | Processes ]]<br />
| main = [[Introduction_to_Linux_in_HPC | Overview ]]<br />
| next = [[Introduction_to_Linux_in_HPC/Shell_scripting | Shell Scripting ]]<br />
}}</div>Lech-nieroda-2eba@uni-koeln.dehttps://hpc-wiki.info/hpc/index.php?title=Introduction_to_Linux_in_HPC/The_vim_text_editor&diff=4254Introduction to Linux in HPC/The vim text editor2020-11-25T18:21:07Z<p>Lech-nieroda-2eba@uni-koeln.de: </p>
<hr />
<div>[[Category:Tutorials]]<nowiki /><br />
{{DISPLAYTITLE:<span style="position:absolute; top:-9999px;">Introduction to Linux in HPC/</span>The vim text editor}}<nowiki /><br />
{{Syllabus Introduction to Linux}}<nowiki /><br />
__TOC__<br />
<br />
This part of the Linux tutorials introduces the vim text editor and describes its main features and use cases. A short explanation of the most important commands paired with examples on how to use them allow the user to delve right in. The tutorial demonstrates the basics, like opening/writing files or moving within the text as well as the most often employed tasks like search&replace or copy&paste which makes it interesting to both complete beginners and more intermediate users. The vim text editor's main advantage is that it's present in most unix operational systems, futhermore it's highly configurable and provides an extensive plugin system.<br />
<br />
=== Video === <!--T:5--><br />
<br />
<youtube width="600" height="340" right>QPWdUkgGd3I</youtube><br />
<br />
([[Media:HPC.NRW_Introduction_to_Linux_in_HPC_08_The_vim_Text_Editor.pdf | Slides as pdf]])<br />
<br />
=== Quiz === <!--T:5--> <br />
<br />
{{hidden begin <br />
|title = How many modes does vim have?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- it has only one mode <br />
|| <br />
- it has two modes<br />
|| <br />
+ it has at least three modes<br />
|| Explanation: <code>vi</code> has the modes normal, insert and command. In addition, <code>vim</code> hast the modes visual, select und ex-mode, not covered in this tutorial.<br />
</quiz><br />
{{hidden end}}<br />
<br />
{{hidden begin <br />
|title = How to enter the insert mode of <code>vim</code>?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- press <code>enter</code> key<br />
|| <br />
+ press <code>i</code> key<br />
|| 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 enter 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.<br />
- press <code>Esc</code> key<br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
{{hidden begin <br />
|title = How to save a file and exit during normal mode?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- press <code>:q!</code> keys<br />
|| <br />
+ press <code>:wq</code> or <code>:X</code> or <code>ZZ</code> keys<br />
|| Explanation: Any of the pressed key combinations will trigger a save and exit when in normal mode. The sequence <code>:q!</code> would exit without writing the file.<br />
- press <code>Ctrl-x Ctrl-s</code> keys<br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
{{hidden begin <br />
|title = How to copy and paste <code>5</code> entire lines in normal mode?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
+ press <code>5yy</code> keys, move the cursor and press <code>p</code><br />
|| Explanation: commands can be repeated by placing an integer value before them. In this case 5 lines are copied by pressing <code>5yy</code>. The paste command is executed by pressing <code>p</code>, pressing <code>5p</code> would have pasted 25 lines. <br />
- press <code>5yy</code> keys, move the cursor and press <code>5p</code><br />
|| <br />
- press <code>Ctrl-c Ctrl-v</code> keys<br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
{{hidden begin <br />
|title = How to search and replace all occurences of the pattern <code>foo</code> with <code>bar</code> in normal mode?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
+ press <code>:s%/foo/bar/g</code> keys<br />
|| Explanation: the command <code>:s%/foo/bar/g</code> will search and replace the pattern in the entire file. Without the <code>g</code> modifier, it would search the entire file as well but only the first occurence in each line would be replaced. The <code>c</code> modifier asks for a confirmation each time.<br />
- press <code>:s%/foo/bar/</code> keys<br />
|| <br />
- press <code>:sed%/foo/bar/</code> keys<br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
<br />
{{hidden begin <br />
|title = How would you open a file in read-only mode using the <code>vim</code> editor? </br><br />
Hint: In terminal <code>man vim</code> <br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- <code>$ vim -r filename</code><br />
||<br />
+ <code>$ vim -R filename</code><br />
|| Explanation: the <code>-R<option> opens the file read-only. This can be overriden by pressing <code>:w!</code> or <code>:set noro</code><br />
- <code>$ vim -n filename</code><br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
<br />
{{Warning|mode=info|text= '''If you forget in which mode you are in while using vim, just keep pressing Esc.'''}}<br />
<br />
=== Exercises in Terminal (slide 100) === <!--T:5--> <br />
<br />
1. Create a vim file and write some text in it with insert (pressing <code>i</code>) and than undo and redo the changes. <br />
{| role="presentation" class="wikitable mw-collapsible mw-collapsed"<br />
| <strong>Answer:</strong><br />
|-<br />
| <br />
<code>$ vim test.txt</code> <br />
In <code>vim</code> editor press <code>i</code> to insert text and write few lines.<br />
Press <code>Esc</code> than press <code>u</code> (for undo) after that press <code>ctrl + r</code> on keyboard for redo.<br />
- <code>u</code>: undo last change (can be repeated to undo preceding commands).<br />
- <code>Ctrl-r</code>: Redo changes which were undone (undo the undos).<br />
|}<br />
<br />
<br />
{{Tutorial Navigation<br />
| previous = [[Introduction_to_Linux_in_HPC/Processes | Processes ]]<br />
| main = [[Introduction_to_Linux_in_HPC | Overview ]]<br />
| next = [[Introduction_to_Linux_in_HPC/Shell_scripting | Shell Scripting ]]<br />
}}</div>Lech-nieroda-2eba@uni-koeln.dehttps://hpc-wiki.info/hpc/index.php?title=Introduction_to_Linux_in_HPC/The_vim_text_editor&diff=4253Introduction to Linux in HPC/The vim text editor2020-11-25T18:17:25Z<p>Lech-nieroda-2eba@uni-koeln.de: </p>
<hr />
<div>[[Category:Tutorials]]<nowiki /><br />
{{DISPLAYTITLE:<span style="position:absolute; top:-9999px;">Introduction to Linux in HPC/</span>The vim text editor}}<nowiki /><br />
{{Syllabus Introduction to Linux}}<nowiki /><br />
__TOC__<br />
<br />
This part of the Linux tutorials introduces the vim text editor and describes its main features and use cases. A short explanation of the most important commands paired with examples on how to use them allow the user to delve right in. The tutorial demonstrates the basics, like opening/writing files or moving within the text as well as the most often employed tasks like search&replace or copy&paste which makes it interesting to both complete beginners and more intermediate users. The vim text editor's main advantage is that it's present in most unix operational systems, futhermore it's highly configurable and provides an extensive plugin system.<br />
<br />
=== Video === <!--T:5--><br />
<br />
<youtube width="600" height="340" right>QPWdUkgGd3I</youtube><br />
<br />
([[Media:HPC.NRW_Introduction_to_Linux_in_HPC_08_The_vim_Text_Editor.pdf | Slides as pdf]])<br />
<br />
=== Quiz === <!--T:5--> <br />
<br />
{{hidden begin <br />
|title = How many modes does vim have?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- it has only one mode <br />
|| <br />
- it has two modes<br />
|| <br />
+ it has at least three modes<br />
|| Explanation: <code>vi</code> has the modes normal, insert and command. In addition, <code>vim</code> hast the modes visual, select und ex-mode, not covered in this tutorial.<br />
</quiz><br />
{{hidden end}}<br />
<br />
{{hidden begin <br />
|title = How to enter the insert mode of <code>vim</code>?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- press <code>enter</code> key<br />
|| <br />
+ press <code>i</code> key<br />
|| 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 enter 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.<br />
- press <code>Esc</code> key<br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
{{hidden begin <br />
|title = How to save a file and exit during normal mode?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- press <code>:q!</code> keys<br />
|| <br />
+ press <code>:wq</code> or <code>:X</code> or <code>ZZ</code> keys<br />
|| Explanation: Any of the pressed key combinations will trigger a save and exit when in normal mode. The sequence <code>:q!</code> would exit without writing the file.<br />
- press <code>Ctrl-x Ctrl-s</code> keys<br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
{{hidden begin <br />
|title = How to copy and paste <code>5</code> entire lines in normal mode?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
+ press <code>5yy</code> keys, move the cursor and press <code>p</code><br />
|| Explanation: commands can be repeated by placing an integer value before them. In this case 5 lines are copied by pressing <code>5yy</code>. The paste command is executed by pressing <code>p</code>, pressing <code>5p</code> would have pasted 25 lines. <br />
+ press <code>5yy</code> keys, move the cursor and press <code>5p</code><br />
|| <br />
- press <code>Ctrl-c Ctrl-v</code> keys<br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
{{hidden begin <br />
|title = How to search and replace all occurences of the pattern <code>foo</code> with <code>bar</code> in normal mode?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
+ press <code>:s%/foo/bar/g</code> keys<br />
|| Explanation: the command <code>:s%/foo/bar/g</code> will search and replace the pattern in the entire file. Without the <code>g</code> modifier, it would search the entire file as well but only the first occurence in each line would be replaced. The <code>c</code> modifier asks for a confirmation each time.<br />
- press <code>:s%/foo/bar/</code> keys<br />
|| <br />
- press <code>:sed%/foo/bar/</code> keys<br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
<br />
{{hidden begin <br />
|title = How would you open a file in read-only mode using the <code>vim</code> editor? </br><br />
Hint: In terminal <code>man vim</code> <br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- <code>$ vim -r filename</code><br />
||<br />
+ <code>$ vim -R filename</code><br />
|| Explanation: the <code>-R<option> opens the file read-only. This can be overriden by pressing <code>:w!</code> or <code>:set noro</code><br />
- <code>$ vim -n filename</code><br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
<br />
{{Warning|mode=info|text= '''If you forget in which mode you are in while using vim, just keep pressing Esc.'''}}<br />
<br />
=== Exercises in Terminal (slide 100) === <!--T:5--> <br />
<br />
1. Create a vim file and write some text in it with insert (pressing <code>i</code>) and than undo and redo the changes. <br />
{| role="presentation" class="wikitable mw-collapsible mw-collapsed"<br />
| <strong>Answer:</strong><br />
|-<br />
| <br />
<code>$ vim test.txt</code> <br />
In <code>vim</code> editor press <code>i</code> to insert text and write few lines.<br />
Press <code>Esc</code> than press <code>u</code> (for undo) after that press <code>ctrl + r</code> on keyboard for redo.<br />
- <code>u</code>: undo last change (can be repeated to undo preceding commands).<br />
- <code>Ctrl-r</code>: Redo changes which were undone (undo the undos).<br />
|}<br />
<br />
<br />
{{Tutorial Navigation<br />
| previous = [[Introduction_to_Linux_in_HPC/Processes | Processes ]]<br />
| main = [[Introduction_to_Linux_in_HPC | Overview ]]<br />
| next = [[Introduction_to_Linux_in_HPC/Shell_scripting | Shell Scripting ]]<br />
}}</div>Lech-nieroda-2eba@uni-koeln.dehttps://hpc-wiki.info/hpc/index.php?title=Introduction_to_Linux_in_HPC/The_vim_text_editor&diff=4252Introduction to Linux in HPC/The vim text editor2020-11-25T17:53:31Z<p>Lech-nieroda-2eba@uni-koeln.de: </p>
<hr />
<div>[[Category:Tutorials]]<nowiki /><br />
{{DISPLAYTITLE:<span style="position:absolute; top:-9999px;">Introduction to Linux in HPC/</span>The vim text editor}}<nowiki /><br />
{{Syllabus Introduction to Linux}}<nowiki /><br />
__TOC__<br />
<br />
This part of the Linux tutorials introduces the vim text editor and describes its main features and use cases. A short explanation of the most important commands paired with examples on how to use them allow the user to delve right in. The tutorial demonstrates the basics, like opening/writing files or moving within the text as well as the most often employed tasks like search&replace or copy&paste which makes it interesting to both complete beginners and more intermediate users. The vim text editor's main advantage is that it's present in most unix operational systems, futhermore it's highly configurable and provides an extensive plugin system.<br />
<br />
=== Video === <!--T:5--><br />
<br />
<youtube width="600" height="340" right>QPWdUkgGd3I</youtube><br />
<br />
([[Media:HPC.NRW_Introduction_to_Linux_in_HPC_08_The_vim_Text_Editor.pdf | Slides as pdf]])<br />
<br />
=== Quiz === <!--T:5--> <br />
<br />
{{hidden begin <br />
|title = How many modes does vim have?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- it has only one mode <br />
|| <br />
- it has two modes<br />
|| <br />
+ it has at least three modes<br />
|| Explanation: <code>vi</code> has the modes normal, insert and command. In addition, <code>vim</code> hast the modes visual, select und ex-mode, not covered in this tutorial.<br />
</quiz><br />
{{hidden end}}<br />
<br />
{{hidden begin <br />
|title = How to enter the insert mode of <code>vim</code>?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- press <code>enter</code> key<br />
|| <br />
+ press <code>i</code> key<br />
|| 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 enter 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.<br />
- press <code>Esc</code> key<br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
{{hidden begin <br />
|title = How to save a file and exit during normal mode?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- press <code>:q!</code> keys<br />
|| <br />
+ press <code>:wq</code> or <code>:X</code> or <code>ZZ</code> keys<br />
|| Explanation: Any of the pressed key combinations will trigger a save and exit when in normal mode. <br />
- press <code>Ctrl-x Ctrl-s</code> key<br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
<br />
{{hidden begin <br />
|title = How would you open a file in read-only mode using the <code>vim</code> editor? </br><br />
Hint: In terminal <code>man vim</code> <br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
+ Click and submit to see the answer<br />
|| <code>$ vim -R filename</code><br />
</quiz><br />
{{hidden end}}<br />
<br />
<br />
{{Warning|mode=info|text= '''If you forget in which mode you are in while using vim, just keep pressing Esc.'''}}<br />
<br />
<br />
=== Exercises in Terminal (slide 100) === <!--T:5--> <br />
<br />
1. Create a vim file and write some text in it with insert (pressing <code>i</code>) and than undo and redo the changes. <br />
{| role="presentation" class="wikitable mw-collapsible mw-collapsed"<br />
| <strong>Answer:</strong><br />
|-<br />
| <br />
<code>$ vim test.txt</code> <br />
In <code>vim</code> editor press <code>i</code> to insert text and write few lines.<br />
Press <code>Esc</code> than press <code>u</code> (for undo) after that press <code>ctrl + r</code> on keyboard for redo.<br />
- <code>u</code>: undo last change (can be repeated to undo preceding commands).<br />
- <code>Ctrl-r</code>: Redo changes which were undone (undo the undos).<br />
|}<br />
<br />
<br />
{{Tutorial Navigation<br />
| previous = [[Introduction_to_Linux_in_HPC/Processes | Processes ]]<br />
| main = [[Introduction_to_Linux_in_HPC | Overview ]]<br />
| next = [[Introduction_to_Linux_in_HPC/Shell_scripting | Shell Scripting ]]<br />
}}</div>Lech-nieroda-2eba@uni-koeln.dehttps://hpc-wiki.info/hpc/index.php?title=Introduction_to_Linux_in_HPC/The_vim_text_editor&diff=4251Introduction to Linux in HPC/The vim text editor2020-11-25T17:33:38Z<p>Lech-nieroda-2eba@uni-koeln.de: intro</p>
<hr />
<div>[[Category:Tutorials]]<nowiki /><br />
{{DISPLAYTITLE:<span style="position:absolute; top:-9999px;">Introduction to Linux in HPC/</span>The vim text editor}}<nowiki /><br />
{{Syllabus Introduction to Linux}}<nowiki /><br />
__TOC__<br />
<br />
This part of the Linux tutorials introduces the vim text editor and describes its main features and use cases. A short explanation of the most important commands paired with examples on how to use them allow the user to delve right in. The tutorial demonstrates the basics, like opening/writing files or moving within the text as well as the most often employed tasks like search&replace or copy&paste which makes it interesting both to a complete beginner and more intermediate user. The vim text editor's main advantage is that it's present in most unix operational systems, futhermore it's highly configurable and provides an extensive plugin system.<br />
<br />
=== Video === <!--T:5--><br />
<br />
<youtube width="600" height="340" right>QPWdUkgGd3I</youtube><br />
<br />
([[Media:HPC.NRW_Introduction_to_Linux_in_HPC_08_The_vim_Text_Editor.pdf | Slides as pdf]])<br />
<br />
=== Quiz === <!--T:5--> <br />
<br />
<br />
{{hidden begin <br />
|title = 1. How to enter the insert mode of <code>vim</code>?<br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
- press <code>enter</code> key<br />
|| <br />
+ press <code>i</code> key<br />
|| 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 enter 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.<br />
- press <code>Esc</code> key<br />
|| <br />
</quiz><br />
{{hidden end}}<br />
<br />
<br />
{{hidden begin <br />
|title = 2. How would you open a file in read-only mode using the <code>vim</code> editor? </br><br />
Hint: In terminal <code>man vim</code> <br />
}}<br />
<quiz display=simple><br />
{<br />
|type="()"}<br />
+ Click and submit to see the answer<br />
|| <code>$ vim -R filename</code><br />
</quiz><br />
{{hidden end}}<br />
<br />
<br />
{{Warning|mode=info|text= '''If you forget in which mode you are in while using vim, just keep pressing Esc.'''}}<br />
<br />
<br />
=== Exercises in Terminal (slide 100) === <!--T:5--> <br />
<br />
1. Create a vim file and write some text in it with insert (pressing <code>i</code>) and than undo and redo the changes. <br />
{| role="presentation" class="wikitable mw-collapsible mw-collapsed"<br />
| <strong>Answer:</strong><br />
|-<br />
| <br />
<code>$ vim test.txt</code> <br />
In <code>vim</code> editor press <code>i</code> to insert text and write few lines.<br />
Press <code>Esc</code> than press <code>u</code> (for undo) after that press <code>ctrl + r</code> on keyboard for redo.<br />
- <code>u</code>: undo last change (can be repeated to undo preceding commands).<br />
- <code>Ctrl-r</code>: Redo changes which were undone (undo the undos).<br />
|}<br />
<br />
<br />
{{Tutorial Navigation<br />
| previous = [[Introduction_to_Linux_in_HPC/Processes | Processes ]]<br />
| main = [[Introduction_to_Linux_in_HPC | Overview ]]<br />
| next = [[Introduction_to_Linux_in_HPC/Shell_scripting | Shell Scripting ]]<br />
}}</div>Lech-nieroda-2eba@uni-koeln.dehttps://hpc-wiki.info/hpc/index.php?title=Software&diff=2194Software2019-10-18T09:19:30Z<p>Lech-nieroda-2eba@uni-koeln.de: RRZK section added</p>
<hr />
<div>[[Category:Site-specifics]]<br />
The following list details the available software of the different facilities:<br />
<br />
{| class="wikitable" style="width: 40%;"<br />
| IT Center - RWTH Aachen || [https://doc.itc.rwth-aachen.de/display/CC/Installed+software Software RWTH]<br />
|-<br />
| RRZE - Erlangen || [https://www.rrze.fau.de/hard-software/software/ Software RRZE]<br />
|-<br />
| TU Darmstadt "''Lichtenberg''" || [https://www.hhlr.tu-darmstadt.de/hhlr/betrieb/lichtenberg_software/index.en.jsp Software on the ''Lichtenberg'' HLR]<br />
|-<br />
| ZIH - Dresden || [https://tu-dresden.de/zih/dienste/service-katalog/arbeitsumgebung/dir_software Software ZIH]<br />
|-<br />
| RRZK - University of Cologne || [https://rrzk.uni-koeln.de/sites/rrzk/HPC_Projekte/CHEOPS_Application_Software.pdf Dokumentation ausgewählter Software auf CHEOPS]<br />
|}<br />
<br />
Furthermore, the Gauss Alliance is offering a platform to provide an overview of installed software at German HPC Centers at [https://gauss-allianz.de/en/application]</div>Lech-nieroda-2eba@uni-koeln.dehttps://hpc-wiki.info/hpc/index.php?title=Support&diff=2193Support2019-10-18T09:17:43Z<p>Lech-nieroda-2eba@uni-koeln.de: RRZK section added</p>
<hr />
<div>[[Category:Site-specifics]]<br />
For Support, please contact your local computing center:<br />
<br />
{| class="wikitable" style="width: 40%;"<br />
| IT Center - RWTH Aachen || [https://doc.itc.rwth-aachen.de/display/SD/Home IT Servicedesk] || [mailto:servicedesk@itc.rwth-aachen.de EMail] <br />
|-<br />
| RRZE - FAU Erlangen || [https://www.rrze.fau.de/infocenter/kontakt-hilfe/hpc-beratung/ HPC_Beratung] || [mailto:support-hpc@fau.de EMail]<br />
|-<br />
| TU Darmstadt || [https://www.hhlr.tu-darmstadt.de/ HRZ / HPC group] || [mailto:hhlr@hrz.tu-darmstadt.de EMail]<br />
|- <br />
| ZIH - TU Dresden || [https://tu-dresden.de/zih/hochleistungsrechnen/support HPC-Support] || [mailto:hpcsupport@zih.tu-dresden.de EMail]<br />
|-<br />
| RRZK - University of Cologne || [https://rrzk.uni-koeln.de/kontakt-helpdesk.html RRZK Helpdesk] || [mailto:hpc-mgr@uni-koeln.de EMail]<br />
|}<br />
<br />
In case you have any questions about the information presented here, use the discussion/talk pages or head over to [[Impressum]]. If you spot any mistakes/outdated information, feel free to edit and correct it.</div>Lech-nieroda-2eba@uni-koeln.dehttps://hpc-wiki.info/hpc/index.php?title=Site-specific_documentation&diff=2192Site-specific documentation2019-10-18T09:10:15Z<p>Lech-nieroda-2eba@uni-koeln.de: RRZK CHEOPS documentation added</p>
<hr />
<div>[[Category:Site-specifics]]<br />
Please find the different documentations of the participating facilities here:<br />
<br />
{| class="wikitable" style="width: 40%;"<br />
| IT Center - RWTH Aachen || [https://doc.itc.rwth-aachen.de/ Doc_site][http://itc.rwth-aachen.de/ IT_Center] <br />
|-<br />
| PC2 - Uni Paderborn || [https://wikis.uni-paderborn.de/pc2doc/Hauptseite HPC documentation & status]<br />
|-<br />
| TU Darmstadt "''Lichtenberg''" || [https://www.hhlr.tu-darmstadt.de/ Main page hardware & software]<br />
|-<br />
| RRZE - FAU Erlangen || [https://www.anleitungen.rrze.fau.de/hpc/ HPC_documentation]<br />
|-<br />
| ZIH - TU Dresden || [https://doc.zih.tu-dresden.de/hpc-wiki/bin/view/Compendium/WebHome HPC Compendium]<br />
|-<br />
| ZIMT - Uni Siegen || [https://cluster.uni-siegen.de/?lang=en Cluster Website]<br />
|-<br />
| RRZK - University of Cologne || [https://rrzk.uni-koeln.de/hpc.html Cluster Website] [https://rrzk.uni-koeln.de/sites/rrzk/HPC_Projekte/CHEOPS_Brief_Instructions.pdf CHEOPS Brief Instructions] [https://rrzk.uni-koeln.de/sites/rrzk/HPC_Projekte/CHEOPS_Application_Software.pdf CHEOPS Application Software]<br />
|}</div>Lech-nieroda-2eba@uni-koeln.dehttps://hpc-wiki.info/hpc/index.php?title=Schedulers&diff=2191Schedulers2019-10-18T09:05:17Z<p>Lech-nieroda-2eba@uni-koeln.de: RRZK section added</p>
<hr />
<div>[[Category:Site-specifics]]<br />
A Batch-Scheduler is a program running on a cluster that decides who can use which machines at what time as explained in the [[Getting_Started#Schedulers_or_.22How-To-Run-Applications-on-a-supercomputer.22|Schedulers Section]] of the [[Getting_Started|Getting Started]] and the [[Scheduling_Basics]] article.<br />
More in-depth general information can be found in the [[Batch-Scheduler]] article.<br />
<br />
The following list details the schedulers of the different facilities:<br />
<br />
{| class="wikitable" style="width: 40%;"<br />
| IT Center - RWTH Aachen [https://doc.itc.rwth-aachen.de/display/CC/Hardware+of+the+RWTH+Compute+Cluster Hardware] || [[SLURM]] <br />
|-<br />
| PC2 - Paderborn [https://pc2.uni-paderborn.de/hpc-services/available-systems/noctua/ HPC system Noctua] || [[SLURM]]<br />
|-<br />
| RRZE - Erlangen [https://www.anleitungen.rrze.fau.de/hpc/ HPC] || [[Torque]] or [[SLURM]] depending on the cluster<br />
|-<br />
| TU Darmstadt "''Lichtenberg''" || [[SLURM]]<br />
|-<br />
| ZIH - Dresden [https://doc.zih.tu-dresden.de/hpc-wiki/bin/view/Compendium/HardwareTaurus Taurus_Hardware] || [[SLURM]]<br />
|-<br />
| RRZK - University of Cologne [https://rrzk.uni-koeln.de/ressourcen-hpc.html CHEOPS Hardware] || [[SLURM]]<br />
|}</div>Lech-nieroda-2eba@uni-koeln.dehttps://hpc-wiki.info/hpc/index.php?title=Nodes&diff=2190Nodes2019-10-18T09:01:49Z<p>Lech-nieroda-2eba@uni-koeln.de: RRZK login and copy node sections added</p>
<hr />
<div>[[Category:Site-specifics]]<br />
If one of these nodes are outdated please read the local documentation and migrate eventual changes to this page.<br />
<br />
== Login ==<br />
<br />
{| class="wikitable" style="width: 40%;"<br />
| IT Center - RWTH Aachen [https://doc.itc.rwth-aachen.de/display/CC/Hardware+of+the+RWTH+Compute+Cluster Hardware][https://doc.itc.rwth-aachen.de/display/CC/SSH+Fingerprints+of+the+Dialog+Systems Fingerprints] || login.hpc.itc.rwth-aachen.de<br />
|-<br />
| RRZE - FAU Erlangen [https://www.anleitungen.rrze.fau.de/hpc/dialogserver/ Dialogserver][https://www.anleitungen.rrze.fau.de/hpc/ HPC] || cshpc.rrze.fau.de (externally reachable gateway);<br />
from there or from within the University, the cluster-specific login nodes can be reached, e.g. <br />
* woody.rrze.uni-erlangen.de (used for Woody and Tiny*)<br />
* lima.rrze.uni-erlangen.de<br />
* emmy.rrze.uni-erlangen.de<br />
* meggie.rrze.uni-erlangen.de<br />
|-<br />
| TU Darmstadt "''Lichtenberg''"<br />([https://www.hhlr.tu-darmstadt.de/hhlr/betrieb/hardware_hlr/aktueller_status_1/statisch.en.jsp Hardware], [https://www.hhlr.tu-darmstadt.de/hhlr/arbeit_auf_dem_cluster/index.en.jsp Fingerprints]) || <code>lcluster'''{1..11}'''.hrz.tu-darmstadt.de</code><br />(e.g. <code>ssh -X lcluster'''5'''.hrz.tu-darmstadt.de</code>)<br />
|-<br />
| ZIH - TU Dresden || taurus.hrsk.tu-dresden.de<br />
|-<br />
| PC2 - Uni Paderborn<br/> ([https://wikis.uni-paderborn.de/pc2doc/Hauptseite Wiki]) || OCuLUS: fe.pc2.uni-paderborn.de <br/> Noctua: fe.noctua.pc2.uni-paderborn.de<br />
|-<br />
| RRZK - University of Cologne || dialog.rrz.uni-koeln.de (externally reachable gateway)<br />
from there or from within the University network (UKLAN) or via [https://rrzk.uni-koeln.de/vpn.html VPN]:<br />
<br />
cheops.rrz.uni-koeln.de (CHEOPS login node)<br />
|}<br />
<br />
== Copy ==<br />
<br />
{| class="wikitable" style="width: 40%;"<br />
| RWTH Aachen [https://doc.itc.rwth-aachen.de/display/CC/Remote+file+transfers File_transfer] || copy.hpc.itc.rwth-aachen.de <br />
|-<br />
| RRZE - FAU Erlangen || no dedicated copy nodes; use the normal login nodes<br />
|-<br />
| TU Darmstadt "''Lichtenberg''" || no dedicated copy nodes; use the normal login nodes<br />
|-<br />
| ZIH - TU Dresden [https://doc.zih.tu-dresden.de/hpc-wiki/bin/view/Compendium/ExportNodes ExportNodes] || taurusexport.hrsk.tu-dresden.de<br />
|-<br />
| PC2 - Uni Paderborn || OCuLUS: no dedicated copy nodes; use the normal login nodes <br/> Noctua: [https://wikis.uni-paderborn.de/pc2doc/Noctua-FileSystems Lustre-Export]<br />
|-<br />
| RRZK - University of Cologne || no dedicated copy nodes; use the normal login nodes<br />
|}</div>Lech-nieroda-2eba@uni-koeln.dehttps://hpc-wiki.info/hpc/index.php?title=Access&diff=2189Access2019-10-18T08:43:21Z<p>Lech-nieroda-2eba@uni-koeln.de: RRZK access link added</p>
<hr />
<div>[[Category:Site-specifics]]<br />
To get access to a supercomputer, please have a look at the possibilities of the facility you are associated with:<br />
<br />
{| class="wikitable" style="width: 40%;"<br />
| IT Center - RWTH Aachen || [https://doc.itc.rwth-aachen.de/display/CC/Access RWTH Compute Cluster Access] [https://doc.itc.rwth-aachen.de/display/CC/Overview+of+Compute+Project+Categories+and+Links+to+Submission+Forms Project Submission]<br />
|-<br />
| RRZE - FAU Erlangen || [https://www.rrze.fau.de/serverdienste/hpc/ RRZE Serverdienste]<br />
|-<br />
| ZIH - TU Dresden || [https://doc.zih.tu-dresden.de/hpc-wiki/bin/view/Compendium/Access ZIH Access]<br />
|-<br />
| PC2 - University Paderborn || [https://pc2.uni-paderborn.de/hpc-services/our-services/become-a-user/ PC2 Become a user]<br />
|-<br />
| HRZ - TU Darmstadt || [https://www.hhlr.tu-darmstadt.de/hhlr/zugang/lichtenberg_zugang.de.jsp HPC Access]<br />
|-<br />
| RRZK - University of Cologne || [https://rrzk.uni-koeln.de/autorisierung-hpc.html CHEOPS HPC Access]<br />
|}<br />
<br />
You might also apply for computing resources through the German [http://www.gauss-centre.eu/gauss-centre/EN/HPCservices/HowToApply/_node.html Gauss Center for Supercomputing] and the [http://www.prace-ri.eu/application-procedure/ partnership for advanced computing in Europe (PRACE)]. This, however, mainly targets large projects that need massive amounts of computing time for highly scalable applications. Therefore the entry barrier to these pooled resources is generally higher, than the one at your local computing center.</div>Lech-nieroda-2eba@uni-koeln.de