![]() |
Mlucas (or Prime95) for Android
Hi,
Does anybody know if there is a port of Mlucas (or Prime95) for Android? I've trying to compile the code at Mlucas page ([url]http://www.mersenneforum.org/mayer/README.html[/url]), but for that I would need to change the way it handles I/O files. I'm trying to create a simple function that takes the input (a single line from worktodo.ini), ie: Test=345E1363B28941213C54A61A8724EFF3,74365037,75,1 And returns the output to be sent to the server. The main for mlucas.c seems very complex and I thought there might be someone that could help in building this function or at least giving some hints on what should I be looking for. Thanks. |
There is a free program on GooglePlay. It does not take a worktodo file.
[url]https://play.google.com/store/apps/details?id=com.movisys.lltest&hl=en[/url] |
[QUOTE=Uncwilly;440141]There is a free program on GooglePlay. It does not take a worktodo file.
[URL]https://play.google.com/store/apps/details?id=com.movisys.lltest&hl=en[/URL][/QUOTE] Interesting comments at the link. One person asserts that the app is BS, because not enough CPU use, among other things. Another, however, decompiled it, and is satisfied that it really is running the test. Low CPU usage, he attributes to very inefficient code. |
Limited battery life is the bane of all mobile devices. LL testing on your phone makes no sense, unless it's just a front end and the actual calculating is done in the cloud.
|
We are planning to use it when certain conditions are met, such as: Phone is charging, has network connection and is at a minimum 95% battery level.
Regarding the code, we plan to use only JNI code and not Java, this will probably make the code more efficient, this is one of the reasons we are trying to port the code from Mlucas page instead of creating a new on based on Java. |
1 Attachment(s)
[QUOTE=yurigomes;440156]We are planning to use it when certain conditions are met, such as: Phone is charging, has network connection and is at a minimum 95% battery level.
Regarding the code, we plan to use only JNI code and not Java, this will probably make the code more efficient, this is one of the reasons we are trying to port the code from Mlucas page instead of creating a new on based on Java.[/QUOTE] Hello!) I think that is not best idea to port code. For which range are you planning to use mobile phone? Might be my code be enough? :big grin: It's very-very-very easy implemation but it working fine and you can compare result (for example [url]http://www.mersenne.org/report_exponent/?exp_lo=15259&exp_hi=&full=1[/url]). So just run it [B]java SimpleLucas[/B] and type [B]15259[/B]. I also accept ideas how i can improve this code. :smile: |
btw, here [url]https://github.com/tbuktu/bigint[/url] you can find more faster BigInteger implementation.
|
I think that the ideal would be to get a gmplib based biginteger library to do the math. I doubt that arm chips are good enough to be worthwhile yet. Before putting much effort into phones I would try something like a raspberry pi to see how fast it runs based upon both gmplib and mlucas. I expect gmplib would beat mlucas on a non-x86 platform due to lack of assembly for mlucas. mlucas may win for extremely large numbers due to being tuned for that.
I suspect even double checks may take a year or more to finish. |
[QUOTE=henryzz;440489]I suspect even double checks may take a year or more to finish.[/QUOTE]
You joking. Say 5 years for a 40M test with the fastest version in the linked table (which please mind, it is not implemented yet, according with the text, only the one which is slower is available - "This code has been merged into OpenJDK 8 except for the Schönhage-Strassen"). That is 2.3 seconds (in the table) to multiply a 10M digits (33M), therefore multiply 40M iterations with about (interpolation) 3.5, and divide by 3600 (seconds), 24 (hours), 365 (days) etc. Add a bit for interruptions, you may not run continuously.. Assuming you keep your mobile so long... edit: And assuming the 3.5ms version become available. OpenJDK 8 actual implementation lists 18 seconds instead of 2.3. You will need to hang on your current phone 20 years or so, to finish that DC assignment! May God help you find it prime! :razz: |
[QUOTE=LaurV;440493]You joking. Say 5 years for a 40M test with the fastest version in the linked table (which please mind, it is not implemented yet, according with the text, only the one which is slower is available - "This code has been merged into OpenJDK 8 except for the Schönhage-Strassen"). That is 2.3 seconds (in the table) to multiply a 10M digits (33M), therefore multiply 40M iterations with about (interpolation) 3.5, and divide by 3600 (seconds), 24 (hours), 365 (days) etc. Add a bit for interruptions, you may not run continuously..
Assuming you keep your mobile so long... edit: And assuming the 3.5ms version become available. OpenJDK 8 actual implementation lists 18 seconds instead of 2.3. You will need to hang on your current phone 20 years or so, to finish that DC assignment! May God help you find it prime! :razz:[/QUOTE] Hello! I agree with you. But no one didn't implement LL-test with FFT and mulltiply matrix on Java. I guess that speed should be significantly increased. So actually i found out many algorithms for LL-test on different languages. Here is the list of 57 implementation of LL-test [url]https://rosettacode.org/wiki/Lucas-Lehmer_test[/url] But I didn't find no one implementation of LL-test with FFT and multiply matrixs. Except CudaLucas and clFFT but they very complicated for understand. :bangheadonwall: [QUOTE]Since the late 1960's the fastest algorithm for squaring large numbers is to [B]split the large number into pieces forming a large array, then perform a Fast Fourier Transform (FFT), a squaring, and an Inverse Fast Fourier Transform (IFFT)[/B].[/QUOTE] For me is puzzle how to implement this algorithm in code. May be someone knows where i can find description for implementation this algorithm? :confused2: |
[QUOTE=Lorenzo;440463]Hello!) I think that is not best idea to port code. For which range are you planning to use mobile phone? Might be my code be enough? :big grin:
It's very-very-very easy implemation but it working fine and you can compare result (for example [url]http://www.mersenne.org/report_exponent/?exp_lo=15259&exp_hi=&full=1[/url]). So just run it [B]java SimpleLucas[/B] and type [B]15259[/B]. I also accept ideas how i can improve this code. :smile:[/QUOTE] Our goal is to build a client that could help PrimeNet find new primes. The whole implementation must be in C for performance reasons and we want to use Java only for I/O Operations. |
[QUOTE=yurigomes;440603]Our goal is to build a client that could help PrimeNet find new primes. The whole implementation must be in C for performance reasons and we want to use Java only for I/O Operations.[/QUOTE]
It not make sense. You can create client on Android as educational project for you. But for finding new primes it not have sense. Just have a look at [URL="http://www.mersenne.org/primenet/"]Exponent Status Distribution[/URL]. For today range of exponents that aviable for first time LL test starting from 70M. I'm sure that you will wait few years for result (if your mobile phone will always on charging) ... |
[QUOTE=Lorenzo;440587]Hello! I agree with you. But no one didn't implement LL-test with FFT and mulltiply matrix on Java.[/QUOTE]
Do you know what Schönhage-Strassen means? Google it. Or at least, click the link in the page that [U]you[/U] provided. The times are in the table. When I talk about 2.3 seconds versus 18 seconds, those 2.3 seconds [B][U]are FFT multiplication[/U]. [/B]Not yet in version 8, "waiting for version 9". But the multiplications are done with FFT. Katatsuba would take ages to multiply 10M digits numbers. |
[B]yurigomes[/B], do you have some progress there?
|
| All times are UTC. The time now is 05:56. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.