20110907, 12:53  #34 
(loop (#_fork))
Feb 2006
Cambridge, England
2×7×461 Posts 
102..110 graph
This graph has the same axes as before, and covers one 1mod3 and one 5mod12 pass on 102G..110G with interval=8e8. For this huge interval the printout subphase does not use memory as flatly as before, and the sqrtlike behaviour in subphase 2 appears to be absent.

20110907, 12:58  #35 
(loop (#_fork))
Feb 2006
Cambridge, England
6454_{10} Posts 
110..111 i=2e7 graph
It looks as if the really peaky memory usage is in part a function of the interval being much larger than the number of primes in the range: here's the graph from running 110..111 with i=2e7. Note that the 1mod3 section takes twice as much memory as the others, but less time.
Code:
Testing p=110000000003...110999999927, p==11 mod 12, time=312 sec. Testing p=110000000041...110999999977, p==1 mod 3, time=52119 sec. about 20% slower than 1e8 Testing p=110000000189...110999999837, p==5 mod 12, time=79959 sec. 24% slower than 1e8 Done the st=110000000000en=111000000000 interval. Time=107912 sec. 27% slower in total 97210.03user 1412.42system 29:58:31elapsed 91%CPU (0avgtext+0avgdata 7641440maxresident)k Peak memory usage observed is 1.904G Last fiddled with by fivemack on 20110908 at 09:08 
20110907, 16:46  #36 
Jun 2003
Ottawa, Canada
3·17·23 Posts 
I just updated my mingw64 environment. The previous binary I posted was compiled with GMP 5.0.1 and this new one is with MPIR 2.4.0 which might be faster. Can someone please help me benchmark this to see which one is faster?
GMP5: http://gilchrist.ca/jeff/factoring/wilsontest_win64.zip MPIR: http://gilchrist.ca/jeff/factoring/w...win64_mpir.zip Try running the same small range with the same parameters and please let me know if there is a big speed difference. 
20110907, 17:33  #37 
Dec 2010
Monticello
3403_{8} Posts 

20110907, 17:54  #38 
"Robert Gerbicz"
Oct 2005
Hungary
11^{2}×13 Posts 
I have a slightly improved code: https://sites.google.com/site/robertgerbicz/wilson (wilsontest2.c). Doing the st=10000000033en=11000000000 with interval=1e7 the first block (p==1 mod 3) done in 4514 sec. with 774MB Ram. The older code done the same block in 5499 sec. with 902MB Ram. So it seems both an improvement in speed and memory for large primes.
For smallish starting values it is possible that it uses more memory: say testing all primes less than 5e7, with interval=2e6, the time is 569 sec. but used more than 100MB Ram. Last fiddled with by R. Gerbicz on 20110907 at 17:54 
20110907, 19:12  #39 
Jun 2003
Ottawa, Canada
3·17·23 Posts 
I haven't really looked at the algorithm you are using but if you redo the same range with the same parameters should you get the same results?
Doing 3 runs, I get mostly the same values in wilson.txt but there are some entries are are in one but not the other and viceversa. For example with a wilsonwork.txt file of: Code:
st=5en=10000000 S[0]=7 S[1]=5 S[2]=11 interval=2000192 printtofile=0 Code:
1750901 1+34p 1851953 150p 2031053 118p 1666403 1+99p 2278343 1+21p 2313083 1+15p Code:
780887 11p 890231 1+62p 898787 153p 1308491 155p 1638347 145p 1640147 188p 
20110907, 19:15  #40 
Jun 2003
Ottawa, Canada
3·17·23 Posts 
Also, I'm wondering if I found another bug. One of my runs is producing a huge amount of results in wilson.txt but they don't seem of actual value.
I'm getting about 3.6MB so far with a ton of lines like: Code:
70039080617 1+0p 70039083185 1+0p 70039087061 1+0p 70039088333 1+0p 70039089617 1+0p 70039091345 1+0p 70039091669 1+0p 70039092905 1+0p 70039093649 1+0p 70039094777 1+0p Code:
st=70000000000en=71000000000 S[0]=70000000003 S[1]=70000000001 S[2]=70000000007 interval=50000256 printtofile=0 
20110907, 19:27  #41  
"Robert Gerbicz"
Oct 2005
Hungary
11000100101_{2} Posts 
Quote:
(and BR=128 in the code). Last fiddled with by R. Gerbicz on 20110907 at 19:28 

20110907, 19:33  #42  
Jun 2003
Ottawa, Canada
3×17×23 Posts 
Quote:
I just entered the start as 1, the end as 10000000 and put 2000000 as the interval. When it wrote the wilsonwork.txt file it created 2000192 as the interval all on its own. Last fiddled with by Jeff Gilchrist on 20110907 at 19:39 

20110907, 19:40  #43  
Jun 2003
Ottawa, Canada
3×17×23 Posts 
Quote:
http://gilchrist.ca/jeff/factoring/wilsontest_win64.zip 

20110907, 19:40  #44  
"Robert Gerbicz"
Oct 2005
Hungary
3045_{8} Posts 
Quote:
Yes, the code saves the modified interval value, and use that if you stop the program and rerun. Moreover it would not be problem to modify this value after the stop. (as long as this is positive and divisible by 2*BR=256) Last fiddled with by R. Gerbicz on 20110907 at 20:32 

Thread Tools  
Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Twin prime search?  MooooMoo  Twin Prime Search  115  20100829 17:38 
k=51 or about coordinated prime search  Kosmaj  Riesel Prime Search  7  20070713 22:15 
Prime Search on PS3?  Kosmaj  Riesel Prime Search  6  20061121 15:19 
Genetics and Wilson's theorem  David John Hill Jr  Science & Technology  2  20060510 14:10 
Generalized wilson's theorem  bouayoun  Math  3  20040312 18:24 