<div dir="ltr"><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Thanks for the reply... I will look into how to configure it.</div><div><br></div><div><div style="color:rgb(136,136,136)">Sid Young</div><div style="color:rgb(136,136,136)">Translational Research Institute</div></div></div></div></div></div></div></div></div></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jun 23, 2021 at 7:06 AM Prentice Bisbal <<a href="mailto:pbisbal@pppl.gov">pbisbal@pppl.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div>Yes,<div dir="auto"><br></div><div dir="auto">You need to use the cgroups plugin.</div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jun 18, 2021, 12:29 AM Sid Young <<a href="mailto:sid.young@gmail.com" target="_blank">sid.young@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">G'Day all,</div><div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"><br></div><div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">I've had a question from a user of our new HPC, the following should explain it:<br></div><div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"><br></div><div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">➜ srun -N 1 --cpus-per-task 8 --time 01:00:00 --mem 2g --pty python3<div>Python 3.6.8 (default, Nov 16 2020, 16:55:22)</div><div>[GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux</div><div>Type "help", "copyright", "credits" or "license" for more information.</div><div>>>> import os</div><div>>>> os.cpu_count()</div><div>256</div><div>>>> len(os.sched_getaffinity(0))</div><div>256</div>>>><br></div><div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"><br></div><div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">The output of os.cpu_count() is correct: there are 256 CPUs on the server, but the output of len(os.sched_getaffinity(0)) is still 256 when I was expecting it to be 8 - the number of CPUs this process is restricted to. Is my slurm command incorrect? When I run a similar test on XXXXXX I get the expected behaviour:<br></div><div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"><br></div><div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">➜ qsub -I -l select=1:ncpus=4:mem=1gb  <div>qsub: waiting for job 9616042.pbs to start</div><div>qsub: job 9616042.pbs ready</div><div>➜ python3</div><div>Python 3.4.10 (default, Dec 13 2019, 16:20:47) [GCC] on linux</div><div>Type "help", "copyright", "credits" or "license" for more information.</div><div>>>> import os</div><div>>>> os.cpu_count()</div><div>72</div><div>>>> len(os.sched_getaffinity(0))</div><div>4</div>>>><br></div><div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"><br></div><div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">This seems to be a problem for me as I have a program provided by a third-party company that keeps trying to run with 256 threads and crashes. The program is a compiled binary so I don't know if they're just grabbing the number of CPUs or correctly getting the scheduler affinity, but it seems as though TRI's HPC will return the total number of CPUs in any case. There aren't any options with the program to set the number of threads manually.</div><br></div><div>My question to the group is what's causing this? Do I need a cgroups plugin?</div><div><br></div><div>I think these are the relevant lines from the slurm.conf file:</div><div><br></div><div>SelectType=select/cons_res<br>SelectTypeParameters=CR_CPU_Memory<br>ReturnToService=1<br>CpuFreqGovernors=OnDemand,Performance,UserSpace<br>CpuFreqDef=Performance<br></div><div><br></div><br clear="all"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><br></div><div><br></div><div>Sid Young</div><div>Translational Research Institute<br></div></div></div></div></div></div></div></div></div></div></div>
</blockquote></div></div></div>
</blockquote></div>