Skip to content

Commit

Permalink
Remove debugging code
Browse files Browse the repository at this point in the history
  • Loading branch information
Naim committed Dec 6, 2023
1 parent 909c710 commit baee0a9
Showing 1 changed file with 0 additions and 74 deletions.
74 changes: 0 additions & 74 deletions cpp/src/community/ecg_impl.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,6 @@ std::tuple<rmm::device_uvector<vertex_t>, 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(
Expand All @@ -76,45 +62,9 @@ std::tuple<rmm::device_uvector<vertex_t>, 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<int>(src),
static_cast<int>(dst),
static_cast<float>(src_property),
static_cast<float>(dst_property),
static_cast<float>(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(
Expand All @@ -127,13 +77,6 @@ std::tuple<rmm::device_uvector<vertex_t>, 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<int>(src),
static_cast<int>(dst),
static_cast<float>(e_weight),
static_cast<float>(e_frequency));

return min_weight + (e_weight - min_weight) * e_frequency / ensemble_size;
},
modified_edge_weights.mutable_view());
Expand All @@ -149,23 +92,6 @@ std::tuple<rmm::device_uvector<vertex_t>, 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);
}

Expand Down

0 comments on commit baee0a9

Please sign in to comment.