mersenneforum.org  

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

Reply
 
Thread Tools
Old 2016-08-16, 20:16   #1
yurigomes
 
Aug 2016
Paraiba, Brazil

112 Posts
Default 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 (http://www.mersenneforum.org/mayer/README.html), 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.

Last fiddled with by ewmayer on 2017-07-03 at 00:47 Reason: url updated to reflect ftp-site migration
yurigomes is offline   Reply With Quote
Old 2016-08-17, 00:02   #2
Uncwilly
6809 > 6502
 
Uncwilly's Avatar
 
"""""""""""""""""""
Aug 2003
101×103 Posts

26×33×5 Posts
Default

There is a free program on GooglePlay. It does not take a worktodo file.
https://play.google.com/store/apps/d...s.lltest&hl=en
Uncwilly is offline   Reply With Quote
Old 2016-08-17, 00:17   #3
kladner
 
kladner's Avatar
 
"Kieren"
Jul 2011
In My Own Galaxy!

22·2,503 Posts
Default

Quote:
Originally Posted by Uncwilly View Post
There is a free program on GooglePlay. It does not take a worktodo file.
https://play.google.com/store/apps/d...s.lltest&hl=en
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.
kladner is offline   Reply With Quote
Old 2016-08-17, 00:35   #4
GP2
 
GP2's Avatar
 
Sep 2003

22·3·5·43 Posts
Default

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.
GP2 is offline   Reply With Quote
Old 2016-08-17, 13:23   #5
yurigomes
 
Aug 2016
Paraiba, Brazil

3 Posts
Default

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.
yurigomes is offline   Reply With Quote
Old 2016-08-22, 21:27   #6
Lorenzo
 
Lorenzo's Avatar
 
Aug 2010
Republic of Belarus

2×5×17 Posts
Default

Quote:
Originally Posted by yurigomes View Post
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.
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?

It's very-very-very easy implemation but it working fine and you can compare result (for example http://www.mersenne.org/report_expon...exp_hi=&full=1). So just run it java SimpleLucas and type 15259.

I also accept ideas how i can improve this code.
Attached Files
File Type: zip SimpleLucas.zip (1.0 KB, 147 views)

Last fiddled with by Lorenzo on 2016-08-22 at 21:29
Lorenzo is offline   Reply With Quote
Old 2016-08-23, 08:58   #7
Lorenzo
 
Lorenzo's Avatar
 
Aug 2010
Republic of Belarus

2·5·17 Posts
Default

btw, here https://github.com/tbuktu/bigint you can find more faster BigInteger implementation.
Lorenzo is offline   Reply With Quote
Old 2016-08-23, 10:55   #8
henryzz
Just call me Henry
 
henryzz's Avatar
 
"David"
Sep 2007
Cambridge (GMT/BST)

10110010110102 Posts
Default

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.
henryzz is offline   Reply With Quote
Old 2016-08-23, 14:01   #9
LaurV
Romulan Interpreter
 
LaurV's Avatar
 
Jun 2011
Thailand

19×461 Posts
Default

Quote:
Originally Posted by henryzz View Post
I suspect even double checks may take a year or more to finish.
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!

Last fiddled with by LaurV on 2016-08-23 at 14:11
LaurV is offline   Reply With Quote
Old 2016-08-24, 12:57   #10
Lorenzo
 
Lorenzo's Avatar
 
Aug 2010
Republic of Belarus

2·5·17 Posts
Default

Quote:
Originally Posted by LaurV View Post
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!
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 https://rosettacode.org/wiki/Lucas-Lehmer_test

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.

Quote:
Since the late 1960's the fastest algorithm for squaring large numbers is to 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).
For me is puzzle how to implement this algorithm in code. May be someone knows where i can find description for implementation this algorithm?
Lorenzo is offline   Reply With Quote
Old 2016-08-24, 17:57   #11
yurigomes
 
Aug 2016
Paraiba, Brazil

3 Posts
Default

Quote:
Originally Posted by Lorenzo View Post
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?

It's very-very-very easy implemation but it working fine and you can compare result (for example http://www.mersenne.org/report_expon...exp_hi=&full=1). So just run it java SimpleLucas and type 15259.

I also accept ideas how i can improve this code.
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.
yurigomes is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Android app recommendations Uncwilly Lounge 9 2020-09-09 12:04
Is there An Android or Iphone version of Prime95 king Information & Answers 1 2018-02-14 07:01
GMP-ECM for Android yoyo GMP-ECM 6 2016-01-19 20:04
handwriting on Android questions jasong jasong 2 2013-02-21 00:04
Android henryzz Lounge 7 2011-01-19 18:21

All times are UTC. The time now is 16:42.

Wed Sep 30 16:42:22 UTC 2020 up 20 days, 13:53, 0 users, load averages: 1.85, 1.69, 1.75

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.