-
Notifications
You must be signed in to change notification settings - Fork 518
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Big vertex fixes #137
base: master
Are you sure you want to change the base?
Big vertex fixes #137
Conversation
I have also modified all the code in the toolkits to work with larger vertex_ids. However, I would like to hear your opinion on the pull request before making it bigger. |
Hi Jesus, http://www.graphlab.com Danny Bickson On Tue, Apr 22, 2014 at 12:34 AM, Jesús Cerquides
|
Thanks Danny, by now just take a look at the main idea on how to do the extension. I have identified some issues that still need to be fixed. |
…orted a bug in boost::multiprecision. Provided a fix so that graphlab is not affected.
Making the whole of graphlab compatible with large vertex_ids is a big change that impacts different parts of the code. Although I have tried to minimize the impact, it is still a major change. As such, right now adding it to the graphlab master branch does not seem the right way to go. On the other hand, I think that it can be potentially very interesting to other people that, like myself, should read the graph from a database which already has their own ids. Thus, to me the best option right now is to create a branch where the work is committed. This raises questions about the development process that you expect for the graphlab project. These are very relevant questions to make clear if your idea is to have people contributing to the code base. By the way, given the amount of movement going on on the code base right now. A simple model such as "Danny will decide" could be the most appropriate. Sorry for wandering ;) |
Hi http://www.graphlab.com Danny Bickson On Tue, Apr 22, 2014 at 2:18 PM, Jesús Cerquides
|
As reported here, I am interested in extending graphlab so that it can be used with ids that are larger than the standard. This pull request does not change the vertex_id_type, but makes some minor changes which are necessary in the code that make it possible for someone who is interested to use a larger vertex id space.
Description of the changes
Current version of graphlab is not prepared for larger vertex id types. The usage of larger vertex id types requires to configure the project to compile with C++11. Slight modifications have been done to to the following files:
graphlab/graph/graph_basic_types.hpp
: The type for local vertex id should be decoupled from the larger type (currently they are enforced to be the same type). We do this by introducing a new intermediate type calledstandard_vertex_id_type
. For regular users this is just an implementation detail.graphlab/engine/distributed_chandy_misra.hpp
: The assessment of sequentialization keys misses a cast tounsigned char
.graphlab/graph/distributed_graph.hpp
andgraphlab/graph/ingress/distributed_ingress_base.hpp
:num_in_edges
andnum_out_edges
should have typesize_t
.graphlab/graph/graph_hash.hpp
: three casts fromvertex_id_type
tosize_t
are missing.To the best of my knowledge, those changes will not have any effect when the
vertex_id_type
is kept "standard" (that is, eitheruint32_t
oruint64_t
) either with C++11 or without it. Thus I push the changes to be accepted into the graphlab project.Steps to use a different
vertex_id_type
(assuming that the changes in this pull request are accepted into the project)There are two ways for doing it.
Simple way
Select one of the types included in
graphlab/util/multiprecision_vertex_id_types.hpp
. They areboost::multiprecision::int128_t
,boost::multiprecision::int256_t
,boost::multiprecision::int512_t
andboost::multiprecision::int1024_t
Configure the project as follows:
./configure --c++11 -D EXTERNAL_VERTEX_ID_TYPE_INCLUDE="'<graphlab/util/multiprecision_vertex_id_types.hpp>'" -D EXTERNAL_VERTEX_ID_TYPE=boost::multiprecision::int128_t
Complex way. Implementing another type
Here follows a step by step guide on how to use other types as
vertex_id_type
.Decide on the type that you would prefer for your vertex id. Constraints on the type are:
boost::multiprecision::int128_t
, and it fulfills all the needs in this sense.size_t
,int
,unsigned char
, .... It our case this is also provided by the boost multiprecision library.boost::multiprecision::int128_t
, I used out of place serialization, seegraphlab/util/multiprecision_vertex_id_types.hpp
for examples).size_t hash_value(const my_large_id_type& x)
in the same namespace wheremy_large_id_type
is defined (seegraphlab/util/multiprecision_vertex_id_types.hpp
, for examples).Configure the project as follows:
./configure --c++11 -D EXTERNAL_VERTEX_ID_TYPE_INCLUDE="'[path to your include file here]'" -D EXTERNAL_VERTEX_ID_TYPE=[your vertex_id_type class here]