mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Blogorrhea > EdH

Reply
 
Thread Tools
Old 2020-03-26, 16:43   #78
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

2×3×72×11 Posts
Default

Sorry - sometimes svn is frustrating. I removed the SVN-inserted conflict marker junk... Try it now.
bsquared is offline   Reply With Quote
Old 2020-03-26, 17:03   #79
RedGolpe
 
RedGolpe's Avatar
 
Aug 2006
Monza, Italy

5·7 Posts
Default

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$
RedGolpe is offline   Reply With Quote
Old 2020-03-26, 17:39   #80
RedGolpe
 
RedGolpe's Avatar
 
Aug 2006
Monza, Italy

438 Posts
Default

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

>>
RedGolpe is offline   Reply With Quote
Old 2020-03-26, 17:56   #81
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

2·3·72·11 Posts
Default

Quote:
Originally Posted by RedGolpe View Post
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);
	mpz_add_ui(dest, dest, (uint32)src);
#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);
	mpz_add_ui(dest, dest, (uint32)src);
#endif
}

Last fiddled with by bsquared on 2020-03-26 at 17:56 Reason: the whole function...
bsquared is offline   Reply With Quote
Old 2020-03-26, 18:35   #82
RedGolpe
 
RedGolpe's Avatar
 
Aug 2006
Monza, Italy

5×7 Posts
Default

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
RedGolpe is offline   Reply With Quote
Old 2020-03-26, 19:00   #83
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

2·3·72·11 Posts
Default

Quote:
Originally Posted by RedGolpe View Post
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.

bsquared is offline   Reply With Quote
Old 2020-03-26, 20:38   #84
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

2×3×499 Posts
Default

The wip branch appears to be working 100% for me here now with GMP 6.2.0.

Thanks much!
EdH is offline   Reply With Quote
Old 2020-03-27, 15:28   #85
RedGolpe
 
RedGolpe's Avatar
 
Aug 2006
Monza, Italy

5·7 Posts
Default

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
RedGolpe is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
How I Install CADO-NFS onto my Ubuntu Machines EdH EdH 3 2019-06-24 03:42
How I Install GMP-ECM onto my Ubuntu Machines EdH EdH 12 2019-04-16 09:28
How I Install msieve onto my Ubuntu Machines EdH EdH 0 2018-02-23 14:43
How I Install ggnfs onto my Ubuntu Machines EdH EdH 0 2018-02-22 03:31
How I Install GMP onto my Ubuntu Machines EdH EdH 0 2018-02-21 23:48

All times are UTC. The time now is 05:27.

Mon Mar 30 05:27:34 UTC 2020 up 5 days, 3 hrs, 2 users, load averages: 1.37, 1.38, 1.37

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.