-
Notifications
You must be signed in to change notification settings - Fork 44
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
organize an example pagerank app employing the gar library (#44) #46
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! The pull request looks good. It has basically met the issue requirement but some modification still need.
examples/pagerank/pagerank.cc
Outdated
|
||
int main(int argc, char* argv[]) { | ||
// read file and construct graph info | ||
std::string path = "/tmp/ldbc_sample/parquet/ldbc_sample.graph.yml"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a little hard-code. Use the relative path to test/gar-test
or add a soft link to it maybe better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My purpose is to make this example a new project over the GAR library.
examples/pagerank/pagerank.cc
Outdated
|
||
// extend the original vertex info and write results to gar using writer | ||
// construct property group | ||
GraphArchive::Property pagerank = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a pagerank example, I don't know if we just write the result to file not extend as a property would be better. That would have two benefits:
- simpler and clear for a example
- no need to include arrow header any more.
@lixueclaire what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. To remove arrow here, you can use VertexBuilder instead of VertexPropertyWriter to write results. (please refer to "method 1 for writing results" in https://github.com/alibaba/GraphAr/blob/main/test/test_example/test_bgl_example.cc)
examples/pagerank/CMakeLists.txt
Outdated
@@ -0,0 +1,23 @@ | |||
cmake_minimum_required(VERSION 2.8) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if we need a CMakeList here. Seems put these to CMakeLists in root path and make example as a new target would be better.
A new CMakeList.txt here would bring some cons:
- it need user/develop to install GraphAr first, not just make
- it's building need to build arrow again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I think what you suggested is the in-project examples. What I want to show here is a new application employing the GAR library, in which case, users should first install GAR, and then build their own application projects.
@@ -0,0 +1,92 @@ | |||
# Licensed to the Apache Software Foundation (ASF) under one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto. We can reuse the apache-arrow.cmake of GraphAr.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer remove arrow from our example
examples/bfs_father_example.cc
Outdated
@@ -6,7 +6,7 @@ You may obtain a copy of the License at | |||
|
|||
http://www.apache.org/licenses/LICENSE-2.0 | |||
|
|||
Unless required by applicable law or agreed to in writing, software | |||
Unless assertd by applicable law or agreed to in writing, software |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, Why we need to change required
to assertd
here and the assertd
has a typo ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a replace mistake, I will revert it back 😁
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Except the required
to asserted
question, this PR is LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no additional comments except the filenames.
docs/applications/out-of-core.rst
Outdated
@@ -107,16 +107,16 @@ Meanwhile, BFS could be implemented in a **push**-style which only traverses the | |||
In some cases, it is required to record the path of BFS, that is, to maintain each vertex's predecessor (also called *father*) in the traversing tree rather than only recording the distance. The implementation of BFS with recording fathers can be found at `test_bfs_father_example.cc`_. | |||
|
|||
|
|||
.. _test_pagerank_example.cc: https://github.com/alibaba/GraphAr/blob/main/test/test_example/test_pagerank_example.cc | |||
.. _test_pagerank_example.cc: https://github.com/alibaba/GraphAr/blob/main/examples/pagerank_example.cc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please modify these file names, for example, "test_pagerank_example.cc" -> "pagerank_example.cc"
docs/user-guide/getting-started.rst
Outdated
|
||
.. _test_pagerank_example.cc: https://github.com/alibaba/GraphAr/blob/main/test/test_example/test_pagerank_example.cc | ||
.. _test_pagerank_example.cc: https://github.com/alibaba/GraphAr/blob/main/examples/pagerank_example.cc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"test_pagerank_example.cc" -> "pagerank_example.cc"
Proposed changes
Organize the original PageRank test code as an example application. It demonstrates how to edit CMake to integrate GAR C++ library and how to extend an input graph with its PageRank values using GAR methods.
Types of changes
What types of changes does your code introduce to GraphAr?
Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Further comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...