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():
args_list = [(i, i) for i in range(114514)]
results = cpu_heater.multiprocess(adder, args_list, max_workers=8, show_progress=True, timeout=5)
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():
args_list = [(i, i) for i in range(114514)]
results = cpu_heater.multithreads(adder, args_list, 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.1.0.tar.gz
(14.8 kB
view details)
Built Distribution
File details
Details for the file cpu_heater-0.1.0.tar.gz
.
File metadata
- Download URL: cpu_heater-0.1.0.tar.gz
- Upload date:
- Size: 14.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07d101bbde51dd21d7f13b4f572912e44d9c5ba1552989376287555126bfecce |
|
MD5 | a00fa19e9202c3c73e11fb6a7848c98b |
|
BLAKE2b-256 | 57edc88bade4c15805d0c277c7c8ca8b46d29e58824ce1232ab578fabd01855f |
File details
Details for the file cpu_heater-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: cpu_heater-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.9 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 | 40c4aa198cbfede87dfa33b52c7569ad4b0a04ff3a6fc081373b13e6faaf26fb |
|
MD5 | 112dd6667fe0b5e55c4fb3601a2ede95 |
|
BLAKE2b-256 | dcb52d00107317474be75894ac605b80897c2c5c0d0749b20c7636c23259afb3 |