Skip to main content

test-CPU-parallel is a basic CPU workload generator.

Project description

test_CPU_parallel.py - A basic CPU workload generator.
Luca.Canali@cern.ch - April 2023

Use test_CPU_parallel to generate CPU-intensive load on a system, running multiple threads in parallel.
The tool runs a CPU-burning loop concurrently on the system, with configurable parallelism.
The tool outputs a measurement of the CPU-burning loop execution time as a function of load.

How to use test_CPU_parallel.py from the command line

Example:
# Install with pip or clone from GitHub
pip install test-CPU-parallel

# run one-off data collection with 2 concurrent workers
test_CPU_parallel.py --num_workers 2 

# Measure job runtime over a ramp of concurrent workers from 1 to 8, and output the results to a CSV file
test_CPU_parallel.py --num_workers 8 --full --output myout.csv 

Parameters:

--full - Full mode will test all the values of num_workers from 1 to the value 
         set with --num_workers, use this to collect speedup test measurements and create plots, default = False
--output - Optional output file, applies only to the full mode, default = None
--num_workers - Number of parallel threads running concurrently, default = 2
--num_job_execution_loops - number of times the execution loop is run on each worker, default = 3
--worker_inner_loop_size - internal weight of the inner execution loop, default = 100000000

How to use test_CPU_parallel programmatically

You have the ability to employ the test_CPU_parallel function within your Python scripts, including its integration into Continuous Integration (CI) tests. This proves advantageous for tasks like quantifying system performance and assessing how well the CPU adapts to varying workloads. This becomes especially handy when you're comparing test runs conducted on different occasions or on distinct computer setups.
In your code, the process of executing the test and obtaining results is as follows:

pip install test-CPU-parallel
from test_CPU_parallel import test_CPU_parallel

# See also the configuration options in the help
test = test_CPU_parallel()

# Run a test
test.test_one_load()

# Run a full run
test.test_full()

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

Test_CPU_parallel-1.0.4.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

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

Test_CPU_parallel-1.0.4-py2.py3-none-any.whl (8.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file Test_CPU_parallel-1.0.4.tar.gz.

File metadata

  • Download URL: Test_CPU_parallel-1.0.4.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for Test_CPU_parallel-1.0.4.tar.gz
Algorithm Hash digest
SHA256 77d0257f4545dc504e30e4285289b45123b6873f9f47e329c999d261093006f6
MD5 d58a8fd9e9492cd8a1ca61c3fb6fa7e3
BLAKE2b-256 3ea6fb3dddbd08e7c589e2d02305cb7a17c5dc78a6df1a9e924ad2f8556538c7

See more details on using hashes here.

File details

Details for the file Test_CPU_parallel-1.0.4-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for Test_CPU_parallel-1.0.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 e5d54a427413769cc3bd64f17fec29aa15f0b3e594c7023f2ac8a2fb75d78b6c
MD5 658b9d0cb3f4e8dea045ba3e3eb3a157
BLAKE2b-256 4b2496d0562b5201bface34bed77707fc7ab4d228ad5f1250a471cebe6533930

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