948 B
948 B
Pi Digits Benchmark
This benchmark compares pthread-based parallelism and fork()-based parallelism for computing digits of pi in independent chunks.
Configuration (environment variables)
THREAD_COUNT: number of worker threadsPROCESS_COUNT: number of worker processesPI_DIGITS: total digits of pi to computeCHUNK_SIZE: digits per worker
Defaults: THREAD_COUNT=4, PROCESS_COUNT=4, PI_DIGITS=2000, CHUNK_SIZE=500
Run
# Run both modes sequentially
bash run_pi_digits_benchmark.sh
# Run a single mode
bash run_pi_digits_benchmark.sh thread
bash run_pi_digits_benchmark.sh process
Outputs
Per-run outputs are stored under runs/:
pi_digits.txt— final concatenated digitsworkers.csv— per-worker durations and chunk metadataresults.csv— per-run summary metrics (includes aggregated RSS/VSZ and snapshot overhead)stdout.log/stderr.log— benchmark logs