Gtk-WARNING

I am getting the following warning when using graph_draw:

(process:23214): Gtk-WARNING **: Locale not supported by C library.
  Using the fallback 'C' locale.
Dynamic session lookup supported but failed: launchd did not provide a socket path, verify that org.freedesktop.dbus-session.plist is loaded!
Fontconfig warning: ignoring UTF-8: not a valid region tag

It appears that the output file is still successfully rendered to .png.

I am not sure what the implications of the warning are, how to remedy, or what, if anything, is affected by it?

Thanks.

These warnings are harmless; they can be safely ignored.

They are triggered by GTK, not by graph-tool itself. So there is little
I can do about them. They do seem, however, to be related to the locale
configuration of your system. You may be able to get rid of them by
properly configuring your locale.

Best,
Tiago

I have installed graph-tool and am doing some tests. One of these was a betweenness calculation, where it appears that only one core was being utilised.

I installed via macports whereby the configuration is fully automatic. I’m therefore assuming that macports by default doesn’t enable openmp (—enable-openmp) ?

Is there a way to enable this via a macports install, or should I install via home-brew instead?

Thanks.

which function specifically?

attachment.html (1.13 KB)

The only supported compiler in MacOS which is capable of compiling c++11
code is clang, which does not yet have openmp support.

You may try to use GCC with macports, but AFAIK it does not work very
well. You can open a ticket at:

    https://trac.macports.org/auth/login/?next=/newticket

And ask the macports maintainers to add an 'openmp' variant which could
be used with GCC.

Best,
Tiago

Is this a limitation of macports or the mac environment itself?

For example, if I install this: http://clang-omp.github.io

Then is there a way to get graph-tool running with openmp?

Thanks.

Is this a limitation of macports or the mac environment itself?

The last time I tried (a long time ago), GCC would not generate valid
binaries for the platform. I think it was not macports related... At the
time it was particularly difficult to mix GCC with clang because of the
whole libstc++/libc++ thing. Nowadays it might be the case that using
both GCC and clang works, as long as libc++ is used instead of
libstdc++. You can try using GCC now and see how far you can get.

For example, if I install this: http://clang-omp.github.io

Then is there a way to get graph-tool running with openmp?

Yes, this could work, but I have never tried it.

Best,
Tiago

The download / installation page makes reference to enabling openMP by passing the —enable-openmp to the configure script…

When installing a pre-compiled package for Ubuntu, would openMP be supported, or does this require a manual install?

Thanks.

Tried installing openMP support for Clang in mac, but keep running into various issues and errors. Giving up and thinking of running graph-tool in Linux on a virtual machine.

No, openmp is already enabled in these cases.

IIRC clang 3.4 has already openmp support, but I'm not sure. You can
open a macports ticket and ask them to add a openmp variant for the
port, which could be used with clang 3.4.

There is talk of it being ready for version 3.5 … which appears to be due for around August.

In the meantime, this pre-release implementation is available:
http://clang-omp.github.io

With some scripts for installation available like the last answer here:
http://stackoverflow.com/questions/20321988/error-enabling-openmp-ld-library-not-found-for-lgomp-and-clang-errors

In case other mac users stumble on this discussion:

It is quite painful to try to install openMP for clang, after much trying I was not able to get it to work. This may change once OpenMP is officially supported in Clang 3.5

In the meantime, I’m now running Ubuntu Linux via Parallels on Mac. Graph-tool is running betweenness computations on all eight cores of my mac... -> always makes me smile to see all cores working hard.

So, if you’re a mac user, the relatively small cost of parallels is worth it. Ubuntu is free, and relatively easy to set up, though there are some bugs (Linux<->Parallels) like blank screens that are resolved relatively easily with a bit of googling.

My point is, if you’re a mac user and you want to use all cores, then you’re probably better off spending your time getting the Linux version working on Parallels. At least until OpenMP is natively supported in Clang.

Best of luck, and thanks to Tiago for help along the way.

Is there a way to approximate the amount of time it will take to complete some of the functions, for example, betweenness centrality? I am running some experimental betweenness computations on large graph sets, and its hard to know when to wait-it-out or to pull-the-plug, so to speak.

Thanks.

No, this is not currently possible.

Best,
Tiago

Is there a manner to run the betweenness algorithm only up to a certain weighted depth from each e / v, instead of for the whole graph?

Similar, for example, to the topology.shortest_distance algorithm which includes an optional input for max_dist.

Thanks,
Gareth

I am using the shortest_distance method with a starting point vertex and a maximum search distance. When returning the results, the vertices outside of the maximum distance threshold are returned as maximum 64bit float numbers (1.79769313486e+308), presumably converted from Numpy’s internal positive infinity value.

Is there a way to return the array with numpy’s positive infinity value intact so that I can use the numpy.isposinf method to directly convert the array into a boolean format which I can then use for masking the graph?

Thanks.

I am using the shortest_distance method with a starting point vertex
and a maximum search distance. When returning the results, the
vertices outside of the maximum distance threshold are returned as
maximum 64bit float numbers (1.79769313486e+308), presumably converted
from Numpy’s internal positive infinity value.

This is not infinity, it is the maximum possible double.

Is there a way to return the array with numpy’s positive infinity
value intact so that I can use the numpy.isposinf method to directly
convert the array into a boolean format which I can then use for
masking the graph?

There is no need to use "inf" (it would not work with integrals
anyway). You can just use array operations to achieve the same thing:

    d = shortest_distance(g, source, max_dist=max_dist)
    mask = d.a <= max_dist
    u = GraphView(g, vfilt=mask)

Best,
Tiago