From 8528b2248463ac1183860dde1911d56d2b7ba8e9 Mon Sep 17 00:00:00 2001 From: Cal <35017184+CallumWalley@users.noreply.github.com> Date: Fri, 4 Oct 2024 15:34:07 +1300 Subject: [PATCH] Replace math fig (#117) * asp timings * mend * move tab commpletgion section * replace fig with math --- _episodes/02-unix-shell.md | 112 ++++++++++++++++++------------------- _episodes/07-resources.md | 33 +++++------ 2 files changed, 73 insertions(+), 72 deletions(-) diff --git a/_episodes/02-unix-shell.md b/_episodes/02-unix-shell.md index fb626ff3..8aa3becf 100644 --- a/_episodes/02-unix-shell.md +++ b/_episodes/02-unix-shell.md @@ -187,6 +187,62 @@ We can check we are in the right place by running `pwd`. {: .output} +> ## Tab completion +> +> Sometimes file paths and file names can be very long, making typing out the path tedious. +> One trick you can use to save yourself time is to use something called **tab completion**. +> If you start typing the path in a command and their is only one possible match, +> if you hit tab the path will autocomplete (until there are more than one possible matches). +> +> > ## Solution +> > +> >For example, if you type: +> > +> > ``` +> > {{ site.remote.prompt }} cd {{ site.working_dir | last | slice: 0,3 }} +> > ``` +> > +> > {: .language-bash} +> > +> > and then press Tab (the tab key on your keyboard), +> > the shell automatically completes the directory name for you (since there is only one possible match): +> > +> > ``` +> > {{ site.remote.prompt }} cd {{ site.working_dir | last }}/ +> > ``` +> > +> > {: .language-bash} +> > +> > However, you want to move to your personal working directory. If you hit Tab once you will +> > likely see nothing change, as there are more than one possible options. Hitting Tab +> > a second time will print all possible autocomplete options. +> > +> > ``` +> > cwal219/ riom/ harrellw/ +> > ``` +> > +> > {: .output} +> > +> >Now entering in the first few characters of the path (just enough that the possible options are no longer ambiguous) and pressing Tab again, should complete the path. +> > +> > Now press Enter to execute the command. +> > +> > ``` +> > {{ site.remote.prompt }} cd {{ site.working_dir | last }}/ +> > ``` +> > +> > {: .language-bash} +> > +> > Check that we've moved to the right place by running `pwd`. +> > +> > ``` +> > {{ site.working_dir | join: '/' }}/ +> > ``` +> > +> > {: .output} +> {: .solution} +{: .challenge} + ## Creating directories @@ -490,62 +546,6 @@ directories "backup" and "thing"; "/Users/backup" contains "original", include in terminal excersise (delete slurm files later on maybe?) -> ## Tab completion -> -> Sometimes file paths and file names can be very long, making typing out the path tedious. -> One trick you can use to save yourself time is to use something called **tab completion**. -> If you start typing the path in a command and their is only one possible match, -> if you hit tab the path will autocomplete (until there are more than one possible matches). -> -> > ## Solution -> > -> >For example, if you type: -> > -> > ``` -> > {{ site.remote.prompt }} cd {{ site.working_dir | last | slice: 0,3 }} -> > ``` -> > -> > {: .language-bash} -> > -> > and then press Tab (the tab key on your keyboard), -> > the shell automatically completes the directory name for you (since there is only one possible match): -> > -> > ``` -> > {{ site.remote.prompt }} cd {{ site.working_dir | last }}/ -> > ``` -> > -> > {: .language-bash} -> > -> > However, you want to move to your personal working directory. If you hit Tab once you will -> > likely see nothing change, as there are more than one possible options. Hitting Tab -> > a second time will print all possible autocomplete options. -> > -> > ``` -> > cwal219/ riom/ harrellw/ -> > ``` -> > -> > {: .output} -> > -> >Now entering in the first few characters of the path (just enough that the possible options are no longer ambiguous) and pressing Tab again, should complete the path. -> > -> > Now press Enter to execute the command. -> > -> > ``` -> > {{ site.remote.prompt }} cd {{ site.working_dir | last }}/ -> > ``` -> > -> > {: .language-bash} -> > -> > Check that we've moved to the right place by running `pwd`. -> > -> > ``` -> > {{ site.working_dir | join: '/' }}/ -> > ``` -> > -> > {: .output} -> {: .solution} -{: .challenge} - ## Create a text file Now let's create a file. To do this we will use a text editor called Nano to create a file called `draft.txt`: diff --git a/_episodes/07-resources.md b/_episodes/07-resources.md index 7b644a8a..a3217456 100644 --- a/_episodes/07-resources.md +++ b/_episodes/07-resources.md @@ -12,6 +12,7 @@ objectives: keypoints: - "As your task gets larger, so does the potential for inefficiencies." - "The smaller your job (time, CPUs, memory, etc), the faster it will schedule." +math: True --- @@ -118,31 +119,31 @@ If we check the status of our finished job using the `sacct` command we learned With this information, we may determine a couple of things. -Memory efficiency can be determined by comparing ReqMem (requested memory) with MaxRSS (maximum used memory), MaxRSS is given in KB, so a unit conversion is usually required. +Memory efficiency can be determined by comparing ReqMem (requested memory) with MaxRSS (maximum used memory), MaxRSS is given in KB, so a unit conversion is usually required. -{% include figure.html url="" max-width="75%" caption="" - file="/fig/mem_eff.svg" - alt="Memory Efficiency Formula" %} + -So for the above example we see that 0.1GB (102048K) of our requested 1GB meaning the memory efficincy was about 10%. +$$ {Efficiency_{mem} = { MaxRSS \over ReqMem}} $$ -CPU efficiency can be determined by comparing TotalCPU(CPU time), with the maximum possible CPU time. The maximum possible CPU time equal to Alloc (number of allocated CPUs) multiplied by Elapsed (Walltime, actual time passed). +So for the above example we see that 0.1GB (102048K) of our requested 1GB meaning the memory efficincy was about 10%. -{% include figure.html url="" max-width="75%" caption="" - file="/fig/cpu_eff.svg" - alt="CPU Efficiency Formula" %} +CPU efficiency can be determined by comparing TotalCPU(CPU time), with the maximum possible CPU time. The maximum possible CPU time equal to Alloc (number of allocated CPUs) multiplied by Elapsed (Walltime, actual time passed). -For the above example 33 seconds of computation was done, + -where the maximum possible computation time was **96 seconds** (2 CPUs multiplied by 48 seconds), meaning the CPU efficiency was about 35%. +$$ {Efficiency_{cpu} = { TotalCPU \over {Elapsed \times Alloc}}} $$ -Time Efficiency is simply the Elapsed Time divided by Time Requested. +For the above example 33 seconds of computation was done, -{% include figure.html url="" max-width="75%" caption="" - file="/fig/time_eff.svg" - alt="Time Efficiency Formula" %} +where the maximum possible computation time was **96 seconds** (2 CPUs multiplied by 48 seconds), meaning the CPU efficiency was about 35%. -48 seconcds out of 15 minutes requested give a time efficiency of about 5% +Time Efficiency is simply the Elapsed Time divided by Time Requested. + +$$ {Efficiency_{time} = { Elapsed \over Requested}} $$ + + + +48 seconcds out of 15 minutes requested give a time efficiency of about 5% > ## Efficiency Exercise >