20180522, 21:30  #1 
"Ben"
Feb 2007
37·89 Posts 
new yafu stuff
I just checked in a few updates; some bugfixes and some improvements.
yafu's sieve of Eratosthenes received several improvements, especially at large offsets, and including AVX512 optimizations (build with SKYLAKEX=1) Also, after 10+ years I finally got around to doing something about LaurV's request to implement "loops and ifs" Why now? I don't know, but it was fun to work on after all. New functions "if", "for", "forprime", and "forfactors" The new functions have laughable error/syntax checking so I'm sure that if anyone tries it out it will start to fail in many interesting ways. Very brief syntax of each: for(init; test; iter; body) where each of the 4 arguments can have assignments and the body can have nested loops or ifs forprime(var=start;stop;body) same as 'for' forfactors(init;body) loops over any factors found in the previous factorization, defining the special variables _f and _fpow for the factor and exponent associated with the current iteration of the loop. body can have nested loops/ifs if(condition;if_body[;else_body]) else_body is optional condition can make use of e.g., the comparison operators <, >, ==, lte, gte if_body and/or else_body can have nested loops/ifs As mentioned, loops and ifs can be nested, but everything must be on one line! I've attached a few examples that you can run as a script, or one line at a time in the interpreter: Code:
./yafu script testscript.txt 
20180523, 04:04  #3 
"Ed Hall"
Dec 2009
Adirondack Mtns
5×11×61 Posts 
Good stuff! Now I have to update a lot of machines. Since you're announcing it, does that mean it's in trunk, or wip, also? I know, I've been lazy and didn't look yet, but I will.
Thanks for all... 
20180523, 07:16  #4 
"Dana Jacobsen"
Feb 2011
Bangkok, TH
2·3·151 Posts 
+1
"Why now? I don't know, but it was fun to work on after all." That describes pretty much all my open source work in the last 30 years. 
20180523, 11:41  #5  
"Ben"
Feb 2007
6335_{8} Posts 
Quote:
I'd probably wait until some dust settles before you update *all* of your machines... 

20180523, 15:50  #6 
"Ed Hall"
Dec 2009
Adirondack Mtns
5·11·61 Posts 

20180604, 14:46  #7 
"Ben"
Feb 2007
CDD_{16} Posts 
r372 has new AVX512 code for SIQS, plus a couple tweaks for more efficiently running on large numbers of threads. RSA100 in 6 minutes on a 256thread KNL 7210. Even without the AVX512 code the KNL is pretty fast (about 9 minutes).
I've also tested on a skylake 7800x but the performance gains aren't as nice there. Maybe 10% and only with larger (80 digits or more) inputs. This is linux only at this point... I have not yet been able to find a compiler capable of avx512 for windows and so I haven't been able to test there. The Intel compiler can, I know, but I don't have a windows version of it. Code:
starting SIQS on c100: 1522605027922533360535618378132637429718068114961380688657908494580122963258952897654000350692006139 ==== sieve params ==== n = 100 digits, 330 bits factor base: 115520 primes (max prime = 3204611) single large prime cutoff: 464668595 (145 * pmax) double large prime range from 44 to 52 bits double large prime range from 10269531661321 to 3988944358351073 allocating 9 large prime slices of factor base buckets hold 2048 elements large prime hashtables have 1179648 bytes using KNLAVX2 enabled 32k sieve core sieve interval: 8 blocks of size 32768 polynomial A has ~ 13 factors using multiplier of 1 using SPV correction of 19 bits, starting at offset 30 trial factoring cutoff at 100 bits ==== sieving in progress (256 threads): 115584 relations needed ==== ==== Press ctrlc to abort and save state ==== 119777 rels found: 29067 full + 90710 from 1703942 partial, (4709.08 rels/sec) sieving required 6419308 total polynomials (4705 'A' polynomials) trial division touched 258498542 sieve locations out of 3365566152704 squfof: 0 failures, 1386863 attempts, 121153992 outside range, 6726584 prp, 1281923 useful total reports = 258498542, total surviving reports = 129718525 total blocks sieved = 102712976,avg surviving reports per block = 1.26 large prime scan failures = 0 QS elapsed time = 368.4496 seconds. 
20180607, 21:08  #8 
"Victor de Hollander"
Aug 2011
the Netherlands
2^{3}·3·7^{2} Posts 
Compiling [r373 wip] on Ubuntu 16.04 with a Sandybridge based processor wanted zlib.h in the /include/ folder (it wasn't in the snapshot I downloaded, but that could be my mistake). No problems/errors otherwise (some warnings, but I tend to ignore those ).
Resulting binary attached (haven't tested it on a other Ubunutu or Linux machine) but I could use EdHs binary from http://mersenneforum.org/showpost.ph...2&postcount=13 so I'm hoping mine also works for other people (and if it doesn't not much lost). YAFU r373 wip (SSE4.1) Code:
make all x86_64 NFS=1 USE_SSE41=1 GMP 6.1.2 GMPECM 7.0.4 (the release version, I think it is SVN2991) Msieve SVN1019 The computer doesn't have the fancy features such as AVX2 or AVX512 (only 'normal' AVX), but it is still pretty fast (RSA100 in less than 11 min) Code:
06/07/18 22:30:52 v1.35beta @ E52650, nfs: commencing nfs on c100: 1522605027922533360535618378132637429718068114961380688657908494580122963258952897654000350692006139 06/07/18 22:30:52 v1.35beta @ E52650, nfs: commencing poly selection with 32 threads 06/07/18 22:30:52 v1.35beta @ E52650, nfs: setting deadline of 38 seconds 06/07/18 22:31:37 v1.35beta @ E52650, nfs: completed 1174 ranges of size 250 in 44.6341 seconds 06/07/18 22:31:37 v1.35beta @ E52650, nfs: best poly = # norm 1.176668e13 alpha 4.539699 e 1.188e08 rroots 2 06/07/18 22:31:37 v1.35beta @ E52650, nfs: commencing lattice sieving with 32 threads 06/07/18 22:32:01 v1.35beta @ E52650, nfs: commencing lattice sieving with 32 threads 06/07/18 22:32:26 v1.35beta @ E52650, nfs: commencing lattice sieving with 32 threads 06/07/18 22:32:50 v1.35beta @ E52650, nfs: commencing lattice sieving with 32 threads 06/07/18 22:33:18 v1.35beta @ E52650, nfs: commencing lattice sieving with 32 threads 06/07/18 22:33:41 v1.35beta @ E52650, nfs: commencing lattice sieving with 32 threads 06/07/18 22:34:07 v1.35beta @ E52650, nfs: commencing lattice sieving with 32 threads 06/07/18 22:34:33 v1.35beta @ E52650, nfs: commencing lattice sieving with 32 threads 06/07/18 22:34:58 v1.35beta @ E52650, nfs: commencing lattice sieving with 32 threads 06/07/18 22:35:24 v1.35beta @ E52650, nfs: commencing lattice sieving with 32 threads 06/07/18 22:35:51 v1.35beta @ E52650, nfs: commencing lattice sieving with 32 threads 06/07/18 22:36:16 v1.35beta @ E52650, nfs: commencing lattice sieving with 32 threads 06/07/18 22:36:43 v1.35beta @ E52650, nfs: commencing lattice sieving with 32 threads 06/07/18 22:37:10 v1.35beta @ E52650, nfs: commencing lattice sieving with 32 threads 06/07/18 22:37:39 v1.35beta @ E52650, nfs: commencing msieve filtering 06/07/18 22:39:13 v1.35beta @ E52650, nfs: commencing msieve linear algebra 06/07/18 22:40:45 v1.35beta @ E52650, nfs: commencing msieve sqrt 06/07/18 22:41:17 v1.35beta @ E52650, prp50 = 37975227936943673922808872755445627854565536638199 06/07/18 22:41:17 v1.35beta @ E52650, prp50 = 40094690950920881030683735292761468389214899724061 06/07/18 22:41:17 v1.35beta @ E52650, NFS elapsed time = 625.1015 seconds. 
20180619, 03:13  #9 
I moo ablest echo power!
May 2013
3^{2}·193 Posts 
Trying to compile the latest committed version of YAFU with the following command:
Code:
make clean && make all x86_64 USE_SSE41=1 Code:
arith/monty.o: In function `addmod': /home/wombat/yafucode/branches/wip/include/monty.h:49: multiple definition of `addmod' factor/rho.o:/home/wombat/yafucode/branches/wip/include/monty.h:49: first defined here arith/monty.o: In function `u64div': /home/wombat/yafucode/branches/wip/include/monty.h:62: multiple definition of `u64div' factor/rho.o:/home/wombat/yafucode/branches/wip/include/monty.h:62: first defined here arith/monty.o: In function `mulredc': /home/wombat/yafucode/branches/wip/include/monty.h:71: multiple definition of `mulredc' factor/rho.o:/home/wombat/yafucode/branches/wip/include/monty.h:71: first defined here arith/monty.o: In function `mulredc63': /home/wombat/yafucode/branches/wip/include/monty.h:114: multiple definition of `mulredc63' factor/rho.o:/home/wombat/yafucode/branches/wip/include/monty.h:114: first defined here collect2: error: ld returned 1 exit status make: *** [all] Error 1 
20180620, 12:33  #10  
May 2008
Worcester, United Kingdom
523 Posts 
Quote:
I have access to the Intel compiler running in Visual Studio 2017 so I might be able to compile it if the Visual Studio build files are up to date. However, I don't have an AVX512 capable machine so I would not be able to test the result. 

20180621, 18:50  #11  
"Ben"
Feb 2007
37×89 Posts 
Quote:


Thread Tools  
Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Running YAFU via Aliqueit doesn't find yafu.ini  EdH  YAFU  8  20180314 17:22 
Some old stuff  Batalov  Miscellaneous Math  1  20170127 04:56 
Raman's stuff  Raman  Chess  8  20130416 20:52 
useful stuff  paulunderwood  Linux  3  20051205 22:18 
Extra Stuff...  Xyzzy  Lounge  11  20030915 23:22 