Skip to content

Commit 08f07b6

Browse files
committed
minor changes
Signed-off-by: niranda perera <niranda.perera@gmail.com>
1 parent a2eced5 commit 08f07b6

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

cpp/include/rapidsmpf/shuffler/finish_counter.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class FinishCounter {
7272
FinishedCallback&& finished_callback = nullptr
7373
);
7474

75-
~FinishCounter();
75+
~FinishCounter() = default;
7676

7777
/**
7878
* @brief Move the goalpost for a specific rank and partition.

cpp/src/shuffler/finish_counter.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,30 +62,26 @@ FinishCounter::FinishCounter(
6262
}
6363
}
6464

65-
FinishCounter::~FinishCounter() = default;
66-
6765
bool FinishCounter::all_finished() const {
6866
std::unique_lock<std::mutex> lock(mutex_);
6967
// we can not use the goalposts.empty() because its being consumed by wait* methods
70-
return n_unfinished_partitions_ == 0 || goalposts_.empty();
68+
return n_unfinished_partitions_ == 0;
7169
}
7270

7371
void FinishCounter::move_goalpost(PartID pid, ChunkID nchunks) {
7472
std::unique_lock<std::mutex> lock(mutex_);
75-
auto& p_info = goalposts_[pid];
73+
auto& p_info = goalposts_.at(pid);
7674
p_info.move_goalpost(nchunks, nranks_);
7775
}
7876

7977
void FinishCounter::add_finished_chunk(PartID pid) {
8078
std::unique_lock<std::mutex> lock(mutex_);
81-
auto& p_info = goalposts_[pid];
79+
auto& p_info = goalposts_.at(pid);
8280

8381
p_info.add_finished_chunk(nranks_);
8482

8583
if (p_info.is_finished(nranks_)) {
86-
RAPIDSMPF_EXPECTS(
87-
n_unfinished_partitions_ > 0, "all partitions have been finished"
88-
); // TODO: use a debug flag
84+
assert(n_unfinished_partitions_ > 0); // TODO: use a debug flag
8985
n_unfinished_partitions_--;
9086
lock.unlock();
9187

0 commit comments

Comments
 (0)