<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-GB link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='mso-fareast-language:EN-US'>Using Parallel or similar will be the easiest and most efficient, but does require that you have control of the R code. There are different approaches for work within a single node or across many nodes, with the latter having a set-up and tear-down cost so the workload within the loop must be worthwhile.<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>I think if you configure Slurm to misrepresent the hardware you might find odd things happen elsewhere.<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>We always disable hyper-threading on the compute nodes, at the recommendation of the company that installed it, who reported that it ran faster that way. Multi-threading has a cost and is not ideal for compute workloads. It is better for things like web servers where some tasks are waiting IO or user input. That said, it likely depends on the CPU and what is true for Intel might not be true for AMD.<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US>From:</span></b><span lang=EN-US> slurm-users <slurm-users-bounces@lists.schedmd.com> <b>On Behalf Of </b>David Bellot<br><b>Sent:</b> 12 October 2020 01:14<br><b>To:</b> Slurm User Community List <slurm-users@lists.schedmd.com><br><b>Subject:</b> Re: [slurm-users] unable to run on all the logical cores<o:p></o:p></span></p></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal><span style='font-family:"Arial",sans-serif'>Indeed, it makes sense now. However, if I launch many R processes using the "parallel" package, I can easily have all the "logical" cores running. In the background, if I'm correct ,R will "fork" and not create a thread. So we have independent processes. On a 20 cores CPU for example, I have 40 "logical" cores and all the cores are running, according to htop.<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial",sans-serif'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial",sans-serif'>With Slurm, I can't reproduce the same behavior even if I use the SelectTypeParameters=CR_CPU.<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial",sans-serif'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial",sans-serif'>So, is there a config to tune, an option to use in "sbatch" to achieve the same result, or should I rather launch 20 jobs per node and have each job split in two internally (using "parallel" or "future" for example)?<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>On Thu, Oct 8, 2020 at 6:32 PM William Brown <<a href="mailto:william@signalbox.org.uk">william@signalbox.org.uk</a>> wrote:<o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><div><p class=MsoNormal>R is single threaded.<o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>On Thu, 8 Oct 2020, 07:44 Diego Zuccato, <<a href="mailto:diego.zuccato@unibo.it" target="_blank">diego.zuccato@unibo.it</a>> wrote:<o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><p class=MsoNormal style='margin-bottom:12.0pt'>Il 08/10/20 08:19, David Bellot ha scritto:<br><br>> good spot. At least, scontrol show job is now saying that each job only<br>> requires one "CPU", so it seems all the cores are treated the same way now.<br>> Though I still have the problem of not using more than half the cores.<br>> So I suppose it might be due to the way I submit (batchtools in this<br>> case) the jobs.<br>Maybe R is generating single-threaded code? In that case, only a single<br>process can run on a given core at a time (processes does not share<br>memory map, threads do, and on Intel CPUs there's a single MMU per core,<br>not one per thread as in some AMDs).<br><br>-- <br>Diego Zuccato<br>DIFA - Dip. di Fisica e Astronomia<br>Servizi Informatici<br>Alma Mater Studiorum - Università di Bologna<br>V.le Berti-Pichat 6/2 - 40127 Bologna - Italy<br>tel.: +39 051 20 95786<o:p></o:p></p></blockquote></div></blockquote></div><p class=MsoNormal><br clear=all><o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><p class=MsoNormal>-- <o:p></o:p></p><div><div><div><div><div><div><div><div><table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 style='border-collapse:collapse;border-spacing:0px'><tr><td width=90 style='width:67.5pt;padding:0cm 0cm 0cm 0cm'><table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 style='border-collapse:collapse;border-spacing:0px'><tr><td style='padding:0cm 0cm 0cm 0cm'><p class=MsoNormal style='mso-line-height-alt:0pt'><a href="https://www.lifetrading.com.au/" target="_blank"><span style='font-size:1.0pt;font-family:"Arial",sans-serif;color:#1155CC;text-decoration:none'><img border=0 width=90 height=90 style='width:.9375in;height:.9375in' id="_x0000_i1025" src="https://cdn.share-and-review.com/a4dbb7fe-109f-4836-b28a-19f584decda8/-/resize/180x180/img.png"></span></a><span style='font-family:"Arial",sans-serif'><o:p></o:p></span></p></td></tr></table></td><td width=7 style='width:5.25pt;padding:0cm 5.25pt 0cm 0cm'></td><td width=3 style='width:2.25pt;background:#3EC2CF;padding:0cm 0cm 0cm 0cm'></td><td width=9 style='width:6.75pt;padding:0cm 6.75pt 0cm 0cm'></td><td style='padding:0cm 0cm 0cm 0cm'><table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 style='border-collapse:collapse;border-spacing:0px'><tr><td style='padding:0cm 0cm 0cm 0cm'><table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 style='border-collapse:collapse;border-spacing:0px'><tr><td style='padding:0cm 0cm 0cm 0cm'><table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 style='border-collapse:collapse;border-spacing:0px'><tr><td style='padding:0cm 0cm 0cm 0cm'><p class=MsoNormal style='line-height:15.0pt'><b><span style='font-size:13.5pt;font-family:"Arial",sans-serif;color:#3EC2CF'>David Bellot</span></b><b><span style='font-size:13.5pt;font-family:"Arial",sans-serif'><o:p></o:p></span></b></p></td></tr><tr style='height:.75pt'><td style='padding:0cm 0cm .75pt 0cm;height:.75pt'></td></tr></table></td><td width=4 style='width:3.0pt;padding:0cm 3.0pt 0cm 0cm'></td><td width=1 style='width:.75pt;background:#595959;padding:0cm 0cm 0cm 0cm'></td><td width=4 style='width:3.0pt;padding:0cm 3.0pt 0cm 0cm'></td><td style='padding:0cm 0cm 0cm 0cm'><table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 style='border-collapse:collapse;border-spacing:0px'><tr><td style='padding:0cm 0cm 0cm 0cm'><p class=MsoNormal style='line-height:12.75pt'><i><span style='font-size:11.5pt;font-family:"Arial",sans-serif;color:#595959'>Head of Quantitative Research</span></i><i><span style='font-size:11.5pt;font-family:"Arial",sans-serif'><o:p></o:p></span></i></p></td></tr></table></td></tr></table></td></tr><tr><td style='padding:0cm 0cm 0cm 0cm'><table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 style='border-collapse:collapse;border-spacing:0px'><tr><td style='padding:0cm 0cm 0cm 0cm'><table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 style='border-collapse:collapse;border-spacing:0px'><tr><td style='padding:0cm 0cm 0cm 0cm'><p class=MsoNormal style='line-height:9.75pt'><span style='font-size:8.5pt;font-family:"Arial",sans-serif;color:#000001'> </span><span style='font-size:8.5pt;font-family:"Arial",sans-serif'><o:p></o:p></span></p></td></tr></table></td></tr></table></td></tr><tr><td style='padding:0cm 0cm 0cm 0cm'><table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 style='border-collapse:collapse;border-spacing:0px'><tr><td style='padding:0cm 0cm 0cm 0cm'><table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 style='border-collapse:collapse;border-spacing:0px'><tr><td style='padding:0cm 0cm 0cm 0cm'><p class=MsoNormal style='line-height:10.5pt'><b><span style='font-size:9.0pt;font-family:"Arial",sans-serif;color:#3EC2CF'>A.</span></b><span style='font-size:9.0pt;font-family:"Arial",sans-serif'> <span style='color:#8F8F8F'>Suite B, Level 3A, 43-45 East Esplanade, Manly, NSW 2095</span><o:p></o:p></span></p></td></tr><tr style='height:.75pt'><td style='padding:0cm 0cm .75pt 0cm;height:.75pt'></td></tr><tr><td style='padding:0cm 0cm 0cm 0cm'><p class=MsoNormal style='line-height:10.5pt'><b><span style='font-size:9.0pt;font-family:"Arial",sans-serif;color:#3EC2CF'>E.</span></b><span style='font-size:9.0pt;font-family:"Arial",sans-serif'> <span style='color:#8F8F8F'><a href="mailto:david.bellot@lifetrading.com.au" target="_blank"><span style='color:#1155CC'>david.bellot@lifetrading.com.au</span></a></span><o:p></o:p></span></p></td></tr><tr style='height:.75pt'><td style='padding:0cm 0cm .75pt 0cm;height:.75pt'></td></tr></table></td></tr></table></td></tr><tr><td style='padding:0cm 0cm 0cm 0cm'><table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 style='border-collapse:collapse;border-spacing:0px'><tr><td style='padding:0cm 0cm 0cm 0cm'><table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 style='border-collapse:collapse;border-spacing:0px'><tr><td style='padding:0cm 0cm 0cm 0cm'><p class=MsoNormal style='line-height:10.5pt'><b><span style='font-size:9.0pt;font-family:"Arial",sans-serif;color:#3EC2CF'>P.</span></b><span style='font-size:9.0pt;font-family:"Arial",sans-serif'> <span style='color:#8F8F8F'>(+61) 0405 263012</span><o:p></o:p></span></p></td></tr></table></td></tr></table></td></tr></table></td></tr></table><p class=MsoNormal><o:p> </o:p></p></div></div></div></div></div></div></div></div></div></body></html>