mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > Software

Reply
 
Thread Tools
Old 2007-12-02, 00:45   #1
monst
 
monst's Avatar
 
Mar 2007

179 Posts
Default NewPGen from the command line

Can NewPGen be run from the command line in Windows? If so, how? and what are its switches?

From the srsieve ReadMe file...
An example to get started:
$ srsieve --newpgen --nmin 5000 --nmax 10000 --pmax 400000 "24*7^n+1"
This will sieve the single sequence 24*7^n+1 with n in the range 5,000 -
10,000 for all factors up to 400,000 and write the remaining terms in newpgen
format to the file t16_b7_k24.npg. It is equivalent (and should produce an
identical file) to the following NewPGen invocation:
$ newpgen -wp=t16_k7_b24.npg -t=16 -base=7 -k=24 -nmin=5000 -nmax=10000 \
-osp=400000

When I use this newpgen command in version 2.82 on windows, all it does is launch the application and shows its GUI.

Any help would be appreciated. Thanks.
monst is offline   Reply With Quote
Old 2007-12-02, 02:25   #2
axn
 
axn's Avatar
 
Jun 2003

4,969 Posts
Default

I suspect this is applicable only for the linux version of NewPGen. If you have CygWin or Msys, you can probably try it out.
axn is offline   Reply With Quote
Old 2007-12-02, 11:51   #3
lavalamp
 
lavalamp's Avatar
 
Oct 2007
Manchester, UK

53F16 Posts
Default

If you'd rather use the command line, why not simply stick with srsieve and sr2sieve?
lavalamp is offline   Reply With Quote
Old 2007-12-02, 16:03   #4
monst
 
monst's Avatar
 
Mar 2007

2638 Posts
Default

Quote:
Originally Posted by lavalamp View Post
If you'd rather use the command line, why not simply stick with srsieve and sr2sieve?

Good question. I was looking to combine NewPGen's performance on fixed-n sieving with the additional flexibility of a command line interface.
monst is offline   Reply With Quote
Old 2007-12-02, 17:26   #5
lavalamp
 
lavalamp's Avatar
 
Oct 2007
Manchester, UK

17×79 Posts
Default

Ah, I didn't realise that NewPGen was faster. Is it also faster for a fixed k? If so I may have to switch back.

Obviously sr2sieve wins hands down for sieving multiple ranges though since it can do them all at once.
lavalamp is offline   Reply With Quote
Old 2007-12-02, 20:53   #6
rogue
 
rogue's Avatar
 
"Mark"
Apr 2003
Between here and the

2·7·11·41 Posts
Default

Quote:
Originally Posted by lavalamp View Post
Ah, I didn't realise that NewPGen was faster. Is it also faster for a fixed k? If so I may have to switch back.

Obviously sr2sieve wins hands down for sieving multiple ranges though since it can do them all at once.
sr(x)sieve is faster than NewPGen at fixed k sieving. For a single k, use sr1sieve, for multiple k (base 2) use sr2sieve. For multiple k (base 5) use sr5sieve.
rogue is online now   Reply With Quote
Old 2007-12-02, 23:28   #7
axn
 
axn's Avatar
 
Jun 2003

4,969 Posts
Default

Quote:
Originally Posted by rogue View Post
sr(x)sieve is faster than NewPGen at fixed k sieving. For a single k, use sr1sieve, for multiple k (base 2) use sr2sieve. For multiple k (base 5) use sr5sieve.
Actually, sr2sieve handles all bases, not just 2 (despite the name). Geoff added that capability some time ago.

I'd also add that, for really large k's, or for sieving at small p, use srsieve. This is because, sr2sieve can't handle p < k, and it (sr2sieve) takes a /really/ long time and lots of memory to compute the Legendre symbol tables for large k's.

Last fiddled with by axn on 2007-12-02 at 23:29 Reason: Legrange -> Legendre (brain fart)
axn is offline   Reply With Quote
Old 2007-12-02, 23:35   #8
lavalamp
 
lavalamp's Avatar
 
Oct 2007
Manchester, UK

17×79 Posts
Default

Oh wow, I just switched a range from sieving on NewPGen to sieving on sr1sieve, the speed of the sieve doubled! Not an exageration, it went from ~ 410,000 p/s to 940,000 p/s.

Also, um, sorry monst, I think I hi-jacked your thread here. So I'll butt-out now, and good luck with finding a command line invocation for NewPGen.
lavalamp is offline   Reply With Quote
Old 2007-12-05, 14:13   #9
Jean Penné
 
Jean Penné's Avatar
 
May 2004
FRANCE

3·193 Posts
Default NewPgen from the Command line : Linux only!

Sorry for this late response...
1) - NewPgen on Windows is GUI only.
2) - NewPgen on Linux or FreeBSD platorms can be used from the command line :
On Linux or FreeBSD, type newpgen -h to see how to do...

It is not very easy to use in this non-interactive mode, but it can be useful while calling newpgen from a shell or a Perl script.

To make the port of Paul Jobling's NewPgen on the Linux and FreeBSD platforms was my first programming work for prime search, before writing LLR, but unfortunately, I forgot completely that I also implemented this feature!

Good luck in your prime numbers hunting and best regards,
Jean
Jean Penné is offline   Reply With Quote
Old 2007-12-05, 16:52   #10
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

113168 Posts
Default

Quote:
Originally Posted by Jean Penné View Post
Sorry for this late response...
1) - NewPgen on Windows is GUI only.
2) - NewPgen on Linux or FreeBSD platorms can be used from the command line :
On Linux or FreeBSD, type newpgen -h to see how to do...

It is not very easy to use in this non-interactive mode, but it can be useful while calling newpgen from a shell or a Perl script.

To make the port of Paul Jobling's NewPgen on the Linux and FreeBSD platforms was my first programming work for prime search, before writing LLR, but unfortunately, I forgot completely that I also implemented this feature!

Good luck in your prime numbers hunting and best regards,
Jean
Would a porting of the Linux code on Cygwin under Windows be possible?

Luigi
ET_ is offline   Reply With Quote
Old 2007-12-05, 17:41   #11
Jean Penné
 
Jean Penné's Avatar
 
May 2004
FRANCE

10010000112 Posts
Default NewPgen on Cygwin ??

Quote:
Originally Posted by ET_ View Post
Would a porting of the Linux code on Cygwin under Windows be possible?

Luigi
I tried to execute my Linux binary on my Cygwin :

"cannot execute binary file"

So, it is at least necessary to build on Cygwin from the source...
I will try as soon as possible, but I don't know if it will be easy, because of several assembler langage files beeing necessarily recompiled...

Jean
Jean Penné is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mail from command line pepi37 Linux 4 2015-07-16 22:06
Windows command line mu5tan6 Software 14 2015-03-20 17:21
Run Benchmark Test using Command Line Only? Gabe Brown Information & Answers 3 2009-12-12 14:01
command line switch wongnog Information & Answers 1 2008-07-20 11:29
MultiSieve from the command line (on Windows) monst Software 7 2007-12-18 02:37

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

Mon May 17 23:30:13 UTC 2021 up 39 days, 18:11, 0 users, load averages: 2.01, 2.14, 2.25

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.