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.3.tar.gz
(14.6 kB
view details)
Built Distribution
File details
Details for the file cpu_heater-0.0.3.tar.gz
.
File metadata
- Download URL: cpu_heater-0.0.3.tar.gz
- Upload date:
- Size: 14.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 682ce6fdcbb2b63b6d7d7388ef73254eae9cfccdad4f11c623c09e1c9860b853 |
|
MD5 | c15651080ccdb6a180dd5594c3399c81 |
|
BLAKE2b-256 | f128b8adf44b6a3e115099a870f05ece6a07c75443996f4cb5f70bdb265b10f5 |
File details
Details for the file cpu_heater-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: cpu_heater-0.0.3-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.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a20bb325eb6c5d21137e47a135b2545d3010ba05daf0e2e6a9a5f673aa1ef3f |
|
MD5 | 4d7befdfafb033569da817db3beddb18 |
|
BLAKE2b-256 | fdf5e9a44399a3189865238698d832c783dcd46fdc0071ee8e429ea4bcd6dde9 |