mersenneforum.org  

Go Back   mersenneforum.org > Prime Search Projects > Sierpinski/Riesel Base 5

Reply
 
Thread Tools
Old 2006-05-12, 12:59   #67
Joe O
 
Joe O's Avatar
 
Aug 2002

3·52·7 Posts
Default

Quote:
Originally Posted by Rogue
TextPad is even better...
Quote:
Originally Posted by Greenbank
With cygwin comes vi, but then I don't want to start a holy editor war. :-)
You are both right. But consider the context. A Windows user working with Cygwin for the first time. Doesn't specify the name of the "text editor" so possibly Notepad. Probably very familiar with Notepad, possibly familiar with WordPad. Wordpad already installed as part of the Default installation of Windows. Easiest thing for them to try is WordPad. This question would not even have come up if they were Unix aware, and or had other text editor experience. So, simplest recommendation try WordPad. It's there, it's a familiar interface, costs nothing to try, no learning curve. Baby Steps first then Giant Steps <G>.
Joe O is offline   Reply With Quote
Old 2006-05-13, 03:02   #68
geoff
 
geoff's Avatar
 
Mar 2003
New Zealand

115710 Posts
Default

Quote:
Originally Posted by Greenbank
Seems that the gcc I have (3.4.4) really didn't like the '_mulmod62' and '_one_over_p' references. I had to remove the leading underscore before they would compile properly.
Thanks I will change this, but it will be a few days before I can post updated source. Version 0.0.12 still has the underscores.

I think the only features that might prevent it compiling in Windows without Cygwin are the alarm signals and getrusage() call.
geoff is offline   Reply With Quote
Old 2006-05-14, 12:01   #69
rogue
 
rogue's Avatar
 
"Mark"
Apr 2003
Between here and the

11×577 Posts
Default

64-bit CPUs give warnings on %ju. Why don't you try this:

#ifdef __ppc64__
#define PRINTF_LLU "%llu"
#else
#define PRINTF_LLU "%ju"
#endif

Then use:

printf("blah="PRINTF_LLU"\n", blah);

instead of

printf("blah=%ju\n", blah);


If there is an easier way to detect 32-bit vs 64-bit which does not depend upon checking the architecture, then use it.
rogue is offline   Reply With Quote
Old 2006-05-14, 23:20   #70
geoff
 
geoff's Avatar
 
Mar 2003
New Zealand

48516 Posts
Default

Quote:
Originally Posted by rogue
64-bit CPUs give warnings on %ju. Why don't you try this:

#ifdef __ppc64__
#define PRINTF_LLU "%llu"
#else
#define PRINTF_LLU "%ju"
#endif
"%llu" works fine for 32 bit CPUs, I thought it would not work for 64 bit ones which is why I used "%ju" :-) I will change it back next time.

Meanwhile 0.0.13 should fix the underscore problem on Windows compiles, and provides an alternative to getrusage() if it is not available.
geoff is offline   Reply With Quote
Old 2006-05-15, 00:06   #71
rogue
 
rogue's Avatar
 
"Mark"
Apr 2003
Between here and the

11×577 Posts
Default

Quote:
Originally Posted by geoff
"%llu" works fine for 32 bit CPUs, I thought it would not work for 64 bit ones which is why I used "%ju" :-) I will change it back next time.

Meanwhile 0.0.13 should fix the underscore problem on Windows compiles, and provides an alternative to getrusage() if it is not available.
On 64-bit CPUs, %llu is used for uint64_t and %lu is used for uint32_t.

geoff, I've been working on some changes so that the current release can be built on PPC, but I've run into a small problem that I need to work out. I use magic numbers for the mulmod and powmod, but they are only calculated in the in sieve32 and sieve64. There is a call to powmod32 in is_pprime that cannot use the powmod that I've written. I have bypassed it by using my own sieve. I could send it on to you if you're interested. I use the same sieving technique in MultiSieve. It uses a callback which passes the next prime so it is structured a little differently than your sieve.
rogue is offline   Reply With Quote
Old 2006-05-17, 18:05   #72
axn
 
axn's Avatar
 
Jun 2003

13BD16 Posts
Default

%ju is not recognised by gcc (under Cygwin) Going to find & replace everything to %llu
axn is online now   Reply With Quote
Old 2006-05-18, 00:30   #73
geoff
 
geoff's Avatar
 
Mar 2003
New Zealand

13·89 Posts
Default version 0.0.15

I have inlined mulmod62() for a small speedup in the 64 bit sieve, and there is a 'check' target for make that tests the srsieve binary.

Quote:
Originally Posted by rogue
On 64-bit CPUs, %llu is used for uint64_t and %lu is used for uint32_t.
I see there are some macros PRIu32, PRIu64 etc. defined in <inttypes.h> that can be used to deal with this problem, they make the printf() format strings a bit hard to read but they are probably the most portable solution.

Quote:
geoff, I've been working on some changes so that the current release can be built on PPC, but I've run into a small problem that I need to work out. I use magic numbers for the mulmod and powmod, but they are only calculated in the in sieve32 and sieve64. There is a call to powmod32 in is_pprime that cannot use the powmod that I've written. I have bypassed it by using my own sieve. I could send it on to you if you're interested. I use the same sieving technique in MultiSieve. It uses a callback which passes the next prime so it is structured a little differently than your sieve.
Yes I would be interested to see it. It shouldn't be a problem to have different mulmod/powmod functions for each sieve.
geoff is offline   Reply With Quote
Old 2006-05-24, 23:42   #74
geoff
 
geoff's Avatar
 
Mar 2003
New Zealand

13·89 Posts
Default version 0.1.4

I have included rogue's prime sieve code, add -DUSE_PRIME_SIEVE to the CFLAGS in the Makefile to use this instead of the existing probable prime functions.

I have lifted the restriction on c in k*b^n+c so it can be any number relatively prime to k and b. I am not 100% sure whether it is correct to allow this, but it seems to work OK.

Since the NewPGen file format only allows c=+1,-1 and PRP only reads NewPGen files (I think?), I have added a --pfgw switch which writes the sieve file in a format suitable for input to pfgw.
geoff is offline   Reply With Quote
Old 2006-06-14, 03:09   #75
geoff
 
geoff's Avatar
 
Mar 2003
New Zealand

13·89 Posts
Default Version 0.1.18

This version fixes a problem with the assembler version of mulmod64 that has been present since it was inlined in version 0.0.15. It probably didn't affect any released version of srsieve, but potentially factors could have been missed in the 64 bit sieve. If anyone wants to be sure whether or not the version they have been using is affected by the bug then they can send me a copy of the bsgs.o object file and I will check it. (It depends on compiler version and optimisation flags used).

On a more positive note, a much improved hashtable should speed up large sieves (e.g. the size of the current base 5 project) by about 60%, and small sieves by 5-10%.
geoff is offline   Reply With Quote
Old 2006-06-14, 17:35   #76
axn
 
axn's Avatar
 
Jun 2003

31×163 Posts
Default

Quote:
Originally Posted by geoff
On a more positive note, a much improved hashtable should speed up large sieves (e.g. the size of the current base 5 project) by about 60%, and small sieves by 5-10%.
When you said 60% speedup I had imagined 60% improvement in throughtput - I didn't realise that it was 60% _reduction_ in time !!

Right now I am getting a better than 2x thruput. This calls for a
axn is online now   Reply With Quote
Old 2006-06-16, 03:02   #77
geoff
 
geoff's Avatar
 
Mar 2003
New Zealand

22058 Posts
Default

Quote:
Originally Posted by axn1
When you said 60% speedup I had imagined 60% improvement in throughtput - I didn't realise that it was 60% _reduction_ in time !!
I did mean a 60% throughput improvement, but I only tested on my P4. The improvement is mainly due to the hashtable being smaller and staying in cache longer, so the actual improvement will depend a lot on cache size.

Last fiddled with by geoff on 2006-06-16 at 03:02
geoff is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Very Prime Riesel and Sierpinski k robert44444uk Open Projects 587 2016-11-13 15:26
Sierpinski/ Riesel bases 6 to 18 robert44444uk Conjectures 'R Us 139 2007-12-17 05:17
Sierpinski/Riesel Base 10 rogue Conjectures 'R Us 11 2007-12-17 05:08
Sierpinski / Riesel - Base 23 michaf Conjectures 'R Us 2 2007-12-17 05:04
Sierpinski / Riesel - Base 22 michaf Conjectures 'R Us 49 2007-12-17 05:03

All times are UTC. The time now is 09:13.


Sat Jul 17 09:13:35 UTC 2021 up 50 days, 7 hrs, 1 user, load averages: 1.63, 1.70, 1.62

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, 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.