20180609, 13:21  #1 
"TF79LL86GIMPS96gpu17"
Mar 2017
US midwest
1001011101011_{2} Posts 
Mlucasspecific reference thread
This thread is intended to hold only reference material specifically for Mlucas
(Suggestions are welcome. Discussion posts in this thread are not encouraged. Please use the reference material discussion thread http://www.mersenneforum.org/showthread.php?t=23383. Offtopic posts may be moved or removed, to keep the reference threads clean, tidy, and useful.) Download and setup information for mlucas is located at http://www.mersenneforum.org/mayer/README.html Table of contents
Top of reference tree: https://www.mersenneforum.org/showpo...22&postcount=1 Last fiddled with by kriesel on 20201127 at 16:38 Reason: split mlucas builds post to separate Linux post and Windows post 
20180609, 13:49  #2  
"TF79LL86GIMPS96gpu17"
Mar 2017
US midwest
29·167 Posts 
Save file format as described by ewmayer
As posted at http://www.mersenneforum.org/showpos...4&postcount=36 by ewmayer, except as updated in bold, first describing the V17.x format:, then planned V18 format additions:
Quote:
I note that the exponent p itself is in the file name, not in the contents. Also note mlucas V19 PRP implementation is type 1 residues only. Save file names are p<exponent>, q<exponent>, p<exponent>.10M, etc. For example, for M332220523, p33220523, q33220523, p33220523.10M, and eventually p33220523.20M and so on. File sizes derived from the preceding are:
Top of reference tree: https://www.mersenneforum.org/showpo...22&postcount=1 Last fiddled with by kriesel on 20200505 at 00:46 Reason: update for V19 PRP type 

20190812, 17:07  #3 
"TF79LL86GIMPS96gpu17"
Mar 2017
US midwest
29·167 Posts 
Mlucas v17.1 h help output
Code:
Mlucas 17.1 http://hogranch.com/mayer/README.html INFO: testing qfloat routines... CPU Family = x86_64, OS = Linux, 64bit Version, compiled with Gnu C [or other compatible], Version 8.2.0. INFO: CPU supports SSE2 instruction set, but using scalar floatingpoint build. INFO: Using inlinemacro form of MUL_LOHI64. INFO: MLUCAS_PATH is set to "" INFO: using 64bitsignificand form of floatingdouble rounding constant for scalarmode DNINT emulation. Setting DAT_BITS = 10, PAD_BITS = 2 INFO: testing IMUL routines... INFO: testing FFT radix tables... For the full list of command line options, run the program with the h flag. Mlucas command line options: Symbol and abbreviation key: <CR> : carriage return  : separator for oneofthefollowing multiplechoice menus [] : encloses optional arguments {} : denotes usersupplied numerical arguments of the type noted. ({int} means nonnegative integer, {+int} = positive int, {float} = float.) argument : Vertical stacking indicates argument short 'nickname' options, arg : e.g. in this example 'arg' can be used in place of 'argument'. Supported arguments: <CR> Default mode: looks for a worktodo.ini file in the local directory; if none found, prompts for manual keyboard entry Help submenus by topic. No additional arguments may follow the displayed ones: s Postbuild selftesting for various FFTlength rnages. fftlen FFTlength setting. radset FFT radixset specification. m[ersenne] Mersennenumber primality testing. f[ermat] Fermatnumber primality testing. iters Iterationnumber setting. nthreadcpu Setting threadcount and CPU core affinity. *** NOTE: *** The following selftest options will cause an mlucas.cfg file containing the optimal FFT radix set for the runlength(s) tested to be created (if one did not exist previously) or appended (if one did) with new timing data. Such a filewrite is triggered by each complete set of FFT radices available at a given FFT length being tested, i.e. by a selftest without a userspecified radset argument. (A userspecific Mersenne exponent may be supplied via the m flag; if none is specified, the program will use the largest permissible exponent for the given FFT length, based on its internal lengthsetting algorithm). The user must specify the number of iterations for the selftest via the iters flag; while it is not required, it is strongly recommended to stick to one of the standard timingtest values of iters = [100,1000,10000], with the larger values being preferred for multithreaded timing tests, in order to assure a decently large slice of CPU time. Similarly, it is recommended to not use the m flag for such tests, unless roundoff error levels on a given compute platform are such that the default exponent at one or more FFT lengths of interest prevents a reasonable sampling of available radix sets at same. If the user lets the program set the exponent and uses one of the aforementioned standard selftest iteration counts, the resulting besttiming FFT radix set will only be written to the resulting mlucas.cfg file if the timingtest result matches the internally stored precomputed one for the given default exponent at the iteration count in question, with eligible radix sets consisting of those for which the roundoff error remains below an acceptable threshold. If the user instead specifies the exponent (only allowed for a singleFFTlength timing test)**************** and/or a nondefault iteration number, the resulting besttiming FFT radix set will only be written to the resulting mlucas.cfg file if the timingtest results match each other? ********* check logic here ******* This is important for tuning code parameters to your particular platform. FOR BEST RESULTS, RUN ANY SELFTESTS UNDER ZERO OR CONSTANTLOAD CONDITIONS s {...} Selftest, user must also supply exponent [via m or f] and/or FFT length to use. s tiny Runs 100iteration selftests on set of 32 Mersenne exponents, ranging from 173431 to 2455003 s t This will take around 1 minute on a fast CPU.. s small Runs 100iteration selftests on set of 24 Mersenne exponents, ranging from 173431 to 1245877 s s This will take around 10 minutes on a fast CPU.. **** THIS IS THE ONLY SELFTEST ORDINARY USERS ARE RECOMMENDED TO DO: ****** * * * s medium Runs set of 24 Mersenne exponents, ranging from 1327099 to 9530803 * s m This will take around an hour on a fast CPU. * * * **************************************************************************** s large Runs set of 24 Mersenne exponents, ranging from 10151971 to 72851621 s l This will take around an hour on a fast CPU. s huge Runs set of 16 Mersenne exponents, ranging from 77597293 to 282508657 s h This will take a couple of hours on a fast CPU. s all Runs 100iteration selftests of all test Mersenne exponents and all FFT radix sets. s a This will take several hours on a fast CPU. fftlen {+int} If {+int} is one of the available FFT lengths (in Kilodoubles), runs all all available FFT radices available at that length, unless the radset flag is invoked (see below for details). If fftlen is invoked without the iters flag, it is assumed the user wishes to do a production run with a nondefault FFT length, In this case the program requires a valid worktodo.inifile entry with exponent not more than 5% larger than the default maximum for that FFT length. If fftlen is invoked with a usersupplied value of iters but without a usersupplied exponent, the program will do the specified number of iterations using the default selftest Mersenne or Fermat exponent for that FFT length. If fftlen is invoked with a usersupplied value of iters and either the m or f flag and a usersupplied exponent, the program will do the specified number of iterations of either the LucasLehmer test with starting value 4 (m) or the Pe'pin test with starting value 3 (f) on the userspecified modulus. In either of the latter 2 cases, the program will produce a cfgfile entry based on the timing results, assuming at least one radix set ran the specified #iters to completion without suffering a fatal error of some kind. Use this to find the optimal radix set for a single FFT length on your hardware. NOTE: IF YOU USE OTHER THAN THE DEFAULT MODULUS OR #ITERS FOR SUCH A SINGLEFFT LENGTH TIMING TEST, IT IS UP TO YOU TO MANUALLY VERIFY THAT THE RESIDUES OUTPUT MATCH FOR ALL FFT RADIX COMBINATIONS AND THE ROUNDOFF ERRORS ARE REASONABLE! radset {int} Specific index of a set of complex FFT radices to use, based on the big select table in the function get_fft_radices(). Requires a supported value of fftlen to also be specified, as well as a value of iters for the timing test. m [{+int}] Performs a LucasLehmer primality test of the Mersenne number M(int) = 2^int  1, where int must be an odd prime. If iters is also invoked, this indicates a timing test. and requires suitable added arguments (fftlen and, optionally, radset) to be supplied. If the fftlen option (and optionally radset) is also invoked but iters is not, the program first checks the first line of the worktodo.ini file to see if the assignment specified there is a LucasLehmer test with the same exponent as specified via the m argument. If so, the fftlen argument is treated as a user override of the default FFT length for the exponent. If radset is also invoked, this is similarly treated as a user specified radix set for the userset FFT length; otherwise the program will use the cfg file to select the radix set to be used for the userforced FFT length. If the worktodo.ini file entry does not match the m value, a set of timing selftests is run on the userspecified Mersenne number using all sets of FFT radices available at the specified FFT length. If the fftlen option is not invoked, the selftests use all sets of FFT radices available at that exponent's default FFT length. Use this to find the optimal radix set for a single given Mersenne number exponent on your hardware, similarly to the fftlen option. Performs as many iterations as specified via the iters flag [required]. f {int} Performs a base3 Pe'pin test on the Fermat number F(num) = 2^(2^num) + 1. If desired this can be invoked together with the fftlen option. as for the Mersennenumber selftests (see notes about the m flag; note that not all FFT lengths supported for m are available for f). Optimal radix sets and timings are written to a fermat.cfg file. Performs as many iterations as specified via the iters flag [required]. iters {int} Do {int} selftest iterations of the type determined by the modulusrelated options (s/m = LucasLehmer test iterations with initial seed 4, f = Pe'pintest squarings with initial seed 3. Top of reference tree: https://www.mersenneforum.org/showpo...22&postcount=1 Last fiddled with by kriesel on 20191118 at 14:34 
20200520, 19:07  #4 
"TF79LL86GIMPS96gpu17"
Mar 2017
US midwest
29×167 Posts 
Mlucas install script for Linux
Haven't tried it myself, but there's a post about one at https://mersenneforum.org/showpost.p...9&postcount=34
Top of reference tree: https://www.mersenneforum.org/showpo...22&postcount=1 Last fiddled with by kriesel on 20200716 at 19:22 
20201119, 22:32  #5 
"TF79LL86GIMPS96gpu17"
Mar 2017
US midwest
1001011101011_{2} Posts 
Mlucas builds for Linux (or for running on WSL on Windows)
How I built Mlucas in WSL / Ubuntu 18.04 for multiple processor types
(rename the executable between builds to identify the flavor) Note these are mostly untested. basic x8664, & presumably the best bet for Knight's Corner Xeon Phi: Code:
gcc c O3 DUSE_THREADS ../src/*.c >& build.log grep error build.log gcc o Mlucas *.o lm lpthread lrt Code:
gcc c O3 DUSE_SSE2 DUSE_THREADS ../src/*.c >& build.log grep error build.log gcc o Mlucas *.o lm lpthread lrt Code:
gcc c O3 DUSE_AVX2 mavx2 DUSE_THREADS ../src/*.c >& build.log grep error build.log gcc o Mlucas *.o lm lpthread lrt Code:
gcc c O3 DUSE_AVX512 march=knl DUSE_THREADS ../src/*.c >& build.log grep error build.log gcc o Mlucas *.o lm lpthread lrt Code:
gcc c O3 DUSE_AVX512 march=skylakeavx512 DUSE_THREADS ../src/*.c >& build.log grep error build.log gcc o Mlucas *.o lm lpthread lrt https://www.mersenneforum.org/mayer/README.html Attachments are Mlucas v19 builds intended for Linux and were built on Ubuntu v18.04 running on WSL / Win10 on an i78750H. Top of reference tree: https://www.mersenneforum.org/showpo...22&postcount=1 Last fiddled with by kriesel on 20210114 at 00:35 Reason: split post to separate Linux and Windows builds, minor edits 
20201127, 15:01  #6 
"TF79LL86GIMPS96gpu17"
Mar 2017
US midwest
29×167 Posts 
Mlucas builds for Windows
Building for Windows in msys2 is similar to building for Linux or WSL, except:
remove DUSE_THREADS and lpthread for Windows singlethreaded end use. How I built or attempted in msys2 for Windows singlethreaded environments: SSE2 such as Xeon x5650, e5645, E526xx Code:
gcc c O3 DUSE_SSE2 ../src/*.c >& build.log grep error build.log gcc o Mlucassse2 *.o lm lrt Code:
gcc c O3 ../src/*.c >& build.log grep error build.log gcc o Mlucasx86 *.o lm lrt Code:
gcc c O3 DUSE_AVX2 mavx2 ../src/*.c >& build.log grep error build.log gcc o Mlucasfma3 *.o lm lrt Code:
gcc c O3 DUSE_AVX512 march=skylakeavx512 ../src/*.c >& build.log grep error build.log gcc o Mlucasavx512 *.o lm lrt Attachments are singlethreaded Mlucas v19 builds intended for Windows 7 or higher, and were built in msys2 running on Windows 7 Pro 64bit on a dualXeonE5645 HP Z600. Top of reference tree: https://www.mersenneforum.org/showpo...22&postcount=1 Last fiddled with by kriesel on 20201127 at 15:05 
Thread Tools  
Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
gpuOwLspecific reference material  kriesel  kriesel  27  20210113 23:25 
Mfaktospecific reference material  kriesel  kriesel  5  20200702 01:30 
CUDALucasspecific reference material  kriesel  kriesel  9  20200528 23:32 
Mfaktcspecific reference material  kriesel  kriesel  8  20200417 03:50 
CUDAPm1specific reference material  kriesel  kriesel  12  20190812 15:51 