A Python parallel computing library
Project description
CPU-Heater
A Python parallel computing library.
Install
pip install cpu-heater
Usage
Multiprocessing:
import cpu_heater
def adder(x, y):
return x + y
def test_cpu_heater():
item_list = [(i, i) for i in range(114514)]
results = cpu_heater.multiprocess(item_list, adder, max_workers=8, show_progress=True)
assert sorted(results) == sorted([i + i for i in range(114514)])
Multithreading:
import cpu_heater
def adder(x, y):
return x + y
def test_cpu_heater():
item_list = [(i, i) for i in range(114514)]
results = cpu_heater.multithreads(item_list, adder, max_workers=8, show_progress=True)
assert sorted(results) == sorted([i + i for i in range(114514)])
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cpu_heater-0.0.4.tar.gz
(14.7 kB
view details)
Built Distribution
File details
Details for the file cpu_heater-0.0.4.tar.gz
.
File metadata
- Download URL: cpu_heater-0.0.4.tar.gz
- Upload date:
- Size: 14.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98a692288b7b7d3df6bea9ef60eaa0c780b9b1561fec4ebd7f244039aafb0459 |
|
MD5 | 1cc7308837592c868345781cd59b9688 |
|
BLAKE2b-256 | 24fa72f14045c199f1690bc3f7212059a4fdd0b0cdb14abaec87f71cfa27a5d2 |
File details
Details for the file cpu_heater-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: cpu_heater-0.0.4-py3-none-any.whl
- Upload date:
- Size: 14.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60b17cc2a190c75dcb59fa132fec7111e0551118b5987f7ae4a35ba9a17713e7 |
|
MD5 | b8aab1860a74acd6ccd9226d42c516d2 |
|
BLAKE2b-256 | e9537742ec695308f4de095d0e225d8bd73aebf42edfb3a912c536f58ee52d84 |