Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename primitive functions. #2234

Merged
merged 23 commits into from
Apr 28, 2022
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
cc2404e
rename two level primitive files
seunghwak Apr 19, 2022
be5884c
rename primitive function calls
seunghwak Apr 19, 2022
14c1945
rename test files
seunghwak Apr 19, 2022
1685445
rename prim function calls in tests
seunghwak Apr 19, 2022
3ec334e
update CMake
seunghwak Apr 19, 2022
56aab7c
additional variable renamings
seunghwak Apr 19, 2022
9f5a9a3
fix errors in print-outs
seunghwak Apr 19, 2022
63c6d26
copyright year
seunghwak Apr 19, 2022
86233f2
piggyback vertex_partition_offsets to vertex_partition_range_offsets …
seunghwak Apr 19, 2022
a3e2104
Merge branch 'branch-22.06' of github.com:rapidsai/cugraph into enh_p…
seunghwak Apr 20, 2022
463b75d
Merge branch 'branch-22.06' of github.com:rapidsai/cugraph into enh_p…
seunghwak Apr 20, 2022
2a93c7f
Merge branch 'branch-22.06' of github.com:rapidsai/cugraph into enh_p…
seunghwak Apr 21, 2022
cf5406d
fix compile error
seunghwak Apr 21, 2022
2e019f2
Merge branch 'branch-22.06' of github.com:rapidsai/cugraph into enh_p…
seunghwak Apr 26, 2022
b3a1e32
update comments about partition_t
seunghwak Apr 26, 2022
1e80fb7
rename update_frontier... file
seunghwak Apr 26, 2022
f40e3ab
remove of_v from update_frontier... prim name
seunghwak Apr 26, 2022
ac62ee2
rename update_frontier... test flie name
seunghwak Apr 26, 2022
9711389
rename prim files
seunghwak Apr 26, 2022
04e37e0
renmae prim related files
seunghwak Apr 27, 2022
3aca5be
code update based on primitive renamings
seunghwak Apr 27, 2022
d001193
Merge branch 'branch-22.06' of github.com:rapidsai/cugraph into enh_p…
seunghwak Apr 27, 2022
161f634
variable renaming in tests
seunghwak Apr 27, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 32 additions & 30 deletions cpp/include/cugraph/graph_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ class serializer_t; // forward...
*
* To be more specific, a GPU with (col_comm_rank, row_comm_rank) will be responsible for
* col_comm_size rectangular partitions [a_i,b_i) by [c,d) where a_i =
* vertex_partition_offsets[row_comm_size * i + row_comm_rank] and b_i =
* vertex_partition_offsets[row_comm_size * i + row_comm_rank + 1]. c is
* vertex_partition_offsets[row_comm_size * col_comm_rank] and d =
* vertex_partition_offsests[row_comm_size * (col_comm_rank + 1)].
* vertex_partition_range_offsets[row_comm_size * i + row_comm_rank] and b_i =
* vertex_partition_range_offsets[row_comm_size * i + row_comm_rank + 1]. c is
* vertex_partition_range_offsets[row_comm_size * col_comm_rank] and d =
* vertex_partition_range_offsets[row_comm_size * (col_comm_rank + 1)].
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we rename this to specify that it is a range of vertex ids?
vertex_id_ranges perhaps?

Copy link
Contributor Author

@seunghwak seunghwak Apr 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be more consistent with the rest, we may need to rename vertex_partition_range to vertex_id_partition_range but I feel like this is a bit too lengthy (I thought vertex_partition somewhat implies partitioning of vertex ID ranges but it seems like this implication is not clear enough).

I added additional comments below to make this point clearer. Do you think this is sufficient or we need to further discuss about renaming?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this explanation is clear enough.

*
* See E. G. Boman et. al., “Scalable matrix computations on large scale-free graphs using 2D graph
* partitioning”, 2013 for additional detail.
Expand All @@ -74,27 +74,29 @@ class partition_t {
public:
partition_t() = default;

partition_t(std::vector<vertex_t> const& vertex_partition_offsets,
partition_t(std::vector<vertex_t> const& vertex_partition_range_offsets,
int row_comm_size,
int col_comm_size,
int row_comm_rank,
int col_comm_rank)
: vertex_partition_offsets_(vertex_partition_offsets),
: vertex_partition_range_offsets_(vertex_partition_range_offsets),
comm_rank_(col_comm_rank * row_comm_size + row_comm_rank),
row_comm_size_(row_comm_size),
col_comm_size_(col_comm_size),
row_comm_rank_(row_comm_rank),
col_comm_rank_(col_comm_rank)
{
CUGRAPH_EXPECTS(
vertex_partition_offsets.size() == static_cast<size_t>(row_comm_size * col_comm_size + 1),
"Invalid API parameter: erroneous vertex_partition_offsets.size().");
CUGRAPH_EXPECTS(vertex_partition_range_offsets.size() ==
static_cast<size_t>(row_comm_size * col_comm_size + 1),
"Invalid API parameter: erroneous vertex_partition_range_offsets.size().");

CUGRAPH_EXPECTS(std::is_sorted(vertex_partition_range_offsets_.begin(),
vertex_partition_range_offsets_.end()),
"Invalid API parameter: partition.vertex_partition_range_offsets values should "
"be non-descending.");
CUGRAPH_EXPECTS(
std::is_sorted(vertex_partition_offsets_.begin(), vertex_partition_offsets_.end()),
"Invalid API parameter: partition.vertex_partition_offsets values should be non-descending.");
CUGRAPH_EXPECTS(vertex_partition_offsets_[0] == vertex_t{0},
"Invalid API parameter: partition.vertex_partition_offsets[0] should be 0.");
vertex_partition_range_offsets_[0] == vertex_t{0},
"Invalid API parameter: partition.vertex_partition_range_offsets[0] should be 0.");

vertex_t start_offset{0};
edge_partition_major_value_start_offsets_.assign(number_of_local_edge_partitions(), 0);
Expand All @@ -111,31 +113,31 @@ class partition_t {
int col_comm_size() const { return col_comm_size_; }
int comm_rank() const { return comm_rank_; }

std::vector<vertex_t> const& vertex_partition_offsets() const
std::vector<vertex_t> const& vertex_partition_range_offsets() const
{
return vertex_partition_offsets_;
return vertex_partition_range_offsets_;
}

std::vector<vertex_t> vertex_partition_range_lasts() const
{
return std::vector<vertex_t>(vertex_partition_offsets_.begin() + 1,
vertex_partition_offsets_.end());
return std::vector<vertex_t>(vertex_partition_range_offsets_.begin() + 1,
vertex_partition_range_offsets_.end());
}

std::tuple<vertex_t, vertex_t> local_vertex_partition_range() const
{
return std::make_tuple(vertex_partition_offsets_[comm_rank_],
vertex_partition_offsets_[comm_rank_ + 1]);
return std::make_tuple(vertex_partition_range_offsets_[comm_rank_],
vertex_partition_range_offsets_[comm_rank_ + 1]);
}

vertex_t local_vertex_partition_range_first() const
{
return vertex_partition_offsets_[comm_rank_];
return vertex_partition_range_offsets_[comm_rank_];
}

vertex_t local_vertex_partition_range_last() const
{
return vertex_partition_offsets_[comm_rank_ + 1];
return vertex_partition_range_offsets_[comm_rank_ + 1];
}

vertex_t local_vertex_partition_range_size() const
Expand All @@ -145,18 +147,18 @@ class partition_t {

std::tuple<vertex_t, vertex_t> vertex_partition_range(size_t partition_idx) const
{
return std::make_tuple(vertex_partition_offsets_[partition_idx],
vertex_partition_offsets_[partition_idx + 1]);
return std::make_tuple(vertex_partition_range_offsets_[partition_idx],
vertex_partition_range_offsets_[partition_idx + 1]);
}

vertex_t vertex_partition_range_first(size_t partition_idx) const
{
return vertex_partition_offsets_[partition_idx];
return vertex_partition_range_offsets_[partition_idx];
}

vertex_t vertex_partition_range_last(size_t partition_idx) const
{
return vertex_partition_offsets_[partition_idx + 1];
return vertex_partition_range_offsets_[partition_idx + 1];
}

vertex_t vertex_partition_range_size(size_t partition_idx) const
Expand All @@ -176,12 +178,12 @@ class partition_t {

vertex_t local_edge_partition_major_range_first(size_t partition_idx) const
{
return vertex_partition_offsets_[row_comm_size_ * partition_idx + row_comm_rank_];
return vertex_partition_range_offsets_[row_comm_size_ * partition_idx + row_comm_rank_];
}

vertex_t local_edge_partition_major_range_last(size_t partition_idx) const
{
return vertex_partition_offsets_[row_comm_size_ * partition_idx + row_comm_rank_ + 1];
return vertex_partition_range_offsets_[row_comm_size_ * partition_idx + row_comm_rank_ + 1];
}

vertex_t local_edge_partition_major_range_size(size_t partition_idx) const
Expand All @@ -205,12 +207,12 @@ class partition_t {

vertex_t local_edge_partition_minor_range_first() const
{
return vertex_partition_offsets_[col_comm_rank_ * row_comm_size_];
return vertex_partition_range_offsets_[col_comm_rank_ * row_comm_size_];
}

vertex_t local_edge_partition_minor_range_last() const
{
return vertex_partition_offsets_[(col_comm_rank_ + 1) * row_comm_size_];
return vertex_partition_range_offsets_[(col_comm_rank_ + 1) * row_comm_size_];
}

vertex_t local_edge_partition_minor_range_size() const
Expand All @@ -219,7 +221,7 @@ class partition_t {
}

private:
std::vector<vertex_t> vertex_partition_offsets_{}; // size = P + 1
std::vector<vertex_t> vertex_partition_range_offsets_{}; // size = P + 1

int comm_rank_{0};
int row_comm_size_{0};
Expand Down
Loading