Skip to content

Commit

Permalink
reduce memory footprint in graph creation
Browse files Browse the repository at this point in the history
  • Loading branch information
seunghwak committed Aug 30, 2024
1 parent d5154d5 commit be504cc
Show file tree
Hide file tree
Showing 2 changed files with 240 additions and 88 deletions.
27 changes: 26 additions & 1 deletion cpp/include/cugraph/partition_manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ class partition_manager {
// partitioning along the major axis (major sub-communicator is responsible for this) and along
// the minor axis (minor sub-communicator is responsible for this). This variable controls whether
// to map the major sub-communicator to the GPU row communicator or the GPU column communicator.
static constexpr bool map_major_comm_to_gpu_row_comm = true;
static constexpr bool map_major_comm_to_gpu_row_comm =
false; // FIXME: this is for benchmarking, reset to true before merging

#ifdef __CUDACC__
__host__ __device__
Expand Down Expand Up @@ -71,6 +72,30 @@ class partition_manager {
: (major_comm_rank * minor_comm_size + minor_comm_rank);
}

#ifdef __CUDACC__
__host__ __device__
#endif
static int
compute_major_comm_rank_from_global_comm_rank(int major_comm_size,
int minor_comm_size,
int comm_rank)
{
return map_major_comm_to_gpu_row_comm ? comm_rank % major_comm_size
: comm_rank / minor_comm_size;
}

#ifdef __CUDACC__
__host__ __device__
#endif
static int
compute_minor_comm_rank_from_global_comm_rank(int major_comm_size,
int minor_comm_size,
int comm_rank)
{
return map_major_comm_to_gpu_row_comm ? comm_rank / major_comm_size
: comm_rank % minor_comm_size;
}

#ifdef __CUDACC__
__host__ __device__
#endif
Expand Down
Loading

0 comments on commit be504cc

Please sign in to comment.