[Networkit] Question Regarding Multithreading

Christian Staudt christian.staudt at kit.edu
Fri Sep 25 20:46:12 CEST 2015

Hi Michael
can we please continue the discussion on the email list? This increases our chances of solving the problem.

On 25 Sep 2015, at 20:38, Michael Marcucci <onlycutch at gmail.com> wrote:

> Hi Chris thanks for getting back to me.
> I've attached my code as well as a list of packages from pip and dpkg.
> This is all on a fresh 15.04 Ubuntu 64bit install
> getMaxNumberOfThreads() outputs 4
> However, when I set the number of threads to 4. setNumberOfThreads() does return None, although I have a feeling it shouldn't return anything
> getCurrentNumberOfThreads() still displays 1.
> As for parallelism i would expect it when running
>         b=centrality.ApproxBetweenness2(sg, args.sample)
>         b.run()
>         br=b.ranking()
>         cl=centrality.ApproxCloseness(sg, args.sample)
>         cl.run()
>         clr=cl.ranking()
>         ct=centrality.EigenvectorCentrality(sg)
>         ct.run()
>         ctr=ct.ranking()
> Let me know if you need more info or figure something out

You are right to expect EigenvectorCentrality to run in parallel. How do you notice that it doesn’t?  However, ApproxBetweenness2 and ApproxCloseness are currently not parallelized - work in progress.

setNumberOfThreads(t) allows you to control the number of threads. getCurrentNumberOfThreads() only returns more than 1 when called from a section of code that is at that moment being run in parallel.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ira.uni-karlsruhe.de/mailman/private/networkit/attachments/20150925/024f8056/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <https://lists.ira.uni-karlsruhe.de/mailman/private/networkit/attachments/20150925/024f8056/attachment.sig>

More information about the NetworKit mailing list