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)

chalsall 2022-11-17 23:24

[QUOTE=SethTro;618023]Better test runner script...[/QUOTE]

IMO, this is an excellent example of excellent work.

Test the code nine ways to Sunday before you even begin to trust it. Particularly if it is written by oneself (who, heuristically, is prone to mistakes).

Only human... 8-)

sweety439 2022-11-18 10:13

@rogue:

Why when click "download" in the page [URL="https://sourceforge.net/projects/mtsieve/"]https://sourceforge.net/projects/mtsieve/[/URL], it only has "srsieve2cl.exe"? It seems that we should click [URL="https://sourceforge.net/projects/mtsieve/files/mtsieve_2.3.3.7z/download"]https://sourceforge.net/projects/mtsieve/files/mtsieve_2.3.3.7z/download[/URL] to download the full mtsieve

rogue 2022-11-18 13:15

[QUOTE=sweety439;618045]@rogue:

Why when click "download" in the page [URL="https://sourceforge.net/projects/mtsieve/"]https://sourceforge.net/projects/mtsieve/[/URL], it only has "srsieve2cl.exe"? It seems that we should click [URL="https://sourceforge.net/projects/mtsieve/files/mtsieve_2.3.3.7z/download"]https://sourceforge.net/projects/mtsieve/files/mtsieve_2.3.3.7z/download[/URL] to download the full mtsieve[/QUOTE]

I'm not certain why it does that. After these changes are integrated I will delete any standalone exe files in sourceforge so it should d/l the 7z with all exes.

rogue 2022-11-18 13:17

SethPro, did you output the number of collisions vs inserts in the hash table from those tests? Maybe there are opportunities to sizing the hash table better.

rogue 2022-11-18 18:09

[QUOTE=SethTro;617967]In two quick checks I saw a 10% improvement in the openCL code by making this [URL="https://github.com/sethtroisi/mtsieve/commit/910f749dc6fb2cef14514e712ccf5adf9be33fca"]one line fix[/URL]

[CODE]
for (idx=0; idx<HASH_SIZE; idx++)
- h_table[idx] = 0;
+ h_table[idx] = HASH_ELEMENTS;
[/CODE][/QUOTE]

I have confirmed the 10% improvement in the OpenCL performance. This is due to choosing a better code path when inserting into the hash table. I was sieving over 3600 at a time.

I have not tested the CPU logic changes yet.

rogue 2022-11-22 18:29

I have still not been able to test the CPU changes as I have been busy, but I have uploaded mtsieve 2.3.5 and all executables to sourceforge. Here are the changes:

[code]
framework:
Added code to destuctors to free allocated memory.
Performance updates to HashTable.

srsieve2/srieve2cl: version 1.6.5
Fixed HashTable usage to get up to 10% better performance.
[/code]

SethTro 2022-11-22 19:58

I'm glad these could get integrating.

I wanted to find a few primes in [URL="https://oeis.org/A063679"]a sequence[/URL] and I was so happy to find a full feature sieving tool already existed for my problem. My first attempt was single-threaded and missed factors so it was great to find sr2sieve.

I also appreciate that it's fully open source and I could modify and improve it; as I needed this to hack around the all terms being divisible by 2 for (3^n-7)/2.

If you wanted to add a line somewhere that acknowledged optimization/profiling from Seth Troisi, it would make me feel extra valued for the work I did.

rogue 2022-11-22 23:24

[QUOTE=SethTro;618288]I'm glad these could get integrating.

I wanted to find a few primes in [URL="https://oeis.org/A063679"]a sequence[/URL] and I was so happy to find a full feature sieving tool already existed for my problem. My first attempt was single-threaded and missed factors so it was great to find sr2sieve.

I also appreciate that it's fully open source and I could modify and improve it; as I needed this to hack around the all terms being divisible by 2 for (3^n-7)/2.

If you wanted to add a line somewhere that acknowledged optimization/profiling from Seth Troisi, it would make me feel extra valued for the work I did.[/QUOTE]

Sorry about that. I should have added your name to CHANGES.txt. I will update that soon.

The divisible by d sequences need work. I laid out in one of these threads the conditions that must be met for srsieve2/srsieve2cl to sieve such sequences. I just don't recall where it is. That would be a nice contribution if you want to work on it.

rogue 2022-11-28 15:32

I have posted mtsieve 2.3.6 to sourceforge. Outside of modifying CHANGES.txt to mention Seth Troisi's addition, here are the changes for 2.3.6:

[code]
cksieve/cksievecl: version 1.4
Initial release of cksievecl.
cksieve will now run on non-x86 CPUs. It is 25% faster than the previous version.
cksievecl is about 5x faster than cksieve when comparing i9-11950H vs NVIDIA RTX A5000
[/code]

The only sieves without ARM builds are afsieve, gcwsieve, pixsieve, xyyxsieve and their OpenCL/Metal equivalents.

rogue 2022-11-29 17:26

I have posted mtsieve 2.3.7 to sourceforge. Here are the changes for 2.3.6:

[code]
gcwsieve/gcwsievecl: version 1.5
Added support for non-x86 CPUs. FPU or AVX is still used on x86 CPUs.
Added -A to enable AVX on x86 CPUs. AVX code can be faster than the FPU,
but you will have to test ranges (for p > max n) to see which is faster.
Updated invmod method in the GPU and FPU code to gain about 2%.
[/code]

storm5510 2022-11-29 18:05

I have an older package. With all due respect, I have not yet seen any good examples of how to use these things.


All times are UTC. The time now is 11:27.

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