From 52c107864cbad91eaff86315297ff27c5a228a5d Mon Sep 17 00:00:00 2001 From: Chuck Hastings <45364586+ChuckHastings@users.noreply.github.com> Date: Mon, 6 Jun 2022 21:09:47 -0400 Subject: [PATCH] Remove legacy sssp implementation (#2344) Legacy SSSP implementation should not be referenced any longer. Authors: - Chuck Hastings (https://github.com/ChuckHastings) Approvers: - Seunghwa Kang (https://github.com/seunghwak) URL: https://github.com/rapidsai/cugraph/pull/2344 --- cpp/CMakeLists.txt | 1 - cpp/include/cugraph/algorithms.hpp | 30 ------------ cpp/src/utilities/cython.cu | 76 ------------------------------ cpp/tests/CMakeLists.txt | 4 -- 4 files changed, 111 deletions(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 22a78924c84..d0faeafca76 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -170,7 +170,6 @@ add_library(cugraph src/structure/legacy/graph.cu src/linear_assignment/hungarian.cu src/traversal/legacy/bfs.cu - src/traversal/legacy/sssp.cu src/link_prediction/jaccard.cu src/link_prediction/overlap.cu src/layout/force_atlas2.cu diff --git a/cpp/include/cugraph/algorithms.hpp b/cpp/include/cugraph/algorithms.hpp index 75d627f4a3e..013c4c56bd9 100644 --- a/cpp/include/cugraph/algorithms.hpp +++ b/cpp/include/cugraph/algorithms.hpp @@ -428,36 +428,6 @@ template std::unique_ptr> get_two_hop_neighbors( legacy::GraphCSRView const& graph); -/** - * @Synopsis Performs a single source shortest path traversal of a graph starting from a vertex. - * - * @throws cugraph::logic_error with a custom message when an error occurs. - * - * @tparam VT Type of vertex identifiers. Supported value : int (signed, - * 32-bit) - * @tparam ET Type of edge identifiers. Supported value : int (signed, - * 32-bit) - * @tparam WT Type of edge weights. Supported values : float or double. - * - * @param[in] graph cuGraph graph descriptor, should contain the connectivity - * information as a CSR - * - * @param[out] distances If set to a valid pointer, array of size V populated by distance - * of every vertex in the graph from the starting vertex. Memory is provided and owned by the - * caller. - * - * @param[out] predecessors If set to a valid pointer, array of size V populated by the SSSP - * predecessor of every vertex. Memory is provided and owned by the caller. - * - * @param[in] start_vertex The starting vertex for SSSP - * - */ -template -void sssp(legacy::GraphCSRView const& graph, - WT* distances, - VT* predecessors, - const VT source_vertex); - // FIXME: Internally distances is of int (signed 32-bit) data type, but current // template uses data from VT, ET, WT from the legacy::GraphCSR View even if weights // are not considered diff --git a/cpp/src/utilities/cython.cu b/cpp/src/utilities/cython.cu index 6ef0facabb5..17d060c1900 100644 --- a/cpp/src/utilities/cython.cu +++ b/cpp/src/utilities/cython.cu @@ -957,54 +957,6 @@ std::unique_ptr random_walks_to_coo(raft::handle_t const& han return std::make_unique(std::move(rw_coo)); } -// Wrapper for calling SSSP through a graph container -template -void call_sssp(raft::handle_t const& handle, - graph_container_t const& graph_container, - vertex_t* identifiers, - weight_t* distances, - vertex_t* predecessors, - const vertex_t source_vertex) -{ - if (graph_container.graph_type == graphTypeEnum::GraphCSRViewFloat) { - graph_container.graph_ptr_union.GraphCSRViewFloatPtr->get_vertex_identifiers( - reinterpret_cast(identifiers)); - sssp( // handle, TODO: clarify: no raft_handle_t? why? - *(graph_container.graph_ptr_union.GraphCSRViewFloatPtr), - reinterpret_cast(distances), - reinterpret_cast(predecessors), - static_cast(source_vertex)); - } else if (graph_container.graph_type == graphTypeEnum::GraphCSRViewDouble) { - graph_container.graph_ptr_union.GraphCSRViewDoublePtr->get_vertex_identifiers( - reinterpret_cast(identifiers)); - sssp( // handle, TODO: clarify: no raft_handle_t? why? - *(graph_container.graph_ptr_union.GraphCSRViewDoublePtr), - reinterpret_cast(distances), - reinterpret_cast(predecessors), - static_cast(source_vertex)); - } else if (graph_container.graph_type == graphTypeEnum::graph_t) { - if (graph_container.edgeType == numberTypeEnum::int32Type) { - auto graph = - detail::create_graph(handle, graph_container); - cugraph::sssp(handle, - graph->view(), - reinterpret_cast(distances), - reinterpret_cast(predecessors), - static_cast(source_vertex)); - } else if (graph_container.edgeType == numberTypeEnum::int64Type) { - auto graph = - detail::create_graph(handle, graph_container); - cugraph::sssp(handle, - graph->view(), - reinterpret_cast(distances), - reinterpret_cast(predecessors), - static_cast(source_vertex)); - } else { - CUGRAPH_FAIL("vertexType/edgeType combination unsupported"); - } - } -} - // wrapper for weakly connected components: // template @@ -1453,34 +1405,6 @@ template std::unique_ptr random_walks_to_coo random_walks_to_coo( raft::handle_t const& handle, random_walk_ret_t& rw_tri); -template void call_sssp(raft::handle_t const& handle, - graph_container_t const& graph_container, - int32_t* identifiers, - float* distances, - int32_t* predecessors, - const int32_t source_vertex); - -template void call_sssp(raft::handle_t const& handle, - graph_container_t const& graph_container, - int32_t* identifiers, - double* distances, - int32_t* predecessors, - const int32_t source_vertex); - -template void call_sssp(raft::handle_t const& handle, - graph_container_t const& graph_container, - int64_t* identifiers, - float* distances, - int64_t* predecessors, - const int64_t source_vertex); - -template void call_sssp(raft::handle_t const& handle, - graph_container_t const& graph_container, - int64_t* identifiers, - double* distances, - int64_t* predecessors, - const int64_t source_vertex); - template void call_wcc(raft::handle_t const& handle, graph_container_t const& graph_container, int32_t* components); diff --git a/cpp/tests/CMakeLists.txt b/cpp/tests/CMakeLists.txt index 1c846c28be5..fd370228a01 100644 --- a/cpp/tests/CMakeLists.txt +++ b/cpp/tests/CMakeLists.txt @@ -313,10 +313,6 @@ ConfigureTest(ERDOS_RENYI_GENERATOR_TEST generators/erdos_renyi_test.cpp) ConfigureTest(LEGACY_BETWEENNESS_TEST centrality/legacy/betweenness_centrality_test.cu) ConfigureTest(LEGACY_EDGE_BETWEENNESS_TEST centrality/legacy/edge_betweenness_centrality_test.cu) -################################################################################################### -# - SSSP tests ------------------------------------------------------------------------------------ -ConfigureTest(LEGACY_SSSP_TEST traversal/legacy/sssp_test.cu) - ################################################################################################### # - BFS tests ------------------------------------------------------------------------------------- ConfigureTest(LEGACY_BFS_TEST traversal/legacy/bfs_test.cu)