Skip to content

Commit

Permalink
Replace math fig (#117)
Browse files Browse the repository at this point in the history
* asp timings

* mend

* move tab commpletgion section

* replace fig with math
  • Loading branch information
CallumWalley authored Oct 4, 2024
1 parent 06f4318 commit 8528b22
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 72 deletions.
112 changes: 56 additions & 56 deletions _episodes/02-unix-shell.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <kbd>Tab</kbd> (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 <kbd>Tab</kbd> once you will
> > likely see nothing change, as there are more than one possible options. Hitting <kbd>Tab</kbd>
> > 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 <kbd>Tab</kbd> again, should complete the path.
> >
> > Now press <kbd>Enter</kbd> to execute the command.
> >
> > ```
> > {{ site.remote.prompt }} cd {{ site.working_dir | last }}/<username>
> > ```
> >
> > {: .language-bash}
> >
> > Check that we've moved to the right place by running `pwd`.
> >
> > ```
> > {{ site.working_dir | join: '/' }}/<username>
> > ```
> >
> > {: .output}
> {: .solution}
{: .challenge}

## Creating directories

<!-- NOTE: This bit uses relative paths even though the convept hasn't been introduced yet. -->
Expand Down Expand Up @@ -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 <kbd>Tab</kbd> (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 <kbd>Tab</kbd> once you will
> > likely see nothing change, as there are more than one possible options. Hitting <kbd>Tab</kbd>
> > 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 <kbd>Tab</kbd> again, should complete the path.
> >
> > Now press <kbd>Enter</kbd> to execute the command.
> >
> > ```
> > {{ site.remote.prompt }} cd {{ site.working_dir | last }}/<username>
> > ```
> >
> > {: .language-bash}
> >
> > Check that we've moved to the right place by running `pwd`.
> >
> > ```
> > {{ site.working_dir | join: '/' }}/<username>
> > ```
> >
> > {: .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`:
Expand Down
33 changes: 17 additions & 16 deletions _episodes/07-resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
---
<!--
- scaling testing involves running jobs with increasing resources and measuring the efficiency in order to establish a pattern informed decisions about future job submissions.-->
Expand Down Expand Up @@ -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 <strong style="color:#66cdaa">ReqMem</strong> (requested memory) with <strong style="color:#00e400">MaxRSS</strong> (maximum used memory), MaxRSS is given in KB, so a unit conversion is usually required.
Memory efficiency can be determined by comparing <strong>ReqMem</strong> (requested memory) with <strong>MaxRSS</strong> (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" %}
<!-- {% 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 <strong style="color:#00e400">0.1GB</strong> (102048K) of our requested <strong style="color:#66cdaa">1GB</strong> meaning the memory efficincy was about <strong>10%</strong>.
$$ {Efficiency_{mem} = { MaxRSS \over ReqMem}} $$

CPU efficiency can be determined by comparing <strong style="color:#ff8c00">TotalCPU</strong>(CPU time), with the maximum possible CPU time. The maximum possible CPU time equal to <strong style="color:#ff1493">Alloc</strong> (number of allocated CPUs) multiplied by <strong style="color:#0000ff">Elapsed</strong> (Walltime, actual time passed).
So for the above example we see that <strong>0.1GB</strong> (102048K) of our requested <strong>1GB</strong> meaning the memory efficincy was about <strong>10%</strong>.

{% include figure.html url="" max-width="75%" caption=""
file="/fig/cpu_eff.svg"
alt="CPU Efficiency Formula" %}
CPU efficiency can be determined by comparing <strong>TotalCPU</strong>(CPU time), with the maximum possible CPU time. The maximum possible CPU time equal to <strong>Alloc</strong> (number of allocated CPUs) multiplied by <strong>Elapsed</strong> (Walltime, actual time passed).

For the above example <strong style="color:#ff8c00">33 seconds</strong> of computation was done,
<!-- {% include figure.html url="" max-width="75%" caption="" file="/fig/cpu_eff.svg" alt="CPU Efficiency Formula" %} -->

where the maximum possible computation time was **96 seconds** (<strong style="color:#ff1493">2 CPUs</strong> multiplied by <strong style="color:#0000ff">48 seconds</strong>), meaning the CPU efficiency was about <strong>35%</strong>.
$$ {Efficiency_{cpu} = { TotalCPU \over {Elapsed \times Alloc}}} $$

Time Efficiency is simply the <strong style="color:#0000ff">Elapsed Time</strong> divided by <strong style="color:#1ebfff">Time Requested</strong>.
For the above example <strong>33 seconds</strong> 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** (<strong>2 CPUs</strong> multiplied by <strong>48 seconds</strong>), meaning the CPU efficiency was about <strong>35%</strong>.

<strong style="color:#0000ff">48 seconcds</strong> out of <strong style="color:#1ebfff">15 minutes</strong> requested give a time efficiency of about <strong>5%</strong>
Time Efficiency is simply the <strong>Elapsed Time</strong> divided by <strong>Time Requested</strong>.

$$ {Efficiency_{time} = { Elapsed \over Requested}} $$

<!-- {% include figure.html url="" max-width="75%" caption="" file="/fig/time_eff.svg" alt="Time Efficiency Formula" %}-->

<strong>48 seconcds</strong> out of <strong>15 minutes</strong> requested give a time efficiency of about <strong>5%</strong>

> ## Efficiency Exercise
>
Expand Down

0 comments on commit 8528b22

Please sign in to comment.