mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Miscellaneous Math

Reply
 
Thread Tools
Old 2020-09-09, 03:53   #56
LaurV
Romulan Interpreter
 
LaurV's Avatar
 
Jun 2011
Thailand

213748 Posts
Default

Quote:
Originally Posted by mart_r View Post
one in Pari... I'm not yet familiar with coding in Perl or C
Man, if you wrote such thing in pari, then you are already "familiar" with C more than you imagine. You can give it a try using either libpari or gwnum, to avoid implementing some things from scratch (but sieving and such, there are a lot of functions and ready-made implementations already). C is extremely simple, only few instructions to learn, haha, it will be the OS you will have to struggle with (like, writing C for Windows or for Linux may be sometimes two different worlds). But you don't know until you try. Give it a try, and there are many guys here who can help you (me included). Just ask.

Perl, on the other hand, is a different animal. It took me some time and effort to learn to deal with regex-es, even after 20 or 30 years of programming experience, and even so, I never wrote more than few scripts in Perl (and I consider myself a very strong programmer in C, many flavors of assembler, Pascal, Fortran, Basic, Lisp). Of course, your mileage may vary, some people here (like Chalsall and DanaJ, who both of them eat Perl on butter every morning for breakfast, I assume) will tell you a different story.

But you have to try first. While you don't buy that lottery ticket, you can't win.

Last fiddled with by LaurV on 2020-09-09 at 04:00
LaurV is offline   Reply With Quote
Old 2020-09-10, 17:54   #57
jzakiya
 
Jul 2014

25 Posts
Default

To test the correctness of your implementation, first search for known large Twins (I assume that's what your looking for) to verify it finds them. Once you know the structure of the program is correct you can use any generator you want, dependent upon the capacity of your hardware to accommodate it.

If you use P23 or P29 you ideally want as many parallel threads as possible. GPUs would be very nice to use in this case, though a Super Computer would be the most ideal platform, more for its memory capacity than just pure speed and threads.

If you are concerned about speed, you need to use a compiled language that has good/mature multi-threading capability, though you can use Perl, etc, to code a proof-of-concept design to get working. All my original coding was done in Ruby, which allowed my to easily and quickly play with different implementations. I then translated that code into Rust, Nim, Crystal, and D multi-threaded versions, and tested their results to Ruby.

First, study my code to know exactly what and why its doing. Then start slow. Know what and why the results should be at each stage of your code for each section. The algorithm is very simple, if you understand it. Once you do, you can run it on any platform in your language(s) of choice.

If you need help post code on git[hub|lab], or a gist, or email me.
jzakiya is offline   Reply With Quote
Old 2020-10-24, 14:20   #58
jzakiya
 
Jul 2014

25 Posts
Default

There's a Rust forum post (2020/10/22) about a package to use Rust on GPUs.


https://users.rust-lang.org/t/introd...-gpu-0-1/50499


I don't have a GPU, so I don't have the hardware to play with it.
For those who do, this package should (?) provide the basics to implement the algorithm on GPUs, which (if properly done) increase performance significantly, while extending the number space range too.



https://github.com/EmbarkStudios/rus...eases/tag/v0.1
jzakiya is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Twin Prime Constellations robert44444uk Prime Gap Searches 21 2019-06-09 12:51
How do you efficiently sieve for prime 3/4-tuples? Puzzle-Peter Software 156 2019-06-03 20:19
find very easy twin prime in the infamy twin primes hal1se Miscellaneous Math 13 2018-11-05 16:34
Highest Prime is also a twin prime... NOT hydeer Lone Mersenne Hunters 9 2018-04-03 22:54
Twin Prime Days, Prime Day Clusters cuBerBruce Puzzles 3 2014-12-01 18:15

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

Wed Dec 2 23:20:45 UTC 2020 up 83 days, 20:31, 2 users, load averages: 1.91, 1.81, 1.69

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.