[slurm-users] Assigning two "cores" when I'm only request one.

Rodrigo Santibáñez rsantibanez.uchile at gmail.com
Mon Jul 12 20:08:50 UTC 2021


I use ThreadsPerCore=1 in the node definitions.

$ srun --cpus-per-task 1 --pty python3
Python 3.8.10 (default, Jun  2 2021, 10:49:15)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.cpu_count()
16
>>> os.sched_getaffinity(0)
{0}

On Mon, Jul 12, 2021 at 12:18 PM Luis R. Torres <lrtorres at gmail.com> wrote:

> Hi Folks,
>
> I'm trying to run one task on one "core", however, when I test the
> affinity, the system gives me "two"; I'm assuming the two are threads since
> the system is a dual socket system.  Is there anything in the configuration
> that I can change to have a single core or thread assigned to a
> single-processing job by default?
>
>
> srun --ntasks=1 --cpus-per-task=1 show-affinity.py
>
> pid 7899's current affinity mask: 401
>
>
> =====================================
>
> CPUs in system:  20
>
> PID:  7899
>
> Allocated CPUs/Cores:  2
>
> Affinity List:  {0, 10}
>
> =====================================
>
>
>
> --
> ----------------------------------------
> Luis R. Torres
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.schedmd.com/pipermail/slurm-users/attachments/20210712/36055f84/attachment-0002.htm>


More information about the slurm-users mailing list