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():
    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)

Uploaded Source

Built Distribution

cpu_heater-0.0.3-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

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

Hashes for cpu_heater-0.0.3.tar.gz
Algorithm Hash digest
SHA256 682ce6fdcbb2b63b6d7d7388ef73254eae9cfccdad4f11c623c09e1c9860b853
MD5 c15651080ccdb6a180dd5594c3399c81
BLAKE2b-256 f128b8adf44b6a3e115099a870f05ece6a07c75443996f4cb5f70bdb265b10f5

See more details on using hashes here.

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

Hashes for cpu_heater-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2a20bb325eb6c5d21137e47a135b2545d3010ba05daf0e2e6a9a5f673aa1ef3f
MD5 4d7befdfafb033569da817db3beddb18
BLAKE2b-256 fdf5e9a44399a3189865238698d832c783dcd46fdc0071ee8e429ea4bcd6dde9

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