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 by running single-threaded, or with multiple threads in parallel.
The tool runs a CPU-burning loop concurrently on the system with configurable parallelism.
The output are measurements of the CPU-burning loop execution time as a function of load, printed to terminal, or to a csv file,
or returned programmatically when used as a Python library.
Link to the project homepage
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()
How to run test_CPU_parallel.py using from a container image
docker run lucacanali/test_cpu_parallel.py test_CPU_parallel.py- See also Container for more details on how to build and run container images for this tool and on how to run it using Docker or Kubernetes
Metadata
Release files for Test-CPU-parallel 1.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| Test_CPU_parallel-1.0.5.tar.gz | 6.1 kB | Without provenance | Details for Test_CPU_parallel-1.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| Test_CPU_parallel-1.0.5-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for Test_CPU_parallel-1.0.5-py2.py3-none-any.whl |
Total release size: 14.7 kB
Release files / Test_CPU_parallel-1.0.5.tar.gz
| Download URL | Test_CPU_parallel-1.0.5.tar.gz |
|---|---|
| Size | 6.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
25b4c457d9e6bee87261662c4c48106edefffc2a3006ca6c4330cf261f509d1a
|
|
BLAKE2b-256 checksum How to use checksums |
39bb840877d22794fc4d2e3d5da11b15a0297d4301ab1b6d4cfe1cc1c4b34537
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.9
|
Release files / Test_CPU_parallel-1.0.5-py2.py3-none-any.whl
| Download URL | Test_CPU_parallel-1.0.5-py2.py3-none-any.whl |
|---|---|
| Size | 8.6 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
7b2c836e62a42cc989c590e81b438b0c98cb31ef91a78acb365c59e6f915a2af
|
|
BLAKE2b-256 checksum How to use checksums |
96cd252dd15239980c257b2bd12e0509843bc25f0ab1520e1ef74942cb350a55
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.9
|
Security for Test-CPU-parallel 1.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.