Project

General

Profile

Slurm » History » Version 103

Martin Kuemmel, 05/25/2020 09:12 AM

1 21 Kerstin Paech
{{toc}}
2 21 Kerstin Paech
3 92 Martin Kuemmel
*Please read through this entire wikipage so everyone can make efficient use of this cluster*
4 92 Martin Kuemmel
5 53 Sebastian Bocquet
h1. Hardware overview
6 53 Sebastian Bocquet
7 90 Martin Kuemmel
You access the Euclid cluster through cosmogw.kosmo.physik.uni-muenchen.de
8 67 Martin Kuemmel
9 90 Martin Kuemmel
* cosmogw is a gateway machines and should *not* be used for computing
10 90 Martin Kuemmel
* there are 21 compute nodes named euclides01--euclides11 and euclides12--euclides21;
11 77 Martin Kuemmel
* euclides01-euclides11 have each 32 logical CPUs and 64GB of RAM;
12 77 Martin Kuemmel
* euclides12-euclides21 have each 56 logical CPUs and 128GB of RAM;
13 53 Sebastian Bocquet
14 1 Kerstin Paech
h1. How to run jobs on the euclides nodes (using Slurm)
15 1 Kerstin Paech
16 9 Kerstin Paech
Use slurm to submit jobs or login to the euclides nodes (euclides01-21).
17 9 Kerstin Paech
18 90 Martin Kuemmel
h2. Control node cosmogw
19 1 Kerstin Paech
20 1 Kerstin Paech
The machine cosmogw is the login node and submit nodes for the slurm queue, so please do not use them as a simple compute nodes - it's hardware is different from the nodes. It hosts our file server and other services that are important to us.
21 90 Martin Kuemmel
22 1 Kerstin Paech
You should use cosmogw to:
23 92 Martin Kuemmel
* transfer files;
24 92 Martin Kuemmel
* develop your code;
25 92 Martin Kuemmel
* compile your code;
26 92 Martin Kuemmel
* submit jobs to the nodes via the slurm queues;
27 51 Sebastian Bocquet
28 51 Sebastian Bocquet
If you need to debug and would like to login to a node, please start an interactive job to one of the nodes using slurm. For instructions see below.
29 51 Sebastian Bocquet
30 51 Sebastian Bocquet
h2. euclides nodes
31 1 Kerstin Paech
32 1 Kerstin Paech
Job submission to the euclides nodes is handled by the slurm jobmanager (see http://slurm.schedmd.com and https://computing.llnl.gov/linux/slurm/). 
33 1 Kerstin Paech
*Important: In order to run jobs, you need to be added to the slurm accounting system - please contact the admin*
34 4 Kerstin Paech
35 92 Martin Kuemmel
All slurm commands listed below have very helpful man pages (e.g. 'man slurm', 'man squeue', ...). 
36 1 Kerstin Paech
37 4 Kerstin Paech
If you are already familiar with another jobmanager the following information may be helpful to you http://slurm.schedmd.com/rosetta.pdf‎.
38 1 Kerstin Paech
39 75 Martin Kuemmel
h3. Scheduling of Jobs
40 69 Martin Kuemmel
41 92 Martin Kuemmel
At this point there are four queues, called partitions in slurm:
42 92 Martin Kuemmel
* on cosmogw:
43 1 Kerstin Paech
** *normal* which is the default partition your jobs will be sent to if you do not specify it otherwise. At this point there is a time limit of
44 92 Martin Kuemmel
four days; this queue comprises the computing nodes euclides01-18;
45 92 Martin Kuemmel
** the *lowpri* partition also comprises the computing nodes euclides01-18; it is a so called preempty queue, allowing more resources for the users; however jobs are re-queued (canceled and re-scheduled) if the resources are demanded on the normal queue;
46 92 Martin Kuemmel
** *eucliddevel* which is intended for software development, especially if he 'normal' is full; this queue comprises the computing nodes euclides19-21; people from the Euclid group have an account on this queue; each user is allowed to use up to 56 cpus;
47 92 Martin Kuemmel
** *cosmodevel* which is intended for software development, especially if he 'normal' is full; this queue comprises the computing nodes euclides19-21; people from the cosmology group have an account on this queue; each user is allowed to use up to 4 cpus; note that this queue is preempt, meaning that the users of the queue eucliddevel precedence;
48 1 Kerstin Paech
49 92 Martin Kuemmel
50 38 Kerstin Paech
The default memory per core used is 2GB, if you need more or less, please specify with the --mem or --mem-per-cpu option.
51 9 Kerstin Paech
52 9 Kerstin Paech
We have also set up a scheduler that goes beyond the first come first serve - some jobs will be favoured over others depending
53 9 Kerstin Paech
on how much you or your group have been using euclides in the past 2 weeks, how long the job has been queued and how much
54 9 Kerstin Paech
resources it will consume.
55 9 Kerstin Paech
56 92 Martin Kuemmel
Job scheduling is a complex issue and we can and have to adjust to the users need whenever possible. Please feel free to speak out if
57 9 Kerstin Paech
there is something that can be improved without creating an unfair disadvantage for other users.
58 9 Kerstin Paech
59 92 Martin Kuemmel
You can run interactive jobs on all partitions.
60 9 Kerstin Paech
61 41 Kerstin Paech
h3. Running an interactive job with slurm (a.k.a. logging in)
62 1 Kerstin Paech
63 9 Kerstin Paech
To run an interactive job with slurm in the default partition, use
64 1 Kerstin Paech
65 1 Kerstin Paech
<pre>
66 14 Kerstin Paech
srun -u --pty bash
67 1 Kerstin Paech
</pre>
68 9 Kerstin Paech
69 1 Kerstin Paech
If you want to use tcsh use
70 1 Kerstin Paech
71 1 Kerstin Paech
<pre>
72 1 Kerstin Paech
srun -u --pty tcsh
73 1 Kerstin Paech
</pre>
74 1 Kerstin Paech
75 15 Shantanu Desai
If you want to use a larger memory per job do
76 15 Shantanu Desai
77 15 Shantanu Desai
<pre>
78 15 Shantanu Desai
srun -u --mem-per-cpu=8000 --pty tcsh
79 30 Shantanu Desai
</pre>
80 20 Kerstin Paech
81 1 Kerstin Paech
In case you want to open x11 applications, use the --x11=first option, e.g.
82 20 Kerstin Paech
<pre>
83 20 Kerstin Paech
srun --x11=first -u --pty  bash
84 92 Martin Kuemmel
</pre>
85 92 Martin Kuemmel
86 92 Martin Kuemmel
Opening an interactive session on one of the development partitions is done with:
87 92 Martin Kuemmel
<pre>
88 92 Martin Kuemmel
srun --account=<euclid_dev/cosmo_dev> --partition=<eucliddevel/cosmodevel> --x11=first -u --pty  bash
89 12 Kerstin Paech
</pre>
90 1 Kerstin Paech
91 44 Kerstin Paech
h3. limited ssh access
92 44 Kerstin Paech
93 44 Kerstin Paech
If you have an active job (batch or interactive), you can login to the node the job is running on. Your ssh session will be killed if the job terminates. Your ssh session will be restricted to the same resources as your job (so you cannot accidentally bypass the job scheduler and harm other user's jobs).
94 44 Kerstin Paech
95 77 Martin Kuemmel
h3. Running a simple one core batch job with slurm using the default partition
96 1 Kerstin Paech
97 1 Kerstin Paech
* To see what queues are available to you (called partitions in slurm), run:
98 1 Kerstin Paech
<pre>
99 1 Kerstin Paech
sinfo
100 1 Kerstin Paech
</pre>
101 1 Kerstin Paech
102 1 Kerstin Paech
* To run slurm, create a myjob.slurm containing the following information:
103 1 Kerstin Paech
<pre>
104 1 Kerstin Paech
#!/bin/bash
105 1 Kerstin Paech
#SBATCH --output=slurm.out
106 1 Kerstin Paech
#SBATCH --error=slurm.err
107 1 Kerstin Paech
#SBATCH --mail-user <put your email address here>
108 1 Kerstin Paech
#SBATCH --mail-type=BEGIN
109 8 Kerstin Paech
#SBATCH -p normal
110 91 Martin Kuemmel
#SBATCH --ntasks=1
111 1 Kerstin Paech
112 1 Kerstin Paech
/bin/hostname
113 1 Kerstin Paech
</pre>
114 1 Kerstin Paech
115 1 Kerstin Paech
* To submit a batch job use:
116 1 Kerstin Paech
<pre>
117 1 Kerstin Paech
sbatch myjob.slurm
118 1 Kerstin Paech
</pre>
119 1 Kerstin Paech
120 1 Kerstin Paech
* To see the status of you job, use 
121 1 Kerstin Paech
<pre>
122 1 Kerstin Paech
squeue
123 1 Kerstin Paech
</pre>
124 1 Kerstin Paech
125 11 Kerstin Paech
* To kill a job use:
126 11 Kerstin Paech
<pre>
127 11 Kerstin Paech
scancel <jobid>
128 11 Kerstin Paech
</pre> the <jobid> you can get from using squeue.
129 1 Kerstin Paech
130 1 Kerstin Paech
* For some more information on your job use
131 11 Kerstin Paech
<pre>
132 1 Kerstin Paech
scontrol show job <jobid>
133 11 Kerstin Paech
</pre>the <jobid> you can get from using squeue.
134 1 Kerstin Paech
135 77 Martin Kuemmel
h3. Running a simple once core batch job with slurm using the lowpri partition
136 10 Kerstin Paech
137 77 Martin Kuemmel
Change the partition to lowpri and add the appropriate account depending if you're part of
138 10 Kerstin Paech
the euclid or cosmology group.
139 10 Kerstin Paech
140 10 Kerstin Paech
<pre>
141 10 Kerstin Paech
#!/bin/bash
142 10 Kerstin Paech
#SBATCH --output=slurm.out
143 10 Kerstin Paech
#SBATCH --error=slurm.err
144 10 Kerstin Paech
#SBATCH --mail-user <put your email address here>
145 10 Kerstin Paech
#SBATCH --mail-type=BEGIN
146 77 Martin Kuemmel
#SBATCH --account=[euclid_lowpri/cosmo_lowpri]
147 77 Martin Kuemmel
#SBATCH --partition=lowpri
148 91 Martin Kuemmel
#SBATCH --ntasks=1
149 10 Kerstin Paech
150 10 Kerstin Paech
/bin/hostname
151 10 Kerstin Paech
</pre>
152 10 Kerstin Paech
153 22 Kerstin Paech
h3. Accessing a node where a job is running or starting additional processes on a node
154 22 Kerstin Paech
155 25 Kerstin Paech
You can attach an srun command to an already existing job (batch or interactive). This
156 22 Kerstin Paech
means you can start an interactive session on a node where a job of yours is running
157 26 Kerstin Paech
or start an additional process.
158 22 Kerstin Paech
159 22 Kerstin Paech
First determine the jobid of the desired job using squeue, then use 
160 22 Kerstin Paech
161 22 Kerstin Paech
<pre>
162 22 Kerstin Paech
srun  --jobid <jobid> [options] <executable> 
163 22 Kerstin Paech
</pre>
164 22 Kerstin Paech
Or more concrete
165 22 Kerstin Paech
<pre>
166 22 Kerstin Paech
srun  --jobid <jobid> -u --pty  bash # to start an interactive session
167 22 Kerstin Paech
srun  --jobid <jobid> ps -eaFAl  # to start get detailed process information 
168 22 Kerstin Paech
</pre>
169 22 Kerstin Paech
170 24 Kerstin Paech
The processes will only run on cores that have been allocated to you. This works 
171 24 Kerstin Paech
for batch as well as interactive jobs. 
172 23 Kerstin Paech
*Important: If the original job that was submitted is finished, any process 
173 23 Kerstin Paech
attached in this fashion will be killed.*
174 22 Kerstin Paech
175 10 Kerstin Paech
176 6 Kerstin Paech
h3. Batch script for running a multi-core job
177 6 Kerstin Paech
178 61 Martin Kuemmel
mpi is installed on cosmofs1.
179 17 Kerstin Paech
180 18 Kerstin Paech
To run a 4 core job for an executable compiled with mpi you can use
181 6 Kerstin Paech
<pre>
182 6 Kerstin Paech
#!/bin/bash
183 6 Kerstin Paech
#SBATCH --output=slurm.out
184 6 Kerstin Paech
#SBATCH --error=slurm.err
185 6 Kerstin Paech
#SBATCH --mail-user <put your email address here>
186 1 Kerstin Paech
#SBATCH --mail-type=BEGIN
187 91 Martin Kuemmel
#SBATCH --ntasks=4
188 1 Kerstin Paech
189 18 Kerstin Paech
mpirun <programname>
190 1 Kerstin Paech
191 1 Kerstin Paech
</pre>
192 18 Kerstin Paech
and it will automatically start on the number of nodes specified.
193 1 Kerstin Paech
194 18 Kerstin Paech
To ensure that the job is being executed on only one node, add
195 18 Kerstin Paech
<pre>
196 18 Kerstin Paech
#SBATCH -n 4
197 18 Kerstin Paech
</pre>
198 18 Kerstin Paech
to the job script.
199 17 Kerstin Paech
200 19 Kerstin Paech
If you would like to run a program that itself starts processes, you can use the
201 19 Kerstin Paech
environment variable $SLURM_NPROCS that is automatically defined for slurm
202 19 Kerstin Paech
jobs to explicitly pass the number of cores the program can run on.
203 19 Kerstin Paech
204 17 Kerstin Paech
To check if your job is acutally running on the specified number of cores, you can check
205 17 Kerstin Paech
the PSR column of
206 17 Kerstin Paech
<pre>
207 17 Kerstin Paech
ps -eaFAl
208 17 Kerstin Paech
# or ps -eaFAl | egrep "<yourusername>|UID" if you just want to see your jobs
209 6 Kerstin Paech
</pre>
210 27 Jiayi Liu
211 28 Kerstin Paech
h3. environment for jobs
212 27 Jiayi Liu
213 29 Kerstin Paech
By default, slurm does not initialize the environment (using .bashrc, .profile, .tcshrc, ...)
214 29 Kerstin Paech
215 28 Kerstin Paech
To use your usual system environment, add the following line in the submission script:
216 27 Jiayi Liu
<pre>
217 27 Jiayi Liu
#SBATCH --get-user-env
218 1 Kerstin Paech
</pre>
219 1 Kerstin Paech
220 87 Martin Kuemmel
h3. Slurm reporting and accounting
221 87 Martin Kuemmel
222 88 Martin Kuemmel
For information on job usage and cluster utilization for slurm jobs the slurm command "sreport" can be used. E.g. the command:
223 87 Martin Kuemmel
<pre>
224 87 Martin Kuemmel
sreport user topusage start=01/15/18 -t percent
225 87 Martin Kuemmel
</pre>
226 88 Martin Kuemmel
shows the top ten users in percent since January 15th 2018. For more information please look at "man sreport".
227 87 Martin Kuemmel
228 88 Martin Kuemmel
For accounting on specific jobs the slurm command "sacct" can be used. E.g. the command:
229 87 Martin Kuemmel
<pre>
230 87 Martin Kuemmel
sacct -j 18551 --format=JobID,JobName,MaxRSS,Elapsed
231 87 Martin Kuemmel
</pre>
232 88 Martin Kuemmel
displays information (elapsed time, memory usage, ...) on the job number "18551". For more details please  use "man sacct".
233 87 Martin Kuemmel
234 78 Martin Kuemmel
h3. Some points on the 'normal' versus 'lowpri' queue on cosmogw
235 78 Martin Kuemmel
236 93 Martin Kuemmel
The allowances for each user on the *normal* partition are 304CPU's and 661335MB, which corresponds to about 1/3 of the entire cluster (euclides01-19). In short, every user is allowed to use up to 1/3 of the cluster in the normal partition.
237 78 Martin Kuemmel
238 78 Martin Kuemmel
On the partition *lowpri* (for low priority) there are no limits on the CPU numbers or RAM consumption, meaning the user can take all available resources up to the *entire* cluster! However, jobs on the partition "lowpri" have a lower priority through the so called preemption mechanism. This means if all nodes are busy (partially through the lowpri queue) and an additional job is submitted to the "normal" partition, slurm will re-queue (meaning cancel and re-schedule to the lowpri-queue) job(s) on the "lowpri" partition to get the job on the "normal" partition running.
239 78 Martin Kuemmel
240 78 Martin Kuemmel
Here is an example scenario to illustrate the opportunities the "lowpri" partition offers:
241 93 Martin Kuemmel
I want to submit a number of jobs for in total 744cpu's. The entire cluster has 744 cpu's in total, this means in the optimal case I get 1/3 of the cluster on the "normal" partition, and it takes at least three cycles to get all my jobs finished. However, if I submit to the "lowpri" partition, in the case of an empty cluster I can use the *entire* cluster and finish in only one cycle. Of course it may happen that other users submit lots of jobs to the "normal" partition afterwards and many of my jobs are being re-queued. That would then delay the finishing of my jobs on the "lowpri" partition correspondingly. To highlight some aspects of using the "lowpri" partition:
242 78 Martin Kuemmel
243 78 Martin Kuemmel
* it is relevant especially when you want to submit several jobs that significantly exceed the user allowance on the "normal" partition and need the entire cluster to get finished;
244 78 Martin Kuemmel
* on average, the available ressources on the "lowpri" partition are much *larger* than on the "normal" partition, especially during the night or on the weekend;
245 78 Martin Kuemmel
* please not that *no job gets ever lost* at the "lowpri" partition; if re-queuing occurs, the user gets an email (Subject: "SLURM Job_id=2563 Name=test_mpi_gather.slurm Failed, Run time 00:01:58, PREEMPTED, ExitCode 0") when the job is stopped and subsequently when it starts again and when it finishes (see 1.);
246 78 Martin Kuemmel
* also on the "lowpri" partition there is a queue which decides which job comes first (of course only in the case of an oversubscription);
247 78 Martin Kuemmel
* the preemption mechanism tries to minimize the number of re-queued jobs necessary to get the job in the "normal" partition going; so, if 8 cpus are requested and the "lowpri" partion contains one job using 8 cpus, three jobs using 4 cpus and several dozens jobs using 1 cpu, only the job with 8 cpus is re-scheduled independent on the run times and other parameters.
248 78 Martin Kuemmel
249 79 Martin Kuemmel
To submit a job to the "lowpri" partition please insert the following lines into the slurm batch script (see also example above):
250 79 Martin Kuemmel
<pre>
251 93 Martin Kuemmel
#SBATCH --account=<your account>
252 79 Martin Kuemmel
#SBATCH -p lowpri
253 79 Martin Kuemmel
</pre>
254 79 Martin Kuemmel
255 79 Martin Kuemmel
with <your_acount> being either "cosmo_lowpri" or "euclid_lowpri".
256 79 Martin Kuemmel
257 80 Martin Kuemmel
There are two typical scenarios where a user can gain from the lowpri queue:
258 80 Martin Kuemmel
* if a job stores intermediate results at regular intervals and picks up from there once started again; then even a long job looses only the computing time since the last storage point if a job is re-scheduled;
259 80 Martin Kuemmel
* if a single job needs only a small amount of computing time (perhaps <12h) but a lot of jobs need to be run; then the loss of computing time is rather small if a job is re-scheduled;
260 80 Martin Kuemmel
261 58 Martin Kuemmel
h2. desdb node
262 58 Martin Kuemmel
263 58 Martin Kuemmel
Some specific jobs in cosmodb, such as the "catalog ingest", need to be performed on the machines desdb1/2. For those jobs there is the slurm account "euclid_cat_ing" with the partition "cat_ing". Only selected persons from the Euclid group have access to this node. Please specify "-p cat_ing" and "--account euclid_cat_ing" on the command line or in the slurm script.
264 28 Kerstin Paech
265 28 Kerstin Paech
h2. Software specific setup
266 28 Kerstin Paech
267 28 Kerstin Paech
h3. Python environment 
268 28 Kerstin Paech
269 28 Kerstin Paech
You can use the python 2.7.3 installed on the euclides cluster by using
270 27 Jiayi Liu
271 27 Jiayi Liu
<pre>
272 27 Jiayi Liu
source /data2/users/ccsoft/etc/setup_all
273 37 Kerstin Paech
source  /data2/users/ccsoft/etc/setup_python2.7.3
274 33 Shantanu Desai
</pre>
275 32 Shantanu Desai
276 32 Shantanu Desai
277 34 Shantanu Desai
h2. Notes For Euclid users
278 32 Shantanu Desai
279 35 Shantanu Desai
For those submitting jobs to euclides* nodes through Cosmo DM pipeline  here are some things which need to be specified for customized job submissions,
280 35 Shantanu Desai
since a different interface to slurm is used.
281 34 Shantanu Desai
282 34 Shantanu Desai
* To use larger memory per block , specify max_memory = 6000 (for 6G) and so on. inside block definition or in the submit file (in
283 34 Shantanu Desai
case you want to use it for all blocks)
284 34 Shantanu Desai
285 34 Shantanu Desai
* If you want to run on multiple cores/cores then use 
286 34 Shantanu Desai
nodes='<number of nodes>:ppn=<number of cores> inside the block definition of a particular block or in the submit file in case you want
287 1 Kerstin Paech
to use it for all blocks.
288 34 Shantanu Desai
289 35 Shantanu Desai
* If you want to use a larger wall time then specify wall_mod=<wall time in minutes> inside the module definition
290 39 Shantanu Desai
291 61 Martin Kuemmel
* note that queue=serial does not work on cosmofs1 (we usually use it for c2pap)
292 45 Roy Henderson
293 45 Roy Henderson
h1. Admin
294 45 Roy Henderson
295 102 Martin Kuemmel
There is a user "slurm" which however is not really necessary for the administration work. The slurm administrator needs sudo access. Some scripts re-starting slurm, adding a user and similar things are in "/data1/users/slurm/cosmo". With the sudo access the admin can execute those scripts. In the mysql database there is the username "slurmdb" with password.
296 63 Martin Kuemmel
297 63 Martin Kuemmel
h2. Slurm configuration
298 63 Martin Kuemmel
299 1 Kerstin Paech
h3. Slurm configuration file
300 63 Martin Kuemmel
301 102 Martin Kuemmel
The currently valid version of the configuration file is "/data1/users/slurm/cosmo/slurm.conf" on cosmogw, respectively. To apply a modified slurm configuration, the script "newconfig.sh" can be used. 
302 63 Martin Kuemmel
303 63 Martin Kuemmel
The script 
304 63 Martin Kuemmel
305 1 Kerstin Paech
* copies the configuration file to the submit node and restarts the submit service;
306 63 Martin Kuemmel
* copies the configuration file to all computing nodes and triggers the reconfiguration there;
307 63 Martin Kuemmel
308 102 Martin Kuemmel
Then the slurm daemon needs to be started on the submit node and all computing nodes with the script "restart.sh". 
309 72 Martin Kuemmel
310 72 Martin Kuemmel
*Note:* Right now the slurmd deamons do not properly start on cosmogw. Even if the start fails, the slurmd daemon is there and working.
311 72 Martin Kuemmel
312 63 Martin Kuemmel
313 62 Martin Kuemmel
h2. User management
314 1 Kerstin Paech
315 62 Martin Kuemmel
h3. Overview over users, accounts, etc.
316 62 Martin Kuemmel
317 50 Sebastian Bocquet
No sudo access needed:
318 50 Sebastian Bocquet
<pre>
319 50 Sebastian Bocquet
/usr/local/bin/sacctmgr show account withassoc
320 1 Kerstin Paech
</pre>
321 1 Kerstin Paech
322 62 Martin Kuemmel
h3. Adding a new user
323 45 Roy Henderson
324 62 Martin Kuemmel
As root on @cosmofs1@,
325 45 Roy Henderson
326 45 Roy Henderson
<pre>
327 55 Sebastian Bocquet
cd /data1/users/slurm/
328 1 Kerstin Paech
./add_user.sh UserName account(cosmo or euclid)
329 45 Roy Henderson
/usr/local/bin/.scontrol reconfigure
330 45 Roy Henderson
</pre>
331 62 Martin Kuemmel
332 45 Roy Henderson
h3. To increase memory, cores etc for a user
333 45 Roy Henderson
334 45 Roy Henderson
Inside script above, various commands for changing user settings, e.g.
335 1 Kerstin Paech
336 1 Kerstin Paech
<pre>
337 1 Kerstin Paech
/usr/local/bin/sacctmgr -i modify user  name=$1 set GrpCPUs=32
338 45 Roy Henderson
/usr/local/bin/sacctmgr -i modify user  name=$1 set GrpMem=128000
339 45 Roy Henderson
</pre>
340 62 Martin Kuemmel
341 62 Martin Kuemmel
h2. Trouble shooting
342 1 Kerstin Paech
343 63 Martin Kuemmel
h3. Information on a particular node
344 1 Kerstin Paech
345 63 Martin Kuemmel
The command "/usr/local/bin/scontrol show node <nodename>" gives detailed information on a particular node (status, reason for being down and so on)
346 63 Martin Kuemmel
347 63 Martin Kuemmel
h3. Node in state "drain"
348 63 Martin Kuemmel
349 50 Sebastian Bocquet
When a node is in "drain" state when calling <pre>sinfo</pre>
350 50 Sebastian Bocquet
run
351 50 Sebastian Bocquet
<pre>
352 50 Sebastian Bocquet
/usr/local/bin/scontrol update nodename=NODE_NAME state=resume
353 50 Sebastian Bocquet
</pre>
354 50 Sebastian Bocquet
to put it back to operation.
355 48 Martin Kuemmel
356 94 Martin Kuemmel
h3. Restart
357 94 Martin Kuemmel
358 94 Martin Kuemmel
A full running of slurm requires:
359 94 Martin Kuemmel
360 94 Martin Kuemmel
* running the data base mysql;
361 94 Martin Kuemmel
* running the slurm data base daemon slurmdpd (for accounting);
362 94 Martin Kuemmel
* running slurmctld on cosmogw;
363 94 Martin Kuemmel
* slurmd on all nodes;
364 94 Martin Kuemmel
365 94 Martin Kuemmel
h4. mysql
366 94 Martin Kuemmel
367 103 Martin Kuemmel
Mysql is started with 'systemctl start mysql'. The log is in '/var/log/mysqld.log' At one re-start (January 2019) the log said "/usr/sbin/mysqld: Can't create/write to file '/var/run/mysqld/mysqld.pid'". Then '/var/run/mysqld' did not exist (somehow disappeared). It had to be created and given to the owner 'mysql'. Then the file mysql.pid is created and mysql seems to be working fine.
368 94 Martin Kuemmel
369 94 Martin Kuemmel
h4. slurmdbd
370 94 Martin Kuemmel
371 97 Martin Kuemmel
Should be started with 'systemctl status slurmdbd'. However this does not seem to work always (at least not on January 2019). It is possible to start the daemon directly with '/usr/local/sbin/slurmdbd'. The log of slurm is in '/var/log/slurm/slurmdbd.log'.
372 94 Martin Kuemmel
373 94 Martin Kuemmel
h4. slurmctld and slurmd
374 95 Martin Kuemmel
375 94 Martin Kuemmel
A re-start of the slurm daemons ('slurmctld' on cosmogw and 'slurmd' on the nodes) is done bye executing the script:
376 94 Martin Kuemmel
/data1/users/slurm/cosmo/restart.sh
377 94 Martin Kuemmel
378 48 Martin Kuemmel
h2. Nodes down
379 48 Martin Kuemmel
380 1 Kerstin Paech
Sometimes nodes are reported as "down". This seems to happen as a result of network problems. Here is some "troubleshooting":https://computing.llnl.gov/linux/slurm/troubleshoot.html#nodes for this situation. Also after a re-boot of cosmofs1 some manual work on slurm might be necessary to get going again.
381 63 Martin Kuemmel
382 76 Martin Kuemmel
If a job does not finish and remains int eh state "CG" then the sequence:
383 76 Martin Kuemmel
<pre>
384 98 Martin Kuemmel
/usr/local/bin/scontrol update NodeName=euclides01 State=down Reason=hung_proc
385 98 Martin Kuemmel
/usr/local/bin/scontrol update NodeName=euclides01 State=resume Reason=hung_proc
386 76 Martin Kuemmel
</pre>
387 76 Martin Kuemmel
brings the node back again.
388 76 Martin Kuemmel
389 1 Kerstin Paech
h2. History
390 89 Martin Kuemmel
391 99 Martin Kuemmel
* January 2nd 2020: one user (Thomas) got the error:
392 100 Martin Kuemmel
<pre>
393 100 Martin Kuemmel
[cosmogw][~] $ srun -u --mem-per-cpu=2000 --x11=first --cpus-per-task=56 --pty bash 
394 99 Martin Kuemmel
srun: error: plugin_load_from_file: dlopen(/usr/local/lib/slurm/select_cons_res.so): /usr/local/lib/slurm/select_cons_res.so: undefined symbol: powercap_get_cluster_current_cap
395 1 Kerstin Paech
srun: error: Couldn't load specified plugin name for select/cons_res: Dlopen of plugin file failed
396 99 Martin Kuemmel
srun: fatal: Can't find plugin for select/cons_res
397 100 Martin Kuemmel
</pre>
398 101 Martin Kuemmel
Turns out that the problem was to set "export LD_BIND_NOW=1" for another issue. After unsetting this slurm worked normally.
399 99 Martin Kuemmel
* December 30th 2019: somehow the controler job slurmctld on cosmogw was down. Agter re-star everything was okay.
400 85 Martin Kuemmel
* January 23rd 2018: Jobs on euclides12 are no longer finishing. They end up in the state "CG" and hang there forever. In the slurmd log there is the entry "[2018-01-23T10:12:17.477] [18153] error: Unable to establish controller machine" basically every 15mins or so. ssh from euclides12 to cosmogw via name and IP address was possible, so it is difficult to interpret this error message. At the end the problem was solved by:
401 81 Martin Kuemmel
** stopping slurmd
402 81 Martin Kuemmel
** removing /var/run/slurmd.pid
403 81 Martin Kuemmel
** creating /var/run/slurmd.pid via touch
404 81 Martin Kuemmel
** re-starting slurmd again
405 86 Martin Kuemmel
** euclides12 had before this sometimes created problems, maybe this was the culmination now.
406 81 Martin Kuemmel
407 73 Martin Kuemmel
* May 18th 2017: On cosmogw, three nodes were reported as "DOWN" despite running the slurmd daemon and having connections to the slurmctl daemon on the control node; turns out that with a normal "/etc/init.d/slurm start" on the control machine only nodes are considered that are *not* DOWN; "/etc/init.d/slurm startclean" must be used to establish new connections to all nodes to take them back into the queue;
408 73 Martin Kuemmel
409 66 Martin Kuemmel
* May 2nd 2017: the control daemon on cosmofs1 was no longer working; also it could not e re-started; the corresponding commands "/etc/init.d/slurm status/start" were not giving back any kind of feedback, the log files were empty; the relevant daemon on the nodes "slurmd", was running smoothly; a comparison revealed that the difference was whether the command  "/usr/local/bin/scontrol show daemon" does return the daemon name or nothing, and in the later case nothing happens and the daemon does not run well; further investigation showed that the machine name given in "slurm.conf" as "ControlMachine=" needs to be identical to the name returned of the command "hostname"; this was no longer the case, likely induced due to moving the machines to the new sub-net (the exact mechanism is unclear);
410 66 Martin Kuemmel
411 65 Martin Kuemmel
* April 24th 2017: taking euclides11 out of the queues to free it for the new OS and the slurm test on it; euclides10 is now the development node;
412 63 Martin Kuemmel
413 63 Martin Kuemmel
* April 07th 2017: Applying "/usr/local/bin/scontrol show node euclides11" for the debug partition euclides11 says "Reason=Node unexpectedly rebooted [root@2016-12-14T13:25:01]"; internet research suggested to change "ReturnToService=" from 1 to 2 in the configuration file; after applying and restarting the new configuration file the debug nodes works again.;
414 63 Martin Kuemmel
415 63 Martin Kuemmel
* April 06th 2017: After the reconfiguration of the cluster the slurm confguration file was adjusted (to reflect the new machine names); also minor changes had to be applied to the scripts "newconfig.sh" and "restart.sh" to loop over the new names; the new configuration files were applied and slurm restarted; all computing nodes for the normal partition came up, the debug partition stayed down;
416 63 Martin Kuemmel
417 63 Martin Kuemmel
* March 29th 2017: euclides7 is in drain state;  "/usr/local/bin/scontrol show node euclides2" says "Reason=Epilog error"; when resumed, seems to work normal;
418 63 Martin Kuemmel
419 63 Martin Kuemmel
* March 28th 2017: euclides2 is in drain state; when resumed, it goes into drain state when using it the next time; "/usr/local/bin/scontrol show node euclides2" says "Reason=Prolog error"; after a reboot the machine was in status "idle*"; when resumed, it worked again;
Redmine Appliance - Powered by TurnKey Linux