arm64 linux client fun

Message boards : Number crunching : arm64 linux client fun

To post messages, you must log in.

AuthorMessage
fractal

Send message
Joined: 1 Feb 17
Posts: 8
Credit: 100,048,293
RAC: 0
   
Message 77 - Posted: 5 Feb 2017, 18:06:28 UTC

So, I have this 20 dollar pine64 board sitting here and I found myself wondering ... can it do anything for this project?

There are a limited number of projects that support arm linux and even fewer that take advantage of the arm 64 architecture so I decided to give this one a go.

First, I downloaded the source from the link in the other thread and compiled it on the pine64 board. I had to fix a few header file issues but other than that it was a clean compile.

Then I ran it in test mode.. ./release/amicable /test ... and it crashed. It did not take long to see that it was running out of memory with only 1GB RAM on the board. So I connect a USB hard drive and create a swap file and try again. The test program finishes without errors.

I copy "release/amicable" to "/var/lib/boinc-client/projects/sech.me_boinc_Amicable/amicable-aarch64-unknown-linux-gnu" and join the machine to the project and iterate a few times until I get a working app_info. Work issued by Boinc does not need swap yet so I removed the hard drive.

<app_info>
        <app>
                <name>amicable_2_64</name>
                <max_concurrent>1</max_concurrent>
                <user_friendly_name>Amicable Numbers up to 2^64</user_friendly_name>
        </app>

        <file>
                <name>amicable-aarch64-unknown-linux-gnu</name>
                <executable/>
        </file>
        <app_version>
                <app_name>amicable_2_64</app_name>
                <plan_class>mt</plan_class>
                <avg_ncpus>4</avg_ncpus>
                <cmdline>--nthreads 4</cmdline>
                <version_num>103</version_num>
                <file_ref>
                        <file_name>amicable-aarch64-unknown-linux-gnu</file_name>
                        <main_program/>
                </file_ref>
        </app_version>
</app_info>

The result? https://sech.me/boinc/Amicable/result.php?resultid=42244

Even with thermal throttling, it is not the slowest machine on https://sech.me/boinc/Amicable/cpu_list.php.

I will test some other arm development boards but it looks like 1GB RAM boards will be an issue for this project, and most of the Raspberry Pi class of boards have 1GB or less. I will play around a bit more when I get a decent heat sink for the pine64.
ID: 77 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
Sergei Chernykh
Project administrator
Project developer

Send message
Joined: 5 Jan 17
Posts: 513
Credit: 72,451,573
RAC: 0
   
Message 78 - Posted: 5 Feb 2017, 18:19:52 UTC - in response to Message 77.  
Last modified: 5 Feb 2017, 18:26:15 UTC

Very interesting. How did you run tests exactly? Did you put c2_3.txt, c2_4.txt, ..., c2_20.txt in the same directory with the compiled binary? It reads amicable pairs from these files and runs tests using them, you can just look at the source code in Tests.cpp. I probably need to add the code that checks for these files first.

You can download these 'c2_*.txt' files from this page: https://sech.me/ap/

P.S. Judging by CPU time on https://sech.me/boinc/Amicable/workunit.php?wuid=19345, one arm64 core is 16 times slower than one physical Core i5 core (with HT on) on this project. But arm64 had thermal throttling, right?
ID: 78 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
fractal

Send message
Joined: 1 Feb 17
Posts: 8
Credit: 100,048,293
RAC: 0
   
Message 79 - Posted: 5 Feb 2017, 20:48:07 UTC

I did not know about the test files. I downloaded them and re-ran the test.

ubuntu@pine64:~/am$ ls
amicable-aarch64-unknown-linux-gnu  c2_11.txt  c2_13.txt  c2_15.txt  c2_17.txt  c2_19.txt  c2_3.txt  c2_5.txt  c2_7.txt  c2_9.txt
c2_10.txt                           c2_12.txt  c2_14.txt  c2_16.txt  c2_18.txt  c2_20.txt  c2_4.txt  c2_6.txt  c2_8.txt
ubuntu@pine64:~/am$ time ./amicable-aarch64-unknown-linux-gnu /test
Testing CheckPair()...done
Testing amicable candidates...done
Testing MaximumSumOfDivisors3()...done
Testing primesieve...done
All tests passed

real    8m14.318s
user    7m34.900s
sys     0m4.410s
ubuntu@pine64:~/am$ cat stderr.txt
20:14:40 (32503): Can't open init data file - running in standalone mode

Just for fun I ran the test on my boinc build box as well since I have no idea what to expect. First, I run with your app

boinc@boinc-build-2:~/am$ wget https://sech.me/boinc/Amicable/download/amicable_v_1_03
2017-02-05 12:35:16 (2.39 MB/s) - ‘amicable_v_1_03’ saved [2746752/2746752]

boinc@boinc-build-2:~/am$ chmod +x amicable_v_1_03
boinc@boinc-build-2:~/am$ ls -l
total 222452
-rwxrwxr-x 1 boinc boinc  2521392 Feb  5 12:25 amicable
-rwxrwxr-x 1 boinc boinc  2746752 Jan 31 22:18 amicable_v_1_03
-rwxr--r-- 1 boinc boinc    63868 Feb  5 12:25 c2_10.txt
-rwxr--r-- 1 boinc boinc   160088 Feb  5 12:25 c2_11.txt
-rwxr--r-- 1 boinc boinc   388690 Feb  5 12:25 c2_12.txt
-rwxr--r-- 1 boinc boinc   907870 Feb  5 12:25 c2_13.txt
-rwxr--r-- 1 boinc boinc  2232700 Feb  5 12:25 c2_14.txt
-rwxr--r-- 1 boinc boinc  5132773 Feb  5 12:25 c2_15.txt
-rwxr--r-- 1 boinc boinc 11255557 Feb  5 12:25 c2_16.txt
-rwxr--r-- 1 boinc boinc 24901405 Feb  5 12:25 c2_17.txt
-rwxr--r-- 1 boinc boinc 56121351 Feb  5 12:25 c2_18.txt
-rwxr--r-- 1 boinc boinc 82565941 Feb  5 12:25 c2_19.txt
-rwxrwxr-- 1 boinc boinc 38705046 Feb  5 12:25 c2_20.txt
-rwxr--r-- 1 boinc boinc       44 Feb  5 12:25 c2_3.txt
-rwxr--r-- 1 boinc boinc      180 Feb  5 12:25 c2_4.txt
-rwxr--r-- 1 boinc boinc      411 Feb  5 12:25 c2_5.txt
-rwxr--r-- 1 boinc boinc     1695 Feb  5 12:25 c2_6.txt
-rwxr--r-- 1 boinc boinc     4062 Feb  5 12:25 c2_7.txt
-rwxrwxr-- 1 boinc boinc     8230 Feb  5 12:25 c2_8.txt
-rwxr--r-- 1 boinc boinc    24703 Feb  5 12:25 c2_9.txt
boinc@boinc-build-2:~/am$ time ./amicable_v_1_03 /test
Testing CheckPair()...done
Testing amicable candidates...done
Testing MaximumSumOfDivisors3()...done
Testing primesieve...done
All tests passed

real    1m52.500s
user    1m52.064s
sys     0m0.560s

Then I run with the app I compiled from source on the x86_64 host to see if there are any differences

boinc@boinc-build-2:~/am$ time ./amicable /test
Testing CheckPair()...done
Testing amicable candidates...done
Testing MaximumSumOfDivisors3()...done
Testing primesieve...done
All tests passed

real    1m56.417s
user    1m56.048s
sys     0m0.504s
boinc@boinc-build-2:~/am$ cat stderr.txt
12:35:29 (23195): Can't open init data file - running in standalone mode
12:38:08 (23197): Can't open init data file - running in standalone mode

This test machine is a VM in an Intel(R) Xeon(R) CPU E5645 @ 2.40GHz host if you want to compare times. It looks like the xeon is 4-5 times faster in the test.

Yes, the pine64 is slowing down to stay within the heat limits. It did not come with a heat sink unlike many of the arm development boards. It will probably run half again faster with a good heat sink.
ID: 79 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
Sergei Chernykh
Project administrator
Project developer

Send message
Joined: 5 Jan 17
Posts: 513
Credit: 72,451,573
RAC: 0
   
Message 123 - Posted: 15 Feb 2017, 20:55:38 UTC - in response to Message 79.  
Last modified: 15 Feb 2017, 20:57:40 UTC

Hello!

I've fixed a bug: https://github.com/SChernykh/Amicable/commit/cf61dd464eb5001ca1ee77da80a1357f22c99ef1
Fortunately this bug wasn't random and I could identify which ranges were skipped and send new work units to fill the gaps.

You need to update your custom version, otherwise it will fail to validate against version 1.05 sometimes.
ID: 123 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote

Message boards : Number crunching : arm64 linux client fun


©2024 Sergei Chernykh