MLUCAS(1) | User Commands | MLUCAS(1) |
mlucas - program to perform Lucas-Lehmer test on a Mersenne number, 2 ^ p - 1
mlucas
mlucas -h
mlucas -s tiny | t | small | s | medium | m | large | l | huge | h | all | a [-iters 100 | 1000 | 10000 [-nthread threads]]
mlucas -m exponent | -f exponent [-iters 100 | 1000 | 10000 [-nthread threads]]
mlucas -fftlen fft_length [-radset radix_set] [-m exponent | -f exponent] -iters 100 | 1000 | 10000 [-nthread threads]
[FIXME: This man page is potentially outdated, please see the online documentation <https://www.mersenneforum.org/mayer/README.html> or the help text located in /usr/share/doc/mlucas/help.txt.gz for up-to-date information.]
This manual page documents briefly the mlucas command.
mlucas is an open-source (and free/libre) program for performing Lucas-Lehmer test on prime-exponent Mersenne numbers, that is, integers of the form 2 ^ p - 1, with prime exponent p. In short, everything you need to search for world-record Mersenne primes! It has been used in the verification of various Mersenne primes, including the 45th, 46th and 48th found Mersenne prime.
You may use it to test any suitable number as you wish, but it is preferable that you do so in a coordinated fashion, as part of the Great Internet Mersenne Prime Search (GIMPS). For more information on GIMPS, see the Great Internet Mersenne Prime Search subsection within the NOTES section and SEE ALSO section. Note that mlucas is not (yet) as efficient as the main GIMPS client, George Woltman's Prime95 program (a.k.a. mprime for the (gnu/)linux version), but that program is not truly open-source (and free/libre), since it requires the user to abide by the prize-sharing rules set by its author (incompatible with freedom to run the program as you wish, for any purpose), should a user be lucky enough to find a new prime eligible for one of the monetary prizes offered by the Electronic Freedom Foundation (see EFF Cooperative Computing Awards <https://www.eff.org/awards/coop> for details).
mlucas reads the exponents from the $MLUCAS_PATH/worktodo.ini file. Results are written to the $MLUCAS_PATH/results.txt file and the exponent-specific $MLUCAS_PATH/*.stat file (see section FILES for details). Error messages are written to stderr and the $MLUCAS_PATH/*.stat file. Exponents can also be passed as command-line arguments but this is mainly used for debugging (see section OPTIONS for details). In addition, mlucas can perform the Pe'pin primality test on Fermat numbers 2 ^ (2 ^ n) + 1, using an exponent-optimized fast-transform length much like that used for testing Mersenne numbers.
New users are urged to jump straight to the EXAMPLE section and follow the examples and pointers to other sections. Users with little time for in-depth reading should at least read the NOTES, BUGS and EXAMPLE sections for a brief introduction to the Great Internet Mersenne Prime Search, undesirable restrictions and common usages. FILES section is also highly recommended since it describes the mlucas configuration files used for host-specific optimization and other mlucas-generated files. Advanced users should also peruse the OPTIONS section since it introduces less-commonly-used advanced options. Experienced users who find this manual inadequate should consult the SEE ALSO section for further information. Lastly, the Mlucas README, available both online and offline, is highly recommended since it is written and maintained by the author of mlucas and should be considered the final authority.
mlucas follows the traditional POSIX (see standards(7) for details) command line syntax, with short options starting with one dashes (`-'). A summary of options is included below. A complete description is in the SEE ALSO section.
pexponent
fexponent
for Fermat number 2 ^ (2 ^ exponent) + 1. (see FILES section for details).
mlucas honors the following environment variables, if they exist:
This section details mlucas configuration files and mlucas generated files. As noted in the ENVIRONMENT section, $MLUCAS_PATH defaults to $HOME/mlucas.d/ but this can be overridden at run-time by setting the MLUCAS_PATH environment variable.
INFO: event
...
Mexponent: using FFT length fft_lengthK
= fft_length * 1024 8-byte floats. Bz<this gives
an average> bits bits per digit
Using complex FFT radices radix_set (product of all elements
of radix_set = fft_length / 2)
...
[date_and_time] Mexponent Iter#
= iterations clocks =
time_taken_per_10000_iterations [
time_taken_per_iteration sec/iter] Res64:
residue. AvgMaxErr = roe_avg.
MaxErr = roe_max
...
[Restarting Mexponent at iteration =
iteration. Res64: residue
Mexponent: using FFT length fft_lengthK
= fft_length * 1024 8-byte floats.
this gives an average bits bits per digit
Using complex FFT radices radix_set] (product of all
elements of radix_set = fft_length / 2)
...
Mexponent is not prime. Res64:
residue. Program: E17.1
Mexponent mod 2^36 = remainder_1
Mexponent mod 2^35 - 1 = remainder_2
Mexponent mod 2^36 - 1 =
remainder_3
17.1
fft_length msec/iter = timing
ROE[avg,max] = [roe_avg,
roe_max] radices = radix_set
...
Normally, the timing entry for each line should be monotonic from above to below since larger FFT length should take longer to test. But it is OK for a given fft_length to have a higher timing than the one after it since mlucas checks the timings listed in this file for all FFT lengths >= the default FFT length for the number being tested, and uses the FFT length having the smallest listed timing. However, if you notice that this file has any entries such that a given fft_length has a timing 5% or more greater than the next-larger FFT length, or higher timing than two or more larger FFT lengths, please contact the author (see BUGS section for details).
INFO: event
...
[Mexponent Roundoff warning on iteration
iteration, maxerr = roundoff_error
Retrying iteration interval to see if roundoff error is
reproducible.
[Retry of iteration interval with fatal roundoff error was
successful.]]
...
Mexponent is not prime. Res64:
residue. Program: E17.1
Mexponent mod 2^36 = remainder_1
Mexponent mod 2^35 - 1 = remainder_2
Mexponent mod 2^36 - 1 = remainder_3
...
assignment=ID,exponent,trial
factored up to,has P-1 factoring
...
The assignment field contains Test if the assignment
is a first-time Lucas-Lehmer test, or DoubleCheck if the assignment
is a double-check Lucas-Lehmer test. (The program handles both cases the
same way.)
ID is a unique 32-digit hex number.
exponent specifies the Mersenne number (of the form 2 ^ exponent
- 1) to be tested.
trial factored up to is the number of bit this Mersenne number has been
trial factored up to without finding a factor.
has P-1 factoring = 0 if no prior P-1 factoring has been
done, = 1 if P-1 factoring (without finding a factor) has been
done. Since mlucas currently has no P-1 factoring capability it simply
discards these data, but users should prefer = 1 here since
such an assignment is slightly more likely (5-10%) to yield a prime.
To do Lucas-Lehmer test, you should reserve exponents from the PrimeNet server and copy lines in the above format into the $MLUCAS_PATH/worktodo.ini file (see subsection Great Internet Mersenne Prime Search in section NOTES for details). You may need to create the $MLUCAS_PATH/worktodo.ini file if it does not exist.
^[fpq][0123456789]+([.][0123456789]+0M)?$
For both of the supported test types, duplicate pairs of savefiles are written at each checkpoint, to guard against corruption of the on-disk savefiles. Lucas-Lehmer test savefile-pair names start with <p> and <q>, respectively, while Pe'pin test savefile-pair names start with <f> and <q>, respectively. They should not be modified but backups may be made by the user. By default, the program will save a persistent backup of the primary (p or f) save file every 10 millionth iteration, for examples upon completion of the Lucas-Lehmer test of M57885161 the user will find the following exponent-associated files in the $MLUCAS_PATH directory:
p57885161.stat p57885161.10M p57885161.20M p57885161.30M p57885161.40M p57885161.50M
This subsection needs to be compeleted...
The argument parser is buggy. The relative position of arguments is relevant to mlucas, the order of arguments in SYNOPSIS should be followed to avoid confusing the parser. Only 100, 1000 and 10000 are supported for -iters flag. However, the parser will not reject unsupported arguments. Using unsupported arguments for -iters flag may trigger strange behaviour.
Sometimes there is more than one applicable exit status values (see EXIT STATUS section for details). In such case, there is no guarantee which will be returned. For example, if malloc(3) failure triggers an assertion failure. It is possible that mlucas returns 1 instead of 255 as exit status value.
For problems regarding the program mlucas, please contact the author Ernst W. Mayer <ewmayer AT aol DOT com>. For installation and documentation related problems regarding the Debian package and this manual, please use reportbug(1) to contact Alex Vong <alexvong1995 AT protonmail DOT com>.
There are 3 common cases where you will want to run this program. Normally, you should do a spot-check first to quick-test your build, followed by the self-test range for `medium' exponents. Finally, full-blown Lucas-Lehmer testing which is the main purpose of this program.
mlucas -m exponent -iters 100
In the case of multi-exponent "production testing", you should reserve exponent from the PrimeNet server and add them into $MLUCAS_PATH/worktodo.ini (see the subsection Great Internet Mersenne Prime Search within the section NOTES and FILES section for details).
To start mlucas in terminal 1, add the following lines to your login shell initialization file, such as $HOME/.profile (see INVOCATION section in bash(1) and Invocation subsection dash(1) for details).
# Test if we are in tty1 if test `tty` = '/dev/tty1' then # turn on job control set -m # start mlucas nice mlucas > /dev/null 2>&1 & fi
bash(1), dash(1), reportbug(1)
<https://www.mersenneforum.org/mayer/README.html>, /usr/share/doc/mlucas/html/README.html
mlucas is documented fully by Mlucas README, available both online and offline as shown above.
Great Internet Mersenne Prime Search <https://www.mersenne.org/>
Mersenne Forum <https://www.mersenneforum.org/>
Chris Caldwell's web page on Mersenne numbers <https://primes.utm.edu/mersenne/index.html>
Richard Crandall and Barry Fagin, Discrete Weighted Transforms and Large-Integer Arithmetic. <https://pdfs.semanticscholar.org/07c0/fae878fe9d6a117de08282802fb7b892bf2d.pdf>
Richard E. Crandall, Ernst W. Mayer, and Jason S. Papadopoulos, The Twenty-Fourth Fermat Number is Composite. <https://www.mersenneforum.org/mayer/F24.pdf>
2019-01-26 | Mlucas 20.1.1 |