mersenneforum.org > EdH How I install YAFU onto my Ubuntu Machines
 Register FAQ Search Today's Posts Mark Forums Read

 2020-03-26, 16:43 #78 bsquared     "Ben" Feb 2007 65138 Posts Sorry - sometimes svn is frustrating. I removed the SVN-inserted conflict marker junk... Try it now.
 2020-03-26, 17:03 #79 RedGolpe     Aug 2006 Monza, Italy 73 Posts factor(2) now works but factor(2^308+97) still segfaults. Code: redgolpe@c2018:~/yafu$./yafu 03/26/20 18:00:43 v1.35-beta @ c2018, System/Build Info: Using GMP-ECM 7.0.5-dev, Powered by GMP 6.2.0 detected Intel(R) Core(TM) i7-7800X CPU @ 3.50GHz detected L1 = 32768 bytes, L2 = 8650752 bytes, CL = 64 bytes measured cpu frequency ~= 3503.994240 using 1 random witnesses for Rabin-Miller PRP checks =============================================================== ======= Welcome to YAFU (Yet Another Factoring Utility) ======= ======= bbuhrow@gmail.com ======= ======= Type help at any time, or quit to quit ======= =============================================================== cached 78498 primes. pmax = 999983 >> factor(2) fac: factoring 2 fac: using pretesting plan: normal fac: using specified qs/gnfs crossover of 93 digits fac: using specified qs/snfs crossover of 75 digits div: primes less than 10000 Total factoring time = 0.0047 seconds ***factors found*** P1 = 2 1 >> factor(2^308+97) fac: factoring 521481209941628438084722096232800809229175908778479680162851955034721612739414196782949728353 fac: using pretesting plan: normal fac: using specified qs/gnfs crossover of 93 digits fac: using specified qs/snfs crossover of 75 digits div: primes less than 10000 fmt: 1000000 iterations rho: x^2 + 3, starting 200 iterations on C93 rho: x^2 + 3, starting 200 iterations on C87 rho: x^2 + 2, starting 200 iterations on C87 rho: x^2 + 1, starting 200 iterations on C87 nfs: searching for brent special forms... nfs: input divides 2^308 + 97 Segmentation fault (core dumped) redgolpe@c2018:~/yafu$
 2020-03-26, 17:39 #80 RedGolpe     Aug 2006 Monza, Italy 4916 Posts SIQS seems to work for any number. Segfaults seem confined to composites for which NFS is invoked. Code: >> siqs(2^308+97) starting SIQS on c93: [...] ***factors found*** P6 = 785033 P41 = 21544259627996485962520784751544229716373 ***co-factor*** C47 = 30833240972859993737296999866502074697103820917 ans = 24205111660647199463571475696199723205691503845935261 >>
2020-03-26, 17:56   #81
bsquared

"Ben"
Feb 2007

41·83 Posts

Quote:
 Originally Posted by RedGolpe SIQS seems to work for any number. Segfaults seem confined to composites for which NFS is invoked. Code: >> siqs(2^308+97) starting SIQS on c93: [...] ***factors found*** P6 = 785033 P41 = 21544259627996485962520784751544229716373 ***co-factor*** C47 = 30833240972859993737296999866502074697103820917 ans = 24205111660647199463571475696199723205691503845935261 >>
I've traced this back into the msieve library. Seems msieve has the same problem yafu did w.r.t gmp-6.2.0. I don't have developer privileges for the msieve repository but making this change locally and then recompiling (first msieve, then yafu) should work (haven't tested yet - busy with other stuff and won't be able to for a little bit).

in include\gmp_xface.h replace this code (starting at line 50 in my version)
Code:
static INLINE void uint64_2gmp(uint64 src, mpz_t dest) {

#if GMP_LIMB_BITS == 64
dest->_mp_d[0] = src;
dest->_mp_size = (src ? 1 : 0);
#else
/* mpz_import is terribly slow */
mpz_set_ui(dest, (uint32)(src >> 32));
mpz_mul_2exp(dest, dest, 32);
#endif
}

with this code:

Code:
static INLINE void uint64_2gmp(uint64 src, mpz_t dest) {
#if GMP_LIMB_BITS == 64
mpz_set_ui(dest, src);
#else
/* mpz_import is terribly slow */
mpz_set_ui(dest, (uint32)(src >> 32));
mpz_mul_2exp(dest, dest, 32);
#endif
}

Last fiddled with by bsquared on 2020-03-26 at 17:56 Reason: the whole function...

 2020-03-26, 18:35 #82 RedGolpe     Aug 2006 Monza, Italy 4916 Posts It looks like it's working, no errors on any input so far with the msieve patch. I assume you have means to directly contact the author about the needed fix. Thank you for the time you spend on this project, and let me know if you need a beta tester
2020-03-26, 19:00   #83
bsquared

"Ben"
Feb 2007

41×83 Posts

Quote:
 Originally Posted by RedGolpe It looks like it's working, no errors on any input so far with the msieve patch. I assume you have means to directly contact the author about the needed fix. Thank you for the time you spend on this project, and let me know if you need a beta tester
Yep, I can let him (jasonp) know.

Thank you very much for your reports and testing! This is how these projects get better.

 2020-03-26, 20:38 #84 EdH     "Ed Hall" Dec 2009 Adirondack Mtns 29·127 Posts The wip branch appears to be working 100% for me here now with GMP 6.2.0. Thanks much!
 2020-03-27, 15:28 #85 RedGolpe     Aug 2006 Monza, Italy 7310 Posts Results on Ubuntu 18.04.4 with yafu v1.35-beta, GMP-ECM 7.0.5-dev, GMP 6.2.0, Msieve 1.54 (patched) of factor(2^308+97): Intel(R) Core(TM) i7-7800X CPU @ 3.50GHz (skylake), 12 logical processors, 32 GB RAM: 12.3395 seconds Intel(R) Core(TM) i7-5820K CPU @ 3.30GHz (haswell), 12 logical processors, 8 GB RAM: 14.9494 seconds Intel(R) Core(TM) i7-3820 CPU @ 3.60GHz (sandy bridge), 8 logical processors, 8 GB RAM: 21.1907 seconds
 2020-07-01, 19:48 #86 Mr. Odd   Mar 2010 3·19 Posts Ed - your guides are a God-send, thanks so much for writing them up and, more importantly, keeping them current! I installed everything without a hitch - except Yafu. Not an issue, just looking for clarification: I couldn't understand the "Using a text editor, open the Makefile file and make the following edit:" section (was I supposed to just change the highlighted text?) so I just replaced the entire 'ifeq ($(NFS),1)' clause in the Makefile with what you posted, that seemed to work fine. The one edit I had to make that you didn't list: I got an error executing the Makefile because it couldn't find the command 'gcc-7.2.1' so I changed it to 'gcc' and that did the trick. After many years, it's great to be current with my factoring tools. On my newly built 32 thread AMD 3950X Ubuntu 19.10 system, I factored 2^308+97 in 5.0s. On to bigger fish! 2020-07-01, 20:47 #87 EdH "Ed Hall" Dec 2009 Adirondack Mtns 29·127 Posts Quote:  Originally Posted by Mr. Odd Ed - your guides are a God-send, thanks so much for writing them up and, more importantly, keeping them current! I installed everything without a hitch - except Yafu. Not an issue, just looking for clarification: I couldn't understand the "Using a text editor, open the Makefile file and make the following edit:" section (was I supposed to just change the highlighted text?) so I just replaced the entire 'ifeq ($(NFS),1)' clause in the Makefile with what you posted, that seemed to work fine. The one edit I had to make that you didn't list: I got an error executing the Makefile because it couldn't find the command 'gcc-7.2.1' so I changed it to 'gcc' and that did the trick. After many years, it's great to be current with my factoring tools. On my newly built 32 thread AMD 3950X Ubuntu 19.10 system, I factored 2^308+97 in 5.0s. On to bigger fish!
Thanks for the report and reminding me of the GCC edit. I actually just comment out that line. It's only necessary to edit it for the wip version

Yes, the bold line(s) is(are) the only change(s) necessary.

I wonder about your gcc-7.2.1, though. That seems old. It's been 7.3.0 for many revisions.

 2020-07-01, 21:05 #88 Mr. Odd   Mar 2010 3×19 Posts I'm using the wip version. Interesting about the bold edit - the text in my make file looked nothing like what you quoted. Sorry, my mistake, it was gcc-7.3.0 and my system now has gcc-9.2.1, so I mixed them up. Eh, all's well that end's well.

 Similar Threads Thread Thread Starter Forum Replies Last Post EdH EdH 3 2019-06-24 03:42 EdH EdH 12 2019-04-16 09:28 EdH EdH 0 2018-02-23 14:43 EdH EdH 0 2018-02-22 03:31 EdH EdH 0 2018-02-21 23:48

All times are UTC. The time now is 23:59.

Tue Apr 13 23:59:12 UTC 2021 up 5 days, 18:40, 1 user, load averages: 1.92, 1.88, 1.72