<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=iso-8859-1">
<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:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 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;
mso-ligatures:standardcontextual;
mso-fareast-language:EN-US;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-ligatures:standardcontextual;
mso-fareast-language:EN-US;}
span.EstilCorreuElectrnic17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:487089722;
mso-list-type:hybrid;
mso-list-template-ids:950674078 67305473 67305475 67305477 67305473 67305475 67305477 67305473 67305475 67305477;}
@list l0:level1
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l0:level2
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level3
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l0:level4
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l0:level5
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level6
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l0:level7
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l0:level8
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level9
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
--></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="CA" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Hi,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I want to run a simple test that uses one node and four cores. Also, in my script, I execute a binary that reports me in what core is running one of the four tasks. These are my files:<o:p></o:p></p>
<ul style="margin-top:0cm" type="disc">
<li class="MsoListParagraph" style="margin-left:0cm;mso-list:l0 level1 lfo1">submit script:<o:p></o:p></li></ul>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas">#!/bin/bash<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas">#SBATCH --job-name=test_jobs # Job name<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas">#SBATCH --output=test_job_%j.out # Output file (using array index)<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas">#SBATCH --error=test_job_%j.err # Error file (using array index)<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas">#SBATCH --ntasks=4<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas">#SBATCH --ntasks-per-core=1<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas">#SBATCH --cpus-per-task=1 # Number of CPU cores per task<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas">echo "START : $(date)"<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas">srun -n1 -c1 check_cores >> output_small.txt &<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas">srun -n1 -c1 check_cores >> output_small.txt &<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas">srun -n1 -c1 check_cores >> output_small.txt &<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas">srun -n1 -c1 check_cores >> output_small.txt &<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"># Wait for all jobs to finish before exiting the job submission script<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas">wait<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas">echo "END : $(date)"<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"><o:p> </o:p></span></p>
<ul style="margin-top:0cm" type="disc">
<li class="MsoListParagraph" style="margin-left:0cm;mso-list:l0 level1 lfo1">check_cores.c file:<o:p></o:p></li></ul>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas">#include <stdio.h><o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas">#include<unistd.h><o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas">struct pstat<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas">{<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> int pid; //process id<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> char tcomm[256];//filename of the executable<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> char state[2]; //state (R is running, S is sleeping, D is sleeping in an<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> //uninterruptible wait, Z is zombie, T is traced or stopped)<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> int ppid;// process id of the parent process<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> int pgrp;// pgrp of the process<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> int sid;// session id<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> int tty_nr;// tty the process uses<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> int tty_pgrp;// pgrp of the tty<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> int flags;// task flags<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> int min_flt;// number of minor faults<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> int cmin_flt;// number of minor faults with child's<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> int maj_flt;// number of major faults<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> int cmaj_flt;// number of major faults with child's<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> int utime;// user mode jiffies<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> int stime;// kernel mode jiffies<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> int cutime;// user mode jiffies with child's<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> int cstime;// kernel mode jiffies with child's<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> int priority;// priority level<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> int nice;// nice level<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> int num_threads;// number of threads<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> int it_real_value;// (obsolete, always 0)<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> int start_time;// time the process started after system boot<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> int vsize;// virtual memory size<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> int rss;// resident set memory size<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> int rsslim;// current limit in bytes on the rss<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> int start_code;// address above which program text can run<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> int end_code;// address below which program text can run<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> int start_stack;// address of the start of the stack<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> int esp;// current value of ESP<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> int eip;// current value of EIP<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> int pending;// bitmap of pending signals<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> int blocked;// bitmap of blocked signals<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> int sigign;// bitmap of ignored signals<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> int sigcatch;// bitmap of catched signals<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> int wchan;// address where process went to sleep<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> int i0;// (place holder)<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> int i1;// (place holder)<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> int exit_signal;// signal to send to parent thread on exit<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> int task_cpu;// which CPU the task is scheduled on<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> int rt_priority;// realtime priority<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> int policy;// scheduling policy (man sched_setscheduler)<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> int blkio_ticks;// time spent waiting for block IO<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> int gtime;// guest time of the task in jiffies<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> int cgtime;// guest time of the task children in jiffies<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas">} p ;<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas">int main()<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas">{<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> char name[256];<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> char state[8];<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> FILE* f = fopen("/proc/self/stat", "r");<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> char hostname[1024];<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> gethostname(hostname, 1024);<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> fscanf(f, "%d%s%s%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d",<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> &p.pid, &p.tcomm, &p.state, &p.ppid, &p.pgrp, &p.sid, &p.tty_nr, &p.tty_pgrp, &p.flags,<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> &p.min_flt, &p.cmin_flt, &p.maj_flt, &p.cmaj_flt, &p.utime, &p.stime, &p.cutime, &p.cstime,<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> &p.priority, &p.nice, &p.num_threads, &p.it_real_value, &p.start_time, &p.vsize, &p.rss,<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> &p.rsslim, &p.start_code, &p.end_code, &p.start_stack, &p.esp, &p.eip, &p.pending, &p.blocked,<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> &p.sigign, &p.sigcatch, &p.wchan, &p.i0, &p.i1, &p.exit_signal, &p.task_cpu, &p.rt_priority, &p.policy,<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> &p.blkio_ticks, &p.gtime, &p.cgtime);<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> sleep (15);<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> printf("HOST %s\n", hostname);<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"> printf("CPU %d\n", p.task_cpu);<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas">return 0;<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas">}<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:70.8pt"><span style="font-size:10.0pt;font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoListParagraph" style="margin-left:0cm"><span style="font-size:10.0pt">When I run this script, I should receive an output like this:<o:p></o:p></span></p>
<p class="MsoListParagraph"><span style="font-size:10.0pt">HOST clus04.hpc.local<o:p></o:p></span></p>
<p class="MsoListParagraph"><span style="font-size:10.0pt">CPU 0<o:p></o:p></span></p>
<p class="MsoListParagraph"><span style="font-size:10.0pt">HOST clus04.hpc.local<o:p></o:p></span></p>
<p class="MsoListParagraph"><span style="font-size:10.0pt">CPU 7<o:p></o:p></span></p>
<p class="MsoListParagraph"><span style="font-size:10.0pt">HOST clus04.hpc.local<o:p></o:p></span></p>
<p class="MsoListParagraph"><span style="font-size:10.0pt">CPU 1<o:p></o:p></span></p>
<p class="MsoListParagraph"><span style="font-size:10.0pt">HOST clus04.hpc.local<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:0cm;text-indent:35.4pt"><span style="font-size:10.0pt">CPU 6<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt">because system has scheduled my job in node “clus04.hpc.local” (a node with two 6-cores processors) and has reserved cores 0-1 of each processor.
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt">However, the real output I receive is<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">HOST clus04.hpc.local<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">CPU 1<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">HOST clus04.hpc.local<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">CPU 1<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">HOST clus04.hpc.local<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">CPU 1<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">HOST clus04.hpc.local<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">CPU 6<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt">(and others outputs where there are one CPU repeated), so it seems SLURMs is reserving correctly four cores but, then, process is running two or more times in the same core.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt">Slurmctld.log file in server shows this information:<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">[...]<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">[2024-01-25T09:38:42.867] DEBUG: JobId=206129 node clus04 vpus 1 cpus 4<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">[2024-01-25T09:38:42.867] ====================<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">[2024-01-25T09:38:42.867] JobId=206129 nhosts:1 ncpus:4 node_req:1 nodes=clus04<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">[2024-01-25T09:38:42.867] Node[0]:<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">[2024-01-25T09:38:42.867] Mem(MB):0:0 Sockets:2 Cores:6 CPUs:4:0<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">[2024-01-25T09:38:42.867] Socket[0] Core[0] is allocated<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">[2024-01-25T09:38:42.867] Socket[0] Core[1] is allocated<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">[2024-01-25T09:38:42.867] Socket[1] Core[0] is allocated<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">[2024-01-25T09:38:42.867] Socket[1] Core[1] is allocated<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">[2024-01-25T09:38:42.867] --------------------<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">[2024-01-25T09:38:42.867] cpu_array_value[0]:4 reps:1<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">[2024-01-25T09:38:42.867] ====================<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">[2024-01-25T09:38:42.867] DEBUG: Dump job_resources: nhosts 1 cb 0-1,6-7<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">[...]<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">[2024-01-25T09:38:58.213] _job_complete: JobId=206129 WEXITSTATUS 0<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">[2024-01-25T09:38:58.213] deallocate_nodes: JobId=206129<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">[2024-01-25T09:38:58.213] DEBUG: Dump job_resources: nhosts 1 cb 0-1,6-7<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">[2024-01-25T09:38:58.213] _job_complete: JobId=206129 done<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt">And slurmd.log file in node clus04 shows this information:<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">[...]<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">[2024-01-25T09:38:30.685] [206129.batch] debug: task/cgroup: job abstract cores are '0-1,6-7'<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">[2024-01-25T09:38:30.685] [206129.batch] debug: task/cgroup: step abstract cores are '0-1,6-7'<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">[2024-01-25T09:38:30.685] [206129.batch] debug: task/cgroup: job physical cores are '0-1,6-7'<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">[2024-01-25T09:38:30.685] [206129.batch] debug: task/cgroup: step physical cores are '0-1,6-7'<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">[...]<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">[2024-01-25T09:38:30.883] [206129.1] debug: task/cgroup: job abstract cores are '0-1,6-7'<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">[2024-01-25T09:38:30.883] [206129.1] debug: task/cgroup: step abstract cores are '0-1,6-7'<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">[2024-01-25T09:38:30.883] [206129.1] debug: task/cgroup: job physical cores are '0-1,6-7'<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">[2024-01-25T09:38:30.883] [206129.1] debug: task/cgroup: step physical cores are '0-1,6-7'<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">[...]<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">[2024-01-25T09:38:30.911] [206129.0] debug: task/cgroup: job abstract cores are '0-1,6-7'<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">[2024-01-25T09:38:30.911] [206129.0] debug: task/cgroup: step abstract cores are '0-1,6-7'<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">[2024-01-25T09:38:30.911] [206129.0] debug: task/cgroup: job physical cores are '0-1,6-7'<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">[2024-01-25T09:38:30.911] [206129.0] debug: task/cgroup: step physical cores are '0-1,6-7'<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">[...]<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">[2024-01-25T09:38:30.912] [206129.2] debug: task/cgroup: job abstract cores are '0-1,6-7'<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">[2024-01-25T09:38:30.912] [206129.2] debug: task/cgroup: step abstract cores are '0-1,6-7'<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">[2024-01-25T09:38:30.912] [206129.2] debug: task/cgroup: job physical cores are '0-1,6-7'<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">[2024-01-25T09:38:30.912] [206129.2] debug: task/cgroup: step physical cores are '0-1,6-7'<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">[...]<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">[2024-01-25T09:38:30.922] [206129.3] debug: task/cgroup: job abstract cores are '0-1,6-7'<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">[2024-01-25T09:38:30.922] [206129.3] debug: task/cgroup: step abstract cores are '0-1,6-7'<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">[2024-01-25T09:38:30.922] [206129.3] debug: task/cgroup: job physical cores are '0-1,6-7'<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt">[2024-01-25T09:38:30.922] [206129.3] debug: task/cgroup: step physical cores are '0-1,6-7'<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt">It seems that SLURM is reserving me correctly four cores for my job but, when inside my script I run four “srun”, then each srun can freely take one of the four reserved cores, not exactly one to each task.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt">What am I doing wrong?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt">Thanks a lot!<o:p></o:p></span></p>
</div>
</body>
</html>