Skip to content
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

bug fix in inmemconncomps #30

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion example_apps/application_template.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ struct MyGraphChiProgram : public GraphChiProgram<VertexDataType, EdgeDataType>
*/
void update(graphchi_vertex<VertexDataType, EdgeDataType> &vertex, graphchi_context &gcontext) {

if (ginfo.iteration == 0) {
if (gcontext.iteration == 0) {
/* On first iteration, initialize vertex (and its edges). This is usually required, because
on each run, GraphChi will modify the data files. To start from scratch, it is easiest
do initialize the program in code. Alternatively, you can keep a copy of initial data files. */
Expand Down
6 changes: 5 additions & 1 deletion example_apps/inmemconncomps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@ struct ConnectedComponentsProgram : public GraphChiProgram<VertexDataType, EdgeD
assert(gcontext.scheduler != NULL);

/* On subsequent iterations, find the minimum label of my neighbors */
vid_t curmin = vertex.get_data();
vid_t curmin;
if(gcontext.iteration == 0)
curmin = vertex_values[vertex.id()];
else
curmin = vertex.get_data();
for(int i=0; i < vertex.num_edges(); i++) {
vid_t nblabel = neighbor_value(vertex.edge(i));
curmin = std::min(nblabel, curmin);
Expand Down