Skip to content

Commit

Permalink
Added a note about killing tasks.
Browse files Browse the repository at this point in the history
  • Loading branch information
CallumWalley committed Sep 18, 2023
1 parent cf74c43 commit c432ef8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 9 deletions.
11 changes: 9 additions & 2 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,18 @@ sched:
efficiency: "nn_seff"
projectcode: "nesi99991"

# For 'R'
example:
lang: "R"
shell: "Rscript"
script: "array_sum.r"
module: "R/4.1.0-gimkl-2020a"

episode_order:
- 01-cluster
- 02-filedir
- 03-break1
- 04-moduless
- 04-modules
- 05-scheduler
- 06-lunch
- 07-resources
Expand Down Expand Up @@ -95,7 +102,7 @@ working_dir:

# Start time in minutes (0 to be clock-independent, 540 to show a start at 09:00 am).
# 600 is 10am
start_time: 780
start_time: 600
# Start time for people wanting to skip bash content
hpc_start_time: 780
# Lesson to start at.
Expand Down
15 changes: 8 additions & 7 deletions _episodes/05-scheduler.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,7 @@ Lets try this now, create and open a new file in your current directory called `


```
{{ site.remote.bash_shebang }}
module load R/4.1.0-gimkl-2020a
Rscript array_sum.r
echo "Done!"
{% include example_scripts/example-job.sh %}
```
{: .language-bash}

Expand All @@ -77,7 +73,6 @@ echo "Done!"
>
{: .callout}


We can now run this script using
```
{{ site.remote.prompt }} bash example-job.sh
Expand All @@ -100,6 +95,13 @@ Done!

You will get the output printed to your terminal as if you had just run those commands one after another.

> ## Cancelling Commands
>
> You can kill a currently running task by pressing the keys <kbd>ctrl</kbd> + <kbd>c</kbd>.
> If you just want your terminal back, but want the task to continue running you can 'background' it by pressing <kbd>ctrl</kbd> + <kbd>v</kbd>.
> Note, a backgrounded task is still attached to your terminal session, and will be killed when you close the terminal (if you need to keep running a task after you log out, have a look at [tmux](https://support.nesi.org.nz/hc/en-gb/articles/4563511601679-tmux-Reference-sheet)).
{: .callout}

## Scheduled Batch Job

Up until now the scheduler has not been involved, our scripts were run directly on the login node (or Jupyter node).
Expand Down Expand Up @@ -188,7 +190,6 @@ status, we check the queue using the command
{% include {{ site.snippets }}/scheduler/basic-job-status.snip %}



If we were too slow, and the job has already finished (and therefore not in the queue) there is another command we can use `{{ site.sched.hist }}` (**s**lurm **acc**oun**t**). By default `{{ site.sched.hist }}` only includes jobs submitted by you, so no need to include additional commands at this point.

```
Expand Down
5 changes: 5 additions & 0 deletions _includes/example_scripts/example-job.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash -e

module load R/4.3.1-gimkl-2022a
Rscript array_sum.r
echo "Done!"

0 comments on commit c432ef8

Please sign in to comment.