Mysticial / Mini-Pi

A miniature program that can compute Pi to millions of digits.
Creative Commons Zero v1.0 Universal
134 stars 23 forks source link

Added Makefile. Allow to specify the number of digits on command line #9

Closed jirka-h closed 1 year ago

jirka-h commented 1 year ago

Hi,

I have added the Makefile and enhanced the programs to allow user to specify the number of digits on command line. Could you please have a look and if you like it, merge it?

make
$./mini-pi_optimized_3_OpenMP --help
ERROR when parsing "--help" as double value. Expecting number in range 1000 - 8e+08 in double notation, see "man strtod" for details.
Unsupported number of arguments
Usage: ./mini-pi_optimized_3_OpenMP [digits] (max 800 millions). Input in double notation (800e6)
Default value: 1000000 digits.
OMP_* env variables can be used to control the program. Example: 
OMP_DISPLAY_ENV=TRUE OMP_NUM_THREADS=4 /usr/bin/time -v ./mini-pi_optimized_3_OpenMP 100e6
./mini-pi_optimized_3_OpenMP 

$./mini-pi_optimized_3_OpenMP 1e6

Thanks a lot! Jirka

Mysticial commented 1 year ago

I'll rubber stamp this simply because I don't really want to maintain this project anymore. So I'll revert if anyone reports any issues.

jirka-h commented 1 year ago

Thanks!

I don't expect any issues - users can input the number of digits on the command line if they want to. Without any input on the command line, the old default is used.