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.2.0.tar.gz (14.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cpu_heater-0.2.0-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

Details for the file cpu_heater-0.2.0.tar.gz.

File metadata

  • Download URL: cpu_heater-0.2.0.tar.gz
  • Upload date:
  • Size: 14.9 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.2.0.tar.gz
Algorithm Hash digest
SHA256 7082787d67ac88637cc2a5f805634105ce6606c57c93bb17f55b3c5af58b804b
MD5 9a116dbf1f118a3152d000f577984a31
BLAKE2b-256 3020f1aae926db2036e3e36eca074e384b0a984348ed34cfd2f96fabb1456398

See more details on using hashes here.

File details

Details for the file cpu_heater-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: cpu_heater-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 15.0 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d0b74b7358021232363c562ec9d77764814d016bc8cdecbbc91c05aa959c6e4e
MD5 bed235c01bc8ea19b056f0bb0f507c16
BLAKE2b-256 3bf4fd5fb72a16d4acf295e1550794ebac41a00f07d88d1fe5b7f77cab1a1140

See more details on using hashes here.

Supported by

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