mersenneforum.org  

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

Reply
 
Thread Tools
Old 2018-02-24, 14:48   #34
Dylan14
 
Dylan14's Avatar
 
"Dylan"
Mar 2017

11×47 Posts
Default update to the previous post

I have figured how to allow cksieve to take 1 as an argument for the -n flag without the error described in the previous post. This requires only one change to the CarolKyneaApp.cpp file. Instead of

Code:
status = Parser::Parse(arg, 2, 1000000000, ii_MinN);
replace it with

Code:
status = Parser::Parse(arg, 1, 1000000000, ii_MinN);
within the switch (opt) block in CarolKyneaApp::ParseOption and then run make to regenerate the executables.
With this change I ran the following input:
Code:
cksieve -P1e9 -n 1 -N50000 -b50
which worked perfectly and I got a sieve file with 18924 terms in it, the same as I got with cksieve v1.1.4.
Dylan14 is offline   Reply With Quote
Old 2018-02-24, 15:22   #35
rogue
 
rogue's Avatar
 
"Mark"
Apr 2003
Between here and the

10111001110112 Posts
Default

That is the fix, but an additional change is needed. For small bases, n=1 with c=-1 yields a negative number, so those need to be excluded.

The next release will have GPU support for afsieve. My fingers are crossed that compiling and linking OpenCL with mingw works. It took me a while to figure out how to get mingw objects to link with the OpenCL library. It now links. The question is, does it run without crashing.

Last fiddled with by rogue on 2018-02-24 at 15:25
rogue is online now   Reply With Quote
Old 2018-02-25, 22:30   #36
rogue
 
rogue's Avatar
 
"Mark"
Apr 2003
Between here and the

19·313 Posts
Default

I have released version 1.2 of the framework.

Code:
   fkbnsieve is now working.
   Modify cksieve to detect candidates that are prime and to log them.
   Fixed an asm bug that at worst causes factors to be missed by
   fbncsieve and gfndsieve.  It will nor result in invalid factors and
   if it did, they would be caught at runtime due to built-in factor
   checking that relies on completely different code.
   
   Added -A option to apply factors (or reformat candidate file) and exit immdiately without sieving.
   Added GPU classes.  This adds the following command line options:
      -D - to select the GPU platform
      -d - to select the GPU device
      -G - to specify the number of GPU workers
      -g - to set multiple of workgroupsize which is used to compute the number of primes per GPU worker
   Added GPU workers to afsieve.
Visit my page to get the link to d/l the latest source and Windows builds.

There are a some things I need to do. First, I need to implement factor validation for the afsieve GPU worker. Second, the build on OS X is broken because getrusage doesn't have the same capabilities on OS X as it does on Linux.

I have not tested the -A option, but if it doesn't work, it should be easy to fix.

I need help from Linux developers to determine the correct settings for compiling and linking with OpenCL.

Here are some notes on using the GPU:
  • When you use the GPU enabled sievers, t is strongly recommended that you play with the -g and -G options when using a GPU to determine the optimal settings for your hardware.
  • You can have a mix of CPU and GPU workers. The default right now is to always have 1 CPU worker even if you have GPU workers, but there is nothing to prevent you from using -W4 -G4 to create 8 workers, 4 for the CPU and 4 for the GPU. This is an incredibly cool and powerful feature that I have not supported in any of my previous sieving programs.
rogue is online now   Reply With Quote
Old 2018-02-25, 23:48   #37
Dylan14
 
Dylan14's Avatar
 
"Dylan"
Mar 2017

11×47 Posts
Default

Thanks for fixing the -n issue and the removal of candidates that result in unity, zero or negative unity in cksieve. However I have run into another bug - when I put this as input:

Code:
cksieve -P150e9 -n 1 -N10000 -b214 -W 4
it runs for a while until it terminates with the following message:

Code:
Fatal Error:  393216 is not a root (mod 77309411329)
In cksieve v1.1.4 it didn't terminate when this happened, but it would give out a warning, like this:

Code:
WARNING: 393216 is not a root (mod 77309411329)
and then continue onward to the desired sieve depth (in this case 150e9).
Dylan14 is offline   Reply With Quote
Old 2018-02-26, 14:01   #38
rogue
 
rogue's Avatar
 
"Mark"
Apr 2003
Between here and the

19·313 Posts
Default

Quote:
Originally Posted by Dylan14 View Post
Thanks for fixing the -n issue and the removal of candidates that result in unity, zero or negative unity in cksieve. However I have run into another bug - when I put this as input:

Code:
cksieve -P150e9 -n 1 -N10000 -b214 -W 4
it runs for a while until it terminates with the following message:

Code:
Fatal Error:  393216 is not a root (mod 77309411329)
In cksieve v1.1.4 it didn't terminate when this happened, but it would give out a warning, like this:

Code:
WARNING: 393216 is not a root (mod 77309411329)
and then continue onward to the desired sieve depth (in this case 150e9).
I changed the behavior because this might be a bug, but I need to investigate. I'll look into restoring the old behavior.
rogue is online now   Reply With Quote
Old 2018-02-26, 20:31   #39
pepi37
 
pepi37's Avatar
 
Dec 2011
After milion nines:)

25048 Posts
Default fbncsieve bug

If you continue sieve from file ( sieve depth for example 50000000) you cannot use switches -p 1000000000000 -P 2000000000000 becauseprogram will still start from 50000000.
So if you have few workers threads you must change header line in a file for right sieve range
pepi37 is offline   Reply With Quote
Old 2018-02-26, 23:02   #40
rogue
 
rogue's Avatar
 
"Mark"
Apr 2003
Between here and the

19×313 Posts
Default

Quote:
Originally Posted by pepi37 View Post
If you continue sieve from file ( sieve depth for example 50000000) you cannot use switches -p 1000000000000 -P 2000000000000 becauseprogram will still start from 50000000.
So if you have few workers threads you must change header line in a file for right sieve range
I think I know the cause.

Last fiddled with by rogue on 2018-02-26 at 23:03
rogue is online now   Reply With Quote
Old 2018-03-08, 15:25   #41
BotXXX
 
BotXXX's Avatar
 
Aug 2003
Europe

110000012 Posts
Default

I have a machine with 2x Intel Xeon E5-2620 v2. Which are 12 cores or 24 threads. When I tried to run cksieve version 1.2, I first received an error about a missing OpenCL.dll library.

After installing the OpenCL Runtime version 16.1.2, it no longer crashes, but it notes it is not able to find a suitable device.

Code:
C:>cksieve.exe
List of available platforms and devices
Platform 0 is a Intel(R) Corporation Intel(R) OpenCL, version OpenCL 1.2
   No devices
Fatal Error:
No devices were found that can run this code
Reading the release notes of the runtime, the Xeon E5's are supported; as long as they support SSE4.2 or above. Which this particular cpu does.
BotXXX is offline   Reply With Quote
Old 2018-03-08, 15:44   #42
rogue
 
rogue's Avatar
 
"Mark"
Apr 2003
Between here and the

19·313 Posts
Default

Quote:
Originally Posted by BotXXX View Post
I have a machine with 2x Intel Xeon E5-2620 v2. Which are 12 cores or 24 threads. When I tried to run cksieve version 1.2, I first received an error about a missing OpenCL.dll library.

After installing the OpenCL Runtime version 16.1.2, it no longer crashes, but it notes it is not able to find a suitable device.

Code:
C:>cksieve.exe
List of available platforms and devices
Platform 0 is a Intel(R) Corporation Intel(R) OpenCL, version OpenCL 1.2
   No devices
Fatal Error:
No devices were found that can run this code
Reading the release notes of the runtime, the Xeon E5's are supported; as long as they support SSE4.2 or above. Which this particular cpu does.
If you can build, then change this line in the makefile:

ENABLE_GPU=yes

to

ENABLE_GPU=no

I haven't tested a build with that set to no, but it might solve your problem.

In any case that it requires a "device" at runtime is a bug. I have fixed it, but not posted an update.

You can d/l the previous build from here.

Last fiddled with by rogue on 2018-03-08 at 15:46
rogue is online now   Reply With Quote
Old 2018-03-09, 13:19   #43
BotXXX
 
BotXXX's Avatar
 
Aug 2003
Europe

193 Posts
Default

Thank you Mark for the 1.1 build .7z. That one works ok.

As example:
Code:
C:>cksieve -b 2 -p 2 -P 1000000 -n 100 -N 10000 -o ck_remain.out -O ck_factors.out
cksieve v1.2, a program to find factors of (b^n+/-1)^2-2 numbers
Sieve started: 2 < p < 1e6 with 19802 terms
Sieve completed at p=1000033.
Processor time: 0.36 sec. (0.02 sieving) (0.61 cores)
3750 terms written to ck_remain.out
Primes tested: 39222.  Factors found: 16052.  Remaining terms: 3750.  Time: 0.59 seconds.
BotXXX is offline   Reply With Quote
Old 2018-03-09, 14:12   #44
rogue
 
rogue's Avatar
 
"Mark"
Apr 2003
Between here and the

19·313 Posts
Default

Once nice feature with mtsieve is that when starting a new sieve you don't need to specify -p. For many you probably don't want to use -P either and you just wait for the removal rate to reach what you need before you start PRP testing. Also many of the programs will generate an output file name if you don't specify one and that file name will often include information that makes it unique based upon the inputs.

And of course you can use scientific notation for most inputs that are numeric. Who wants to type --P1000000000000 when -P1e12 doesn't require you to count zeros?
rogue is online now   Reply With Quote
Reply

Thread Tools


All times are UTC. The time now is 04:10.

Sat Oct 24 04:10:40 UTC 2020 up 44 days, 1:21, 1 user, load averages: 1.66, 1.50, 1.42

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