mersenneforum.org NewPGen from the command line
 Register FAQ Search Today's Posts Mark Forums Read

 2007-12-02, 00:45 #1 monst     Mar 2007 179 Posts 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.
 2007-12-02, 02:25 #2 axn     Jun 2003 4,969 Posts I suspect this is applicable only for the linux version of NewPGen. If you have CygWin or Msys, you can probably try it out.
 2007-12-02, 11:51 #3 lavalamp     Oct 2007 Manchester, UK 53F16 Posts If you'd rather use the command line, why not simply stick with srsieve and sr2sieve?
2007-12-02, 16:03   #4
monst

Mar 2007

2638 Posts

Quote:
 Originally Posted by lavalamp 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.

 2007-12-02, 17:26 #5 lavalamp     Oct 2007 Manchester, UK 17×79 Posts 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.
2007-12-02, 20:53   #6
rogue

"Mark"
Apr 2003
Between here and the

2·7·11·41 Posts

Quote:
 Originally Posted by lavalamp 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.

2007-12-02, 23:28   #7
axn

Jun 2003

4,969 Posts

Quote:
 Originally Posted by rogue 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)

 2007-12-02, 23:35 #8 lavalamp     Oct 2007 Manchester, UK 17×79 Posts 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.
 2007-12-05, 14:13 #9 Jean Penné     May 2004 FRANCE 3·193 Posts 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
2007-12-05, 16:52   #10
ET_
Banned

"Luigi"
Aug 2002
Team Italia

113168 Posts

Quote:
 Originally Posted by Jean Penné 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

2007-12-05, 17:41   #11
Jean Penné

May 2004
FRANCE

10010000112 Posts
NewPgen on Cygwin ??

Quote:
 Originally Posted by ET_ 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

 Similar Threads Thread Thread Starter Forum Replies Last Post pepi37 Linux 4 2015-07-16 22:06 mu5tan6 Software 14 2015-03-20 17:21 Gabe Brown Information & Answers 3 2009-12-12 14:01 wongnog Information & Answers 1 2008-07-20 11:29 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