From fa701f5f223093bb0d7f0e721efce10326ac05f4 Mon Sep 17 00:00:00 2001 From: Seunghwa Kang <45857425+seunghwak@users.noreply.github.com> Date: Thu, 23 Jun 2022 10:05:19 -0700 Subject: [PATCH] Bug fix for decompressing partial edge list and using (key, value) pairs for major properties. (#2366) Authors: - Seunghwa Kang (https://github.com/seunghwak) Approvers: - Chuck Hastings (https://github.com/ChuckHastings) URL: https://github.com/rapidsai/cugraph/pull/2366 --- cpp/include/cugraph/detail/decompress_edge_partition.cuh | 2 +- cpp/include/cugraph/graph.hpp | 2 +- cpp/src/structure/graph_impl.cuh | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cpp/include/cugraph/detail/decompress_edge_partition.cuh b/cpp/include/cugraph/detail/decompress_edge_partition.cuh index b0dcd9658e9..ae1c83cd0fb 100644 --- a/cpp/include/cugraph/detail/decompress_edge_partition.cuh +++ b/cpp/include/cugraph/detail/decompress_edge_partition.cuh @@ -368,7 +368,7 @@ void partially_decompress_edge_partition_to_fill_edgelist( thrust::fill( thrust::seq, majors + major_offset, majors + major_offset + local_degree, major); thrust::copy(thrust::seq, indices, indices + local_degree, minors + major_offset); - if (weights) + if (output_weights) thrust::copy( thrust::seq, *weights, *weights + local_degree, *output_weights + major_offset); diff --git a/cpp/include/cugraph/graph.hpp b/cpp/include/cugraph/graph.hpp index b298da4a5de..808da435235 100644 --- a/cpp/include/cugraph/graph.hpp +++ b/cpp/include/cugraph/graph.hpp @@ -225,7 +225,7 @@ class graph_t>( (*local_sorted_unique_edge_src_chunk_start_offsets_).size()); - for (size_t i = 0; (*local_sorted_unique_edge_srcs).size(); ++i) { + for (size_t i = 0; i < (*local_sorted_unique_edge_srcs).size(); ++i) { (*local_sorted_unique_edge_srcs)[i] = raft::device_span((*local_sorted_unique_edge_srcs_)[i].begin(), (*local_sorted_unique_edge_srcs_)[i].end()); diff --git a/cpp/src/structure/graph_impl.cuh b/cpp/src/structure/graph_impl.cuh index 024266ebd15..4efb64002c6 100644 --- a/cpp/src/structure/graph_impl.cuh +++ b/cpp/src/structure/graph_impl.cuh @@ -638,6 +638,10 @@ update_local_sorted_unique_edge_majors_minors( auto const chunk_size = std::min(static_cast(1.0 / max_major_properties_fill_ratio), size_t{1024}); + local_sorted_unique_edge_majors = std::vector>{}; + local_sorted_unique_edge_major_chunk_start_offsets = + std::vector>{}; + (*local_sorted_unique_edge_majors).reserve(edge_partition_offsets.size()); (*local_sorted_unique_edge_major_chunk_start_offsets).reserve(edge_partition_offsets.size()); for (size_t i = 0; i < edge_partition_offsets.size(); ++i) {