Skip to content

Commit

Permalink
Fix primitive bug discovered in MG edge betweenness centrality testing (
Browse files Browse the repository at this point in the history
#3723)

@jnke2016 found a bug in MG edge betweenness centrality.  Upon investigation, the `major_offset` in this block of code wasn't being set correctly if `major` is in the hypersparse region.

Authors:
  - Chuck Hastings (https://github.com/ChuckHastings)

Approvers:
  - Seunghwa Kang (https://github.com/seunghwak)
  - Joseph Nke (https://github.com/jnke2016)
  - Naim (https://github.com/naimnv)

URL: #3723
  • Loading branch information
ChuckHastings authored Jul 20, 2023
1 parent 54b43e1 commit 803b854
Showing 1 changed file with 9 additions and 16 deletions.
25 changes: 9 additions & 16 deletions cpp/src/prims/transform_e.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -291,23 +291,16 @@ void transform_e(raft::handle_t const& handle,
auto major = thrust::get<0>(edge);
auto minor = thrust::get<1>(edge);

vertex_t major_offset{};
vertex_t major_idx{};
auto major_hypersparse_first = edge_partition.major_hypersparse_first();
if (major_hypersparse_first) {
if (major < *major_hypersparse_first) {
major_offset = edge_partition.major_offset_from_major_nocheck(major);
major_idx = major_offset;
} else {
auto major_hypersparse_idx =
edge_partition.major_hypersparse_idx_from_major_nocheck(major);
assert(major_hypersparse_idx);
major_idx = edge_partition.major_offset_from_major_nocheck(*major_hypersparse_first) +
*major_hypersparse_idx;
}
} else {
major_offset = edge_partition.major_offset_from_major_nocheck(major);
major_idx = major_offset;
auto major_offset = edge_partition.major_offset_from_major_nocheck(major);
vertex_t major_idx{major_offset};

if ((major_hypersparse_first) && (major >= *major_hypersparse_first)) {
auto major_hypersparse_idx =
edge_partition.major_hypersparse_idx_from_major_nocheck(major);
assert(major_hypersparse_idx);
major_idx = edge_partition.major_offset_from_major_nocheck(*major_hypersparse_first) +
*major_hypersparse_idx;
}

auto minor_offset = edge_partition.minor_offset_from_minor_nocheck(minor);
Expand Down

0 comments on commit 803b854

Please sign in to comment.