mersenneforum.org  

Go Back   mersenneforum.org > Factoring Projects > YAFU

Reply
 
Thread Tools
Old 2012-05-18, 06:43   #1
LaurV
Romulan Interpreter
 
LaurV's Avatar
 
Jun 2011
Thailand

22×7×317 Posts
Default yafu trivia

Code:
==== sieving in progress ( 2 threads):   44444 relations needed ====
====            Press ctrl-c to abort and save state            ====
Certainly this guy is not Chinese!
LaurV is offline   Reply With Quote
Old 2012-05-19, 16:35   #2
Stargate38
 
Stargate38's Avatar
 
"Daniel Jackson"
May 2011
14285714285714285714

607 Posts
Default

What number did you factor?
Stargate38 is offline   Reply With Quote
Old 2012-05-20, 23:50   #3
Dubslow
Basketry That Evening!
 
Dubslow's Avatar
 
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88

3×2,399 Posts
Default Hijacking this thread for some "trivia"

Is there a way to get the best poly found so far while poly select is running?
Dubslow is offline   Reply With Quote
Old 2012-05-21, 02:24   #4
jasonp
Tribal Bullet
 
jasonp's Avatar
 
Oct 2004

DA116 Posts
Default

Not without brute-force parsing the results, unfortunately.
jasonp is offline   Reply With Quote
Old 2012-05-21, 03:01   #5
Dubslow
Basketry That Evening!
 
Dubslow's Avatar
 
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88

3·2,399 Posts
Default

Quote:
Originally Posted by jasonp View Post
Not without brute-force parsing the results, unfortunately.
I had a dinky Python script half way done when I posted, so that's okay.
Dubslow is offline   Reply With Quote
Old 2012-05-21, 05:28   #6
Dubslow
Basketry That Evening!
 
Dubslow's Avatar
 
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88

1C1D16 Posts
Default

Quote:
Originally Posted by Dubslow View Post
I had a dinky Python script half way done when I posted, so that's okay.

Code:
bill@Gravemind:~/yafu∰∂ score.py

nfs.dat.p - Best: 40024 -- score: 2.059e-12
nfs.dat.1.p - Best: 129 -- score: 1.78e-12
nfs.dat.2.p - Best: 562 -- score: 1.802e-12
nfs.dat.3.p - Best: 383 -- score: 1.601e-12
nfs.dat.4.p - Best: 707 -- score: 1.644e-12
nfs.dat.5.p - Best: 4 -- score: 1.345e-12
nfs.dat.6.p - Best: 121 -- score: 2.028e-12
nfs.dat.7.p - Best: 828 -- score: 1.73e-12

I think the best is the following:
# norm 2.824831e-15 alpha -8.666018 e 2.059e-12 rroots 3
skew: 59896335.71
c0: 895897620029938237657596659356466915669760
c1: -9916866312411647273960145680089008
c2: -982422272849236864202218268
c3: -15047997790788080639
c4: -20444892482
c5: 3672
Y0: -6230395847942608324575436414951
Y1: 74116122267086123

This is the 40024th poly in nfs.dat.p; at ten lines per poly, this should be somewhere around line 400240.
(Edit: It was actually at line 400253. Huh.)

bill@Gravemind:~/yafu∰∂
Code:
#! /usr/bin/python3

dir = '/home/bill/yafu'
# This is the absolute path to your poly select working directory

files = ['nfs.dat.p', 'nfs.dat.1.p', 'nfs.dat.2.p', 'nfs.dat.3.p', 'nfs.dat.4.p', 'nfs.dat.5.p',
         'nfs.dat.6.p', 'nfs.dat.7.p']
# This is the list of files with polys in the above directory
# It's probably possible to automatically generate this, but I have no idea how standard Msieve is
# about that sort of thing.
#
###################################################################################################

print() # Pet peeve
import os, re
os.chdir(dir)
pattern = re.compile(r'(# norm .*? e ([0-9][.][0-9]{3}e-1[123]).*?(?=#|\Z))', flags=re.DOTALL)
scores = []
meta = []

for file in files:
     with open(file, 'r') as data:
          mxsc = 0 # Max Murphy-e score found so far
          i = 0    # Rolling index
          best = 0 # Index corresponding to mxsc
          data = data.read()
          polys = pattern.findall(data) # This returns a list of match-tuples. match[0] gives the
          # first group, in this case the whole poly (see above regex) and match[1] gives the inner
          # group, which is the Murphy e score.
          while i < len(polys):
               score = float(polys[i][1])
               #print(str(score)) # Debugging statement
               if score > mxsc:
                    best = i
                    mxsc = score
               i += 1
          print(file+' - Best:', str(best), '-- score:', str(mxsc))
          scores.append(polys[best])
          meta.append( (best, file) )

mxsc = 0
i = 0
best = 0
while i < len(scores):
     score = float(scores[i][1])
     #print('Testing score:', scores[i][1])
     if score > mxsc:
          best = i
          mxsc = score
     i += 1
print('\nI think the best is the following:')
print(scores[best][0])
print('This is the '+str(meta[best][0])+'th poly in '+str(meta[best][1])+'; at ten lines per poly,\
 this should be somewhere around line '+str(10*meta[best][0])+'.\n')
As yet, it does not detect duplicate scores or track runners-up.
As mentioned in the comments, how does Msieve organize the poly-select files? Are the polys always printed in the same format?

On a mostly unrelated note, this is for a C158; the spreadsheet that fivemack maintains suggests that a score above 2e-12 is above average, yet poly-select is only around 35-40% through the amount of time it stated at the beginning. Is this a good poly? (I haven't trial sieved; I have no clue how to produce the other values in a .job file, like lp, q, etc. though I could make some decent guesses from that nice spreadsheet.)

(In another segue, can someone explain what the various matrix and pmatrix columns of that spreadsheet mean?)

Last fiddled with by Dubslow on 2012-05-21 at 05:42
Dubslow is offline   Reply With Quote
Old 2012-05-21, 11:35   #7
jasonp
Tribal Bullet
 
jasonp's Avatar
 
Oct 2004

3·1,163 Posts
Default

Msieve saves every polynomial whose E-value exceeds a bound, in the order they are found. It would be relatively straightforward to maintain a priority queue of the N best polynomials, and only print out a new one if it displaces another polynomial from the queue. But right now there are only two kinds of jobs: small jobs where the only thing that matters is the best score, and large jobs that require manual intervention no matter what.
jasonp is offline   Reply With Quote
Old 2012-05-22, 07:25   #8
Dubslow
Basketry That Evening!
 
Dubslow's Avatar
 
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88

3·2,399 Posts
Default

Hmm... it finished, and YAFU printed this:
Code:
best poly: 
# norm 1.404811e-15 alpha -7.157730 e 1.2# norm 1.639528e-15 alpha -7.621592 e 1.427e-12 rroots 5
n: 34473140218538108783457767847160803005570403677190199323501471286696391707357183201882067234295472747361321855598229568051445043790754713420994112701235355501
skew: 36163026.47
c0: -742886448093238800788055271017068780151535
c1: 61941015689400432499049921540181313
c2: 2387468922892267418028395733
c3: -162188279674099406689
c4: -2825808162878
c5: 23256
Y0: -4307145920676934752087794328126
Y1: 171378602537761387
The comment looks (really) funny. My own script gives the following poly with best Murphy e score:
Code:
# norm 3.364711e-15 alpha -6.617400 e 2.303e-12 rroots 3
skew: 5288187.23
c0: 8352362303696618979154069233422527850
c1: -13760873120991388185420545758555
c2: 13016221317246226972433428
c3: -7337464421806796798
c4: -756156744888
c5: 20664
Y0: -4410149585920118231836181983101
Y1: 41380670996658991
Normally I would write off this mismatch to my own ignorace of these things, but the messed up comment line leads me to believe that Yafu somehow thought that poly had a Murphy score of 1.2. Is there any way I can get it to produce an nfs.job file for the other poly?

Edit: There appear to be multiple places where this clobbering occurred.
Code:
bill@Gravemind:~/yafu∰∂ grep "#.*#" nfs.dat.p -n
1691148:# norm 1.576873e-15 alpha -6.920# norm 1.500226e-15 alpha -7.108843 e 1.360e-12 rroots 3
1707128:# norm 1.395646e-15 al# norm 1.524023e-15 alpha -6.490944 e 1.370e-12 rroots 5
1708992:# n# norm 1.427331e-15 alpha -7.023741 e 1.338e-12 rroots 1
1749323:# norm 1.614413e-15 alpha -7.686080 e 1.417e-1# norm 1.836832e-15 alpha -7.081007 e 1.517e-12 rroots 3
1749979:# norm 1.404811e-15 alpha -7.157730 e 1.2# norm 1.639528e-15 alpha -7.621592 e 1.427e-12 rroots 5
1750109:# norm 1.605257e-15 alpha -6.958131 e 1.386e-12 rroots# norm 1.414861e-15 alpha -7.297132 e 1.308e-12 rroots 5
Could reading these files with Python while Msieve is running somehow cause this?

Edit2: I deleted the parts in red from .dat.p, deleted .fb and .job, and "resumed" the job; it's redoing around 20 minutes worth of PS, which isn't too bad. Hopefully it'll get the poly right this time.

Last fiddled with by Dubslow on 2012-05-22 at 07:44
Dubslow is offline   Reply With Quote
Old 2012-05-22, 09:49   #9
Dubslow
Basketry That Evening!
 
Dubslow's Avatar
 
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88

3·2,399 Posts
Default

Well the 20 minutes was a total lie; it just finished now. (2 of 8 threads took an hour, the rest have slowly trickled off until the last one died just now.)

Regardless, this time there were no errors in the poly file.

Code:
best poly: 
# norm 3.364711e-15 alpha -6.617400 e 2.303e-12 rroots 3
n: 34473140218538108783457767847160803005570403677190199323501471286696391707357183201882067234295472747361321855598229568051445043790754713420994112701235355501
skew: 5288187.23
c0: 8352362303696618979154069233422527850
c1: -13760873120991388185420545758555
c2: 13016221317246226972433428
c3: -7337464421806796798
c4: -756156744888
c5: 20664
Y0: -4410149585920118231836181983101
Y1: 41380670996658991
Code:
bill@Gravemind:~/yafu∰∂ cat nfs.job
n: 34473140218538108783457767847160803005570403677190199323501471286696391707357183201882067234295472747361321855598229568051445043790754713420994112701235355501
skew: 5288187.23
c0: 8352362303696618979154069233422527850
c1: -13760873120991388185420545758555
c2: 13016221317246226972433428
c3: -7337464421806796798
c4: -756156744888
c5: 20664
Y0: -4410149585920118231836181983101
Y1: 41380670996658991
rlim: 30000000
alim: 30000000
lpbr: 29
lpba: 29
mfbr: 58
mfba: 58
rlambda: 2.500000
alambda: 2.500000
Would the bad formatting be YAFU or Msieve, if it wasn't Python somehow interfering...? (I opened the files in read only mode, but still...)
Dubslow is offline   Reply With Quote
Old 2012-05-22, 12:50   #10
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

2·13·127 Posts
Default

Quote:
Originally Posted by Dubslow View Post
Would the bad formatting be YAFU or Msieve, if it wasn't Python somehow interfering...? (I opened the files in read only mode, but still...)
I don't know - I've never seen yafu or msieve hose its own output before, but neither have I been looking. The poly file parser in yafu has been working just fine, as far as I know, so that's as far as I've investigated. I would think that yafu's parser would become confused by the "e 1.2#" you showed below, so I tend to think that doesn't happen normally...
bsquared is offline   Reply With Quote
Old 2012-05-22, 15:40   #11
RichD
 
RichD's Avatar
 
Sep 2008
Kansas

61068 Posts
Default

Quote:
Originally Posted by Dubslow View Post
(2 of 8 threads took an hour, ...
Are you sure both threads weren't pointed to the same poly (output) file? That's what it looks like to me.
RichD is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Running YAFU via Aliqueit doesn't find yafu.ini EdH YAFU 8 2018-03-14 17:22
Random trivia questions chappy Puzzles 40 2015-03-12 03:59
yafu-1.33 bsquared YAFU 12 2012-11-08 04:12
yafu-1.32.1 bsquared YAFU 21 2012-09-04 19:44
Sports Trivia cheesehead Lounge 10 2010-10-31 01:57

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

Sat Oct 31 17:23:53 UTC 2020 up 51 days, 14:34, 2 users, load averages: 1.55, 1.78, 1.88

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.