Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9250375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:25:54+00:00 2026-06-18T10:25:54+00:00

I was using the numactl, with –physcpubind option. manual says: –physcpubind=cpus, -C cpus Only

  • 0

I was using the numactl, with –physcpubind option. manual says:

--physcpubind=cpus, -C cpus
Only execute process on cpus. Etc...

Let’s say I have NUMA system with 3 NUMA nodes, where each of them has 4 cores. NUMA node 0 has 0, 1, 2, 3 as core numbers. NUMA node 1 has 4,5,6,7, and NUMA node 2 has 8,9,10,11. My question is let’s say I run the program as follows:

export OMP_NUM_THREADS=6
numactl --physcpubind=0,1,4,5,8,9 ./program

i.e. I’ll be running my program with 6 threads and I am requesting them to be on CPU cores 0,1,4,5,8,9. For example, if at some point during the program threads 0-5 are assigned CPU cores 0,1,4,5,8,9 (setup1). Is it possible that at some other point during the program execution thread 0 may be running on CPU core 9 for example, and so forth? I.e. will there be thread migration between CPU cores? Or the threads uniquely get bound to CPU cores (as in setup1)? Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T10:25:55+00:00Added an answer on June 18, 2026 at 10:25 am

    physcpubind option of numactl should be an interface to sched_setaffinity system call, which modifies cpuset (set of allowed CPU) of the process at moment of process starting. Each thread will have own cpuset, but all threads will inherit their cpuset value from parent process.

    So, threads are allowed to run on any CPU from the cpuset, migration is allowed between any cpu from cpuset.

    Any thread can call sched_setaffinity or pthread_setaffinity_np (linux-specific variant of affinity changing for single thread) to narrow or even to expand its cpuset.

    If you want bind threads to CPUs, use sched_setaffinity or pthread_setaffinity_np directly in every thread, or in case of OpenMP set affinity via OMP library: OpenMP and CPU affinity e.g. with command (OpenMP 3.1+)

    export OMP_PROC_BIND=true
    

    I guess that OMP library will select CPUs in round-robin manner from cpuset of process at time of omp library initialization.

    For older version of libgomp – OMP support library used by GCC – you can pass allowed set of CPU with command:

    export GOMP_CPU_AFFINITY=0-1,4-5,8-9
    

    PS: to check your threads placement you can start top and enable “Last CPU used” field with f j keys and turn on thread display with H.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using SSRS 2008 R2 I have a background process that dynamically generates RDL for
Using php, what is the regex to match an exact string. Say we have
Using knockoutjs mapping plugin is it possible to only make the child elements observables?
Using Trigger.io's barcode api in an application that only contains boilerplate HTML and the
Using this approach I have made my static method calls an Action in the
Using ember 1.0.0-pre3 I have a little app that has this code: window.App =
Using Visual SourceSafe's Open SourceSafe Database... command, there is an option at the bottom
Using Subsonic 3 I have the fields: o CreatedOn (datetime) o CreatedBy (nvarchar(50)) o
Using MATLAB, you have to start with a uniform distribution between (0,1). You need
Using Java, assuming v1.6. I have a collection where the unique index is a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.