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·17·97 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

2×3×11 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

2·3·11 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·17·97 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

4216 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

1100111000102 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

1101001111002 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

4216 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
Old 2020-07-01, 19:48   #86
Mr. Odd
 
Mar 2010

678 Posts
Default

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!
Mr. Odd is offline   Reply With Quote
Old 2020-07-01, 20:47   #87
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

22×7×112 Posts
Default

Quote:
Originally Posted by Mr. Odd View Post
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.
EdH is offline   Reply With Quote
Old 2020-07-01, 21:05   #88
Mr. Odd
 
Mar 2010

1101112 Posts
Default

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.
Mr. Odd 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 10:55.

Fri Oct 30 10:55:18 UTC 2020 up 50 days, 8:06, 1 user, load averages: 1.63, 1.60, 1.60

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.