<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)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:DengXian;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"\@DengXian";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Times New Roman",serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
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-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:"Times New Roman",serif;color:#1F497D">Dear David,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:"Times New Roman",serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:"Times New Roman",serif;color:#1F497D">Thank you for your reply. I did it. It did request one CPU.</span><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I added your command into my job file<o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:"Times New Roman",serif;color:#1F497D">#!/bin/sh<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:"Times New Roman",serif;color:#1F497D">#SBATCH --partition=defq<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:"Times New Roman",serif;color:#1F497D">#SBATCH --ntasks-per-node=2<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:"Times New Roman",serif;color:#1F497D">#SBATCH -n 1<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:"Times New Roman",serif;color:#1F497D">#SBATCH --mem-per-cpu=5gb<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:"Times New Roman",serif;color:#1F497D">#SBATCH --ntasks=1<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:"Times New Roman",serif;color:#1F497D">#SBATCH --cpus-per-task=1<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:"Times New Roman",serif;color:#1F497D">#SBATCH -t 45-00:00:00<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:"Times New Roman",serif;color:#1F497D">#SBATCH -J 9673%j<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:"Times New Roman",serif;color:#1F497D">#SBATCH -o 9673.out<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:"Times New Roman",serif;color:#1F497D">#SBATCH -e 9673.err<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:"Times New Roman",serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:"Times New Roman",serif;color:#1F497D">echo $SLURM_CPUS_ON_NODE<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:"Times New Roman",serif;color:#1F497D">echo $SLURM_JOB_CPUS_PER_NODE<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:"Times New Roman",serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:"Times New Roman",serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:"Times New Roman",serif;color:#1F497D">time /home/scripts/wcnqn.auto.pl<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:"Times New Roman",serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:"Times New Roman",serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:"Times New Roman",serif;color:#1F497D">Here is the results for
</span><o:p></o:p></p>
<p class="MsoNormal">echo $SLURM_CPUS_ON_NODE   <span style="font-family:Wingdings">è</span>       40<br>
echo $SLURM_JOB_CPUS_PER_NODE      <span style="font-family:Wingdings">è</span>          40<o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:"Times New Roman",serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:"Times New Roman",serif;color:#1F497D">Here, the cluster has 8 nodes, each node has 2 sockets, each socket has 20 cores, and each core has 2 threads. Thus, the value is 40.
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:"Times New Roman",serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:"Times New Roman",serif;color:#1F497D">If I use your command “</span>srun --cpus-per-task=1 --ntasks-per-node=1 --partition=standard --mem=1G wcnqn.auto.pl”, I cannot get any output.
<span style="font-size:14.0pt;font-family:"Times New Roman",serif;color:#1F497D">
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:"Times New Roman",serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:"Times New Roman",serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:"Times New Roman",serif;color:#1F497D">I am wondering whether the configuration of the cluster is improper or not. Any further suggestion would be highly appreciated.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:"Times New Roman",serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:"Times New Roman",serif;color:#1F497D">Appreciatively,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:"Times New Roman",serif;color:#1F497D">Leon<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:"Times New Roman",serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:"Times New Roman",serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b>From:</b> David Rhey <drhey@umich.edu> <br>
<b>Sent:</b> Friday, February 15, 2019 07:54<br>
<b>To:</b> Slurm User Community List <slurm-users@lists.schedmd.com><br>
<b>Subject:</b> Re: [slurm-users] How to request ONLY one CPU instead of one socket or one node?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal">Hello,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Are you sure you're NOT getting 1 CPU when you run your job? You might want to put some echo logic into your job to look at Slurm env variables of the node your job lands on as a way of checking. E.g.:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div style="margin-left:30.0pt">
<p class="MsoNormal">echo $SLURM_CPUS_ON_NODE<br>
echo $SLURM_JOB_CPUS_PER_NODE<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I don't see anything wrong with your script. As a test I took the basic parameters you've outlined and ran an interactive `srun` session, requesting 1 CPU per task and 4 CPUs per task, and then looked at the aforementioned variable output
 within each session. For example, requesting 1 CPU per task:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div style="margin-left:30.0pt">
<p class="MsoNormal">[drhey@beta-login ~]$ srun --cpus-per-task=1 --ntasks-per-node=1 --partition=standard --mem=1G --pty bash<br>
[drhey@bn19 ~]$ echo $SLURM_CPUS_ON_NODE<br>
1<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">And again, running this command now asking for 4 CPUs per task and then echoing the env var:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div style="margin-left:30.0pt">
<p class="MsoNormal">[drhey@beta-login ~]$ srun --cpus-per-task=4 --ntasks-per-node=1 --partition=standard --mem=1G --pty bash<br>
[drhey@bn19 ~]$ echo $SLURM_CPUS_ON_NODE<br>
4<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">HTH!<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">David<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Wed, Feb 13, 2019 at 9:24 PM Wang, Liaoyuan <<a href="mailto:wangly@alfred.edu">wangly@alfred.edu</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:14.0pt;font-family:"Times New Roman",serif">Dear there,</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:14.0pt;font-family:"Times New Roman",serif"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:14.0pt;font-family:"Times New Roman",serif">I wrote an analytic program to analyze my data. The analysis costs around twenty days to analyze all data for
 one species. When I submit my job to the cluster, it always request one node instead of one CPU. I am wondering how I can ONLY request one CPU using “sbatch” command? Below is my batch file. Any comments and help would be highly appreciated.
</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:14.0pt;font-family:"Times New Roman",serif"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:14.0pt;font-family:"Times New Roman",serif">Appreciatively,</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:14.0pt;font-family:"Times New Roman",serif">Leon</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:14.0pt;font-family:"Times New Roman",serif">================================================</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.5pt;font-family:"Verdana",sans-serif;color:#666666">#!/bin/sh
<br>
<br>
#SBATCH --ntasks=1 <br>
#SBATCH --cpus-per-task=1 <br>
#SBATCH -t 45-00:00:00 <br>
#SBATCH -J 9625%j <br>
#SBATCH -o 9625.out <br>
#SBATCH -e 9625.err <br>
<br>
/home/scripts/<a href="http://wcnqn.auto.pl" target="_blank">wcnqn.auto.pl</a></span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.5pt;font-family:"Verdana",sans-serif;color:#666666">===========================================</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.5pt;font-family:"Verdana",sans-serif;color:#666666">Where
<a href="http://wcnqn.auto.pl" target="_blank">wcnqn.auto.pl</a> is my program. 9625 denotes the species number.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:14.0pt;font-family:"Times New Roman",serif"> </span><o:p></o:p></p>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><br clear="all">
<br>
-- <o:p></o:p></p>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal">David Rhey<br>
---------------<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.5pt">Advanced Research Computing - Technology Services</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.5pt">University of Michigan</span><o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>