[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Parallella Community • View topic - Searching for prime constellations / mining for Riecoins

Searching for prime constellations / mining for Riecoins

Forum for anything not suitable for the other forums.

Searching for prime constellations / mining for Riecoins

Postby mikebell » Sun Feb 22, 2015 4:53 pm

I've been interested for a long time in searching for prime numbers and prime constellations in particular, and this seemed a good basis for my first significant project on the Parallella board.

I got a basic prime sieve together quite quickly, and then took a look at the page to decide on a good target to work on. (For some reason you have to download this page as an attachment and then open it.)

I noticed that 6-tuplets were being found by a project using prime finding as a proof of work for a bitcoin clone known as , so I decided to learn a bit about that, and ended up integrating my code with a mining client for riecoin.

The result has turned into a non-trivial project that gives a good workout for both the ARM and Epiphany chip. I've extracted small bits of GMP to do the multi-precision work on the Epiphany side, and optimized a couple of inner loops in inline assembler - I just got hardware loops working today. There are a few nice features like that on the Epiphany, but I really wish there was an add with carry instruction!

Anyway, if you're interested, please take a look at the , it's not currently well commented - this is a hobby project after all :), but I've at least added a brief explanation on what each module does!

It's pretty easy to use this to mine for small amounts of riecoins (which can be traded for bitcoins) by setting up an account on ypool.net and following the simple instructions in the readme. The performance is currently around 1/40th of my i7 4770K desktop, which seems to match the difference in power consumption reasonably well.

Note that it does lock up occasionally (you'll see a "core stuck" message), I'm not sure what causes this, and sometimes it will run fine for days. I think it may be an infrastructure thing, as when it has happened once it seems more likely to happen again until you reboot. Until I work out what's going on, if you did want to dedicate a parallella to running this the easiest thing would be to exit the program and reboot the board when it happens.
mikebell
 
Posts: 41
Joined: Thu Jan 08, 2015 9:46 pm

Re: Searching for prime constellations / mining for Riecoins

Postby aolofsson » Sun Feb 22, 2015 7:11 pm

mikebell,

A very cool project. I love the fact that you went all the way down to assembly! I am glad you got the hardware loops working. The HW
loops is a very quirky feature. (you have no idea how nasty it was to implement :D )

Thanks for the feedback on the add and carry..we'll see what we can do about that for the next version!

Would you be willing to do a pull request to the examples: https://github.com/parallella/parallella-examples

(even if it's just a snapshot of your development)

There is a lot that others can learn from your project, and it's going to easier if all of the examples are located in one repository. We will also be using these tests as part of our regression suite and burn in test, so having them as part of the a common repo has huge value for everyone.

Andreas
User avatar
aolofsson
 
Posts: 1005
Joined: Tue Dec 11, 2012 6:59 pm
Location: Lexington, Massachusetts,USA

Re: Searching for prime constellations / mining for Riecoins

Postby mikebell » Sun Feb 22, 2015 7:28 pm

Hi Andreas,

Thanks for the reply :) I agree there's quite a lot here that would be good to share as an example.

I'll see if I can take the test harness, tidy it up a bit and get it into a sensible state to submit as an example project, I should have some time for that next weekend.

Cheers,
Mike
mikebell
 
Posts: 41
Joined: Thu Jan 08, 2015 9:46 pm

Re: Searching for prime constellations / mining for Riecoins

Postby aolofsson » Sun Feb 22, 2015 8:02 pm

Mike,
Great!
btw. What is the compute to IO ratio for your prime search example? Are you compute or IO bound at the moment?
Andreas
User avatar
aolofsson
 
Posts: 1005
Joined: Tue Dec 11, 2012 6:59 pm
Location: Lexington, Massachusetts,USA

Re: Searching for prime constellations / mining for Riecoins

Postby mikebell » Sun Feb 22, 2015 11:06 pm

It's completely compute bound for the prime testing itself.

During the sieving step I'm currently compute bound but it might be close to IO becoming involved. I haven't got a measurement of the data rate, but a quick calculation suggests I'm doing around 4MB/s to and 13MB/s from the Epiphany chip. It keeps one core on the ARM maybe around 50% busy dealing with the transfers, though I haven't tried to optimize that.

Am I right that the Epiphany III is only running at 600MHz on the Parallella board? What's the bottleneck there and might it be possible to raise it with an update to the programmable logic, or is a significant hardware revision required?

Mike
mikebell
 
Posts: 41
Joined: Thu Jan 08, 2015 9:46 pm

Re: Searching for prime constellations / mining for Riecoins

Postby xaoqao » Fri Mar 13, 2015 9:43 am

:(

make -j2

g++ -Wall -Wextra -O3 -fomit-frame-pointer -g -std=gnu99 -marm -march=armv7-a -mfpu=neon -mtune=cortex-a9 -L/usr/local/lib -L/usr/lib -L/DBA/openssl/1.0.1f/lib/ -L/opt/adapteva/esdk/tools/host/lib -I/usr/local/include -I/usr/include -IxptMiner/includes/ -Iepiphany/src -I/opt/adapteva/esdk/tools/host/include -o xptminer xptMiner/ticker.o xptMiner/main.o xptMiner/sha2.o xptMiner/xptClient.o xptMiner/xptClientPacketHandler.o xptMiner/xptPacketbuffer.o xptMiner/xptServer.o xptMiner/xptServerPacketHandler.o xptMiner/transaction.o xptMiner/rh_riecoin.o xptMiner/riecoinMiner.o xptMiner/jhlib.o -lcrypto -lssl -pthread -ldl -le-hal -lgmp -lgmpxx -lrt -flto
cd xptMiner && ./buildtest.sh
xptMiner/rh_riecoin.o: In function `epipTester':
/home/parallella/fastrie/xptMiner/xptMiner/rh_riecoin.c:717: undefined reference to `e_load_group'
xptMiner/rh_riecoin.o: In function `initSieve':
/home/parallella/fastrie/xptMiner/xptMiner/rh_riecoin.c:374: undefined reference to `e_load_group'
collect2: error: ld returned 1 exit status
make: *** [xptminer] Error 1
make: *** Waiting for unfinished jobs....
rh_riecoin.o: In function `epipTester':
/home/parallella/fastrie/xptMiner/xptMiner/rh_riecoin.c:717: undefined reference to `e_load_group'
rh_riecoin.o: In function `initSieve':
/home/parallella/fastrie/xptMiner/xptMiner/rh_riecoin.c:374: undefined reference to `e_load_group'
collect2: error: ld returned 1 exit status
make: *** [xptMiner/test] Error 1
===============================================================

The Epiphany SDK Build Completed successfully
My SDK Build Settings:

Build Rev = 2015.1
Branch = esdk-2015.1
EPIPHANY_HOME = /secdisk/epiphany-sdk/esdk
ESDK = /secdisk/epiphany-sdk/esdk.2015.1
HOSTNAME = host.armv7l
GNUNAME = e-gnu.armv7l
GNU = /secdisk/epiphany-sdk/esdk.2015.1/tools/e-gnu.armv7l
PATH = /secdisk/epiphany-sdk/esdk/tools/host/bin:/secdisk/epiphany-sdk/esdk/tools/e-gnu/bin:/secdisk/epiphany-sdk/esdk.2015.1/tools/e-gnu.armv7l/bin:/usr/local/browndeer/bin:/usr/local/browndeer/bin:/opt/adapteva/esdk/tools/host/bin:/opt/adapteva/esdk/tools/e-gnu/bin:/opt/openmpi/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games

===============================================
| NOTE: The default BSP is set to parallella_E16G3_1GB
| Please make sure it matches your system, |
| or chenge the settings in this build script |
===============================================

Need to set the path?

Thanks.
xaoqao
 
Posts: 2
Joined: Fri Mar 13, 2015 4:01 am

Re: Searching for prime constellations / mining for Riecoins

Postby sebraa » Fri Mar 13, 2015 2:29 pm

With the new SDK, you need to link against both e-hal and e-loader. In the older versions, e-loader was part of e-hal.
sebraa
 
Posts: 495
Joined: Mon Jul 21, 2014 7:54 pm

Re: Searching for prime constellations / mining for Riecoins

Postby mikebell » Fri Mar 13, 2015 5:22 pm

I'm still using an old ESDK version - I'm hoping to get chance this weekend to load up the 2015.01 version on a new SD card and test everything there.

Let me know if sebraa's suggestion fixed it or if there's more that needs to be done.

Cheers,
Mike
mikebell
 
Posts: 41
Joined: Thu Jan 08, 2015 9:46 pm

Re: Searching for prime constellations / mining for Riecoins

Postby mikebell » Fri Mar 13, 2015 11:34 pm

I've now pushed an update that works correctly with the 2015.1 esdk version (it even seems a little faster).

If you're still using the original sdk, use the esdk.5.13.09.10 branch.

Cheers,
Mike
mikebell
 
Posts: 41
Joined: Thu Jan 08, 2015 9:46 pm

Re: Searching for prime constellations / mining for Riecoins

Postby xaoqao » Sat Mar 14, 2015 2:59 am

:D

very cool!
it works!
Thanks.
xaoqao
 
Posts: 2
Joined: Fri Mar 13, 2015 4:01 am

Next

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 6 guests