Helper to tally the finish status of a shuffle. More...
#include <finish_counter.hpp>
Public Member Functions | |
| FinishCounter (Rank nranks, PartID n_local_partitions) | |
| Construct a finish counter. More... | |
| void | move_goalpost (Rank src_rank, ChunkID nchunks) |
| Move the goalpost for a specific source rank. More... | |
| void | add_finished_chunk () |
| Add a finished chunk to the global counter. More... | |
| bool | all_finished () const |
| Returns whether all partitions are finished (non-blocking). More... | |
| std::string | str () const |
| Returns a description of this instance. More... | |
Helper to tally the finish status of a shuffle.
The FinishCounter class tracks the completion of shuffle operations across different ranks. Each rank reports its total chunk count once, and individual chunks are tallied globally. All local partitions finish simultaneously when every rank has reported and all chunks have been received.
Definition at line 38 of file finish_counter.hpp.
| rapidsmpf::shuffler::detail::FinishCounter::FinishCounter | ( | Rank | nranks, |
| PartID | n_local_partitions | ||
| ) |
Construct a finish counter.
| nranks | The total number of ranks participating in the shuffle. |
| n_local_partitions | The number of local partitions owned by this rank. |
| void rapidsmpf::shuffler::detail::FinishCounter::add_finished_chunk | ( | ) |
Add a finished chunk to the global counter.
This function increments the global finished chunk counter. When all ranks have reported and the number of finished chunks matches the total goal, all partitions are marked as finished.
| std::logic_error | If the total finished chunks exceed the goal. |
| bool rapidsmpf::shuffler::detail::FinishCounter::all_finished | ( | ) | const |
Returns whether all partitions are finished (non-blocking).
Move the goalpost for a specific source rank.
This function sets the number of chunks that need to be received from a specific rank. It should only be called once per rank.
| src_rank | The source rank reporting its chunk count. |
| nchunks | The number of chunks required. (Requires nchunks > 0) |
| std::logic_error | If the goalpost is moved more than once for the same rank, or if nchunks is 0. |
| std::string rapidsmpf::shuffler::detail::FinishCounter::str | ( | ) | const |
Returns a description of this instance.