py-libnuma
py-libnuma is python3 interface to numa Linux library so that you can set task affinity and memory affinity in python level for your process which can help you to improve your code's performence.
Installation
pip install py-libnuma
Usage
py-libnuma categorize libnuma's apis into 3 groups :memory, schedule and info. You can set your tasks' cpu affinity, memory affinity and get information about your
systems's hardware with these 3 modules respectively. For more information about APIs, you can refer to API.md in github
schedule
numa.schedule helps you to set cpu affinity for your process, if you have multiple numa nodes, and you want your process to be scheduled on cpus from node1 and node2, you can use numa.schedule like this
from numa import schedule
schedule.run_on_nodes(1,2)
If you want a certain process with pid to run on specific cpus, you can use numa.schedule like this
from numa import schedule
schedule.run_on_cpus(pid, 1,3,4,6)
memory
numa.memory helps you to set memory policy for your process, if you want your current process to allocate memory from multiple numa nodes
to balance local and remote memory access, you can use numa.memory like this:
from numa import memory
memory.set_interleave_nodes(0,1)
or you can make your process to allocate from certain nodes by
from numa import memory
memory.set_membind_nodes(1)
Info
numa.info helps you to get information about your numa hardware, you can check hardware information by:
from numa import info
info.numa_hardware_info()
This will tell you distance between different numa nodes and node-cpu relation. You can also check cpu set for certain nodes by:
from numa import info
info.node_to_cpus(1)
or check which node is a certain cpu belongs to by:
from numa import info
info.cpu_to_node(1)
For more information about APIs, you can refer to API.md in github
Feedback
If you have any problems with using this package, feel free to create issues and you will get answered in no more than 24 hours
Metadata
Release files for py-libnuma 1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| py-libnuma-1.2.tar.gz | 6.3 kB | Without provenance | Details for py-libnuma-1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| py_libnuma-1.2-py3-none-any.whl | Python 3 | none | any | Details for py_libnuma-1.2-py3-none-any.whl |
Total release size: 13.9 kB
Release files / py-libnuma-1.2.tar.gz
| Download URL | py-libnuma-1.2.tar.gz |
|---|---|
| Size | 6.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e9d67ad04f274015e9acac497d642ce92f8a96d1d4e7be24e39124b24320b95a
|
|
BLAKE2b-256 checksum How to use checksums |
7b9ce06382505da25f8e62e1234f1d76b4cf607e74275e6a48692014b6768324
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.2
|
Release files / py_libnuma-1.2-py3-none-any.whl
| Download URL | py_libnuma-1.2-py3-none-any.whl |
|---|---|
| Size | 7.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a4c0b9188c03a1ba23b994e9c99f67ef25a090fadce90db94d46e229bd258fb9
|
|
BLAKE2b-256 checksum How to use checksums |
203ee1f727f0ce0e26a0eac27fb5a6de043d41e04d76710063606a801b690c08
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.2
|
Security for py-libnuma 1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.