mlucas.1 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949
  1. .\" Hey, EMACS: -*- nroff -*-
  2. .\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
  3. .\"
  4. .\" mlucas.1 - man page of mlucas written for Debian GNU/Linux
  5. .\" Copyright (C) 2015, 2017 Alex Vong <alexvong1995@gmail.com>,
  6. .\"
  7. .\" This program is free software; you can redistribute it and/or modify
  8. .\" it under the terms of the GNU General Public License as published by
  9. .\" the Free Software Foundation; either version 2 of the License, or
  10. .\" (at your option) any later version.
  11. .\"
  12. .\" This program is distributed in the hope that it will be useful,
  13. .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. .\" GNU General Public License for more details.
  16. .\"
  17. .\" You should have received a copy of the GNU General Public License along
  18. .\" with this program; if not, write to the Free Software Foundation, Inc.,
  19. .\" 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  20. .\"
  21. .\" First parameter, NAME, should be all caps
  22. .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
  23. .\" other parameters are allowed: see man(7), man(1)
  24. .\"
  25. .\" Some roff macros, for reference:
  26. .\" .nh disable hyphenation
  27. .\" .hy enable hyphenation
  28. .\" .ad l left justify
  29. .\" .ad b justify to both left and right margins
  30. .\" .nf disable filling
  31. .\" .fi enable filling
  32. .\" .br insert line break
  33. .\" .sp <n> insert n+1 empty lines
  34. .\" for manpage-specific macros, see man(7)
  35. .\" for reference for writing man pages, see man-page(7).
  36. .\" for Perl Pod format, see perlpod(1).
  37. .\"
  38. .\" Standard preamble:
  39. .\" ========================================================================
  40. .de Sp \" Vertical space (when we can't use .PP)
  41. .if t .sp .5v
  42. .if n .sp
  43. ..
  44. .de Vb \" Begin verbatim text
  45. .ft CW
  46. .nf
  47. .ne \\$1
  48. ..
  49. .de Ve \" End verbatim text
  50. .ft R
  51. .fi
  52. ..
  53. .\" Set up some character translations and predefined strings. \*(-- will
  54. .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
  55. .\" double quote, and \*(R" will give a right double quote. \*(C+ will
  56. .\" give a nicer C++. Capital omega is used to do unbreakable dashes and
  57. .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
  58. .\" nothing in troff, for use with C<>.
  59. .tr \(*W-
  60. .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
  61. .ie n \{\
  62. . ds -- \(*W-
  63. . ds PI pi
  64. . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
  65. . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
  66. . ds L" ""
  67. . ds R" ""
  68. . ds C` ""
  69. . ds C' ""
  70. 'br\}
  71. .el\{\
  72. . ds -- \|\(em\|
  73. . ds PI \(*p
  74. . ds L" ``
  75. . ds R" ''
  76. . ds C`
  77. . ds C'
  78. 'br\}
  79. .\"
  80. .\" Escape single quotes in literal strings from groff's Unicode transform.
  81. .ie \n(.g .ds Aq \(aq
  82. .el .ds Aq '
  83. .\"
  84. .\" If the F register is >0, we'll generate index entries on stderr for
  85. .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
  86. .\" entries marked with X<> in POD. Of course, you'll have to process the
  87. .\" output yourself in some meaningful fashion.
  88. .\"
  89. .\" Avoid warning from groff about undefined register 'F'.
  90. .de IX
  91. ..
  92. .if !\nF .nr F 0
  93. .if \nF>0 \{\
  94. . de IX
  95. . tm Index:\\$1\t\\n%\t"\\$2"
  96. ..
  97. . if !\nF==2 \{\
  98. . nr % 0
  99. . nr F 2
  100. . \}
  101. .\}
  102. .\"
  103. .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
  104. .\" Fear. Run. Save yourself. No user-serviceable parts.
  105. . \" fudge factors for nroff and troff
  106. .if n \{\
  107. . ds #H 0
  108. . ds #V .8m
  109. . ds #F .3m
  110. . ds #[ \f1
  111. . ds #] \fP
  112. .\}
  113. .if t \{\
  114. . ds #H ((1u-(\\\\n(.fu%2u))*.13m)
  115. . ds #V .6m
  116. . ds #F 0
  117. . ds #[ \&
  118. . ds #] \&
  119. .\}
  120. . \" simple accents for nroff and troff
  121. .if n \{\
  122. . ds ' \&
  123. . ds ` \&
  124. . ds ^ \&
  125. . ds , \&
  126. . ds ~ ~
  127. . ds /
  128. .\}
  129. .if t \{\
  130. . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
  131. . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
  132. . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
  133. . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
  134. . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
  135. . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
  136. .\}
  137. . \" troff and (daisy-wheel) nroff accents
  138. .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
  139. .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
  140. .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
  141. .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
  142. .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
  143. .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
  144. .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
  145. .ds ae a\h'-(\w'a'u*4/10)'e
  146. .ds Ae A\h'-(\w'A'u*4/10)'E
  147. . \" corrections for vroff
  148. .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
  149. .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
  150. . \" for low resolution devices (crt and lpr)
  151. .if \n(.H>23 .if \n(.V>19 \
  152. \{\
  153. . ds : e
  154. . ds 8 ss
  155. . ds o a
  156. . ds d- d\h'-1'\(ga
  157. . ds D- D\h'-1'\(hy
  158. . ds th \o'bp'
  159. . ds Th \o'LP'
  160. . ds ae ae
  161. . ds Ae AE
  162. .\}
  163. .rm #[ #] #H #V #F C
  164. .\" ========================================================================
  165. .\"
  166. .IX Title "MLUCAS 1"
  167. .TH MLUCAS 1 "2017-01-27" "Mlucas 14.2" "User Commands"
  168. .\" For nroff, turn off justification. Always turn off hyphenation; it makes
  169. .\" way too many mistakes in technical documents.
  170. .if n .ad l
  171. .nh
  172. .SH "NAME"
  173. mlucas \- program to perform Lucas\-Lehmer test on a Mersenne number,
  174. 2 ^ p \- 1
  175. .SH "SYNOPSIS"
  176. .IX Header "SYNOPSIS"
  177. .PD 0
  178. .de Sp
  179. .br
  180. ..
  181. \&\fBmlucas\fR
  182. .PP
  183. \&\fBmlucas \-h\fR
  184. .PP
  185. \&\fBmlucas\fR \fB\-s\fR \fBtiny\fR | \fBt\fR | \fBsmall\fR | \fBs\fR | \fBmedium\fR | \fBm\fR |
  186. \&\fBlarge\fR | \fBl\fR | \fBhuge\fR | \fBh\fR | \fBall\fR | \fBa\fR
  187. [\fB\-iters\fR \fB100\fR | \fB1000\fR | \fB10000\fR [\fB\-nthread\fR \fIthreads\fR]]
  188. .PP
  189. \&\fBmlucas\fR \fB\-m\fR \fIexponent\fR | \fB\-f\fR \fIexponent\fR
  190. [\fB\-iters\fR \fB100\fR | \fB1000\fR | \fB10000\fR [\fB\-nthread\fR \fIthreads\fR]]
  191. .PP
  192. \&\fBmlucas\fR \fB\-fftlen\fR \fIfft_length\fR
  193. [\fB\-radset\fR \fIradix_set\fR]
  194. [\fB\-m\fR \fIexponent\fR | \fB\-f\fR \fIexponent\fR]
  195. \&\fB\-iters\fR \fB100\fR | \fB1000\fR | \fB10000\fR
  196. [\fB\-nthread\fR \fIthreads\fR]
  197. .PD
  198. .de Sp
  199. .if t .sp .5v
  200. .if n .sp
  201. ..
  202. .SH "DESCRIPTION"
  203. .IX Header "DESCRIPTION"
  204. This manual page documents briefly the \fBmlucas\fR command.
  205. .PP
  206. \&\fBmlucas\fR is an open-source (and free/libre) program
  207. for performing Lucas-Lehmer test on prime-exponent Mersenne numbers,
  208. that is, integers of the form 2 ^ p \- 1, with prime exponent p.
  209. In short, everything you need to search for world-record Mersenne primes!
  210. It has been used in the verification of various Mersenne primes,
  211. including the 45th, 46th and 48th found Mersenne prime.
  212. .PP
  213. You may use it to test any suitable number as you wish,
  214. but it is preferable that you do so in a coordinated fashion,
  215. as part of the \fBGreat Internet Mersenne Prime Search\fR (\fB\s-1GIMPS\s0\fR).
  216. For more information on \fB\s-1GIMPS\s0\fR,
  217. see the \fBGreat Internet Mersenne Prime Search\fR subsection
  218. within the \fB\s-1NOTES\s0\fR section and \fB\s-1SEE ALSO\s0\fR section.
  219. Note that \fBmlucas\fR is not (yet) as efficient as the main \fB\s-1GIMPS\s0\fR client,
  220. George Woltman's \fBPrime95\fR program
  221. (a.k.a. \fBmprime\fR for the (gnu/)linux version),
  222. but that program is not truly open-source (and free/libre), since
  223. it requires the user to abide by the prize-sharing rules set by its author
  224. (incompatible with \fIfreedom to run the program as you wish,
  225. for any purpose\fR),
  226. should a user be lucky enough to find a new prime eligible for
  227. one of the monetary prizes offered by the Electronic Freedom Foundation
  228. (see \s-1EFF\s0 Cooperative Computing Awards <https://www.eff.org/awards/coop>
  229. for details).
  230. .PP
  231. \&\fBmlucas\fR reads the exponents from the \fI\f(CI$MLUCAS_PATH\fI/worktodo.ini\fR file.
  232. Results are written to the \fI\f(CI$MLUCAS_PATH\fI/results.txt\fR file
  233. and the exponent-specific \fI\f(CI$MLUCAS_PATH\fI/*.stat\fR file
  234. (see section \fB\s-1FILES\s0\fR for details).
  235. Error messages are written to \fIstderr\fR
  236. and the \fI\f(CI$MLUCAS_PATH\fI/*.stat\fR file.
  237. Exponents can also be passed as command-line arguments
  238. but this is mainly used for debugging (see section \fB\s-1OPTIONS\s0\fR for details).
  239. In addition, \fBmlucas\fR can perform the Pe'pin primality test
  240. on Fermat numbers 2 ^ (2 ^ n) + 1,
  241. using an exponent-optimized fast-transform length
  242. much like that used for testing Mersenne numbers.
  243. .PP
  244. New users are urged to jump straight to the \fB\s-1EXAMPLE\s0\fR section
  245. and follow the examples and pointers to other sections.
  246. Users with little time for in-depth reading
  247. should at least read the \fB\s-1NOTES\s0\fR, \fB\s-1BUGS\s0\fR and \fB\s-1EXAMPLE\s0\fR sections
  248. for a brief introduction to the \fBGreat Internet Mersenne Prime Search\fR,
  249. undesirable restrictions and common usages.
  250. \&\fB\s-1FILES\s0\fR section is also highly recommended
  251. since it describes the \fBmlucas\fR configuration files
  252. used for host-specific optimization and other \fBmlucas\fR\-generated files.
  253. Advanced users should also peruse the \fB\s-1OPTIONS\s0\fR section
  254. since it introduces less-commonly-used advanced options.
  255. Experienced users who find this manual inadequate
  256. should consult the \fB\s-1SEE ALSO\s0\fR section for further information.
  257. Lastly, the \fIMlucas \s-1README\s0\fR, available both online and offline,
  258. is highly recommended
  259. since it is written and maintained by the author of \fBmlucas\fR
  260. and should be considered the final authority.
  261. .SH "OPTIONS"
  262. .IX Header "OPTIONS"
  263. \&\fBmlucas\fR follows the traditional \s-1POSIX \s0(see
  264. .BR standards (7)
  265. for details)
  266. command line syntax,
  267. with short options starting with one dashes (`\fI\-\fR').
  268. A summary of options is included below.
  269. A complete description is in the \fB\s-1SEE ALSO\s0\fR section.
  270. .TP 7
  271. \fB\-h\fR
  272. .IX Item "-h"
  273. Show version of program and summary of options.
  274. .TP 7
  275. \fB\-s t, \-s tiny\fR
  276. .IX Item "-s t, -s tiny"
  277. Run 100\-iteration self-test on a set of 32 Mersenne exponents,
  278. ranging from 173431 to 2455003.
  279. This will take around 1 minute on a fast (pre\-2010) \s-1CPU.\s0
  280. .TP 7
  281. \fB\-s s, \-s small\fR
  282. .IX Item "-s s, -s small"
  283. Run 100\-iteration self-test on a set of 24 Mersenne exponents,
  284. ranging from 173431 to 1245877.
  285. This will take around 10 minutes on a fast (pre\-2010) \s-1CPU.\s0
  286. .TP 7
  287. \fB\-s m, \-s medium\fR
  288. .IX Item "-s m, -s medium"
  289. Run 100\-iteration self-test on a set of 24 Mersenne exponents,
  290. ranging from 1327099 to 9530803.
  291. This will take around an hour on a fast (pre\-2010) \s-1CPU.\s0
  292. .TP 7
  293. \fB\-s l, \-s large\fR
  294. .IX Item "-s l, -s large"
  295. Run 100\-iteration self-test on a set of 24 Mersenne exponents,
  296. ranging from 10151971 to 72851621.
  297. This will take around an hour on a fast (pre\-2010) \s-1CPU.\s0
  298. .TP 7
  299. \fB\-s h, \-s huge\fR
  300. .IX Item "-s h, -s huge"
  301. Run 100\-iteration self-test on a set of 16 Mersenne exponents,
  302. ranging from 77597293 to 282508657.
  303. This will take a couple of hours on a fast (pre\-2010) \s-1CPU.\s0
  304. .TP 7
  305. \fB\-s a, \-s all\fR
  306. .IX Item "-s a, -s all"
  307. Run 100\-iteration self-test on all Mersenne exponents
  308. and all \s-1FFT\s0 radix sets.
  309. This will take several hours on a fast (pre\-2010) \s-1CPU.\s0
  310. .TP 7
  311. \fB\-fftlen\fR \fIfft_length\fR
  312. .IX Item "-fftlen fft_length"
  313. This allows the user to specify the length of the fast-transform (\s-1FFT\s0)
  314. used to effect the large-integer modular multiply
  315. which is at the heart of all such nonfactorial primality tests.
  316. The length unit here is in terms of the number of double-precision
  317. machine words used in the multiword-integer encoding
  318. of the primality test residue
  319. which is both input and result of each of said multiplies.
  320. Because mlucas is intended for testing numbers with many millions of bits,
  321. we generally speak of these \s-1FFT\s0 lengths in terms of kilodoubles
  322. (= 2 ^ 10 or 1024 doubles).
  323. If \fIfft_length\fR is one of the available \s-1FFT\s0 lengths (in kilodoubles),
  324. run all available \s-1FFT\s0 radices available at that length,
  325. unless the \fI\-radset\fR flag is also invoked (see below for details).
  326. If \fI\-fftlen\fR is invoked with either the \fI\-m\fR or \fI\-f\fR flag,
  327. the self-tests will perform the first 100 iterations
  328. of a Lucas-Lehmer test (\fI\-m\fR) or Pe'pin test (\fI\-f\fR)
  329. on the user-specified Mersenne or Fermat number.
  330. If no user-set exponent is invoked,
  331. do 100 Lucas-Lehmer test iterations using
  332. the default self-test Mersenne or Fermat exponent for that \s-1FFT\s0 length.
  333. The program uses this to find the optimal radix set for a given \s-1FFT\s0 length
  334. on your hardware.
  335. .TP 7
  336. \fB\-iters\fR \fB100\fR | \fB1000\fR | \fB10000\fR
  337. .IX Item "-iters 100 | 1000 | 10000"
  338. Do \fI100\fR, \fI1000\fR or \fI10000\fR self-test iterations of the type determined
  339. by the modulus-related options
  340. (\fI\-s\fR / \fI\-m\fR = Lucas-Lehmer test iterations with initial seed 4,
  341. \&\fI\-f\fR = Pe'pin test squarings with initial seed 3).
  342. Default is \fI100\fR iterations.
  343. .TP 7
  344. \fB\-radset\fR \fIradix_set\fR
  345. .IX Item "-radset radix_set"
  346. Specify index of a set of complex \s-1FFT\s0 radices to use,
  347. based on the big selection table in the function
  348. .BR get_fft_radices ().
  349. This requires a supported value of \fI\-fftlen\fR to be specified,
  350. meaning (for an \s-1FFT\s0 length supported by the program)
  351. an index \fB0\fR, \fB1\fR, \fB2\fR, ... and so on.
  352. \&\fB0\fR is always a valid radix set index;
  353. how high one can go in the enumeration depends on the \s-1FFT\s0 length.
  354. As soon as the user tries an index out of range of the current \s-1FFT\s0 length,
  355. the program will error-exit with an informational message to that effect,
  356. which also notes the maximum allowable radix set index for that \s-1FFT\s0 length.
  357. .TP 7
  358. \fB\-nthread\fR \fIthreads\fR
  359. .IX Item "-nthread threads"
  360. For multithread-enabled (default) build,
  361. perform the test in parallel mode with this many threads.
  362. .TP 7
  363. \fB\-m\fR \fIexponent\fR
  364. .IX Item "-m exponent"
  365. Perform a Lucas-Lehmer primality test of the Mersenne number
  366. M(\fIexponent\fR) = 2 ^ \fIexponent\fR \- 1,
  367. where \fIexponent\fR must be an odd prime.
  368. If \fI\-iters\fR is also invoked, this indicates a timing test.
  369. This requires suitable added arguments
  370. (\fI\-fftlen\fR and, optionally, \fI\-radset\fR) to be supplied.
  371. If the \fI\-fftlen\fR option (and optionally \fI\-radset\fR) is also invoked
  372. but \fI\-iters\fR is not,
  373. the program first checks
  374. the first line of the \fI\f(CI$MLUCAS_PATH\fI/worktodo.ini\fR file to see
  375. if the assignment specified there is a Lucas-Lehmer test
  376. with the same exponent as specified via the \fI\-m\fR argument.
  377. If so, the \fI\-fftlen\fR argument is treated as a user override
  378. of the default \s-1FFT\s0 length for the exponent.
  379. If \fI\-radset\fR is also invoked, this is similarly treated as
  380. a user-specified radix set for the user-set \s-1FFT\s0 length;
  381. otherwise the program will use the \fI\f(CI$MLUCAS_PATH\fI/mlucas.cfg\fR file
  382. to select the radix set to be used for the user-forced \s-1FFT\s0 length.
  383. If the \fI\f(CI$MLUCAS_PATH\fI/worktodo.ini\fR file entry
  384. does not match the \fI\-m\fR value,
  385. a set of timing self-tests is run on the user-specified Mersenne number
  386. using all sets of \s-1FFT\s0 radices available at the specified \s-1FFT\s0 length.
  387. If the \fI\-fftlen\fR option is not invoked,
  388. the tests use all sets of \s-1FFT\s0 radices
  389. available at that exponent's default \s-1FFT\s0 length.
  390. Use this to find the optimal radix set
  391. for a single given Mersenne exponent on your hardware,
  392. similarly to the \fI\-fftlen\fR option.
  393. Perform 100 iterations, or as many as specified via the \fI\-iters\fR flag.
  394. .TP 7
  395. \fB\-f\fR \fIexponent\fR
  396. .IX Item "-f exponent"
  397. Perform a base\-3 Pe'pin test on the Fermat number
  398. F(\fIexponent\fR) = 2 ^ (2 ^ \fIexponent\fR) + 1.
  399. If desired this can be invoked together with the \fI\-fftlen\fR option
  400. as for the Mersenne-number self-tests (see above notes on the \fI\-m\fR flag;
  401. note that not all \s-1FFT\s0 lengths supported for \fI\-m\fR are available for \fI\-f\fR:
  402. \&\fI\-m\fR permits \s-1FFT\s0 lengths of form \fIodd\fR * 2 ^ n
  403. with \fIodd\fR = any of \fB1\fR, \fB3\fR, \fB5\fR, \fB7\fR, \fB9\fR, \fB11\fR, \fB13\fR, \fB15\fR;
  404. \&\fI\-f\fR allows odd = \fB1\fR, \fB7\fR, \fB15\fR and \fB63\fR)
  405. Optimal radix sets and timings
  406. are written to the \fI\f(CI$MLUCAS_PATH\fI/fermat.cfg\fR file.
  407. Perform 100 iterations, or as many as specified via the \fI\-iters\fR flag.
  408. .SH "EXIT STATUS"
  409. .IX Header "EXIT STATUS"
  410. .TP 4
  411. The list of exit status values is limited. It is not possible to determine the cause of failure from the exit status value alone. However, \fBmlucas\fR make use of \fIstderr\fR to print error messages as well as saving them to the \fI\f(CI$MLUCAS_PATH\fI/*.stat\fR file, where \fI*\fR is in the form
  412. .IX Item "The list of exit status values is limited. It is not possible to determine the cause of failure from the exit status value alone. However, mlucas make use of stderr to print error messages as well as saving them to the $MLUCAS_PATH/*.stat file, where * is in the form"
  413. .Sp
  414. .PD 0
  415. .de Sp
  416. .br
  417. ..
  418. p\fIexponent\fR
  419. .PD
  420. .de Sp
  421. .if t .sp .5v
  422. .if n .sp
  423. ..
  424. .TP 4
  425. for Mersenne number 2 ^ \fIexponent\fR \- 1 or
  426. .IX Item "for Mersenne number 2 ^ exponent - 1 or"
  427. .Sp
  428. .PD 0
  429. .de Sp
  430. .br
  431. ..
  432. f\fIexponent\fR
  433. .PD
  434. .de Sp
  435. .if t .sp .5v
  436. .if n .sp
  437. ..
  438. .PP
  439. for Fermat number 2 ^ (2 ^ \fIexponent\fR) + 1.
  440. (see \fB\s-1FILES\s0\fR section for details).
  441. .TP 7
  442. \fB0\fR
  443. .IX Item "0"
  444. Exit successfully.
  445. .TP 7
  446. \fB1\fR
  447. .IX Item "1"
  448. .PD 0
  449. .de Sp
  450. .br
  451. ..
  452. Assertion failure.
  453. .Sp
  454. Cannot determine the number of CPUs.
  455. .Sp
  456. Unknown fetal error.
  457. .Sp
  458. Radix set index not available for given \s-1FFT\s0 length.
  459. .PD
  460. .de Sp
  461. .if t .sp .5v
  462. .if n .sp
  463. ..
  464. .TP 7
  465. \fB255\fR
  466. .IX Item "255"
  467. .PD 0
  468. .de Sp
  469. .br
  470. ..
  471. .BR thread_policy_set ()
  472. failure.
  473. .Sp
  474. .BR malloc (3),
  475. .BR calloc (3)
  476. or
  477. .BR realloc (3)
  478. failure.
  479. .Sp
  480. .BR pthread_create (3)
  481. or
  482. .BR pthread_join (3)
  483. failure.
  484. .PD
  485. .de Sp
  486. .if t .sp .5v
  487. .if n .sp
  488. ..
  489. .SH "ENVIRONMENT"
  490. .IX Header "ENVIRONMENT"
  491. \&\fBmlucas\fR honors the following environment variables, if they exist:
  492. .TP 7
  493. \fB\s-1MLUCAS_PATH\s0\fR
  494. .IX Item "MLUCAS_PATH"
  495. The path to read \fBmlucas\fR configuration files
  496. and to write \fBmlucas\fR generated files (see \fB\s-1FILES\s0\fR section for details).
  497. \&\fB\s-1MLUCAS_PATH\s0\fR must end with a slash (e.g., \fI/home/foolish/bar/\fR.
  498. If \fB\s-1MLUCAS_PATH\s0\fR is not set,
  499. then \fB\s-1MLUCAS_PATH\s0\fR defaults to \fI\f(CI$HOME\fI/.mlucas.d/\fR,
  500. where the environmental variable \fI\f(CI$HOME\fI\fR will be expanded
  501. in the environment where \fBmlucas\fR is invoked.
  502. \&\fBmlucas\fR will attept to make the directory with parents
  503. pointed by \fB\s-1MLUCAS_PATH\s0\fR using the
  504. .BR mkdir (1)
  505. command.
  506. The effect is similar to executing \fImkdir \-p \f(CI$MLUCAS_PATH\fI\fR in the shell
  507. provided that the \fI\-p\fR flag is honored.
  508. .SH "FILES"
  509. .IX Header "FILES"
  510. This section details \fBmlucas\fR configuration files
  511. and \fBmlucas\fR generated files.
  512. As noted in the \fB\s-1ENVIRONMENT\s0\fR section,
  513. \&\fB\f(CB$MLUCAS_PATH\fB\fR defaults to \fI\f(CI$HOME\fI/mlucas.d/\fR but this can be
  514. overridden at run-time by setting the \fB\s-1MLUCAS_PATH\s0\fR environment variable.
  515. .TP 7
  516. \fB\f(CB$MLUCAS_PATH\fB/*.stat\fR
  517. .IX Item "$MLUCAS_PATH/*.stat"
  518. .RS 7
  519. .PD 0
  520. .TP 4
  521. The filename-prefix wildcard \fI*\fR is as described in the \s-1EXIT STATUS\s0 section; for the primality test of the Mersenne number 2 ^ \fIexponent\fR \- 1 it is of the form
  522. .IX Item "The filename-prefix wildcard * is as described in the EXIT STATUS section; for the primality test of the Mersenne number 2 ^ exponent - 1 it is of the form"
  523. .Sp
  524. .PD 0
  525. .de Sp
  526. .br
  527. ..
  528. .PD
  529. p\fIexponent\fR
  530. .PD
  531. .de Sp
  532. .if t .sp .5v
  533. .if n .sp
  534. ..
  535. .RE
  536. .RS 7
  537. .TP 4
  538. All important events, per\-10000\-iteration residues (or per\-100000\-iteration if more than 4 threads are used for the test) and the final residue during Lucas-Lehmer test of \fIexponent\fR are recorded in this file. It can be seen as an \fIexponent\fR\-specific detailed \fI\f(CI$MLUCAS_PATH\fI/results.txt\fR (see \fI\f(CI$MLUCAS_PATH\fI/results.txt\fR below for details). This file is useful for debugging purposes. Its format looks like:
  539. .IX Item "All important events, per-10000-iteration residues (or per-100000-iteration if more than 4 threads are used for the test) and the final residue during Lucas-Lehmer test of exponent are recorded in this file. It can be seen as an exponent-specific detailed $MLUCAS_PATH/results.txt (see $MLUCAS_PATH/results.txt below for details). This file is useful for debugging purposes. Its format looks like:"
  540. .Sp
  541. .PD 0
  542. .de Sp
  543. .br
  544. ..
  545. \&\fB\s-1INFO\s0\fR: \fIevent\fR
  546. .Sp
  547. \&...
  548. .Sp
  549. \&\fBM\fR\fIexponent\fR: \fBusing \s-1FFT\s0 length\fR \fIfft_length\fR\fBK\fR
  550. \&\fB=\fR \fIfft_length * 1024\fR \fB8\-byte floats.\fR
  551. Bz<this gives an average> \fIbits\fR \fBbits per digit\fR
  552. .Sp
  553. \&\fBUsing complex \s-1FFT\s0 radices\fR \fIradix_set\fR
  554. (product of all elements of radix_set = fft_length / 2)
  555. .Sp
  556. \&...
  557. .Sp
  558. \&\fB[\fR\fIdate_and_time\fR\fB]\fR
  559. \&\fBM\fR\fIexponent\fR
  560. \&\fBIter#\fR \fB=\fR \fIiterations\fR
  561. \&\fBclocks\fR \fB=\fR \fItime_taken_per_10000_iterations\fR
  562. \&\fB[\fR\fI time_taken_per_iteration\fR \fBsec/iter\fR\fB]\fR
  563. \&\fBRes64:\fR \fIresidue\fR\fB.\fR
  564. \&\fBAvgMaxErr\fR \fB=\fR \fIroe_avg\fR\fB.\fR
  565. \&\fBMaxErr\fR \fB=\fR \fIroe_max\fR
  566. .Sp
  567. \&...
  568. .Sp
  569. [\fBRestarting\fR \fBM\fR\fIexponent\fR \fBat iteration\fR \fB=\fR \fIiteration\fR\fB.\fR
  570. \&\fBRes64:\fR \fIresidue\fR
  571. .Sp
  572. \&\fBM\fR\fIexponent\fR: \fBusing \s-1FFT\s0 length\fR \fIfft_length\fR\fBK\fR
  573. \&\fB=\fR \fIfft_length * 1024\fR \fB8\-byte floats.\fR
  574. .Sp
  575. \&\fBthis gives an average\fR \fIbits\fR \fBbits per digit\fR
  576. .Sp
  577. \&\fBUsing complex \s-1FFT\s0 radices\fR \fIradix_set\fR]
  578. (product of all elements of radix_set = fft_length / 2)
  579. .Sp
  580. \&...
  581. .Sp
  582. \&\fBM\fR\fIexponent\fR \fBis not prime.\fR
  583. \&\fBRes64:\fR \fIresidue\fR\fB.\fR
  584. \&\fBProgram: E14.2\fR
  585. .Sp
  586. \&\fBM\fR\fIexponent\fR \fBmod 2^36\fR \fB=\fR \fIremainder_1\fR
  587. .Sp
  588. \&\fBM\fR\fIexponent\fR \fBmod 2^35 \- 1\fR \fB=\fR \fIremainder_2\fR
  589. .Sp
  590. \&\fBM\fR\fIexponent\fR \fBmod 2^36 \- 1\fR \fB=\fR \fIremainder_3\fR
  591. .PD
  592. .de Sp
  593. .if t .sp .5v
  594. .if n .sp
  595. ..
  596. .RE
  597. .RS 7
  598. .RE
  599. .TP 7
  600. \fB\f(CB$MLUCAS_PATH\fB/fermat.cfg\fR
  601. .IX Item "$MLUCAS_PATH/fermat.cfg"
  602. The format of this file is exactly the same as
  603. the format of \fI\f(CI$MLUCAS_PATH\fI/mlucas.cfg\fR
  604. (see \fI\f(CI$MLUCAS_PATH\fI/mlucas.cfg\fR below for details).
  605. .TP 7
  606. \fB\f(CB$MLUCAS_PATH\fB/mlucas.cfg\fR
  607. .IX Item "$MLUCAS_PATH/mlucas.cfg"
  608. .RS 7
  609. .PD 0
  610. .TP 4
  611. This file stores the radix set with best timing for each \s-1FFT\s0 length. Its format looks like:
  612. .IX Item "This file stores the radix set with best timing for each FFT length. Its format looks like:"
  613. .Sp
  614. .PD 0
  615. .de Sp
  616. .br
  617. ..
  618. .PD
  619. \&\fB14.2\fR
  620. .Sp
  621. \&\fIfft_length\fR \fBmsec/iter\fR \fB=\fR \fItiming\fR
  622. \&\fBROE[avg,max]\fR \fB=\fR \fB[\fR\fIroe_avg\fR\fB,\fR \fIroe_max\fR\fB]\fR
  623. \&\fBradices\fR \fB=\fR \fIradix_set\fR
  624. .Sp
  625. \&...
  626. .PD
  627. .de Sp
  628. .if t .sp .5v
  629. .if n .sp
  630. ..
  631. .RE
  632. .RS 7
  633. .PD
  634. .de Sp
  635. .if t .sp .5v
  636. .if n .sp
  637. ..
  638. .Sp
  639. Normally, the \fItiming\fR entry for each line should be monotonic
  640. from above to below since larger \s-1FFT\s0 length should take longer to test.
  641. But it is \s-1OK\s0 for a given \fIfft_length\fR to have a higher \fItiming\fR than
  642. the one after it since \fBmlucas\fR checks the timings listed in this file
  643. for all \s-1FFT\s0 lengths >= the default \s-1FFT\s0 length for the number being tested,
  644. and uses the \s-1FFT\s0 length having the smallest listed timing.
  645. However, if you notice that this file has any entries such that
  646. a given \fIfft_length\fR has a timing 5% or more greater than the next-larger
  647. \&\s-1FFT\s0 length, or higher timing than two or more larger \s-1FFT\s0 lengths,
  648. please contact the author (see \fB\s-1BUGS\s0\fR section for details).
  649. .RE
  650. .TP 7
  651. \fB\f(CB$MLUCAS_PATH\fB/nthreads.ini\fR
  652. .IX Item "$MLUCAS_PATH/nthreads.ini"
  653. This file sets the number of threads used.
  654. It should only contain a positive integer
  655. since the content of this file is read by
  656. \&\fBsscanf(\fR\fIin_line\fR, \fI\*(L"%d\*(R"\fR\fB,\fR \fI&NTHREADS\fR\fB);\fR
  657. where the variable \fIin_line\fR
  658. contains the content of the \fI\f(CI$MLUCAS_PATH\fI/nthreads.ini\fR file.
  659. If this file is not present,
  660. \&\fBmlucas\fR will use as many threads as the number of CPUs detected.
  661. The number of threads used set by this file
  662. can be overridden by setting \fI\-nthread\fR flag at run-time.
  663. This file is for those who want to set the number of threads
  664. to be greater or less than the number of CPUs detected.
  665. This can be useful since some users reported up to 10% performance gain
  666. when using more threads than the number of CPUs detected.
  667. .TP 7
  668. \fB\f(CB$MLUCAS_PATH\fB/results.txt\fR
  669. .IX Item "$MLUCAS_PATH/results.txt"
  670. .RS 7
  671. .PD 0
  672. .TP 4
  673. Important events which occurred during Lucas-Lehmer test and the final residue obtained are recorded in this file. This file summarizes important information in all \fI\f(CI$MLUCAS_PATH\fI/*.stat\fR files (see \fI\f(CI$MLUCAS_PATH\fI/*.stat\fR above for details) into a single file. This file (more specifically, any results which were added to it since your last checkin from) should be submitted to the PrimeNet server (see subsection \fBGreat Internet Mersenne Prime Search\fR in section \fB\s-1NOTES\s0\fR for details) since the Lucas-Lehmer test exponents are obtained from the PrimeNet server (see \fI\f(CI$MLUCAS_PATH\fI/worktodo.ini\fR below for details). Its format looks like:
  674. .IX Item "Important events which occurred during Lucas-Lehmer test and the final residue obtained are recorded in this file. This file summarizes important information in all $MLUCAS_PATH/*.stat files (see $MLUCAS_PATH/*.stat above for details) into a single file. This file (more specifically, any results which were added to it since your last checkin from) should be submitted to the PrimeNet server (see subsection Great Internet Mersenne Prime Search in section NOTES for details) since the Lucas-Lehmer test exponents are obtained from the PrimeNet server (see $MLUCAS_PATH/worktodo.ini below for details). Its format looks like:"
  675. .Sp
  676. .PD 0
  677. .de Sp
  678. .br
  679. ..
  680. .PD
  681. \&\fB\s-1INFO:\s0\fR \fIevent\fR
  682. .Sp
  683. \&...
  684. .Sp
  685. [\fBM\fR\fIexponent\fR \fBRoundoff warning on iteration\fR \fIiteration\fR\fB,\fR
  686. \&\fBmaxerr\fR \fB=\fR \fIroundoff_error\fR
  687. .Sp
  688. \&\fB Retrying iteration interval to see if roundoff error is reproducible.\fR
  689. .Sp
  690. [\fBRetry of iteration interval with fatal roundoff error was successful.\fR]]
  691. .Sp
  692. \&...
  693. .Sp
  694. \&\fBM\fR\fIexponent\fR\fB is not prime.\fR
  695. \&\fBRes64:\fR \fIresidue\fR\fB.\fR
  696. \&\fBProgram: E14.2\fR
  697. .Sp
  698. \&\fBM\fR\fIexponent\fR \fBmod 2^36\fR \fB=\fR \fIremainder_1\fR
  699. .Sp
  700. \&\fBM\fR\fIexponent\fR \fBmod 2^35 \- 1\fR \fB=\fR \fIremainder_2\fR
  701. .Sp
  702. \&\fBM\fR\fIexponent\fR \fBmod 2^36 \- 1\fR \fB=\fR \fIremainder_3\fR
  703. .Sp
  704. \&...
  705. .PD
  706. .de Sp
  707. .if t .sp .5v
  708. .if n .sp
  709. ..
  710. .RE
  711. .RS 7
  712. .RE
  713. .TP 7
  714. \fB\f(CB$MLUCAS_PATH\fB/worktodo.ini\fR
  715. .IX Item "$MLUCAS_PATH/worktodo.ini"
  716. .RS 7
  717. .PD 0
  718. .TP 4
  719. This file contains Lucas-Lehmer test assignments to be tested. Its format looks like:
  720. .IX Item "This file contains Lucas-Lehmer test assignments to be tested. Its format looks like:"
  721. .Sp
  722. .PD 0
  723. .de Sp
  724. .br
  725. ..
  726. .PD
  727. \&\fIassignment\fR\fB=\fR\fI\s-1ID\s0\fR\fB,\fR\fIexponent\fR\fB,\fR\fItrial
  728. factored up to\fR\fB,\fR\fIhas P\-1 factoring\fR
  729. .Sp
  730. \&...
  731. .PD
  732. .de Sp
  733. .if t .sp .5v
  734. .if n .sp
  735. ..
  736. .RE
  737. .RS 7
  738. .Sp
  739. The \fIassignment\fR field contains \fBTest\fR
  740. if the assignment is a first-time Lucas-Lehmer test,
  741. or \fBDoubleCheck\fR if the assignment is a double-check Lucas-Lehmer test.
  742. (The program handles both cases the same way.)
  743. .PD 0
  744. .de Sp
  745. .br
  746. ..
  747. .Sp
  748. \&\fI\s-1ID\s0\fR is a unique 32\-digit hex number.
  749. .Sp
  750. \&\fIexponent\fR specifies the Mersenne number
  751. (of the form 2 ^ \fIexponent\fR \- 1) to be tested.
  752. .Sp
  753. \&\fItrial factored up to\fR is the number of bit this Mersenne number
  754. has been trial factored up to without finding a factor.
  755. .Sp
  756. \&\fIhas P\-1 factoring\fR \fB=\fR \fB0\fR if no prior P\-1 factoring has been done,
  757. \&\fB=\fR \fB1\fR if P\-1 factoring (without finding a factor) has been done.
  758. Since mlucas currently has no P\-1 factoring capability
  759. it simply discards these data,
  760. but users should prefer \fB=\fR \fB1\fR here
  761. since such an assignment is slightly more likely (5\-10%) to yield a prime.
  762. .PD
  763. .de Sp
  764. .if t .sp .5v
  765. .if n .sp
  766. ..
  767. .Sp
  768. To do Lucas-Lehmer test,
  769. you should reserve exponents from the PrimeNet server
  770. and copy lines in the above format into the
  771. \&\fI\f(CI$MLUCAS_PATH\fI/worktodo.ini\fR file (see subsection
  772. \&\fBGreat Internet Mersenne Prime Search\fR in section \fB\s-1NOTES\s0\fR for details).
  773. You may need to create the \fI\f(CI$MLUCAS_PATH\fI/worktodo.ini\fR file
  774. if it does not exist.
  775. .RE
  776. .TP 7
  777. \fBSave files in \f(CB$MLUCAS_PATH\fB\fR
  778. .IX Item "Save files in $MLUCAS_PATH"
  779. All files matching the following extended regular expression
  780. (see
  781. .BR regex (7)
  782. for details)
  783. in \fI\f(CI$MLUCAS_PATH\fI\fR directory are save files:
  784. .Sp
  785. .Vb 1
  786. \& ^[fpq][0123456789]+([.][0123456789]+0M)?$
  787. .Ve
  788. .Sp
  789. For both of the supported test types,
  790. duplicate pairs of savefiles are written at each checkpoint,
  791. to guard against corruption of the on-disk savefiles.
  792. Lucas-Lehmer test savefile-pair names start with <p> and <q>, respectively,
  793. while Pe'pin test savefile-pair names start with <f> and <q>, respectively.
  794. They should not be modified but backups may be made by the user.
  795. By default, the program will save a persistent backup of the primary
  796. (\fBp\fR or \fBf\fR) save file every 10 millionth iteration,
  797. for examples upon completion of the Lucas-Lehmer test of M57885161
  798. the user will find the following exponent-associated files
  799. in the \fI\f(CI$MLUCAS_PATH\fI\fR directory:
  800. .Sp
  801. .Vb 6
  802. \& p57885161.stat
  803. \& p57885161.10M
  804. \& p57885161.20M
  805. \& p57885161.30M
  806. \& p57885161.40M
  807. \& p57885161.50M
  808. .Ve
  809. .SH "NOTES"
  810. .IX Header "NOTES"
  811. .SS "Great Internet Mersenne Prime Search"
  812. .IX Subsection "Great Internet Mersenne Prime Search"
  813. This subsection needs to be compeleted...
  814. .SH "BUGS"
  815. .IX Header "BUGS"
  816. The argument parser is buggy.
  817. The relative position of arguments is relevant to \fBmlucas\fR,
  818. the order of arguments in \fB\s-1SYNOPSIS\s0\fR
  819. should be followed to avoid confusing the parser.
  820. Only \fI100\fR, \fI1000\fR and \fI10000\fR are supported for \fI\-iters\fR flag.
  821. However, the parser will not reject unsupported arguments.
  822. Using unsupported arguments for \fI\-iters\fR flag
  823. may trigger strange behaviour.
  824. .PP
  825. Sometimes there is more than one applicable exit status values
  826. (see \fB\s-1EXIT STATUS\s0\fR section for details).
  827. In such case, there is no guarantee which will be returned.
  828. For example,
  829. if
  830. .BR malloc (3)
  831. failure triggers an assertion failure.
  832. It is possible that \fBmlucas\fR returns \fI1\fR
  833. instead of \fI255\fR as exit status value.
  834. .PP
  835. For problems regarding the program \fBmlucas\fR,
  836. please contact the author Ernst W. Mayer <ewmayer@aol.com>.
  837. For installation and documentation related problems
  838. regarding the Debian package and this manual,
  839. please use
  840. .BR reportbug (1)
  841. to contact Alex Vong <alexvong1995@gmail.com>.
  842. .SH "EXAMPLE"
  843. .IX Header "EXAMPLE"
  844. There are 3 common cases where you will want to run this program.
  845. Normally, you should do a spot-check first to quick-test your build,
  846. followed by the self-test range for `medium' exponents.
  847. Finally, full-blown Lucas-Lehmer testing
  848. which is the main purpose of this program.
  849. .TP 7
  850. \fBmlucas \-fftlen 192 \-iters 100 \-radset 0 \-nthread 2\fR
  851. .IX Item "mlucas -fftlen 192 -iters 100 -radset 0 -nthread 2"
  852. Perform spot-check to see if \fBmlucas\fR works
  853. and fill-in a bug report if it does not.
  854. The spot check should produce residues
  855. matching the internal tabulated ones.
  856. If the residues does not match,
  857. \&\fBmlucas\fR should emit a verbose error message.
  858. .TP 7
  859. \fBmlucas \-s m\fR
  860. .IX Item "mlucas -s m"
  861. Perform timing self-test for `medium' exponents
  862. to tune code parameters for your platform.
  863. Ordinary users are recommended to do this self-test only.
  864. For best results,
  865. run any self-tests under zero\- or constant-load conditions.
  866. The self-tests append
  867. (or create if \fI\f(CI$MLUCAS_PATH\fI/mlucas.cfg\fR does not exist)
  868. new timing data to the \fI\f(CI$MLUCAS_PATH\fI/mlucas.cfg\fR
  869. (see \fB\s-1FILES\s0\fR section for details).
  870. Before doing any self-tests,
  871. you should first check if there is an existing
  872. \&\fI\f(CI$MLUCAS_PATH\fI/mlucas.cfg\fR file
  873. and either delete it or do a backup-via-rename to
  874. to prevent mixing old and new timing data.
  875. \&\fI\f(CI$MLUCAS_PATH\fI/mlucas.cfg\fR normally locates at
  876. \&\fI\f(CI$HOME\fI/.mlucas.d/\fR directory
  877. although this can be overridden at run-time
  878. by settingthe \fB\s-1MLUCAS_PATH\s0\fR environment variable
  879. (see \fB\s-1ENVIRONMENT\s0\fR section for details).
  880. .TP 7
  881. \fBmlucas &\fR
  882. .IX Item "mlucas &"
  883. .RE
  884. .RS 7
  885. Perform Lucas-Lehmer test on Mersenne numbers
  886. by running \fBmlucas\fR as a background job
  887. (see \fB\s-1JOB CONTROL\s0\fR section in
  888. .BR bash (1)
  889. and \fBBuiltins\fR subsection in
  890. .BR dash (1)
  891. for details).
  892. To perform Lucas-Lehmer test on a given Mersenne number,
  893. you must first perform a self-test
  894. for `medium' exponents mentioned above,
  895. or if you only desire to test a single selected Mersenne number,
  896. a self-test for the default \s-1FFT\s0 length for that number:
  897. .RS 4
  898. .Sp
  899. mlucas \-m \fIexponent\fR \-iters 100
  900. .RE
  901. .Sp
  902. In the case of multi-exponent \*(L"production testing\*(R",
  903. you should reserve exponent from the PrimeNet server
  904. and add them into \fI\f(CI$MLUCAS_PATH\fI/worktodo.ini\fR
  905. (see the subsection \fBGreat Internet Mersenne Prime Search\fR
  906. within the section \fB\s-1NOTES\s0\fR and \fB\s-1FILES\s0\fR section for details).
  907. .SS "Advanced Usage Tips"
  908. .IX Subsection "Advanced Usage Tips"
  909. To start \fBmlucas\fR in terminal 1,
  910. add the following lines to your login shell initialization file,
  911. such as \fI\f(CI$HOME\fI/.profile\fR
  912. (see \fB\s-1INVOCATION\s0\fR section in
  913. .BR bash (1)
  914. and \fBInvocation\fR subsection
  915. .BR dash (1)
  916. for details).
  917. .PP
  918. .Vb 8
  919. \& # Test if we are in tty1
  920. \& if test \`tty\` = \*(Aq/dev/tty1\*(Aq
  921. \& then
  922. \& # turn on job control
  923. \& set \-m
  924. \& # start mlucas
  925. \& nice mlucas > /dev/null 2>&1 &
  926. \& fi
  927. .Ve
  928. .SH "SEE ALSO"
  929. .IX Header "SEE ALSO"
  930. .BR bash (1),
  931. .BR dash (1),
  932. .BR reportbug (1)
  933. .PP
  934. <http://hogranch.com/mayer/README.html>,
  935. \&\fI/usr/share/doc/mlucas/html/README.html\fR
  936. .PP
  937. \&\fBmlucas\fR is documented fully by \fIMlucas \s-1README\s0\fR,
  938. available both online and offline as shown above.
  939. .PP
  940. \&\fIGreat Internet Mersenne Prime Search\fR <http://www.mersenne.org>
  941. .PP
  942. \&\fIMersenne Forum\fR <http://www.mersenneforum.org>
  943. .PP
  944. \&\fIChris Caldwell's web page on Mersenne numbers\fR <http://www.utm.edu/research/primes/mersenne.shtml>
  945. .PP
  946. \&\fIRichard Crandall and Barry Fagin, Discrete Weighted Transforms and Large-Integer Arithmetic.\fR <http://www.faginfamily.net/barry/Papers/Discrete%20Weighted%20Transforms.pdf>
  947. .PP
  948. \&\fIRichard E. Crandall, Ernst W. Mayer, and Jason S. Papadopoulos, The Twenty-Fourth Fermat Number is Composite.\fR <http://hogranch.com/mayer/F24.pdf>