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

Add error messages for BFS validation #313

Merged
merged 1 commit into from Jun 19, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 7 additions & 8 deletions libgalois/src/analytics/bfs/bfs.cpp
Expand Up @@ -531,8 +531,8 @@ katana::analytics::BfsAssertValid(
(u_parent != BfsImplementation::kDistanceInfinity)) {
if (u == source) {
if (!(u_parent == u && levels[u] == 0)) {
// Incorrect source
return katana::ErrorCode::AssertionFailed;
return KATANA_ERROR(
katana::ErrorCode::AssertionFailed, "incorrect source");
}
continue;
}
Expand All @@ -542,21 +542,20 @@ katana::analytics::BfsAssertValid(
uint32_t v = *(transpose_graph.GetEdgeDest(e));
if (v == u_parent) {
if (levels[v] != levels[u] - 1) {
// Incorrect depth
return katana::ErrorCode::AssertionFailed;
return KATANA_ERROR(
katana::ErrorCode::AssertionFailed, "incorrect depth");
}
parent_found = true;
break;
}
}

if (!parent_found) {
// Parent must exist
return katana::ErrorCode::AssertionFailed;
return KATANA_ERROR(
katana::ErrorCode::AssertionFailed, "parent must exist");
}
} else if (levels[u] != u_parent) {
// Unvisited node check
return katana::ErrorCode::AssertionFailed;
return KATANA_ERROR(katana::ErrorCode::AssertionFailed, "unvisited node");
}
}

Expand Down