Skip to main content

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)

Uploaded Source

Built Distribution

cpu_heater-0.1.0-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

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

Hashes for cpu_heater-0.1.0.tar.gz
Algorithm Hash digest
SHA256 07d101bbde51dd21d7f13b4f572912e44d9c5ba1552989376287555126bfecce
MD5 a00fa19e9202c3c73e11fb6a7848c98b
BLAKE2b-256 57edc88bade4c15805d0c277c7c8ca8b46d29e58824ce1232ab578fabd01855f

See more details on using hashes here.

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

Hashes for cpu_heater-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 40c4aa198cbfede87dfa33b52c7569ad4b0a04ff3a6fc081373b13e6faaf26fb
MD5 112dd6667fe0b5e55c4fb3601a2ede95
BLAKE2b-256 dcb52d00107317474be75894ac605b80897c2c5c0d0749b20c7636c23259afb3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page