mersenneforum.org  

Go Back   mersenneforum.org > Factoring Projects > YAFU

Reply
 
Thread Tools
Old 2016-01-25, 22:02   #1
richs
 
richs's Avatar
 
"Rich"
Aug 2002
Benicia, California

2·11·53 Posts
Default Work flag

I am trying to use the work flag to ecm a C156 from t=50 to 52. I specified the following in the YAFU configuration file:

plan=custom
pretest=52
work=50

When YAFU runs I get:

fac: factoring <C156>
fac: using pretesting plan: custom
fac: custom pretest ratio is: 0.3077
fac: custom pretesting limit is: 52
fac: using tune info for qs/gnfs crossover
fac: input indicated to have been pretested to t50.00
div: primes less than 10000
rho: x^2 + 3, starting 1000 iterations on C156
rho: x^2 + 2, starting 1000 iterations on C156
rho: x^2 + 1, starting 1000 iterations on C156
Total factoring time = 0.0936 seconds

If I delete the plan=custom, I get:

fac: using pretesting plan: normal
fac: custom pretesting limit is: 52
fac: using tune info for qs/gnfs crossover
fac: input indicated to have been pretested to t50.00
div: primes less than 10000
rho: x^2 + 3, starting 1000 iterations on C156
rho: x^2 + 2, starting 1000 iterations on C156
rho: x^2 + 1, starting 1000 iterations on C156
Total factoring time = 0.0936 seconds

Anyone have any suggestions how to make the work flag operate?
richs is offline   Reply With Quote
Old 2016-01-26, 04:34   #2
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

13×257 Posts
Default

There are some... quirks... it appears, with how -work and -pretest interact.

A workaround is to use -work 49.99. The magic number to avoid in this case is 50
bsquared is offline   Reply With Quote
Old 2016-01-26, 06:25   #3
Dubslow
Basketry That Evening!
 
Dubslow's Avatar
 
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88

3×2,399 Posts
Default

Yes, I had a similar situation. I was (am, still) ECMing a C187. On its own, yafu calculated a target of t57 I think (sounds about right for 4/13ths). Anyways, if I specified -work 45, it would continue ECM, but if I specified -work 50 or -work 55, then factor() went straight to poly select, which confused the crap out of me. The workaround was to manually look up the right bounds and curve count and use ecm().

Certainly seems to be the same bug.
Dubslow is offline   Reply With Quote
Old 2016-01-26, 18:37   #4
richs
 
richs's Avatar
 
"Rich"
Aug 2002
Benicia, California

2·11·53 Posts
Default

Thanks for the responses. It appears that using 49.99 still results in strange behavior:

fac: using pretesting plan: custom
fac: custom pretest ratio is: 0.3077
fac: custom pretesting limit is: 52
fac: using tune info for qs/gnfs crossover
fac: input indicated to have been pretested to t49.99
div: primes less than 10000
rho: x^2 + 3, starting 1000 iterations on C156
rho: x^2 + 2, starting 1000 iterations on C156
rho: x^2 + 1, starting 1000 iterations on C156
fac: setting target pretesting digits to 48.00
fac: t15: 2240.00
fac: t20: 2240.00
fac: t25: 640.00
fac: t30: 172.31
fac: t35: 36.72
fac: t40: 6.58
fac: t45: 1.00
fac: t50: 0.13
fac: t55: 0.02
fac: sum of completed work is t45.67
fac: work done at B1=43000000: 0 curves, max work = 7553 curves
fac: 3458 more curves at B1=43000000 needed to get to t48.00
ecm: 0/3458 curves on C156, B1=43M, B2=gmp-ecm default

Same behavior without specifying plan=custom.
richs is offline   Reply With Quote
Old 2016-01-26, 18:47   #5
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

13·257 Posts
Default

Quote:
Originally Posted by richs View Post
Thanks for the responses. It appears that using 49.99 still results in strange behavior:

fac: using pretesting plan: custom
fac: custom pretest ratio is: 0.3077
fac: custom pretesting limit is: 52
fac: using tune info for qs/gnfs crossover
fac: input indicated to have been pretested to t49.99
div: primes less than 10000
rho: x^2 + 3, starting 1000 iterations on C156
rho: x^2 + 2, starting 1000 iterations on C156
rho: x^2 + 1, starting 1000 iterations on C156
fac: setting target pretesting digits to 48.00
fac: t15: 2240.00
fac: t20: 2240.00
fac: t25: 640.00
fac: t30: 172.31
fac: t35: 36.72
fac: t40: 6.58
fac: t45: 1.00
fac: t50: 0.13
fac: t55: 0.02
fac: sum of completed work is t45.67
fac: work done at B1=43000000: 0 curves, max work = 7553 curves
fac: 3458 more curves at B1=43000000 needed to get to t48.00
ecm: 0/3458 curves on C156, B1=43M, B2=gmp-ecm default

Same behavior without specifying plan=custom.
I don't think it will let you run more ECM than the plan calls for. 156*0.3077 = 48 digits. You'd need to set pretest_ratio=0.4 or something to get it to run up to 52 digits.

As for why it says work is 45.67 when you've told it 49.99? Like I said... buggy quirky :)

But, working with what we got, you could do something like this:
Code:
./yafu "factor(rsa(512))" -v -work 45.67 -pretest 50 -plan custom -pretest_ratio 0.4
to find out how many curves it would schedule to get from 45.67 to 50. And then do this:

Code:
./yafu "factor(rsa(512))" -v -work 45.67 -pretest 52 -plan custom -pretest_ratio 0.4
to find out how many curves it would schedule to get from 45.67 to 52. And then manually run the difference.

Last fiddled with by bsquared on 2016-01-26 at 18:50 Reason: wrong multiplier
bsquared is offline   Reply With Quote
Old 2016-01-26, 18:56   #6
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

13·257 Posts
Default

Quote:
Originally Posted by bsquared View Post

to find out how many curves it would schedule to get from 45.67 to 52. And then manually run the difference.
Actually that won't work at all, since it is scheduling 50-digit curves.

Your best bet is probably to go the gmp-ecm readme, find out how many 55-digit curves it takes to reach t55, then run 2/5*thatmany curves.
bsquared is offline   Reply With Quote
Old 2016-01-26, 23:33   #7
VBCurtis
 
VBCurtis's Avatar
 
"Curtis"
Feb 2005
Riverside, CA

10001011111102 Posts
Default

To reach t52, I'd run a t50 with 50-digit ECM bounds and then a t50 worth of curves using 55-digit ECM bounds. Invoking B1 = 110M with -v will give you a list of how many curves for a t50.

t52 is really close to 2*t50, less close to 40% of t55.

Roughly, t52 = 2t50, t53 = 3t50 = 0.5t55, t55 =6t50. Or, 2 digits more work is roughly a doubling of effort.
VBCurtis is offline   Reply With Quote
Old 2016-01-27, 16:56   #8
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

D0D16 Posts
Default

Just committed some changes. SVN 346 should work better for -work inputs at 50 or above.
bsquared is offline   Reply With Quote
Old 2016-01-28, 10:21   #9
Brian Gladman
 
Brian Gladman's Avatar
 
May 2008
Worcester, United Kingdom

523 Posts
Default

Quote:
Originally Posted by bsquared View Post
Just committed some changes. SVN 346 should work better for -work inputs at 50 or above.
Hi Ben,

Is there any realistic prospect that the Visual Studio build will be bought up to date?
Brian Gladman is offline   Reply With Quote
Old 2016-01-28, 17:03   #10
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

13×257 Posts
Default

Quote:
Originally Posted by Brian Gladman View Post
Hi Ben,

Is there any realistic prospect that the Visual Studio build will be bought up to date?
Yes, in fact I've already fixed stuff such that yafu in Release\Win32 mode compiles ok. But I got stuck when linking together all the dependencies.

I've rebuilt all of the dependencies successfully using MSVC13 (mpir, gmp-ecm, msieve, pthreads). Although to get msieve to build I had to exclude the zlib\asm-win32\*.asm files from the project.

Then when building yafu I got this error, resulting in multiply defined symbols:

Error 1 error LNK2005: _strtoll already defined in common.lib(strtoll.obj)
in file LIBCMT.lib(strtoq.obj)

If I try excluding that specific library from the yafu project, I get hundreds of other errors instead.

Any suggestions?
bsquared is offline   Reply With Quote
Old 2016-01-30, 08:59   #11
Brian Gladman
 
Brian Gladman's Avatar
 
May 2008
Worcester, United Kingdom

52310 Posts
Default

Quote:
Originally Posted by bsquared View Post
Yes, in fact I've already fixed stuff such that yafu in Release\Win32 mode compiles ok. But I got stuck when linking together all the dependencies.

I've rebuilt all of the dependencies successfully using MSVC13 (mpir, gmp-ecm, msieve, pthreads). Although to get msieve to build I had to exclude the zlib\asm-win32\*.asm files from the project.

Then when building yafu I got this error, resulting in multiply defined symbols:

Error 1 error LNK2005: _strtoll already defined in common.lib(strtoll.obj)
in file LIBCMT.lib(strtoq.obj)

If I try excluding that specific library from the yafu project, I get hundreds of other errors instead.

Any suggestions?
Thanks for the update Ben - its good to know that you have not forgotten us Visual Studio users! I can't really comment on win32 buiilds as I consider them obsolete and don't normally build them.

But I get a lot of errors on the x64 build:

---------------------------------------------------------------
1> med_sieve_32k_avx2.c
1>..\..\factor\qs\med_sieve_32k_avx2.c(130): error C2065: '_INIT_AVX2_SMALL_PRIME_SIEVE': undeclared identifier
1>..\..\factor\qs\med_sieve_32k_avx2.c(131): error C2065: '_AVX2_SMALL_PRIME_SIEVE_32k_DIV3': undeclared identifier
1>..\..\factor\qs\med_sieve_32k_avx2.c(156): error C2065: '_INIT_AVX2_SMALL_PRIME_SIEVE': undeclared identifier
1>..\..\factor\qs\med_sieve_32k_avx2.c(157): error C2065: '_AVX2_SMALL_PRIME_SIEVE_14b': undeclared identifier
1>..\..\factor\qs\med_sieve_32k_avx2.c(179): error C2065: '_INIT_AVX2_SMALL_PRIME_SIEVE': undeclared identifier
1>..\..\factor\qs\med_sieve_32k_avx2.c(180): error C2065: '_AVX2_SMALL_PRIME_SIEVE_15b': undeclared identifier
1>..\..\factor\qs\med_sieve_32k_avx2.c(205): error C2065: '_INIT_AVX2_SMALL_PRIME_SIEVE': undeclared identifier
1>..\..\factor\qs\med_sieve_32k_avx2.c(206): error C2065: '_AVX2_SMALL_PRIME_SIEVE': undeclared identifier

1> poly_roots.c
1>..\..\factor\qs\poly_roots.c(82): error C2065: 'BLOCKBITS': undeclared identifier
1>..\..\factor\qs\poly_roots.c(87): error C2065: 'BLOCKBITS': undeclared identifier
1>..\..\factor\qs\poly_roots.c(339): error C2065: 'BLOCKBITS': undeclared identifier
1>..\..\factor\qs\poly_roots.c(626): error C2065: 'BLOCKBITS': undeclared identifier
1>..\..\factor\qs\poly_roots.c(626): error C2065: 'BLOCKSIZEm1': undeclared identifier
1>..\..\factor\qs\poly_roots.c(631): error C2065: 'BLOCKBITS': undeclared identifier
1>..\..\factor\qs\poly_roots.c(631): error C2065: 'BLOCKSIZEm1': undeclared identifier
1>..\..\factor\qs\poly_roots.c(670): error C2065: 'BLOCKBITS': undeclared identifier
1>..\..\factor\qs\poly_roots.c(670): error C2065: 'BLOCKSIZEm1': undeclared identifier
1>..\..\factor\qs\poly_roots.c(675): error C2065: 'BLOCKBITS': undeclared identifier
1>..\..\factor\qs\poly_roots.c(675): error C2065: 'BLOCKSIZEm1': undeclared identifier

1> tdiv_med.c
1>..\..\factor\qs\tdiv_med.c(493): error C2065: 'BLOCKSIZE': undeclared identifier
1>..\..\factor\qs\tdiv_med.c(500): error C2065: 'BLOCKSIZE': undeclared identifier
1>..\..\factor\qs\tdiv_med.c(528): error C2065: 'BLOCKSIZE': undeclared identifier
1>..\..\factor\qs\tdiv_med.c(529): error C2065: 'BLOCKSIZE': undeclared identifier
1>..\..\factor\qs\tdiv_med.c(530): error C2065: 'BLOCKSIZE': undeclared identifier
1>..\..\factor\qs\tdiv_med.c(531): error C2065: 'BLOCKSIZE': undeclared identifier
1>..\..\factor\qs\tdiv_med.c(532): error C2065: 'BLOCKSIZE': undeclared identifier
1>..\..\factor\qs\tdiv_med.c(533): error C2065: 'BLOCKSIZE': undeclared identifier
1>..\..\factor\qs\tdiv_med.c(534): error C2065: 'BLOCKSIZE': undeclared identifier
1>..\..\factor\qs\tdiv_med.c(535): error C2065: 'BLOCKSIZE': undeclared identifier

1> tdiv_med_32k_avx2.c
1>..\..\factor\qs\tdiv_med_32k_avx2.c(219): error C2065: 'MOD_INIT_16X': undeclared identifier

1> tdiv_resieve.c
1>..\..\factor\qs\tdiv_resieve.c(700): error C2065: 'BLOCKSIZE': undeclared identifier
1>..\..\factor\qs\tdiv_resieve.c(701): error C2065: 'BLOCKSIZE': undeclared identifier
1>..\..\factor\qs\tdiv_resieve.c(702): error C2065: 'BLOCKSIZE': undeclared identifier
1>..\..\factor\qs\tdiv_resieve.c(703): error C2065: 'BLOCKSIZE': undeclared identifier
1>..\..\factor\qs\tdiv_resieve.c(704): error C2065: 'BLOCKSIZE': undeclared identifier
1>..\..\factor\qs\tdiv_resieve.c(705): error C2065: 'BLOCKSIZE': undeclared identifier
1>..\..\factor\qs\tdiv_resieve.c(706): error C2065: 'BLOCKSIZE': undeclared identifier
1>..\..\factor\qs\tdiv_resieve.c(707): error C2065: 'BLOCKSIZE': undeclared identifier

1> tdiv_resieve_32k_avx2.c
1>..\..\factor\qs\tdiv_resieve_32k_avx2.c(119): error C2065: 'RESIEVE_16X_14BIT_MAX': undeclared identifier
1>..\..\factor\qs\tdiv_resieve_32k_avx2.c(130): error C2065: 'RESIEVE_16X_15BIT_MAX': undeclared identifier
1>..\..\factor\qs\tdiv_resieve_32k_avx2.c(141): error C2065: 'RESIEVE_16X_16BIT_MAX': undeclared identifier

1> calc.c
1>..\..\top\calc.c(34): fatal error C1083: Cannot open include file: 'mpz_aprcl.h': No such file or directory

1> factor_common.c
1>..\..\factor\factor_common.c(29): fatal error C1083: Cannot open include file: 'mpz_aprcl.h': No such file or directory

1> arith3.c
1>..\..\arith\arith3.c(25): fatal error C1083: Cannot open include file: 'mpz_aprcl.h': No such file or directory
---------------------------------------------------------------

I will certainly be happy to help out withy dependency issues but to do this I need to start with a successful compile which seems some way off given the above list of errors.

I am also happy to push some assembler code into subroutines to ensure that x64 perfromance is maintained. But it would be good to start with something that works!

all the best,

Brian
Brian Gladman is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Which SIMD flag to use for Raspberry Pi BrainStone Mlucas 14 2017-11-19 00:59
GMP-ECM with --enable-openmp flag set in configure = bad results? GP2 GMP-ECM 3 2016-10-16 10:21
C and the scarry flag Mr. P-1 Programming 77 2015-02-23 00:04
How to calculate work/effort for PRP work? James Heinrich PrimeNet 0 2011-06-28 19:29
Work to do for old CPU Unregistered Hardware 6 2006-08-12 05:25

All times are UTC. The time now is 06:55.

Fri Nov 27 06:55:05 UTC 2020 up 78 days, 4:06, 4 users, load averages: 0.86, 1.07, 1.14

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.