-
Notifications
You must be signed in to change notification settings - Fork 0
/
Script-3.txt
176 lines (112 loc) · 5.62 KB
/
Script-3.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
Hello and welcome to the Research IT Videos Channel.
This first series is dedicated to the Merced cluster.
In the previous video we've seen how to connect to the merced cluster,
We are now going to see how to to submit a job to be perfomed by the HPC system.
Let's get started.
--
As in previous video I am going to connect to the merced cluster using SSH.
```
```
And type the command `hostname` followed by `enter` to see on which machine I am currently connected.
I can also issue the command `ls` to list all the files that are current files
and folder in my home directory. the `-l` option of ls give us a more detail informations.
We see that we currently have three folders:
- data
- help
and
- scratch
In our HOME directory.
I can also check which directory I am in by using the `pwd` command.
`clear` can be used to clear the current screen.
---
Let's look at what is available in our help folder.
I am going to use the command `cd` followed by the name of the folder I want to move into.
```
cd help
```
And issue the command `ls` to look at the content of the help folder.
I am interested in using and modifying the files `projectile.exe` and `sample.sub`.
The help folder is read only, so I'm going to have to copy those files into my home directory.
let's go back to our home directory with `cd ~`
```
cd ~
```
`cd ~` is a conveninent way to aalways come back to your home directory if you are lost.
We are going to copy `projectile.exe` using the `cp` command as followed:
- cp
- followed by the source we want to copy, here `help/projectile.exe`
- and the destination; here I want to copy in the current directory, so I am going to use a single dot to represent "Here".
- let' do the same for `sample.sub`
DO COPY SAMPLE.SUB.
Let's have a look at the files we currently have in our home directory:
```
ls -l
```
We know have `sample.sub` and `projectile.exe`
----
Let's have a look at the content of projectile.exe and sample.sub.
I am going to use the `head` command to look at the first few lines.
```
head projectile.exe
```
This looks like giberish; this is because projectile.exe is a binary executable.
```
head sample.sub
```
This does looks more like a text file.
Now we want to run projectile.exe, – this is a sample program that compute the
trajectory of a ball. We could try to do this on the current machine but that
would be ill-advised. The current machine – the Merced Head node – is a gateway
to the HPC system. It is not the most performant machine on our system, and see
a lot of traffic. We want to request for the execution of projectile.exe to be
schedule on a performant machine, that have free resources.
To do so we need to interact with the HPC scheduler – called slurm. Tell it what
resources we expect to use, which program to run, and slurm will takee care of
the rest. To do so we'll edit sample.sub.
CLEAR
----
to edit sample.sub let'use the nano text editor.
We can do so by using the following command:
- nano
- followed by the file name.
I can use arrow keys to move around.
Let's describe out file
- On the first line is a comment we can remove.
- the second line, give a hint about the language this file is written in.
- All the lines starting with #SBATCH are indication for the scheduler
- the first option indicate that we want to use a single machine.
- The second that we'll only going to run a single program.
- The third that we expect to use a single CPU.
- The fourth that we are going to use only 1GB of ram per CPU.
None of these quotas are enforce by the scheduler but it is important to
set those values correctly. As Merced is a shared resource setting a value
too high and not using allocated resources penalise other users and make
you wait longer in line. Asking for too few and the scheduler will
overload machines which may end up crashing your jobs. If either of these
happen the Research IT team may cancel your jobs and notify you. It is
always ok to make mistakes and ask for further help you you need. Properly
using the merced cluster and gaining HPC can help you to justify access to
larger and more powerfull clusters.
The fifth and seventh line indicate time restrictions for your program to
run. The on the `fast.q` your program will likely start soon, but is
restricted to a 4h runtime. We also provide a std.q and long.q for
respectively 24h and 14 days runtime limit; though time until start can be
delayed by that much as well.
We then indicate our program runs in less than 15 minutes, informing the
scheduler that if there is a 15min long spot available, we can fit in here.
This also tell the scheduler that if our program is not finished after
15minutes, it should stop it and notify us.
The 8th options tell give the filename where to store any output from the
program. As we will likely not stay here until the program is run, we
require a filename to write the output. %j will be replaced by the job
number to make sure two jobs do not clober each other output.
Job ne is just a convenient way for you to name your jobs, and we'll ignore
export-all for now.
The next 4 lines are comments, and the next two will be part of running our program.
before moving forward, let's see how to save and quit the text editor.
At the bottom of the screen we have a reminder of shortcut. The carret (or
hat), represent the Control key, note that this is the control key even on MacOS.
Let's press Ctrl-O to save and enter to confirm.
We can now exit with Ctrl-X
---