mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Software (https://www.mersenneforum.org/forumdisplay.php?f=10)
-   -   mtsieve (https://www.mersenneforum.org/showthread.php?t=23042)

Dylan14 2020-02-10 02:32

A suggestion: when using the -A (or the --applyandexit flag), assume that if there is no file given with -I, assume that the factors are given in a file called "factors.txt", or warn the user that the switch requires a file name to be given with -I to work.

rogue 2020-02-10 12:30

[QUOTE=Dylan14;537181]A suggestion: when using the -A (or the --applyandexit flag), assume that if there is no file given with -I, assume that the factors are given in a file called "factors.txt", or warn the user that the switch requires a file name to be given with -I to work.[/QUOTE]

Seems reasonable

rogue 2020-04-12 23:09

I posted 1.9.6. I was sitting on it for a while as I forgot to post. Here are the changes:
[list][*]Fixed issue in srsieve2 where it crashes when starting a new sieve.[*]Fixed issue in srsieve2 where it finds an invalid factor and terminates.[*]Refactored logic for "single worker" and "rebuild" logic so they work more nicely together.[*]Fixed calculation of p/sec which is wrong after workers are recreated.[*]Feset factor stats whenever workers are created as the rate is inflated for lower p as far more terms are removed.[*]Fix issue with multiple threads which can cause program to hang.[*]Add support for ABC format to srsieve2.[/list]

JeppeSN 2020-04-18 12:20

Silly question: Which is the preferred place to download from if I only care about the Windows (x64) binaries, not the source?

On [url]https://www.mersenneforum.org/rogue/mtsieve.html[/url] there is a file with 1.9.6 in its name. The version history on that html page does not go further than 1.7.3.

On [url]https://sourceforge.net/projects/mtsieve/[/url] there is a file with 1.9.7 in its name. Does it include both source and binaries? Is this a "beta" or "unreleased" version?

The README_MTSieve.txt file refers to the former of these two web sites.

/JeppeSN

rogue 2020-04-18 15:00

[QUOTE=JeppeSN;543049]Silly question: Which is the preferred place to download from if I only care about the Windows (x64) binaries, not the source?

On [url]https://www.mersenneforum.org/rogue/mtsieve.html[/url] there is a file with 1.9.6 in its name. The version history on that html page does not go further than 1.7.3.

On [url]https://sourceforge.net/projects/mtsieve/[/url] there is a file with 1.9.7 in its name. Does it include both source and binaries? Is this a "beta" or "unreleased" version?

The README_MTSieve.txt file refers to the former of these two web sites.

/JeppeSN[/QUOTE]

Sorry about the confusion. 1.9.6 and 1.9.7 are the same. I misnamed it because the version in the changes.txt file was incorrect. The file is named incorrectly on the one webpage. I need to change that to point to sourceforge.

pepi37 2020-05-03 23:26

I have found small error ( if we can call it error) In latest twinsieve release if we set -P 10000000 it only sieve up to 10007. I believe it has some connection with chunks ( number of worker or so) So that is nearly cosmetic error. On higher P limit everything is OK
Can you also add in info line cpu usage in percentage?

VBCurtis 2020-05-12 18:18

[QUOTE=rogue;535644]:censored: Yet another reason to dislike Windows. Thanks for finding the reason.[/QUOTE]

Was a fixed version ever posted for this problem? I also run ubuntu, also have the "Unable to lock mutex thread_1_worker. Exiting" error.

Am I to edit the source as indicated in the posts above, or has that been done for me in a released version?

I grabbed source from sourceforge 11 May, CHANGES.txt notes 1.9.6 changes from 15 Jan 2020.

rogue 2020-05-12 18:27

[QUOTE=VBCurtis;545178]Was a fixed version ever posted for this problem? I also run ubuntu, also have the "Unable to lock mutex thread_1_worker. Exiting" error.

Am I to edit the source as indicated in the posts above, or has that been done for me in a released version?

I grabbed source from sourceforge 11 May, CHANGES.txt notes 1.9.6 changes from 15 Jan 2020.[/QUOTE]

Worker.h was fixed on 1/20. The latest build has that fix.

VBCurtis 2020-05-12 19:28

Well, I've tried the download button from the sourceforge project, and the link from [url]http://www.mersenneforum.org/rogue/mtsieve.html[/url] (this link appears to be windows .exe's only, I don't see source)

Neither seems to have the fix. Where can I find the latest build? Edit: I notice that srsieve2.exe from the MForum link is dated 21 Jan, so maybe it does- but the fix concerned linux, and that's an .exe, so it doesn't seem too relevant.

rogue 2020-05-12 19:46

[QUOTE=VBCurtis;545180]Well, I've tried the download button from the sourceforge project, and the link from [url]http://www.mersenneforum.org/rogue/mtsieve.html[/url] (this link appears to be windows .exe's only, I don't see source)

Neither seems to have the fix. Where can I find the latest build? Edit: I notice that srsieve2.exe from the MForum link is dated 21 Jan, so maybe it does- but the fix concerned linux, and that's an .exe, so it doesn't seem too relevant.[/QUOTE]

The source is only in sourceforge. I do not provide Linux builds and I do not know the last version built for linux.

The issue was encountered on Windows, but could happen on other platforms.

VBCurtis 2020-05-12 22:26

No, unconnected's report from posts 280 and 282 were ubuntu 18.04, same OS I'm running. You noticed that windows *does not* point out the problem in the succeeding posts.

Changing line 117 in workers.h from -> SetValueNoLock to -> SetValueHasLock results in a functioning srsieve2.

Thanks for your quick replies!

Note that I grabbed the code from sourceforge this morning, so this change has not yet made it into SF.

rogue 2020-05-13 13:11

[QUOTE=VBCurtis;545194]No, unconnected's report from posts 280 and 282 were ubuntu 18.04, same OS I'm running. You noticed that windows *does not* point out the problem in the succeeding posts.

Changing line 117 in workers.h from -> SetValueNoLock to -> SetValueHasLock results in a functioning srsieve2.

Thanks for your quick replies!

Note that I grabbed the code from sourceforge this morning, so this change has not yet made it into SF.[/QUOTE]

This was updated in revision 16 months ago. I'm not certain why you are seeing something different.

Citrix 2020-05-15 18:28

If using fbncsieve.exe can you sieve sequence k*2^n+1 and k*2^n-1 at the same time (for a range of k)? What command line arguments should one use to do this?

Also if you have multiple n and multiple k (Where # of k>> # of n) for same base is there a way to sieve that all at once.

rogue 2020-05-15 19:36

[QUOTE=Citrix;545477]If using fbncsieve.exe can you sieve sequence k*2^n+1 and k*2^n-1 at the same time (for a range of k)? What command line arguments should one use to do this?

Also if you have multiple n and multiple k (Where # of k>> # of n) for same base is there a way to sieve that all at once.[/QUOTE]

Use twinsieve with the -s argument to sieve for a single fixed n and both +1 and -1.

For your other question, if using base 2 and +1, then use gfndsieve.

I do not have a sieve that sieves a single base for both +1 and -1, a range of k, and a range of n. I don't think it would be too difficult to modify twinsieve to do that.

rogue 2020-05-20 16:04

I posted the binaries to mtsieve 2.0.0 at sourceforge. This is what I fixed:
[list][*]Fixed an issue with the framework where it could stop sieving before reaching the max prime specified on the command line.[*]Fixed a link issue with gfndsieve and dmdsieve with GMP on OS X.[*]Fixed a compiler issue with the .align ASM instruction on OS X.[/list]

Citrix 2020-05-24 04:55

[QUOTE=rogue;545486]Use twinsieve with the -s argument to sieve for a single fixed n and both +1 and -1.

For your other question, if using base 2 and +1, then use gfndsieve.

I do not have a sieve that sieves a single base for both +1 and -1, a range of k, and a range of n. I don't think it would be too difficult to modify twinsieve to do that.[/QUOTE]

Thanks.

I am working on
kmin=2
kmax=n
b=2
N=n*n
c=+1 and -1

Currently I am using fbncsieve (now twinsieve) for each N value separately using a script.

If there could be a sieve for these square numbers that would be great.
These numbers can be sieved very efficiently.
You can jump from one N value to next using 1 modular multiplication and 3 additions making it extremely fast to sieve together than sieve separately.
A GPU version should also be possible.


Here is the code that you can use for this

[code]
//Adapted from multisieve

void SquareNSieve::DoWork64Bit(uint64_t thePrime)
{
uint32_t nmin, nmax;
nmin = 100;
nmax = 1000;

uint64_t temp, power;

temp = thePrime + 1;
temp >> 1;
temp = expmod62(temp, nmax*nmax, thePrime);
power = expmod62(2, 2 * nmax, thePrime);

for (int x = nmax; x >= nmin; x--)
{
if (temp <= x)
LogFactor('-', temp, 2, x*x, thePrime);

if (temp >= thePrime - x)
LogFactor('+', temp, 2, x*x, thePrime);

temp = mulmod62(temp, power, thePrime);
if (temp&1)
{
temp = temp + thePrime;
}
temp >> 1;
if (power&1)
{
power = power + thePrime;
}
power >> 1;
if (power&1)
{
power = power + thePrime;
}
power >> 1;
}
}
[/code]

Citrix 2020-05-25 05:49

1 Attachment(s)
I tried to write the code my self. I have attached it.

The program mainly writes the factors to factor file which need to be processed by srfile. There is no input or output file.

I only modified the FPU code and not the AVX multiplication code.

I cannot get it to compile. gmp.h is missing. I do not have GMP installed on my computer. Can anyone help compile it?

I do not have experience with GPU apps - how do I modify the code for GPU? Possibly cw_kernel.cl needs to be modified. Not sure what to do with the cw_kernel.h file.

[code]

void SquareNWorker::TestLargePrimesFPU(uint64_t *ps)
{
uint64_t powinvs[4];
uint64_t tempinvs[4];
for (int i = 0; i < 4; i++)
{
powinvs[i] = ps[i] + 1;
powinvs[i] >> 1;
tempinvs[i] = powinvs[i];
}

fpu_powmod_4b_1n_4p(powinvs, 2 * ii_MaxN, ps);
fpu_powmod_4b_1n_4p(tempinvs, ii_MaxN * ii_MaxN, ps);

for (int32_t x = ii_MaxN; x >= ii_MinN; x--)
{
for (int i = 0; i < 4; i++)
{
if (tempinvs[i] <= x) { ip_SquareNApp->ReportFactor(tempinvs[i], x*x, -1, ps[i]); }
if (tempinvs[i] >= ps[i] - x) { ip_SquareNApp->ReportFactor(tempinvs[i], x*x, +1, ps[i]); }
// do not verify factors
// just write to file as k*2^n+-1
// use srfile then to clean up abc file.
// modified report factor so also print k.
}

fpu_push_1divp(ps[3]);
fpu_push_1divp(ps[2]);
fpu_push_1divp(ps[1]);
fpu_push_1divp(ps[0]);

fpu_mulmod_4a_4b_4p(powinvs, tempinvs, ps);

for (int i = 0; i < 4; i++)
{
if (tempinvs[i] & 1) { tempinvs[i] += ps[i]; }
tempinvs[i] >> 1;
if (powinvs[i] & 1) { powinvs[i] += ps[i]; }
powinvs[i] >> 1;
if (tempinvs[i] & 1) { powinvs[i] += ps[i]; }
powinvs[i] >> 1;

}
}
fpu_pop();
fpu_pop();
fpu_pop();
fpu_pop();
}

[/code]

rogue 2020-05-25 13:03

[QUOTE=Citrix;546386]I tried to write the code my self. I have attached it.

The program mainly writes the factors to factor file which need to be processed by srfile. There is no input or output file.

I only modified the FPU code and not the AVX multiplication code.

I cannot get it to compile. gmp.h is missing. I do not have GMP installed on my computer. Can anyone help compile it?

I do not have experience with GPU apps - how do I modify the code for GPU? Possibly cw_kernel.cl needs to be modified. Not sure what to do with the cw_kernel.h file.[/QUOTE]

Cool. I appreciate your attempt. It sounds like you are very close.

GMP is only needed or gfndsieve and dmdsieve. It seems that the makefile has a mistake since it has a dependency for the GMP library to build gcwsieve, which is what it appears that you started with. You can remove that dependency from the makefile.

The OpenCL source files have the .cl extension. These have to be converted to .h files which are then included in the GpuWorker.cpp class. This requires the use of perl (I use ActivePerl). The command is "perl cltoh.pl file.cl > file.h". It is easier to work edit the .cl files.

It might be easier to start with the OpenCL kernel for gfndsieve than gcwsieve as that kernel is much simpler. I don't know what experience you have with OpenCL.

I'm not certain what you mean by "modified the FPU code". I'm hoping that you did not modify any .S sources.

Citrix 2020-05-26 08:16

[QUOTE=rogue;546397]Cool. I appreciate your attempt. It sounds like you are very close.

GMP is only needed or gfndsieve and dmdsieve. It seems that the makefile has a mistake since it has a dependency for the GMP library to build gcwsieve, which is what it appears that you started with. You can remove that dependency from the makefile.

The OpenCL source files have the .cl extension. These have to be converted to .h files which are then included in the GpuWorker.cpp class. This requires the use of perl (I use ActivePerl). The command is "perl cltoh.pl file.cl > file.h". It is easier to work edit the .cl files.

It might be easier to start with the OpenCL kernel for gfndsieve than gcwsieve as that kernel is much simpler. I don't know what experience you have with OpenCL.

I'm not certain what you mean by "modified the FPU code". I'm hoping that you did not modify any .S sources.[/QUOTE]

I was able to compile the code. Needed to do some debugging.

I would recommend you include [url]https://github.com/GPUOpen-LibrariesAndSDKs/OCL-SDK/releases[/url] & [url]https://github.com/KhronosGroup/OpenCL-Headers[/url] with mtsieve source - instead of using AMD SDK which would need to be installed.

I am only using FPU code in the worker file and not the AVX code function. Something to look into when I have time to make the code even faster.

I do not have experience with openCL but gcwsieve cw_kernel.cpp code seems straight forward. I can look into it. Using Perl might be more challenging.

Do you know if anyone is using the gcwsieve to sieve? It can be made faster by switching multiplication by add.

rogue 2020-05-26 12:15

[QUOTE=Citrix;546468]I was able to compile the code. Needed to do some debugging.

I would recommend you include [url]https://github.com/GPUOpen-LibrariesAndSDKs/OCL-SDK/releases[/url] & [url]https://github.com/KhronosGroup/OpenCL-Headers[/url] with mtsieve source - instead of using AMD SDK which would need to be installed.

I am only using FPU code in the worker file and not the AVX code function. Something to look into when I have time to make the code even faster.

I do not have experience with openCL but gcwsieve cw_kernel.cpp code seems straight forward. I can look into it. Using Perl might be more challenging.

Do you know if anyone is using the gcwsieve to sieve? It can be made faster by switching multiplication by add.[/QUOTE]

For the SDK, I have used AMD SDK for years and never had a reason to update, but since AMD doesn't seem to support it anymore, I could look into another OpenCL library.

AVX512 is a bit harder to use if you want to get the full benefit.

For perl, it is just a command line tool I used to generate a header file from a .cl file. Nothing more than that. In theory it could be converted to a .sh or .bat script.

[URL="http://harvey563.tripod.com"]This search [/URL] uses gcwsieve for Generatlized Woodalls.

[URL="http://guenter.loeh.name/gc/status.html"]This search [/URL] uses gcwsieve for Generatlized Cullens.

If you are thinking of an enhancement to gcwsieve, I suggest that you post in the other thread and include the math.

rogue 2020-05-26 13:48

[QUOTE=rogue;546483]For the SDK, I have used AMD SDK for years and never had a reason to update, but since AMD doesn't seem to support it anymore, I could look into another OpenCL library.

AVX512 is a bit harder to use if you want to get the full benefit.

For perl, it is just a command line tool I used to generate a header file from a .cl file. Nothing more than that. In theory it could be converted to a .sh or .bat script.

[URL="http://harvey563.tripod.com"]This search [/URL] uses gcwsieve for Generatlized Woodalls.

[URL="http://guenter.loeh.name/gc/status.html"]This search [/URL] uses gcwsieve for Generatlized Cullens.

If you are thinking of an enhancement to gcwsieve, I suggest that you post in the other thread and include the math.[/QUOTE]

To be clear, the framework only has code for AVX2, not AVX512. I don't have a CPU that supports AVX512, so I cannot write or test code for it.

Citrix 2020-05-26 21:14

[QUOTE=rogue;546483]

AVX512 is a bit harder to use if you want to get the full benefit.

For perl, it is just a command line tool I used to generate a header file from a .cl file. Nothing more than that. In theory it could be converted to a .sh or .bat script.

If you are thinking of an enhancement to gcwsieve, I suggest that you post in the other thread and include the math.[/QUOTE]

I was able to modify the AVX - substantially faster. Getting 1.2Mp/sec on 4 cores.
Though limited to 2^52.

[code]

Is there a faster way of doing this

avx_set_16a(tempinvs);
avx_set_16b(powinvs);
avx_mulmod(dps, reciprocals);
avx_get_16a(tempinvs);

avx_set_16a(tempinvs);
avx_set_16b(multinvs);
avx_mulmod(dps, reciprocals);
avx_get_16a(tempinvs);

If I eliminate the first get step and the second set step the program misses factors.
Are you able to write some code to calculate n/2 (mod p) for a double and 64 bit integers. Currently I am having to use mulmod which is extremely slow.

[/code]

For GPU - modifying the code should not take too long. Though will need to sieve deep enough with CPU first as program is finding too many factors. Might not be worth changing the GPU code as might have sieved deep enough with CPU anyway. How many factors can the GPU handle and when to switch over?

I will post gcwsieve code/algorithm in other thread.

rogue 2020-05-26 22:45

I am impressed with how quickly you have picked up on the framework. It is one of the reasons why I wrote the framework in the first place. The idea is that it should be easily accessible to anyone with some basic knowledge of C and C++ and the math they need for the Worker class.

[QUOTE=Citrix;546534]I was able to modify the AVX - substantially faster. Getting 1.2Mp/sec on 4 cores.
Though limited to 2^52.

Is there a faster way of doing this:

[code]
avx_set_16a(tempinvs);
avx_set_16b(powinvs);
avx_mulmod(dps, reciprocals);
[COLOR="Red"]avx_get_16a(tempinvs);

avx_set_16a(tempinvs);[/COLOR]
avx_set_16b(multinvs);
avx_mulmod(dps, reciprocals);
avx_get_16a(tempinvs);
[/code]

If I eliminate the first get step and the second set step the program misses factors.[/QUOTE]

That it misses factors is very odd. Does it miss the same factors consistently when the lines in red are removed? The geta() and seta() functions access the same set of xmm registers. If this can be reproduced easily, then it should be debugged.

[QUOTE]
Are you able to write some code to calculate n/2 (mod p) for a double and 64 bit integers. Currently I am having to use mulmod which is extremely slow.

For GPU - modifying the code should not take too long. Though will need to sieve deep enough with CPU first as program is finding too many factors. Might not be worth changing the GPU code as might have sieved deep enough with CPU anyway. How many factors can the GPU handle and when to switch over?

I will post gcwsieve code/algorithm in other thread.[/QUOTE]

Please explain what you mean by "64 bit integers"? The FPU routines are limited to 62 bits. The SSE and AVX routines are limited to 52 bits. If you are referring to pure 64-bit and the CPU, I do not have mulmod or powmod routines for it. The GPU can handle 64-bit mulmods.

If the GPU is returning too many factors and you are concerned about overflowing a buffer, then you can call SetMinGpuPrime() from the App class. This will tell the framework to not use a GPU worker until it reaches the value passed to that method. This might require some experimentation on your part regarding that limit and the size of the factor buffer that the GPU will support.

Citrix 2020-05-26 23:13

[QUOTE=rogue;546544]I am impressed with how quickly you have picked up on the framework. It is one of the reasons why I wrote the framework in the first place. The idea is that it should be easily accessible to anyone with some basic knowledge of C and C++ and the math they need for the Worker class.



That it misses factors is very odd. Does it miss the same factors consistently when the lines in red are removed? The geta() and seta() functions access the same set of xmm registers. If this can be reproduced easily, then it should be debugged.



Please explain what you mean by "64 bit integers"? The FPU routines are limited to 62 bits. The SSE and AVX routines are limited to 52 bits. If you are referring to pure 64-bit and the CPU, I do not have mulmod or powmod routines for it. The GPU can handle 64-bit mulmods.

If the GPU is returning too many factors and you are concerned about overflowing a buffer, then you can call SetMinGpuPrime() from the App class. This will tell the framework to not use a GPU worker until it reaches the value passed to that method. This might require some experimentation on your part regarding that limit and the size of the factor buffer that the GPU will support.[/QUOTE]

I will see if I can post an example in which factors are missed.

[CODE]
void TestPrimesAVX(void)
{
double __attribute__((aligned(32))) powinvs[AVX_ARRAY_SIZE];

double __attribute__((aligned(32))) tempinvs[AVX_ARRAY_SIZE];

double __attribute__((aligned(32))) dps[AVX_ARRAY_SIZE];

// CODE MISSING HERE
for (int i = 0; i < AVX_ARRAY_SIZE; i++)
{
// This code is really slow.
// Faster to use mulmod
// Any other tricks? Can we use bitshift etc.
if (((uint64_t)tempinvs[i]) % 2 == 1) { tempinvs[i] = tempinvs[i] + dps[i]; }
tempinvs[i] = tempinvs[i] / 2;
if (((uint64_t)powinvs[i]) % 2 == 1) { powinvs[i] = powinvs[i] + dps[i]; }
powinvs[i] = powinvs[i] / 2;
if (((uint64_t)powinvs[i]) % 2 == 1) { powinvs[i] = powinvs[i] + dps[i]; }
powinvs[i] = powinvs[i] / 2;
}
}


[/CODE]

I need to do the above multiple times. For the doubles in AVX can we do modular arithmetic or any bit operations. The above code is very slow and slower than using mulmod. By 64 bit integers I mean uint64_t type used in the FPU code.

Anything you can help with?

rogue 2020-05-27 01:28

[QUOTE=Citrix;546547]I will see if I can post an example in which factors are missed.

[CODE]
void TestPrimesAVX(void)
{
double __attribute__((aligned(32))) powinvs[AVX_ARRAY_SIZE];

double __attribute__((aligned(32))) tempinvs[AVX_ARRAY_SIZE];

double __attribute__((aligned(32))) dps[AVX_ARRAY_SIZE];

// CODE MISSING HERE
for (int i = 0; i < AVX_ARRAY_SIZE; i++)
{
// This code is really slow.
// Faster to use mulmod
// Any other tricks? Can we use bitshift etc.
if (((uint64_t)tempinvs[i]) % 2 == 1) { tempinvs[i] = tempinvs[i] + dps[i]; }
tempinvs[i] = tempinvs[i] / 2;
if (((uint64_t)powinvs[i]) % 2 == 1) { powinvs[i] = powinvs[i] + dps[i]; }
powinvs[i] = powinvs[i] / 2;
if (((uint64_t)powinvs[i]) % 2 == 1) { powinvs[i] = powinvs[i] + dps[i]; }
powinvs[i] = powinvs[i] / 2;
}
}
[/CODE]

I need to do the above multiple times. For the doubles in AVX can we do modular arithmetic or any bit operations. The above code is very slow and slower than using mulmod. By 64 bit integers I mean uint64_t type used in the FPU code.

Anything you can help with?[/QUOTE]

I don't know how to do bit operations with floating point values. What is the specific math you are trying to accomplish? Maybe there is a different way to get the desired result.

Citrix 2020-05-27 03:37

[QUOTE=rogue;546556]I don't know how to do bit operations with floating point values. What is the specific math you are trying to accomplish? Maybe there is a different way to get the desired result.[/QUOTE]

Just multiplying the (Double) floating point number with 1/2 (mod p).

I looked into the code further. I was wrong before on get and set giving the error. This portion of the code gives the error. You can try it yourself.

[CODE]

avx_set_16a(powinvs);
avx_set_16b(multinvs2);
avx_mulmod(dps, reciprocals);
avx_get_16a(powinvs);

The above works alright. Multinvs2 is 1/4 (mod p)

avx_set_16a(powinvs);
avx_set_16b(multinvs);
avx_mulmod(dps, reciprocals);
avx_mulmod(dps, reciprocals);
avx_get_16a(powinvs);

The above does not give right answer. Multinvs is 1/2 (mod p)

They should be the same.

The following does work correctly

avx_set_16a(powinvs);
avx_set_16b(multinvs);
avx_mulmod(dps, reciprocals);
avx_get_16a(powinvs);

avx_set_16a(powinvs);
avx_set_16b(multinvs);
avx_mulmod(dps, reciprocals);
avx_get_16a(powinvs);
[/CODE]

rogue 2020-05-27 12:26

ave_mulmod modifies the contents ymm4-ymm7, thus you cannot call it two times in a row and expect the result to be a*b*b mod p. You would have to call ave_set_16b or avx_set_1b after the first avx_mulmod before calling avx_mulmod again.

Citrix 2020-05-29 02:36

I was finally able to modify the GPU code. I had to do the Perl portion manually. The script did not work for me. It goes into an infinite while loop. The code did compile.

Though I cannot get the code to run. I have tried the original gcwsievecl.exe from mtsieve and that does not work either. afsievecl.exe does not work either. ppsieve (open cl) etc works fine.

Any thoughts on how to fix this.

Thanks.

rogue 2020-05-29 10:35

[QUOTE=Citrix;546721]I was finally able to modify the GPU code. I had to do the Perl portion manually. The script did not work for me. It goes into an infinite while loop. The code did compile.

Though I cannot get the code to run. I have tried the original gcwsievecl.exe from mtsieve and that does not work either. afsievecl.exe does not work either. ppsieve (open cl) etc works fine.

Any thoughts on how to fix this.[/QUOTE]

Hmm. Are you getting an error at runtime with gcwsievecl? If so, what error are you getting?

In the meantime, I'll do some tests to see if it is working for me. Maybe I broke something with a more recent change.

Citrix 2020-05-29 23:10

[QUOTE=rogue;546730]Hmm. Are you getting an error at runtime with gcwsievecl? If so, what error are you getting?

In the meantime, I'll do some tests to see if it is working for me. Maybe I broke something with a more recent change.[/QUOTE]


No message, It does crash before the start banner is printed. Possibly I am not using the input line correctly.

I am using :- Should I be using something else? Both programs crash for me.

[CODE]

gcwsievecl.exe -p 3770000000000 -P 4000000000000 -b 2 -n 825 -N 1000 -s +
afsievecl.exe -n 825 -N 1000

[/CODE]


Even using "any*cl.exe -h" will crash and not print the help options.

Citrix 2020-05-30 01:19

Looking at the code more closely -

In the make file for linking the *cl files the $(GPUCPPFLAGS) and $(*_GPU_OBJS) is missing so the compiler does not even build the GPU.o files.

I now have
[CODE]

gcwsievecl: $(GPU_CORE_OBJS) $(PRIMESIEVE_OBJS) $(ASM_OBJS) $(GCW_OBJS) $(GCW_GPU_OBJS)
$(CC) $(CPPFLAGS) $(LDFLAGS) -o $@ $^ $(GPUCPPFLAGS) $(GPULDFLAGS) $(EXTRALDFLAGS)

[/CODE]

In ip_CullenWoodallApp->GetDevice() ; there is no function defined as GetDevice.
Maybe an object of device type needs to be created under CullenWoodallGpuWorker.

Then use function *GetDeviceIdPtr or GetDeviceId (in device.h)

Are you able to correct the code?

rogue 2020-05-30 12:51

I really messed up the makefile for GPU builds. You need this line:

GCW_GPU_OBJS=cullen_woodall/CullenWoodallApp_gpu.o cullen_woodall/CullenWoodallWorker.o cullen_woodall/CullenWoodallGpuWorker_gpu.o

and this line:

gcwsievecl: $(GPU_CORE_OBJS) $(PRIMESIEVE_OBJS) $(ASM_OBJS) $(GCW_GPU_OBJS)
$(CC) $(CPPFLAGS) $(LDFLAGS) -o $@ $^ $(GPULDFLAGS) $(EXTRALDFLAGS)

to get a clean build. I haven't tested it yet, but I know that I have to fix the other OpenCL exes.

Thanks for the find.

BTW, I just committed an updated makefile that should fix all OpenCL exes.

Citrix 2020-05-30 15:15

It did not work for me. :confused2:

rogue 2020-05-30 15:16

[QUOTE=Citrix;546811]It did not work for me. :confused2:[/QUOTE]

Did not compile or failed when it ran?

Citrix 2020-05-30 16:38

[QUOTE=rogue;546812]Did not compile or failed when it ran?[/QUOTE]

Did not compile - "too many paths"

rogue 2020-05-30 16:51

I made another change to the makefile which might address the issue. Both gcwsieve and gcwsievecl run on Windows, but I haven't tried any GPU workers. It builds, but fails on OS X, for an unknown reason that I have to look into.

Citrix 2020-05-30 16:57

[QUOTE=rogue;546821]I made another change to the makefile which might address the issue. Both gcwsieve and gcwsievecl run on Windows, but I haven't tried any GPU workers. It builds, but fails on OS X, for an unknown reason that I have to look into.[/QUOTE]

Where do you get the new makefile from?

rogue 2020-05-30 17:32

[QUOTE=Citrix;546822]Where do you get the new makefile from?[/QUOTE]

I had committed to svn.

Citrix 2020-05-30 17:54

[QUOTE=rogue;546823]I had committed to svn.[/QUOTE]

You need to add gcwsievecl to

GPU_PROGS=afsievecl mfsievecl gfndsievecl pixsievecl xyyxsievecl

Compiles for me and at least I get
"gcwsievecl.exe -p 3770000000000 -P 4000000000000 -b 2 -n 825 -N 1000 -s +
gcwsieve v1.2, a program to find factors numbers of the form n*b^n+1 and n*b^n-1
Sieve started: 377e10 < p < 4e12 with 0 terms (825 <= n <= 1000, n*2^n+1) (expecting 0 factors)"

Then it crashes.

rogue 2020-05-30 19:50

[QUOTE=Citrix;546825]You need to add gcwsievecl to

GPU_PROGS=afsievecl mfsievecl gfndsievecl pixsievecl xyyxsievecl

Compiles for me and at least I get
"gcwsievecl.exe -p 3770000000000 -P 4000000000000 -b 2 -n 825 -N 1000 -s +
gcwsieve v1.2, a program to find factors numbers of the form n*b^n+1 and n*b^n-1
Sieve started: 377e10 < p < 4e12 with 0 terms (825 <= n <= 1000, n*2^n+1) (expecting 0 factors)"

Then it crashes.[/QUOTE]

Hmm. Doesn't crash for me. Did you do a "make clean" before "make gcwsievecl"?

But I think I introduced another bug somewhere else as it was hanging on me.

Citrix 2020-05-30 20:07

[QUOTE=rogue;546828]Hmm. Doesn't crash for me. Did you do a "make clean" before "make gcwsievecl"?

But I think I introduced another bug somewhere else as it was hanging on me.[/QUOTE]

Clean build. No luck. still crashes.
It does not work with the original cw_kernel.cl file either.
I am on Windows 10 if that makes a difference.

rogue 2020-05-30 20:13

I found and fixed two issues in the CullenWoodallWorker class. It no longer hangs and it runs cleanly on OS X. One was caused by a change in the framework. The other by indexing beyond the bounds of an array. That latter triggers a crash on OS X, but behaves unpredictably on Windows.

rogue 2020-06-01 16:10

I posted 2.0.1. This fixes gcwsieve and adds k1b2sieve which sieves 2*n+c for a range of n and c.

pepi37 2020-06-02 08:12

[QUOTE=rogue;546942]I posted 2.0.1. This fixes gcwsieve and adds k1b2sieve which sieves 2*n+c for a range of n and c.[/QUOTE]
Link?

rogue 2020-06-02 12:49

[QUOTE=pepi37;546997]Link?[/QUOTE]

[url]https://sourceforge.net/projects/mtsieve/[/url], but there are bugs in that sieve that I have to fix. I will hopefully post an update later today.

pepi37 2020-06-02 19:57

One suggestion :using twinsieve on big range can easy consume 4, 8 or more GB of RAM: so I suggest that you add quick calculation at start that will show user how many RAM twinsieve will allocate.If user agree with prediction: then calculation is continuing.
I ran few times twinsieve and got out of memory. Newpgen solve this program as suggested above.

rogue 2020-06-02 20:47

[QUOTE=pepi37;547038]One suggestion :using twinsieve on big range can easy consume 4, 8 or more GB of RAM: so I suggest that you add quick calculation at start that will show user how many RAM twinsieve will allocate.If user agree with prediction: then calculation is continuing.
I ran few times twinsieve and got out of memory. Newpgen solve this program as suggested above.[/QUOTE]

How large a range are you sieving? Is this on Windows? How many threads are you running with?

pepi37 2020-06-02 21:08

[QUOTE=rogue;547040]How large a range are you sieving? Is this on Windows? How many threads are you running with?[/QUOTE]


I run it on hexacore CPU ,Win10

range was from 113853849125 to 213853849125 base 2

rogue 2020-06-02 22:06

[QUOTE=pepi37;547042]I run it on hexacore CPU ,Win10

range was from 113853849125 to 213853849125 base 2[/QUOTE]

It takes up that much memory because you have 2e11 terms.

NewPGen only warns you because it is a 32-bit app and is limited on how much memory it can use. I don't see a reason for such a message in any of my sieves. They are all 64-bit so it is really an issue of how much memory you have available as opposed to how much memory the software can use.

pepi37 2020-06-02 22:16

But reason is to warn user, twinsieve will use 12GB of ram and you have 8....(example)

Citrix 2020-06-04 01:26

[QUOTE=rogue;546830]I found and fixed two issues in the CullenWoodallWorker class. It no longer hangs and it runs cleanly on OS X. One was caused by a change in the framework. The other by indexing beyond the bounds of an array. That latter triggers a crash on OS X, but behaves unpredictably on Windows.[/QUOTE]

I was able to give this a try by replacing the CullenWoodallWorker class. No improvement. Still crashes.

In the latest build the gcwsievecl does work on my computer.

Would this have to do with opencl lib used. I am not using the AMD tool kit.

Any thoughts?

BTW there is an undeclared function in Cullenwoodallapp.cpp. Possibly a typo.

rogue 2020-06-04 03:09

[QUOTE=Citrix;547112]I was able to give this a try by replacing the CullenWoodallWorker class. No improvement. Still crashes.

In the latest build the gcwsievecl does work on my computer.

Would this have to do with opencl lib used. I am not using the AMD tool kit.

Any thoughts?

BTW there is an undeclared function in Cullenwoodallapp.cpp. Possibly a typo.[/QUOTE]

Hmm. I will have to run some more tests then. Is this the same error you were seeing before? What command line parameters are you using?

Citrix 2020-06-04 03:15

[QUOTE=rogue;547119]Hmm. I will have to run some more tests then. Is this the same error you were seeing before? What command line parameters are you using?[/QUOTE]

[CODE]

gcwsievecl.exe -p 3770000000000 -P 4000000000000 -b 2 -n 825 -N 1000 -s +

[/CODE]

Same error. Crashes after printing banner. Though the gcwsievecl.exe from latest release does work as I mentioned before.

I believe it has something to do with not having proper libraries at the time of compile etc. I do get the following warning. Not sure if it makes a difference.

[CODE]
In file included from cullen_woodall/../core/../opencl/../CL/cl.h:22,
from cullen_woodall/../core/../opencl/Device.h:22,
from cullen_woodall/../core/App.h:26,
from cullen_woodall/../core/FactorApp.h:14,
from cullen_woodall/../core/AlgebraicFactorApp.h:14,
from cullen_woodall/CullenWoodallApp.h:16,
from cullen_woodall/CullenWoodallWorker.h:11,
from cullen_woodall/CullenWoodallWorker.cpp:12:
cullen_woodall/../core/../opencl/../CL/../CL/cl_version.h:22:104: note: #pragma message: cl_version.h: CL_TARGET_OPENCL_VERSION is not defined. Defaulting to 220 (OpenCL 2.2)
#pragma message("cl_version.h: CL_TARGET_OPENCL_VERSION is not defined. Defaulting to 220 (OpenCL 2.2)")

[/CODE]

rogue 2020-06-04 13:22

[QUOTE=Citrix;547120][CODE]

gcwsievecl.exe -p 3770000000000 -P 4000000000000 -b 2 -n 825 -N 1000 -s +

[/CODE]

Same error. Crashes after printing banner. Though the gcwsievecl.exe from latest release does work as I mentioned before.

I believe it has something to do with not having proper libraries at the time of compile etc. I do get the following warning. Not sure if it makes a difference.

[CODE]
In file included from cullen_woodall/../core/../opencl/../CL/cl.h:22,
from cullen_woodall/../core/../opencl/Device.h:22,
from cullen_woodall/../core/App.h:26,
from cullen_woodall/../core/FactorApp.h:14,
from cullen_woodall/../core/AlgebraicFactorApp.h:14,
from cullen_woodall/CullenWoodallApp.h:16,
from cullen_woodall/CullenWoodallWorker.h:11,
from cullen_woodall/CullenWoodallWorker.cpp:12:
cullen_woodall/../core/../opencl/../CL/../CL/cl_version.h:22:104: note: #pragma message: cl_version.h: CL_TARGET_OPENCL_VERSION is not defined. Defaulting to 220 (OpenCL 2.2)
#pragma message("cl_version.h: CL_TARGET_OPENCL_VERSION is not defined. Defaulting to 220 (OpenCL 2.2)")

[/CODE][/QUOTE]

Where did you d/l the OpenCL libraries that you are using? It doesn't crash for me on Windows or OS X.

BTW, what is the undeclared function that you were referring to?

Citrix 2020-06-05 02:44

[QUOTE=rogue;547150]Where did you d/l the OpenCL libraries that you are using? It doesn't crash for me on Windows or OS X.

BTW, what is the undeclared function that you were referring to?[/QUOTE]

[url]https://github.com/GPUOpen-LibrariesAndSDKs/OCL-SDK/releases[/url] & [url]https://github.com/KhronosGroup/OpenCL-Headers[/url]

I get this error with the latest release

[code]

cullen_woodall/CullenWoodallApp.cpp: In member function 'virtual void CullenWoodallApp::ValidateOptions()':
cullen_woodall/CullenWoodallApp.cpp:191:4: error: 'SetMaxPrimeForSingleWorker' was not declared in this scope
SetMaxPrimeForSingleWorker(pForSingleWorker);
^~~~~~~~~~~~~~~~~~~~~~~~~~
cullen_woodall/CullenWoodallApp.cpp:191:4: note: suggested alternative: 'pForSingleWorker'
SetMaxPrimeForSingleWorker(pForSingleWorker);
^~~~~~~~~~~~~~~~~~~~~~~~~~
pForSingleWorker
mingw32-make: *** [makefile:117: cullen_woodall/CullenWoodallApp.o] Error 1

[/code]

rogue 2020-06-05 12:21

[QUOTE=Citrix;547198][url]https://github.com/GPUOpen-LibrariesAndSDKs/OCL-SDK/releases[/url] & [url]https://github.com/KhronosGroup/OpenCL-Headers[/url]

I get this error with the latest release

[code]

cullen_woodall/CullenWoodallApp.cpp: In member function 'virtual void CullenWoodallApp::ValidateOptions()':
cullen_woodall/CullenWoodallApp.cpp:191:4: error: 'SetMaxPrimeForSingleWorker' was not declared in this scope
SetMaxPrimeForSingleWorker(pForSingleWorker);
^~~~~~~~~~~~~~~~~~~~~~~~~~
cullen_woodall/CullenWoodallApp.cpp:191:4: note: suggested alternative: 'pForSingleWorker'
SetMaxPrimeForSingleWorker(pForSingleWorker);
^~~~~~~~~~~~~~~~~~~~~~~~~~
pForSingleWorker
mingw32-make: *** [makefile:117: cullen_woodall/CullenWoodallApp.o] Error 1

[/code][/QUOTE]

Hmm. Which compiler are you using? Is it the current version of that compiler? That is a protected method in App.h, so a child class should be able to call it. What if you change App.h to make it public?

The first link you provided only has OpenCL headers. What OpenCL libraries are you linking against? Can you compile and link with the headers then it fails at runtime? If so, then I suspect the libraries to be an issue. If you cannot compile or link, it could be an issue with the code.

Citrix 2020-06-06 05:42

[QUOTE=rogue;547211]Hmm. Which compiler are you using? Is it the current version of that compiler? That is a protected method in App.h, so a child class should be able to call it. What if you change App.h to make it public?

The first link you provided only has OpenCL headers. What OpenCL libraries are you linking against? Can you compile and link with the headers then it fails at runtime? If so, then I suspect the libraries to be an issue. If you cannot compile or link, it could be an issue with the code.[/QUOTE]

I am using MinGW

The first opencl link has both .lib and header files
I cannot find AMD SDK online. The one I could find was for openGL.
The code compiles fine but crashes on runtime. All cl apps crash for me (eg afsieve etc - so it has more to do with the header/lib than the code)

Any other SDK you can recommend?

rogue 2020-06-06 11:25

Okay. I'll try compiling and linking against that and see if I can reproduce.

I did find the AMD SDK here: [url]https://www.softpedia.com/get/Programming/SDK-DDK/ATI-Stream-SDK.shtml[/url].

pepi37 2020-06-06 12:54

I found bug in latest 2..0.1 package ( twinsieve)


Twinsieve ignore start sieving position in command, but uses header in sieve file.
Previous version works ok

rogue 2020-06-06 14:19

[QUOTE=pepi37;547279]I found bug in latest 2..0.1 package ( twinsieve)


Twinsieve ignore start sieving position in command, but uses header in sieve file.
Previous version works ok[/QUOTE]

Thanks for the bug report. I'll take a look. It is possible that this is affecting all sieves.

Citrix 2020-06-06 14:19

[QUOTE=rogue;547277]Okay. I'll try compiling and linking against that and see if I can reproduce.

I did find the AMD SDK here: [url]https://www.softpedia.com/get/Programming/SDK-DDK/ATI-Stream-SDK.shtml[/url].[/QUOTE]

The windows version only has openGL. I do not see an openCL.lib. I tried this yesterday.

I also tried using the headers from the Khronos group (2nd link) and using opencl.dll driver provided by AMD with no luck.

rogue 2020-06-06 14:21

[QUOTE=Citrix;547286]The windows version only has openGL. I do not see an openCL.lib. I tried this yesterday.

I also tried using the headers from the Khronos group (2nd link) and using opencl.dll driver provided by AMD with no luck.[/QUOTE]

You are correct. Although that is the same version that I installed and build against (supposedly), that installer does not install OpenCL.lib.

Citrix 2020-06-07 03:58

[QUOTE=rogue;547287]You are correct. Although that is the same version that I installed and build against (supposedly), that installer does not install OpenCL.lib.[/QUOTE]

The AMD SDK does have opencl in program files folder even though it does not say so. It still did not work.

There is an issue with the compiler
[url]https://community.amd.com/thread/138890[/url]

The proposed above solution did not work for me.

What compiler are you using?

rogue 2020-06-07 12:57

[QUOTE=Citrix;547339]The AMD SDK does have opencl in program files folder even though it does not say so. It still did not work.

There is an issue with the compiler
[url]https://community.amd.com/thread/138890[/url]

The proposed above solution did not work for me.

What compiler are you using?[/QUOTE]

I am using mingw64 version 8.1. I will have to take a look.

Dylan14 2020-06-10 20:10

Suggestion for twinsieve: be able to specify a minimum and maximum n value to sieve. This would be useful for the search for the first twin in a given n range (see [URL="https://mersenneforum.org/showthread.php?t=8479"]this thread[/URL]).

rebirther 2020-06-12 13:06

srsieve2 stopped with


p=973083703, 182.1 p/sec, 3621751 factors found at 1.24 sec per factor, 97.3% done. ETC 2020-06-12 09:44
[B]2 workers didn't stop after 10 minutes[/B]

I hope this is not an issue and correct?


was running with -W16 command

rogue 2020-06-12 15:21

[QUOTE=rebirther;547785]srsieve2 stopped with

p=973083703, 182.1 p/sec, 3621751 factors found at 1.24 sec per factor, 97.3% done. ETC 2020-06-12 09:44
[B]2 workers didn't stop after 10 minutes[/B]

I hope this is not an issue and correct?

was running with -W16 command[/QUOTE]

Which version (build date) and which OS?

What command line options did you use?

rebirther 2020-06-12 15:54

[QUOTE=rogue;547801]Which version (build date) and which OS?

What command line options did you use?[/QUOTE]


srsieve2 from 16.01.2020 on win10 pro
commandline -->srsieve2 -n2501 -N10000 -P1e9 -W16 -spl_remain.txt -fB

rogue 2020-06-12 16:19

[QUOTE=rebirther;547805]srsieve2 from 16.01.2020 on win10 pro
commandline -->srsieve2 -n2501 -N10000 -P1e9 -W16 -spl_remain.txt -fB[/QUOTE]

That is very likely fixed with the next build.

rebirther 2020-06-12 16:42

[QUOTE=rogue;547808]That is very likely fixed with the next build.[/QUOTE]


Is it already fixed in the latest build or I need to wait? Can I use the result, it stopped at 674506999 ?

rogue 2020-06-12 17:00

[QUOTE=rebirther;547810]Is it already fixed in the latest build or I need to wait? Can I use the result, it stopped at 674506999 ?[/QUOTE]

Yes, you can use the result.

I posted 2.0.2 over at sourceforge. Let me know if that doesn't solve the problem.

rebirther 2020-06-12 17:04

[QUOTE=rogue;547811]Yes, you can use the result.

I posted 2.0.2 over at sourceforge. Let me know if that doesn't solve the problem.[/QUOTE]


The file is not available in the package.

rogue 2020-06-12 18:28

[QUOTE=rebirther;547812]The file is not available in the package.[/QUOTE]

Sorry. I missed some of the exe in the .7z file. Please take another look.

pepi37 2020-06-12 19:23

1 Attachment(s)
some error while compiling under linux


And second , you didnot fix problem with start value


./twinsieve -p3500000000000000 -P12000000000000000 -W6 -w10000000 -iBASE7.txt -oBASE7.txt -s -O factors.txt -command


2020-06-12 21:38:02: Sieve started: 270474380449657 < p < 12e15 with 25400 terms (250000 < k < 999958, k*7^777777) (expecting 2602 factors)

rogue 2020-06-12 19:41

[QUOTE=pepi37;547826]some error while compaling under linux[/QUOTE]

Those are warnings, not errors. Shouldn't be an issue.

pepi37 2020-06-12 19:46

[QUOTE=rogue;547829]Those are warnings, not errors. Shouldn't be an issue.[/QUOTE]


Sorry in that case , please fix start p value

kruoli 2020-06-12 20:33

Nice, thanks! :)

rogue 2020-06-13 02:18

[QUOTE=pepi37;547830]Sorry in that case , please fix start p value[/QUOTE]

That should have been fixed in this build.

pepi37 2020-06-13 08:06

[QUOTE=rogue;547862]That should have been fixed in this build.[/QUOTE]

But as you can see it is not

rogue 2020-06-13 13:19

[QUOTE=pepi37;547867]But as you can see it is not[/QUOTE]

As far as I am concerned it works as it is supposed to:

[code]
twinsieve -b10 -k1000 -K20000 -n5000 -P1e5
twinsieve v1.2, a program to find factors of k*b^n+1/-1 numbers for fixed b and n and variable k
Sieve started: 1 < p < 1e5 with 19001 terms (1000 < k < 20000, k*10^5000) (expecting 17857 factors)
Sieve completed at p=[COLOR="red"]100003[/COLOR].
Processor time: 0.02 sec. (0.02 sieving) (0.10 cores)
204 terms written to k_b10_n5000.pfgw
Primes tested: 9594. Factors found: 18797. Remaining terms: 204. Time: 0.16 seconds.


twinsieve -[COLOR="red"]p2e5 [/COLOR]-i k_b10_n5000.pfgw
twinsieve v1.2, a program to find factors of k*b^n+1/-1 numbers for fixed b and n and variable k
Sieve started: [COLOR="red"]2e5 [/COLOR]< p < 2^62 with 204 terms (1161 < k < 19824, k*10^5000)

CTRL-C accepted. Please wait for threads to complete.
Sieve interrupted at p=[COLOR="red"]1065806411[/COLOR].
Processor time: 3.92 sec. (0.44 sieving) (0.73 cores)
63 terms written to k_b10_n5000.pfgw
Primes tested: 54000000. Factors found: 141. Remaining terms: 63. Time: 5.34 seconds.


twinsieve -[COLOR="red"]p2e5 [/COLOR]-i k_b10_n5000.pfgw
twinsieve v1.2, a program to find factors of k*b^n+1/-1 numbers for fixed b and n and variable k
Sieve started: [COLOR="red"]2e5 [/COLOR]< p < 2^62 with 63 terms (1392 < k < 19446, k*10^5000)

CTRL-C accepted. Please wait for threads to complete.
Sieve interrupted at p=[COLOR="red"]553465999[/COLOR].
Processor time: 2.05 sec. (0.19 sieving) (0.71 cores)
63 terms written to k_b10_n5000.pfgw
Primes tested: 29000000. Factors found: 0. Remaining terms: 63. Time: 2.88 seconds.


twinsieve -i k_b10_n5000.pfgw
twinsieve v1.2, a program to find factors of k*b^n+1/-1 numbers for fixed b and n and variable k
Sieve started: [COLOR="red"]553465999 [/COLOR]< p < 2^62 with 63 terms (1392 < k < 19446, k*10^5000)

CTRL-C accepted. Please wait for threads to complete.
Sieve interrupted at p=[COLOR="Red"]1485048041[/COLOR].
Processor time: 3.34 sec. (0.48 sieving) (0.75 cores)
62 terms written to k_b10_n5000.pfgw
Primes tested: 45000000. Factors found: 1. Remaining terms: 62. Time: 4.44 seconds.
[/code]

pepi37 2020-06-13 17:06

[QUOTE=rogue;547876]As far as I am concerned it works as it is supposed to:

[code]
twinsieve -b10 -k1000 -K20000 -n5000 -P1e5
twinsieve v1.2, a program to find factors of k*b^n+1/-1 numbers for fixed b and n and variable k
Sieve started: 1 < p < 1e5 with 19001 terms (1000 < k < 20000, k*10^5000) (expecting 17857 factors)
Sieve completed at p=[COLOR=red]100003[/COLOR].
Processor time: 0.02 sec. (0.02 sieving) (0.10 cores)
204 terms written to k_b10_n5000.pfgw
Primes tested: 9594. Factors found: 18797. Remaining terms: 204. Time: 0.16 seconds.


twinsieve -[COLOR=red]p2e5 [/COLOR]-i k_b10_n5000.pfgw
twinsieve v1.2, a program to find factors of k*b^n+1/-1 numbers for fixed b and n and variable k
Sieve started: [COLOR=red]2e5 [/COLOR]< p < 2^62 with 204 terms (1161 < k < 19824, k*10^5000)

CTRL-C accepted. Please wait for threads to complete.
Sieve interrupted at p=[COLOR=red]1065806411[/COLOR].
Processor time: 3.92 sec. (0.44 sieving) (0.73 cores)
63 terms written to k_b10_n5000.pfgw
Primes tested: 54000000. Factors found: 141. Remaining terms: 63. Time: 5.34 seconds.


twinsieve -[COLOR=red]p2e5 [/COLOR]-i k_b10_n5000.pfgw
twinsieve v1.2, a program to find factors of k*b^n+1/-1 numbers for fixed b and n and variable k
Sieve started: [COLOR=red]2e5 [/COLOR]< p < 2^62 with 63 terms (1392 < k < 19446, k*10^5000)

CTRL-C accepted. Please wait for threads to complete.
Sieve interrupted at p=[COLOR=red]553465999[/COLOR].
Processor time: 2.05 sec. (0.19 sieving) (0.71 cores)
63 terms written to k_b10_n5000.pfgw
Primes tested: 29000000. Factors found: 0. Remaining terms: 63. Time: 2.88 seconds.


twinsieve -i k_b10_n5000.pfgw
twinsieve v1.2, a program to find factors of k*b^n+1/-1 numbers for fixed b and n and variable k
Sieve started: [COLOR=red]553465999 [/COLOR]< p < 2^62 with 63 terms (1392 < k < 19446, k*10^5000)

CTRL-C accepted. Please wait for threads to complete.
Sieve interrupted at p=[COLOR=Red]1485048041[/COLOR].
Processor time: 3.34 sec. (0.48 sieving) (0.75 cores)
62 terms written to k_b10_n5000.pfgw
Primes tested: 45000000. Factors found: 1. Remaining terms: 62. Time: 4.44 seconds.
[/code][/QUOTE]




I am very confused: so it looks like you "kill " -P switch? What if I have 10 computer and every need to start on different position? So I need to adjust start point in sieve files on 9 computes?


[CODE]/twinsieve -p[COLOR=Green]3500000000000000[/COLOR] -P12000000000000000 -W6 -w10000000 -iBASE7.txt -oBASE7.txt -s -O factors.txt -command


2020-06-12 21:38:02: Sieve started: [COLOR=Magenta]270474380449657[/COLOR] < p < 12e15 with 25400 terms (250000 < k < 999958, k*7^777777) (expecting 2602 factors)
[/CODE]


So why sieve dont start at 3500000000000000? It start at start point of sieve... for me it is not fix it is bug

rogue 2020-06-13 17:27

[QUOTE=pepi37;547889]I am very confused: so it looks like you "kill " -P switch? What if I have 10 computer and every need to start on different position? So I need to adjust start point in sieve files on 9 computes?


[CODE]/twinsieve -p[COLOR=Green]3500000000000000[/COLOR] -P12000000000000000 -W6 -w10000000 -iBASE7.txt -oBASE7.txt -s -O factors.txt -command


2020-06-12 21:38:02: Sieve started: [COLOR=Magenta]270474380449657[/COLOR] < p < 12e15 with 25400 terms (250000 < k < 999958, k*7^777777) (expecting 2602 factors)
[/CODE]


So why sieve dont start at 3500000000000000? It start at start point of sieve... for me it is not fix it is bug[/QUOTE]

Is that from the 2.0.2 distribution? Is that my build? I cannot reproduce the error.

What OS is this? Can you send me your BASE7.txt file?

pepi37 2020-06-13 17:41

1 Attachment(s)
[QUOTE=rogue;547890]Is that from the 2.0.2 distribution? Is that my build? I cannot reproduce the error.

What OS is this? Can you send me your BASE7.txt file?[/QUOTE]


That is last SVN I take from your page and build it under Linux
File attached


svn checkout [url]https://svn.code.sf.net/p/mtsieve/svn/[/url] mtsieve-svn r46
I download it and compile it

rogue 2020-06-13 18:54

[QUOTE=pepi37;547892]That is last SVN I take from your page and build it under Linux
File attached


svn checkout [url]https://svn.code.sf.net/p/mtsieve/svn/[/url] mtsieve-svn r46
I download it and compile it[/QUOTE]

When did you get the latest and build? You might not have the current version of App.h and App.cpp. I committed them yesterday and have the changes needed to make -p work correctly.

pepi37 2020-06-13 19:07

Can you send me fixed source ready for compiling?

paulunderwood 2020-06-13 19:15

[QUOTE=pepi37;547897]Can you send me fixed source ready for compiling?[/QUOTE]

Download it from: [url]https://sourceforge.net/projects/mtsieve/[/url]

pepi37 2020-06-13 19:41

[QUOTE=paulunderwood;547898]Download it from: [url]https://sourceforge.net/projects/mtsieve/[/url][/QUOTE]

I do that and select snapshot r46
But that give me twinsieve with this error

paulunderwood 2020-06-13 19:57

[QUOTE=pepi37;547902]I do that and select snapshot r46
But that give me twinsieve with this error[/QUOTE]

Please be more verbose. On the page I linked there is no word "snapshot".

If you mean [url]https://sourceforge.net/p/mtsieve/svn/46/[/url] there are two new files to download: core/App.cpp and core/App.h
[url]https://sourceforge.net/p/mtsieve/svn/HEAD/tree/core/App.cpp[/url]
[url]https://sourceforge.net/p/mtsieve/svn/HEAD/tree/core/App.h[/url]

Maybe you should run the svn command to download all source files.

pepi37 2020-06-13 21:53

[QUOTE=paulunderwood;547903]Please be more verbose. On the page I linked there is no word "snapshot".

Maybe you should run the svn command to download all source files.[/QUOTE]
Thanks , now it works!

rebirther 2020-06-14 05:36

srsieve2 doesnt work anymore, after the last line with Split it seems that the workers not starting and sitting idle.


[CODE]g:\sierp-base817>srsieve2 -n2501 -N10000 -W16 -P1e9 -spl_remain.txt -fB
srsieve2 v1.2.1, a program to find factors of k*b^n+c numbers for fixed b and variable k and n
Sieving with generic logic
Sieve started: 2 < p < 1e9 with 181357500 terms (2501 < n < 10000, k*817^n+c) (expecting 175291495 factors)
Sieving with generic logic
Split 24181 base 817 sequences into 24181 base 817^1 sequences.[/CODE]

rogue 2020-06-14 11:56

[QUOTE=rebirther;547924]srsieve2 doesnt work anymore, after the last line with Split it seems that the workers not starting and sitting idle.


[CODE]g:\sierp-base817>srsieve2 -n2501 -N10000 -W16 -P1e9 -spl_remain.txt -fB
srsieve2 v1.2.1, a program to find factors of k*b^n+c numbers for fixed b and variable k and n
Sieving with generic logic
Sieve started: 2 < p < 1e9 with 181357500 terms (2501 < n < 10000, k*817^n+c) (expecting 175291495 factors)
Sieving with generic logic
Split 24181 base 817 sequences into 24181 base 817^1 sequences.[/CODE][/QUOTE]

I'll look into it.

rogue 2020-06-14 17:19

I fixed this in the latest over at sourceforge. When rebuilding workers, it was no resetting a status.

pepi37 2020-06-18 08:49

Can you build sr1sieve with mtsieve? I would like to have MT option. It has that option for Linux , but not for windows

rogue 2020-06-18 12:42

[QUOTE=pepi37;548354]Can you build sr1sieve with mtsieve? I would like to have MT option. It has that option for Linux , but not for windows[/QUOTE]

Not at this time. Integrating that functionality into mtsieve is a "work in progress". I have only been working on it in small pieces and have a ways to go.

henryzz 2020-06-19 21:56

[QUOTE=pepi37;548354]Can you build sr1sieve with mtsieve? I would like to have MT option. It has that option for Linux , but not for windows[/QUOTE]

If you want multithreaded sr1sieve on windows try wsl.

pepi37 2020-06-19 23:16

[QUOTE=henryzz;548542]If you want multithreaded sr1sieve on windows try wsl.[/QUOTE]
I can always run it on Linux :)

But if was so easy to implement MT in LLR and if it is easy like that to implement in sr1sieve... ;)

rebirther 2020-06-21 05:34

Another issue with the latest srsieve2:


from 14.06.
[CODE]g:\sierp-base913>srsieve2 -n2501 -N10000 -P1e9 -W16 -spl_remain.txt -fB
srsieve2 v1.2.1, a program to find factors of k*b^n+c numbers for fixed b and variable k and n
(p4) Removed 1875 algebraic factors for 324*913^n+1 of the form (2*3^2*913^(n/2)+2*3^1*913^(n/4)+1)
(kp) Sequence has algebraic factorization: 74088*913^n+1 -> (42^3)*913^n+1
(kp) Sequence 74088*913^n+1 has 2500 terms removed due to algebraic factors of the form 42*913^(n/3)+1
(p4) Removed 1875 algebraic factors for 334084*913^n+1 of the form (2*17^2*913^(n/2)+2*17^1*913^(n/4)+1)
Sieving with generic logic
Sieve started: 2 < p < 1e9 with 237646250 terms (2501 < n < 10000, k*913^n+c) (expecting 229697511 factors)
p=135719, 209.3 p/sec, 207211870 factors found at 3.199M f/sec, 0.0% done. ETC 2020-06-26 12:17[/CODE]from 16.01.
[CODE]g:\sierp-base913>srsieve2 -n2501 -N10000 -P1e9 -W16 -spl_remain.txt -fB
srsieve2 v1.2.1, a program to find factors of k*b^n+c numbers for fixed b and variable k and n
(p4) Removed 1875 algebraic factors for 324*913^n+1 of the form (2*3^2*913^(n/2)+2*3^1*913^(n/4)+1)
(kp) Sequence has algebraic factorization: 74088*913^n+1 -> (42^3)*913^n+1
(kp) Sequence 74088*913^n+1 has 2500 terms removed due to algebraic factors of the form 42*913^(n/3)+1
(p4) Removed 1875 algebraic factors for 334084*913^n+1 of the form (2*17^2*913^(n/2)+2*17^1*913^(n/4)+1)
Sieving with generic logic
Sieve started: 2 < p < 1e9 with 237646250 terms (2501 < n < 10000, k*913^n+c) (expecting 229697511 factors)
Sieving with generic logic
Split 31687 base 913 sequences into 31687 base 913^1 sequences.
p=275794661, 4.765K p/sec, 20401086 factors found at 70.73K f/sec, 27.6% done. ETC 2020-06-21 07:32[/CODE]
The split line was missing and only 2 workers of 16 are running, tried several times with the same result.


All times are UTC. The time now is 22:41.

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