Boost logo

Boost Users :

Subject: Re: [Boost-users] [Graph] Distributed edge insertion
From: Sensei (senseiwa_at_[hidden])
Date: 2015-08-25 05:53:52


On 8/24/15 8:13pm, Sensei wrote:
> Dear all,
>
> I am finding difficulties in understanding how distributed graphs work.
> My graph is simple, a string-valued property, with some edges, however,
> right now I have only one edge... if it works.
>
> Since each process will add its own nodes, is it possible to avoid
> communication when adding nodes, given that each node owns its own
> vertices, and no overlap is possible between processes? This would save
> some communication avoiding re-distribution of nodes.
>
> Can I add edges concurrently? Meaning, each process adds some edges.
> I've only seen examples with root adding edges, but that's limiting.

> My last question is maybe easy. I'm adding an edge that connects two
> nodes, owned by different processes. Doing this results in a crash. It
> seems I cannot access properties with operator[] when traversing processes.

This issue seems to be solved by avoiding operator[], and using a
property map:

     property_map<dgraph, std::string str::*>::type properties =
get(&str::s_, g);

     synchronize(g);

     BGL_FORALL_EDGES(e, g, dgraph)
     {
         std::cout << "E @ " << comm.rank() << " " << get(properties,
boost::source(e, g)) << " -> " << get(properties, boost::target(e, g))
                   << " owner " << e.owner() << " srccpu " <<
e.source_processor << " dstcpu " << e.target_processor << std::endl;
     }

However, I am still trying to figure out the answers to the first two
questions:
- is it possible to add edges from different processes concurrently?
- is it possible to partition nodes a priori?

Of course my code works right now, but maybe what I'm doing isn't
kosher, that's why I'm asking if it's possible (aka "safe").

Thanks!


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net