Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_number_of_processors does not take into account hyper-threading #52

Closed
m-ober opened this issue Mar 17, 2019 · 1 comment
Closed

Comments

@m-ober
Copy link
Contributor

m-ober commented Mar 17, 2019

Currently, the procedure get_number_of_processors is reading /proc/cpuinfo and returns the number of logical cores. On a 6-core CPU with hyper-threading, this results in 12 threads being launched for synthesis - when enabling out of context mode. This is probably slower than launching only 6 threads due to HT overhead. It also happens that this number of threads exhausts even large amounts of RAM (32 GiB in my case), so it could be required to lower the number of threads even below the number of available (physical) cores.

My suggestion is:

  • Use nproc (output can be used directly) instead of (probably error prone) parsing of /proc/cpuinfo
  • Maybe introduce an environment variable like TAPASCO_MAX_THREADS to set a maximum number of threads or TAPASCO_NUM_THREADS to use a fixed number of threads
@cahz
Copy link
Member

cahz commented Mar 17, 2019

Selecting the right number of threads is a problem. Relying on the number of cores is not a good metric as memory usage can explode, depending on which FPGA is targeted.

  • nproc is simpler to use, but still includes hyper-threading
  • there is already a command line parameter --maxThreads and --maxTasks to set the maximum number of threads / tasks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants