Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Graph algorithms (lib) with input graph in read-only shared memory on C/++

I would like to have a manager process sharing graphs via shared memory, read-only for other processes which will run various graph algorithms on these graphs. I would like to ask some questions emerged while researching the issue:

  • Are there any graph libraries which are able to operate on (possibly their own) graph structures in read-only shm? That is, the algorithms would need to have their workspace and result buffers in the local process memory, and not use any buffers declared in the graph structure.

  • Two libs which I know are famous are igraph and Boost. I don't know much about the C interface of the former and haven't used Boost yet. Any experience in the topic (regarding shm compatibility)?

  • When looking in the Boost docs, I see that there is a Boost.Interprocess package with shm support.

    • At first I thought about using manually crafted shm with mmapped shm (Linux platform). Is Boost superior and recommended over this method?
    • Does the Boost Graph library plays nice along with manual shm or Interprocess?

Apart from insights about these questions I would be glad to read about your experience regarding graph processing and shared memory. Thanks!

like image 846
ron Avatar asked Feb 21 '26 16:02

ron


1 Answers

In Boost Graph Library the various graph types are just concepts ( http://www.boost.org/doc/libs/1_42_0/libs/graph/doc/graph_concepts.html ).

You should be able to implement your own graph structure, adhere to the concept you need and apply any BGL algorithm on your own data (or perhaps just wrap your shared data in an edge_list class http://www.boost.org/doc/libs/1_42_0/libs/graph/doc/edge_list.html ).

Since you are looking at shared memory you might also be interested in the Parallel BGL ( http://www.boost.org/doc/libs/1_42_0/libs/graph_parallel/doc/html/index.html )

HTH

like image 153
baol Avatar answered Feb 23 '26 06:02

baol



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!