diff --git a/cpp/examples/developers/graph_operations/graph_operations.cu b/cpp/examples/developers/graph_operations/graph_operations.cu index 014cedcab7e..912f9f1fd46 100644 --- a/cpp/examples/developers/graph_operations/graph_operations.cu +++ b/cpp/examples/developers/graph_operations/graph_operations.cu @@ -131,7 +131,7 @@ create_graph(raft::handle_t const& handle, // if (multi_gpu) { - std::tie(d_edge_srcs, d_edge_dsts, d_edge_wgts, std::ignore, std::ignore) = + std::tie(d_edge_srcs, d_edge_dsts, d_edge_wgts, std::ignore, std::ignore, std::ignore) = cugraph::shuffle_external_edges(handle, std::move(d_edge_srcs), std::move(d_edge_dsts), @@ -215,10 +215,10 @@ void perform_example_graph_operations( graph_view); cugraph::update_edge_src_property( - handle, graph_view, vertex_weights.begin(), src_vertex_weights_cache); + handle, graph_view, vertex_weights.begin(), src_vertex_weights_cache.mutable_view()); cugraph::update_edge_dst_property( - handle, graph_view, vertex_weights.begin(), dst_vertex_weights_cache); + handle, graph_view, vertex_weights.begin(), dst_vertex_weights_cache.mutable_view()); rmm::device_uvector weighted_averages( size_of_the_vertex_partition_assigned_to_this_process, handle.get_stream()); @@ -259,10 +259,10 @@ void perform_example_graph_operations( graph_view); cugraph::update_edge_src_property( - handle, graph_view, vertex_weights.begin(), src_vertex_weights_cache); + handle, graph_view, vertex_weights.begin(), src_vertex_weights_cache.mutable_view()); cugraph::update_edge_dst_property( - handle, graph_view, vertex_weights.begin(), dst_vertex_weights_cache); + handle, graph_view, vertex_weights.begin(), dst_vertex_weights_cache.mutable_view()); rmm::device_uvector weighted_averages( size_of_the_vertex_partition_assigned_to_this_process, handle.get_stream()); diff --git a/cpp/examples/developers/vertex_and_edge_partition/vertex_and_edge_partition.cu b/cpp/examples/developers/vertex_and_edge_partition/vertex_and_edge_partition.cu index ce02e3b2639..c261ff6d843 100644 --- a/cpp/examples/developers/vertex_and_edge_partition/vertex_and_edge_partition.cu +++ b/cpp/examples/developers/vertex_and_edge_partition/vertex_and_edge_partition.cu @@ -127,7 +127,7 @@ create_graph(raft::handle_t const& handle, // if (multi_gpu) { - std::tie(d_edge_srcs, d_edge_dsts, d_edge_wgts, std::ignore, std::ignore) = + std::tie(d_edge_srcs, d_edge_dsts, d_edge_wgts, std::ignore, std::ignore, std::ignore) = cugraph::shuffle_external_edges(handle, std::move(d_edge_srcs), std::move(d_edge_dsts), diff --git a/cpp/examples/users/multi_gpu_application/mg_graph_algorithms.cpp b/cpp/examples/users/multi_gpu_application/mg_graph_algorithms.cpp index a9e2a170208..db629117604 100644 --- a/cpp/examples/users/multi_gpu_application/mg_graph_algorithms.cpp +++ b/cpp/examples/users/multi_gpu_application/mg_graph_algorithms.cpp @@ -123,7 +123,7 @@ create_graph(raft::handle_t const& handle, // if (multi_gpu) { - std::tie(d_edge_srcs, d_edge_dsts, d_edge_wgts, std::ignore, std::ignore) = + std::tie(d_edge_srcs, d_edge_dsts, d_edge_wgts, std::ignore, std::ignore, std::ignore) = cugraph::shuffle_external_edges(handle, std::move(d_edge_srcs), std::move(d_edge_dsts), @@ -248,9 +248,8 @@ void run_graph_algorithms( std::cout); } -int main(int argc, char** argv) +void run_tests() { - initialize_mpi_and_set_device(argc, argv); std::unique_ptr handle = initialize_mg_handle(); // @@ -279,6 +278,7 @@ int main(int argc, char** argv) std::move(std::make_optional(edge_wgts)), renumber, is_symmetric); + // Non-owning view of the graph object auto graph_view = graph.view(); @@ -292,5 +292,14 @@ int main(int argc, char** argv) run_graph_algorithms( *handle, graph_view, edge_weight_view); + handle.release(); +} + +int main(int argc, char** argv) +{ + initialize_mpi_and_set_device(argc, argv); + + run_tests(); + RAFT_MPI_TRY(MPI_Finalize()); } diff --git a/cpp/include/cugraph/graph_functions.hpp b/cpp/include/cugraph/graph_functions.hpp index e1364f69991..7f6543ccab8 100644 --- a/cpp/include/cugraph/graph_functions.hpp +++ b/cpp/include/cugraph/graph_functions.hpp @@ -1178,7 +1178,8 @@ std::tuple, rmm::device_uvector, std::optional>, std::optional>, - std::optional>> + std::optional>, + std::vector> shuffle_external_edges(raft::handle_t const& handle, rmm::device_uvector&& edge_srcs, rmm::device_uvector&& edge_dsts,