mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Computer Science & Computational Number Theory (https://www.mersenneforum.org/forumdisplay.php?f=116)
-   -   Wilson-prime search practicalities (https://www.mersenneforum.org/showthread.php?t=16028)

pinhodecarlos 2012-11-07 18:53

[QUOTE=Jeff Gilchrist;317448]Thanks for the update. Does this new code support multiple cores like you were talking about before? I wouldn't mind playing with your new code if you are able to release it.[/QUOTE]

Me too, me too...

R. Gerbicz 2012-11-09 01:41

[QUOTE=Jeff Gilchrist;317448]Thanks for the update. Does this new code support multiple cores like you were talking about before? I wouldn't mind playing with your new code if you are able to release it.[/QUOTE]

Yes, it supports.

Ok, David agreed to publish, so here it is the needed ntt library and pw13.c (my latest code):
[url]https://sites.google.com/site/robertgerbicz/wilson[/url]

You need gmp library, we used gmp-5.0.4 but it works for gmp-4.x also (copied to code some newer functions). 64 bits processor (for the ntt library). And you need a not very old gcc that supports OpenMp. (gcc 4.2 or newer).

His old comment about ntt:
"See the makefile for how to build it.
You want to run e.g.
./tune-gmp 12 > tunetab.c
on a 12-core machine, it will replace tunetab.c with correct thresholds. Best to do it on a machine with no other CPU load. It just does a very simple approximation, nothing fancy. It prints progress to stderr.
Note that the default tuning settings mean ALWAYS use GMP, so you will have to run it at least once.
Then you will need to rebuild the library (or pw)."

To help the building see my long compilation line in pw13.c, in that case we are in the ntt library (pw13.c is also there). and replaced after time.h the 6 lines with the following:
#include "gmp.h"
#include "gmp-impl.h"
#include "omp.h"
#include "longlong.h"
#include "ntt.h"
#include "ntt-internal.h"

Probably not the best way, but I have used this.

I plan to write a similar code to search Wolstenholme primes, we won't do it with David and Edgar, so we could search them here.
Need some months to complete the code. It will be also a parallel code, using also the ntt library for parallel multiplication.

Jeff Gilchrist 2012-11-16 03:11

Not sure what I'm doing wrong here but I'm trying to do a "make gmp-tune" and I keep getting this error:

[CODE]In file included from tune.c:19:
ntt-internal.h: In function '_NTT_mul_mod':
ntt-internal.h:372: warning: implicit declaration of function 'MUL128'
ntt-internal.h:373: warning: implicit declaration of function 'DIV128'

<lots snipped>

ccOcWlKr.o:misc.c:(.text+0x1bf): undefined reference to `MUL128'
ccOcWlKr.o:misc.c:(.text+0x1d3): undefined reference to `DIV128'
[/CODE]

So it won't even compile that code. How are you getting around that?

Jeff Gilchrist 2012-11-16 16:30

Ok, so I finally got the NTT tune code compiling in Linux but I had to force this definition from 0 to 1:
// set this to avoid gcc 128-bit types, use inline assembly instead
#ifndef AVOID_128_BIT
#define AVOID_128_BIT 1
#endif

Did you have to do that as well?

Also, what e value are you using or how does the choice effect things? What kind of ranges should we be continuing our search in?

Jeff Gilchrist 2012-11-16 16:33

Can you give a little tutorial on all the options? Is there any way to pass stuff on the command line or in a config file or do we always need to enter it in the terminal?

I tried some values but not sure what is happening. It gave one line of output and then stopped so I'm not sure if it there were no results or it just stopped working:

[CODE]Please give the number of availables core(s) for this code! 2
Not found unfinished workunit.
The allowed (even) e values are:
2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,48,50,54,60,66,70,84,90
Choose one: 12
Please give start and end value of the search! 999979
10000000537
Give how many primes to process at once: 4
Do you want to print to file all residues (0/1)? (Warning large text file!): 0
Would you like to use large savefile for frequent save (in approx. every 1800 seconds or before we exit) (0/1)? 0
All interesting residues in wilson.txt (res=-1+kp, where abs(k)<=max(100,p/5000))
Give the Wall time you would like to spend on this run in seconds ! 240
Updated st=1498685363716
[/CODE]

Jeff Gilchrist 2012-11-16 19:58

Something is definitely wrong, I can't get it to work at all, it just stops immediately after whatever inputs you use. I had forgotten the trick we used for your last version, but you can specify the parameters something like the following to help automat it:

echo -e "4\n28\n298000000000\n300000000000\n45000000\n0\n0\n5000\n" | ./pw13

What do you use to launch your executable, or do you put the values in by hand every time?

R. Gerbicz 2012-11-16 21:14

[QUOTE=Jeff Gilchrist;318584]Can you give a little tutorial on all the options? Is there any way to pass stuff on the command line or in a config file or do we always need to enter it in the terminal?

I tried some values but not sure what is happening. It gave one line of output and then stopped so I'm not sure if it there were no results or it just stopped working:

[CODE]Please give the number of availables core(s) for this code! 2
Not found unfinished workunit.
The allowed (even) e values are:
2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,48,50,54,60,66,70,84,90
Choose one: 12
Please give start and end value of the search! 999979
10000000537
Give how many primes to process at once: 4
Do you want to print to file all residues (0/1)? (Warning large text file!): 0
Would you like to use large savefile for frequent save (in approx. every 1800 seconds or before we exit) (0/1)? 0
All interesting residues in wilson.txt (res=-1+kp, where abs(k)<=max(100,p/5000))
Give the Wall time you would like to spend on this run in seconds ! 240
Updated st=1498685363716
[/CODE][/QUOTE]

Not surprising, the treshold for e=12 was greater than 10000000537, so the program exited. But thanks, for the input, because from this observed that it was the old treshold table, see the updated pw13 what we used in the search. Basically we searched up to p=2e13.

"What do you use to launch your executable, or do you put the values in by hand every time?"
As I can remember they used python code to distribute ranges.

Jeff Gilchrist 2012-11-16 21:19

[QUOTE=R. Gerbicz;318632]Not surprising, the treshold for e=12 was greater than 10000000537, so the program exited. But thanks, for the input, because from this observed that it was the old treshold table, see the updated pw13 what we used in the search. Basically we searched up to p=2e13.
[/QUOTE]

I will look at the new code. Is anyone continuing the search? Should we be coordinating with someone?

Can you provide us with a sample set of parameters and range with some kind of output so we can verify that our compiled binaries are working properly and at least match yours?

R. Gerbicz 2012-11-16 21:28

[QUOTE=Jeff Gilchrist;318584]Can you give a little tutorial on all the options? [/QUOTE]

There is no. But you can ask. It is possible to test low p values with large e values, see line 129, used only for testing. In the search obviously we used optimal e values, so it was test_all_primes_for_e=0.

See also line 111 to change the frequency of the saving in second (we could use something larger than half an hour, so 1800).

You can change also line 106 or 107, to print out solutions for that w<=max(bound,p/denom).

I have older ntt libraries also, not used this version, basically this is the same that was ntt-1.1.

There is a sheduling algorithm for 3*2^n cores you can disable that on line 126. I wouldn't recommend changing other built-in variables. These are quite good.

R. Gerbicz 2012-11-16 22:19

[QUOTE=Jeff Gilchrist;318633]I will look at the new code. Is anyone continuing the search? Should we be coordinating with someone?

Can you provide us with a sample set of parameters and range with some kind of output so we can verify that our compiled binaries are working properly and at least match yours?[/QUOTE]

I've uploaded the results for e=10 st=112701072207-en=113000000000 range, choose say interval=2e7. We have run such blocks for that in [st,en] there are slightly less than interval primes (so here 2e7 is suboptimal), but we could get quickly a bound for the number of special primes in [st,en] if there was no treshold value in [st,en], an approximation for the number of special primes was simply r*(primepi(en)-primepi(st)), where r is fixed.

As far as I know currently there is no running code at David and Edgar or at other team.

Jeff Gilchrist 2012-11-17 03:39

[QUOTE=R. Gerbicz;318644]I've uploaded the results for e=10 st=112701072207-en=113000000000 range, choose say interval=2e7. We have run such blocks for that in [st,en] there are slightly less than interval primes (so here 2e7 is suboptimal), but we could get quickly a bound for the number of special primes in [st,en] if there was no treshold value in [st,en], an approximation for the number of special primes was simply r*(primepi(en)-primepi(st)), where r is fixed.[/QUOTE]

Thanks for uploading the file, my latest compiled code in Linux seems to be working and matches your output.

Now I just need to figure out what parameters are best for starting to search at p=2e13 to continue and what kind of e values I should be using there.


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

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