diff --git a/cpp/src/community/ecg_impl.cuh b/cpp/src/community/ecg_impl.cuh index c325dbac4b1..0d2aa2bf005 100644 --- a/cpp/src/community/ecg_impl.cuh +++ b/cpp/src/community/ecg_impl.cuh @@ -50,20 +50,6 @@ std::tuple, size_t, weight_t> ecg( threshold, resolution); - // std::tie(std::ignore, modularity) = cugraph::leiden(handle, - // rng_state, - // graph_view, - // edge_weight_view, - // cluster_assignments.data(), - // size_t{1}, - // resolution, - // theta); - - RAFT_CUDA_TRY(cudaDeviceSynchronize()); - raft::print_device_vector( - "\tcluster_assignments:", cluster_assignments.data(), cluster_assignments.size(), std::cout); - std::cout << "\tmodularity: " << modularity << std::endl; - cugraph::update_edge_src_property( handle, graph_view, cluster_assignments.begin(), src_cluster_assignments); cugraph::update_edge_dst_property( @@ -76,45 +62,9 @@ std::tuple, size_t, weight_t> ecg( dst_cluster_assignments.view(), modified_edge_weights.view(), [] __device__(auto src, auto dst, auto src_property, auto dst_property, auto edge_property) { - printf("\n\t src %d dst %d sc %f dc %f mew %f\n", - static_cast(src), - static_cast(dst), - static_cast(src_property), - static_cast(dst_property), - static_cast(edge_property)); return edge_property + (src_property == dst_property); }, modified_edge_weights.mutable_view()); - - for (size_t ep_idx = 0; ep_idx < graph_view.number_of_local_edge_partitions(); ++ep_idx) { - // // Toplogy - // auto edge_partition = graph_view.local_edge_partition_view(ep_idx); - - // RAFT_CUDA_TRY(cudaDeviceSynchronize()); - // std::cout << "rank: " << r << ", #edges = " << edge_partition.number_of_edges() - // << std::endl; - - // auto number_of_edges = edge_partition.number_of_edges(); - // auto offsets = edge_partition.offsets(); - // auto indices = edge_partition.indices(); - - // RAFT_CUDA_TRY(cudaDeviceSynchronize()); - // raft::print_device_vector("offsets:", offsets.begin(), offsets.size(), std::cout); - // RAFT_CUDA_TRY(cudaDeviceSynchronize()); - // raft::print_device_vector("indices:", indices.begin(), indices.size(), std::cout); - - // Edge property values - { - auto value_firsts = modified_edge_weights.view().value_firsts(); - auto edge_counts = modified_edge_weights.view().edge_counts(); - - // assert(number_of_edges == edge_counts[ep_idx]); - - RAFT_CUDA_TRY(cudaDeviceSynchronize()); - raft::print_device_vector( - "\tmodified weights:", value_firsts[ep_idx], edge_counts[ep_idx], std::cout); - } - } } cugraph::transform_e( @@ -127,13 +77,6 @@ std::tuple, size_t, weight_t> ecg( auto src, auto dst, thrust::nullopt_t, thrust::nullopt_t, auto edge_properties) { auto e_weight = thrust::get<0>(edge_properties); auto e_frequency = thrust::get<1>(edge_properties); - - printf("\n\t src %d dst %d e_weight %f e_freq %f\n", - static_cast(src), - static_cast(dst), - static_cast(e_weight), - static_cast(e_frequency)); - return min_weight + (e_weight - min_weight) * e_frequency / ensemble_size; }, modified_edge_weights.mutable_view()); @@ -149,23 +92,6 @@ std::tuple, size_t, weight_t> ecg( threshold, resolution); - // cugraph::leiden(handle, - // rng_state, - // graph_view, - // std::make_optional(modified_edge_weights.view()), - // cluster_assignments.data(), - // max_level, - // resolution, - // theta); - - RAFT_CUDA_TRY(cudaDeviceSynchronize()); - - std::cout << "\tfinal modularity: " << modularity << std::endl; - raft::print_device_vector("\tfinal cluster_assignments:", - cluster_assignments.data(), - cluster_assignments.size(), - std::cout); - return std::make_tuple(std::move(cluster_assignments), max_level, modularity); }