[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/bbcode.php on line 112: 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 - Nbody simulations on the Parallella

Nbody simulations on the Parallella

Forum for anything not suitable for the other forums.

Nbody simulations on the Parallella

Postby capnrob97 » Tue Jul 07, 2015 5:18 pm

I got my first Parallella around 1 month ago, and dove into it immediately.

I am a software developer who loves the subject of astronomy, so the N-body simulations appeal to me.

I first located some Nbody C language code on the net for a CPU and modified it to run the calculations on the 16 Epiphany cores.

This is one of the early videos (sorry for the poor iPad video quality, wish I could record the cdmi output directly)

This one has a super massive star in the middle of the screen and one of the smaller stars coded to leave orbit trail, kind of interesting to see some of the orbits the stars fall into around the massive one. In this one all the stars are white and equal mass, except for the super massive one in the middle of the screen. It is red but the iPad doesn't seem to pic up reds well.



Then I had seen a video of a simulation from a University where they color coded the stars by mass and had small trails behind each star to give a better indication of where it is going, so I copied that. The smallest mass stars are blue, medium mass white, large mass red (these show up as white in the poor quality video)

These stars are all starting at zero velocity all on the surface of the sphere, the gravity of the system collapses onto itself.



These videos all look better in person, I am not the best cameraman :)

Here is a cube randomly filled with stars, again zero velocity and it collapses onto itself. I find the star system collapses the most visually appealing.



I am now working on adding graphics the N-body code from the US Army lab github. If I can get the Epiphany cores dma copying the stars directly into the frame buffer like the mandelbrot example does, it should be a pretty fast demo I think. Will post a video of that here when I get it working satisfactory.
capnrob97
 
Posts: 74
Joined: Fri Feb 01, 2013 1:11 pm

Re: Nbody simulations on the Parallella

Postby tnt » Tue Jul 07, 2015 5:39 pm

Very cool :)

Is the code available somewhre ?
tnt
 
Posts: 408
Joined: Mon Dec 17, 2012 3:21 am

Re: Nbody simulations on the Parallella

Postby capnrob97 » Tue Jul 07, 2015 5:53 pm

Most of this code is not originally written by me, I am just hacking and slashing up exiting code to do what I want and work with the Epiphany chips.

Not sure the proper way to make it generally available without upsetting any of the original authors of the code.

Once I get this all worked out in my head I will probably write one from scratch I can call my own and put that out on github for the parallella community to play with.

My goal is to get an MPI version working across all 4 boards in my little parallella cluster.
capnrob97
 
Posts: 74
Joined: Fri Feb 01, 2013 1:11 pm

Re: Nbody simulations on the Parallella

Postby aolofsson » Tue Jul 07, 2015 6:45 pm

I think a lot of folks would love it if you wrote up a quick post on parallella.org explaining step by step how you got up and running.

Some questions that I think people would be interested in:
-Where did you run the graphics, how are you doing the display of the n-body?
-Are you running openGL or something else?
-Do you know where the bottleneck is right now? How could we increase # of stars?
-What is your exact starting point, packages used?
-How to leverage your work?

If you want to upload code, you can do it here, Just create a folder.(don't worry about taking code, just give reference and everyone should be happy:-)

https://github.com/parallella/parallella-examples

PM me with email address and I will give you a blogger account at parallella.org

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

Re: Nbody simulations on the Parallella

Postby capnrob97 » Tue Jul 07, 2015 7:20 pm

Got it working!

3000 stars using the US Army Nbody code, each Epiphany core DMA copying the graphics to the frame buffer, very fast!

capnrob97
 
Posts: 74
Joined: Fri Feb 01, 2013 1:11 pm

Re: Nbody simulations on the Parallella

Postby capnrob97 » Tue Jul 07, 2015 7:51 pm

capnrob97
 
Posts: 74
Joined: Fri Feb 01, 2013 1:11 pm

Re: Nbody simulations on the Parallella

Postby capnrob97 » Tue Jul 07, 2015 7:56 pm

Also, for the latest MPI example, I need to go to a double buffering technique as there is screen flicker on this version.

By playing with the timestep, I can make it insanely fast

Sorry for the thumb in the video in this one :)

capnrob97
 
Posts: 74
Joined: Fri Feb 01, 2013 1:11 pm

Re: Nbody simulations on the Parallella

Postby capnrob97 » Tue Jul 07, 2015 9:08 pm

Since it is completely offloaded to the Epiphany coprocessor now, It can run while the ARM does something else.

capnrob97
 
Posts: 74
Joined: Fri Feb 01, 2013 1:11 pm

Re: Nbody simulations on the Parallella

Postby aolofsson » Tue Jul 07, 2015 9:22 pm

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

Re: Nbody simulations on the Parallella

Postby capnrob97 » Wed Jul 08, 2015 11:28 am

I have eliminated the screen flicker when running at slower time steps.

Before I was erasing all the stars, calculating new positions, then displaying the new star positions.

Now on a star by star basis, I delete the old position right before I draw the new star position, zero flicker now.

I actually prefer running it at the slower speeds.

This is 3440 stars, 215 stars per core, that seems to be about the max with this version of the code.

capnrob97
 
Posts: 74
Joined: Fri Feb 01, 2013 1:11 pm

Next

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 7 guests