diff --git a/README.md b/README.md index 3328ef428..893b7d28d 100644 --- a/README.md +++ b/README.md @@ -88,33 +88,33 @@ Generate the primes and/or prime k-tuplets inside [START, STOP] (< 2^64) using the segmented sieve of Eratosthenes. Options: - -c, --count[=NUM+] Count primes and/or prime k-tuplets, NUM <= 6. - Count primes: -c or --count (default option), - count twin primes: -c2 or --count=2, - count prime triplets: -c3 or --count=3, ... - --cpu-info Print CPU information (cache sizes). - -d, --dist=DIST Sieve the interval [START, START + DIST]. - -n, --nth-prime Find the nth prime. - primesieve 100 -n: finds the 100th prime, - primesieve 2 100 -n: finds the 2nd prime > 100. - -p, --print[=NUM] Print primes or prime k-tuplets, NUM <= 6. - Print primes: -p or --print, - print twin primes: -p2 or --print=2, - print prime triplets: -p3 or --print=3, ... - -q, --quiet Quiet mode, prints less output. - -s, --size=SIZE Set the sieve size in KiB, SIZE <= 8192. - By default primesieve uses a sieve size that - matches your CPU's L1 cache size (per core) or is - slightly smaller than your CPU's L2 cache size. - --stress-test[=MODE] Run a stress test. The MODE can be either - CPU (default) or RAM. The default timeout is 24h. - --test Run various correctness tests (< 1 minute). - -t, --threads=NUM Set the number of threads, NUM <= CPU cores. - Default setting: use all available CPU cores. - --time Print the time elapsed in seconds. - --timeout=SEC Set the stress test timeout in seconds. Supported - units of time suffixes: s, m, h, d or y. - 30 minutes timeout: --timeout 30m + -c, --count[=NUM+] Count primes and/or prime k-tuplets, NUM <= 6. + Count primes: -c or --count (default option), + count twin primes: -c2 or --count=2, + count prime triplets: -c3 or --count=3, ... + --cpu-info Print CPU information (cache sizes). + -d, --dist=DIST Sieve the interval [START, START + DIST]. + -n, --nth-prime Find the nth prime. + primesieve 100 -n: finds the 100th prime, + primesieve 2 100 -n: finds the 2nd prime > 100. + -p, --print[=NUM] Print primes or prime k-tuplets, NUM <= 6. + Print primes: -p or --print, + print twin primes: -p2 or --print=2, + print prime triplets: -p3 or --print=3, ... + -q, --quiet Quiet mode, prints less output. + -s, --size=SIZE Set the sieve size in KiB, SIZE <= 8192. + By default primesieve uses a sieve size that + matches your CPU's L1 cache size (per core) or is + slightly smaller than your CPU's L2 cache size. + -S, --stress-test[=MODE] Run a stress test. The MODE can be either + CPU (default) or RAM. The default timeout is 24h. + --test Run various correctness tests (< 1 minute). + -t, --threads=NUM Set the number of threads, NUM <= CPU cores. + Default setting: use all available CPU cores. + --time Print the time elapsed in seconds. + --timeout=SEC Set the stress test timeout in seconds. Supported + units of time suffixes: s, m, h, d or y. + 30 minutes timeout: --timeout 30m ``` ## Build instructions diff --git a/doc/primesieve.1 b/doc/primesieve.1 index e1bf13d03..8f444cf2f 100644 --- a/doc/primesieve.1 +++ b/doc/primesieve.1 @@ -2,12 +2,12 @@ .\" Title: primesieve .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 02/13/2024 +.\" Date: 02/14/2024 .\" Manual: \ \& .\" Source: \ \& .\" Language: English .\" -.TH "PRIMESIEVE" "1" "02/13/2024" "\ \&" "\ \&" +.TH "PRIMESIEVE" "1" "02/14/2024" "\ \&" "\ \&" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -125,7 +125,7 @@ Set the size of the sieve array in KiB, 16 <= <= 8192\&. By default primesieve uses a sieve size that matches your CPU\(cqs L1 cache size (per core) or is slightly smaller than your CPU\(cqs L2 cache size\&. This setting is crucial for performance, on exotic CPUs primesieve sometimes fails to determine the CPU\(cqs cache sizes which usually causes a big slowdown\&. In this case you can get a significant speedup by manually setting the sieve size to your CPU\(cqs L1 or L2 cache size (per core)\&. .RE .PP -\fB\-\-stress\-test\fR[=\fIMODE\fR] +\fB\-S, \-\-stress\-test\fR[=\fIMODE\fR] .RS 4 Run a stress test\&. The \fIMODE\fR @@ -145,7 +145,7 @@ option\&. .PP \fB\-\-test\fR .RS 4 -Run various sieving tests\&. +Run various correctness tests (< 1 minute)\&. .RE .PP \fB\-t, \-\-threads\fR=\fINUM\fR diff --git a/doc/primesieve.txt b/doc/primesieve.txt index fa149f378..893245d41 100644 --- a/doc/primesieve.txt +++ b/doc/primesieve.txt @@ -77,7 +77,7 @@ OPTIONS this case you can get a significant speedup by manually setting the sieve size to your CPU's L1 or L2 cache size (per core). -*--stress-test*[='MODE']:: +*-S, --stress-test*[='MODE']:: Run a stress test. The 'MODE' can be either CPU (default) or RAM. The CPU 'MODE' uses little memory (on average about 225 MiB per thread) and puts the highest load on the CPU. The RAM 'MODE' uses much more memory than the @@ -90,7 +90,7 @@ OPTIONS using the *--threads=NUM* option. *--test*:: - Run various sieving tests. + Run various correctness tests (< 1 minute). *-t, --threads*='NUM':: Set the number of threads, 1 \<= 'NUM' \<= CPU cores. By default primesieve diff --git a/src/app/CmdOptions.cpp b/src/app/CmdOptions.cpp index 23ab2a153..401312be0 100644 --- a/src/app/CmdOptions.cpp +++ b/src/app/CmdOptions.cpp @@ -337,6 +337,7 @@ CmdOptions parseOptions(int argc, char* argv[]) { "--R-inverse", std::make_pair(OPTION_R_INVERSE, NO_PARAM) }, { "-s", std::make_pair(OPTION_SIZE, REQUIRED_PARAM) }, { "--size", std::make_pair(OPTION_SIZE, REQUIRED_PARAM) }, + { "-S", std::make_pair(OPTION_STRESS_TEST, OPTIONAL_PARAM) }, { "--stress-test", std::make_pair(OPTION_STRESS_TEST, OPTIONAL_PARAM) }, { "--test", std::make_pair(OPTION_TEST, NO_PARAM) }, { "-t", std::make_pair(OPTION_THREADS, REQUIRED_PARAM) }, diff --git a/src/app/help.cpp b/src/app/help.cpp index ecacf8b95..ef1b2e601 100644 --- a/src/app/help.cpp +++ b/src/app/help.cpp @@ -23,40 +23,40 @@ void help(int exitCode) "(< 2^64) using the segmented sieve of Eratosthenes.\n" "\n" "Options:\n" - " -c, --count[=NUM+] Count primes and/or prime k-tuplets, NUM <= 6.\n" - " Count primes: -c or --count (default option),\n" - " count twin primes: -c2 or --count=2,\n" - " count prime triplets: -c3 or --count=3, ...\n" - " --cpu-info Print CPU information (cache sizes).\n" - " -d, --dist=DIST Sieve the interval [START, START + DIST].\n" - " -h, --help Print this help menu.\n" - " -n, --nth-prime Find the nth prime.\n" - " primesieve 100 -n: finds the 100th prime,\n" - " primesieve 2 100 -n: finds the 2nd prime > 100.\n" - " --no-status Turn off the progressing status.\n" - " -p, --print[=NUM] Print primes or prime k-tuplets, NUM <= 6.\n" - " Print primes: -p or --print,\n" - " print twin primes: -p2 or --print=2,\n" - " print prime triplets: -p3 or --print=3, ...\n" - " -q, --quiet Quiet mode, prints less output.\n" - " -R, --RiemannR Riemann R function, very accurate\n" - " approximation of PrimePi(x).\n" - " --R-inverse Inverse Riemann R function, very accurate\n" - " approximation of the nth prime.\n" - " -s, --size=SIZE Set the sieve size in KiB, SIZE <= 8192.\n" - " By default primesieve uses a sieve size that\n" - " matches your CPU's L1 cache size (per core) or is\n" - " slightly smaller than your CPU's L2 cache size.\n" - " --stress-test[=MODE] Run a stress test. The MODE can be either\n" - " CPU (default) or RAM. The default timeout is 24h.\n" - " --test Run various correctness tests (< 1 minute).\n" - " -t, --threads=NUM Set the number of threads, NUM <= CPU cores.\n" - " Default setting: use all available CPU cores.\n" - " --time Print the time elapsed in seconds.\n" - " --timeout=SEC Set the stress test timeout in seconds. Supported\n" - " units of time suffixes: s, m, h, d or y.\n" - " 30 minutes timeout: --timeout 30m\n" - " -v, --version Print version and license information."; + " -c, --count[=NUM+] Count primes and/or prime k-tuplets, NUM <= 6.\n" + " Count primes: -c or --count (default option),\n" + " count twin primes: -c2 or --count=2,\n" + " count prime triplets: -c3 or --count=3, ...\n" + " --cpu-info Print CPU information (cache sizes).\n" + " -d, --dist=DIST Sieve the interval [START, START + DIST].\n" + " -h, --help Print this help menu.\n" + " -n, --nth-prime Find the nth prime.\n" + " primesieve 100 -n: finds the 100th prime,\n" + " primesieve 2 100 -n: finds the 2nd prime > 100.\n" + " --no-status Turn off the progressing status.\n" + " -p, --print[=NUM] Print primes or prime k-tuplets, NUM <= 6.\n" + " Print primes: -p or --print,\n" + " print twin primes: -p2 or --print=2,\n" + " print prime triplets: -p3 or --print=3, ...\n" + " -q, --quiet Quiet mode, prints less output.\n" + " -R, --RiemannR Riemann R function, very accurate\n" + " approximation of PrimePi(x).\n" + " --R-inverse Inverse Riemann R function, very accurate\n" + " approximation of the nth prime.\n" + " -s, --size=SIZE Set the sieve size in KiB, SIZE <= 8192.\n" + " By default primesieve uses a sieve size that\n" + " matches your CPU's L1 cache size (per core) or is\n" + " slightly smaller than your CPU's L2 cache size.\n" + " -S, --stress-test[=MODE] Run a stress test. The MODE can be either\n" + " CPU (default) or RAM. The default timeout is 24h.\n" + " --test Run various correctness tests (< 1 minute).\n" + " -t, --threads=NUM Set the number of threads, NUM <= CPU cores.\n" + " Default setting: use all available CPU cores.\n" + " --time Print the time elapsed in seconds.\n" + " --timeout=SEC Set the stress test timeout in seconds. Supported\n" + " units of time suffixes: s, m, h, d or y.\n" + " 30 minutes timeout: --timeout 30m\n" + " -v, --version Print version and license information."; std::cout << helpMenu << std::endl; std::exit(exitCode);