You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 1_Introduction_and_setup.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,7 +74,7 @@ The course has three parts. The first introduces the concept of a “compute cl
74
74
75
75
# Cluster Computing
76
76
## What is a compute (or computer) cluster?
77
-
A compute cluster is a set of computers that work together so that they can be regarded as a single entity. These inter-connected computers (known as nodes) run software to coordinate the running of programs across the system. The diagram below gives an overview of a compute cluster.
77
+
A compute cluster is a set of computers that work together so that they can be regarded as a single entity. These inter-connected computers (known as nodes, a sometime blades) run software to coordinate the running of programs across the system. The diagram below gives an overview of a compute cluster.
Copy file name to clipboardExpand all lines: 3_Cluster_Computing.md
+37-7Lines changed: 37 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -112,14 +112,14 @@ All scripts you write should start with the line: `#!/bin/bash`. This makes it
112
112
113
113
The second line is the command you wish to run, which if you remember from before will print “Hello World!” to the screen.
114
114
115
-
To execute this Bash script on the head node, type:
115
+
To execute this Bash script **on a head node**, type:
116
116
117
117
bash test.sh
118
118
Hello World!
119
119
120
120
(Although we are discussing how to submit jobs to the cluster in this section, it is certainly worth knowing that Bash commands can be written to files in this way and subsequently run. Doing this can save users a lot of time entering the same commands over-and-over again into the command line.)
121
121
122
-
So, this has had the same effect as simply entering the echo Hello World! on the command line. Now, in this example, we pass this script to the `sbatch` command to submit the job to a compute node.
122
+
So, this has had the same effect as simply entering the echo Hello World! on the command line. Now, in this example, we pass this script to the `sbatch` command to submit the job **from a head node to a compute node**.
123
123
124
124
sbatch test.sh
125
125
Submitted batch job 2444919
@@ -164,8 +164,12 @@ Passing a bash script to `sbatch` is one way to run a non-interactive job on the
164
164
#SBATCH --job-name=test_job
165
165
#SBATCH --cpus-per-task=c
166
166
#SBATCH --mem=2G
167
-
#SBATCH --mail-type=ALL
168
-
#SBATCH --mail-user=$USER@mrc-lmb.cam.ac.uk
167
+
#SBATCH --mail-user=john_smith@mrc-lmb.cam.ac.uk
168
+
#SBATCH --mem=30G
169
+
170
+
# Bash command
171
+
module load R/4.5.1
172
+
Rscript norm_dist_1_billion.R
169
173
170
174
# Bash commands
171
175
echo Hello World!
@@ -174,14 +178,16 @@ The first line of the script tells the cluster to use the bash shell. The lines
174
178
175
179
1. the shell we wish to use
176
180
177
-
2. the sbatch parameters
181
+
2. the `sbatch` parameters
178
182
179
-
2) the contents of the bash script.
183
+
3) the contents of the bash script.
180
184
181
-
To run the slurm script, enter:
185
+
To run the slurm script, enter**on the head node**:
182
186
183
187
sbatch test.slurm
184
188
189
+
**Please note that the variable `$USER` will not be interpreted inside a Slurm script, and so you will need to enter your actual LMB email address.**
190
+
185
191
### A note on exit codes
186
192
At various points when using the cluster, you may see the term "exit code" reported. What does this mean?
187
193
@@ -345,6 +351,30 @@ Visual Studio Code allows users to connect to the cluster (even from outside the
345
351
The software can be downloaded from:
346
352
https://code.visualstudio.com/
347
353
354
+
We shall not discuss how to use VS Code in detail here, and in any case, the manufacturers of the software produce a good training video at: https://code.visualstudio.com/docs/introvideos/basics
355
+
356
+
To connect to the software to the cluster, you will also need to install the extension "Remote - SSH" from the VS Code marketplace. Click on the marketplace icon in the left-hand side menu to do this.
357
+
358
+
You will also need to specify your login credentials to access the server. The best way to do this is to access the Command Palette (<kbd>Shift</kbd> + <kbd>Command</kbd> + <kbd>P</kbd> (Mac) / <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> (Windows/Linux) and then select `Remote-SSH: Open SSH Configuration File...` Then, from the drop-down menu, select the configuration file that is located in your home directory. Then enter the setup listed below (replacing "your_username" with your actual cluster username):
Log in with your LMB credentials, then click the "slurm" link in the "Additional" section and click the confirmation button.
10
10
11
+
Also, check in this section that the "Shell" is: "/bin/bash". If it is not, then please email Scientific Computing and ask them to change your default shell to "Bash".
12
+
11
13
**Software**
12
14
13
15
Please bring your own laptop to the course, which should be running a recent version of Windows or macOS. Please install recent versions of the following software before attending the course:
0 commit comments