Skip to content
GitLab
  • Explore
  • Sign in
  • EDA Guides
  • eda-servers-guide
  • Wiki
  • cpu limit

cpu limit · Changes

Page history
Update cpu limit authored May 07, 2021 by Daniele Jahier Pagliari's avatar Daniele Jahier Pagliari
Hide whitespace changes
Inline Side-by-side
cpu-limit.md
View page @ 218f2953
......@@ -2,7 +2,7 @@
As explained in the ["Monitoring Resources"](/monitoring) page, it is your responsibility to make sure that you are not monopolizing the entire CPUs of a server. This page lists a set of tricks to limit the number of CPU threads used by your scripts, when using common applications and libraries.
## Limiting CPU Threads with OpenMP
## Limiting CPU Threads in OpenMP
[OpenMP](https://www.openmp.org/) is a common shared-memory parallel programming library. For example, OpenMP is sometimes used by TensorFlow and PyTorch when training a model without GPU support.
......@@ -16,6 +16,17 @@ The example above limits the number of threads to 8. You can change this to any
Most graphical IDEs that support remote deployment (see ["Remote Code Deployment"](/remote-code)) also allow you to set environment variables in the remote host. For example, in PyCharm by JetBrains, this is achieved by modifying the "Run Configuration" of your script. Check the documentation of your IDE for more details.
## Limiting CPU Threads in OpenBLAS
[OpenBLAS](https://github.com/xianyi/OpenBLAS/wiki) is another common parallel programming library, used for example by Numpy. Limiting the number of threads works similarly to OpenMP, but with a different environmental variable. For example:
```
export OPENBLAS_NUM_THREADS=8
```
See this [link](https://github.com/xianyi/OpenBLAS#setting-the-number-of-threads-using-environment-variables) for more details.
## Other Tools and Libraries
If you are currently working with another program or library that uses multi-threading, and you can share some code or some tips on how to limit the number of threads, please contact the sysadmins. We will be glad to add your suggestions to this page.
## Credits
Thanks to Francesco Daghero for contributing to this page.
Clone repository
Home

Servers Information
Accounts
Connecting to the Servers
Storage Management and Quotas
Monitoring Resources
Software, Libraries and Data
  • Using Custom Software
  • Software Modules on Philae
  • Remote Code Deployment
  • Python Virtual Environments
  • EDA Technology Libraries
  • Shared Datasets
Miscellaneous Settings
  • Setting Up CUDA Libraries
  • Choosing which GPU to Use
  • Limiting GPU Memory
  • Limiting CPU Threads
Gitlab

Sidebar