Parallel Force Atlas

Algorithms and parameters to put data in space
User avatar
pbittner
Gephi Plugin Developer
Posts:35
Joined:18 Mar 2010 23:03
Location:London, UK
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Parallel Force Atlas

Post by pbittner » 09 Jul 2011 00:30

Hi everybody!

As mentioned in a previous post, I have been working on a parallel implementation of the Force Atlas layout recently and a first version is ready for release. I published it earlier today and it will hopefully be available quite soon. I attached the plugin NBM if anybody wants to try it now.

The plugin uses a dynamic library written in Fortran and parallelized with OpenMP. Because of that, it is only available on Windows 64bit for now as the library must be recompiled for each platform. The only part of the algorithm that is parallelized is the O(n2) repulsion as it is by far the most costly.

In term of performance, I have done some benchmarking on a recent i7 quad-core laptop and it is more than 50 times faster than the standard Force Atlas layout in some cases. On that machine, one iteration of the layout takes about 30ms with 5,000 nodes, 0.8s with 20,000 nodes and 3s with 50,000 nodes.

For the next version, I'll try to make it available on Linux and Mac. I also plan on implementing a version of the layout with CUDA to make it even faster.

Let me know what you think,
Paul
Last edited by pbittner on 27 Jul 2011 16:59, edited 1 time in total.

admin
Gephi Community Manager
Posts:964
Joined:09 Dec 2009 14:41
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Parallel Force Atlas

Post by admin » 09 Jul 2011 23:26

That's amazing! Can't wait to see the ForceAtlas 2 improved!

User avatar
PMR3349
Posts:9
Joined:28 Jun 2011 17:30
Location:Cambridge, MA
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Parallel Force Atlas

Post by PMR3349 » 11 Jul 2011 13:47

I will definitely be trying this out today. Nice work :mrgreen:

User avatar
seinecle
Gephi Community Support
Posts:546
Joined:08 Feb 2010 16:55
Location:Lyon, France
Contact:

Re: Parallel Force Atlas

Post by seinecle » 11 Jul 2011 14:06

I just tried it on the Power grid.gml (example of a network available on the welcome screen of Gephi): that's ***crazy*** fast.

Thanks a lot!

Clement

User avatar
pbittner
Gephi Plugin Developer
Posts:35
Joined:18 Mar 2010 23:03
Location:London, UK
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Parallel Force Atlas

Post by pbittner » 13 Jul 2011 05:03

I'm glad that you like it :)

Over the week-end, I wrote a prototype of Force Atlas using CUDA that is even faster (~10x). On my laptop with a mid-range GPU card, one iteration of the layout is taking 0.1s with 20,000 nodes and 2s with 100,000 nodes. I will include it in the next version of the plugin.

Regarding Force Atlas 2, things are a little more complicated. I have made a parallel version using OpenMP but it is at best 2.5 times faster than the Java implementation. I don't have much hope for a parallel version running on CPUs. However, I found a paper presenting the implementation of the Barnes-Hut method using CUDA and the performance is crazy: they manage to run one iteration of Barnes-Hut with 5,000,000 bodies in about 5s! (using a high-end desktop GPU card)

I'll definitely look into that when I have some time.

admin
Gephi Community Manager
Posts:964
Joined:09 Dec 2009 14:41
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Parallel Force Atlas

Post by admin » 13 Jul 2011 09:00

Even if the performance is increase by 2.5, this would be still a great improvement for the users, and keeping the same quality of layout!

User avatar
seinecle
Gephi Community Support
Posts:546
Joined:08 Feb 2010 16:55
Location:Lyon, France
Contact:

Re: Parallel Force Atlas

Post by seinecle » 13 Jul 2011 12:52

If I may repeat the obvious and cheer again:

the work you do is very, very important! Good layouts are an essential for dataviz, and unfortunately there are very few if any very fast performing, good quality layouts.

ForceAtlas stands out for the very intuitive interpretation it affords, but so far it was still much too slow past a certain number of nodes. In practice, this means that good visualizations were simply not available for, say, a 100,000 nodes network. Your work is literally exploding this limit, and this opens new horizons for dataviz.

To illustrate, I just compared the layout of a 9,000 nodes + 15,000 edges network with OpenOrd and Parallel Force Atlas. it took me 20 seconds with each algo to get the final result. See snapshots attached. Main differences in favor of Parallel Force Atlas are:

- quality of the dispersal of nodes: communities appear more clearly
- no overlap of nodes
- possibility to modify the parameters for gravity, etc. while the layout is still running. OpenOrd makes one treatment without possibility to intervene while it runs.
- possibility to explain the mechanism of the layout to the audience. ForceAtlas = expansion + attraction + gravity. OpenOrd = much more difficult to explain in 1 minute.

So... continue the good work if you can, it benefits the community in a huge way!
Attachments
zoom_on_OpenOrd.jpg
zoom on the central region of the graph - OpenOrd layout
zoom_on_Parallel_ForceAtlas.jpg
zoom on the central region of the graph - Parallel Force Atlas layout
OpenOrd.png
OpenOrd
ForceAtlas.png
Parallel ForceAtlas

User avatar
eduramiba
Gephi Code Manager
Posts:1064
Joined:22 Mar 2010 15:30
Location:Madrid, Spain
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Parallel Force Atlas

Post by eduramiba » 13 Jul 2011 14:52

Wow, this works really great!!
Keep the good work :)

User avatar
pbittner
Gephi Plugin Developer
Posts:35
Joined:18 Mar 2010 23:03
Location:London, UK
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Parallel Force Atlas

Post by pbittner » 24 Jul 2011 03:19

The plug-in has just been updated and includes a CUDA implementation of the layout running on GPUs. :)

If some of you have Windows 64 bit and a CUDA compatible Nvidia graphic card, I would appreciate some feedback since portability between different generations of Nvidia cards is a bit tricky. I have successfully tested the plug-in with a Quadro 2000 and a Geforce GT 540m but I wasn't able to use it with an older Quadro FX 1700.

The performance of the GPU implementation depends on the specification of the graphic card (number of CUDA cores) and on the number of nodes in the graph. With the Quadro 2000 card, the plug-in needs 0.5s per iteration on a graph of 100,000 nodes. This is about 1,000 times faster than the standard Force Atlas and 20 times faster than the parallel CPU implementation. Because the overhead of CUDA is quite high, the GPU implementation does not perform as well as the CPU implementation under 1,000 nodes.

Otherwise, I have been struggling a bit with making a parallel version of Force Atlas 2. The current prototype runs about 4 times faster but crashes above 100,000 nodes with a stack overflow. With OpenMP, the data private to each thread is allocated on the stack and I am not sure whether it is possible to increase the stack size when using a library through JNI. I'll try to make a non-recursive implementation and see how it performs.

User avatar
seinecle
Gephi Community Support
Posts:546
Joined:08 Feb 2010 16:55
Location:Lyon, France
Contact:

Re: Parallel Force Atlas

Post by seinecle » 24 Jul 2011 10:56

Hi,

I tested this new version of Parallel ForceAtlas on the Powergrid dataset.

I use Win7 64bits and the graphic card is GeForce GTX 560M (CUDA cores: 192 according to the specs)

Results:
GPU (CUDA)
- after a few seconds, the layout starts running. All nodes converge to the center until the graph is a single dot on the screen. Changing the parameters does nothing to that.

CPU (OpenMP)
- the layout works.

Hope it helps!

Best,

Clement

Post Reply
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable