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

Changing the count parameter type from int to size_t in reduction algorithms. #380

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions gloo/allreduce_bcube.h
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ class AllreduceBcube : public Algorithm {
AllreduceBcube(
const std::shared_ptr<Context>& context,
const std::vector<T*> ptrs,
const int count,
const size_t count,
const ReductionFunction<T>* fn = ReductionFunction<T>::sum)
: Algorithm(context),
myRank_(this->context_->rank),
Expand Down Expand Up @@ -461,11 +461,11 @@ class AllreduceBcube : public Algorithm {
/**
* Total number of elements to process
*/
const int totalNumElems_{0};
const size_t totalNumElems_{0};
/**
* Total number of bytes to process
*/
const int bytes_{0};
const size_t bytes_{0};
/**
* Total number of steps
*/
Expand Down
6 changes: 3 additions & 3 deletions gloo/allreduce_halving_doubling.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class AllreduceHalvingDoubling : public Algorithm {
AllreduceHalvingDoubling(
const std::shared_ptr<Context>& context,
const std::vector<T*> ptrs,
const int count,
const size_t count,
const ReductionFunction<T>* fn = ReductionFunction<T>::sum)
: Algorithm(context),
ptrs_(ptrs),
Expand Down Expand Up @@ -362,8 +362,8 @@ class AllreduceHalvingDoubling : public Algorithm {

protected:
std::vector<T*> ptrs_;
const int count_;
const int bytes_;
const size_t count_;
const size_t bytes_;
const size_t steps_;
const size_t chunks_;
const size_t chunkSize_;
Expand Down
2 changes: 1 addition & 1 deletion gloo/allreduce_local.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ template <typename T>
AllreduceLocal<T>::AllreduceLocal(
const std::shared_ptr<Context>& context,
const std::vector<T*>& ptrs,
const int count,
const size_t count,
const ReductionFunction<T>* fn)
: Algorithm(context),
ptrs_(ptrs),
Expand Down
6 changes: 3 additions & 3 deletions gloo/allreduce_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class AllreduceLocal : public Algorithm {
AllreduceLocal(
const std::shared_ptr<Context>& context,
const std::vector<T*>& ptrs,
const int count,
const size_t count,
const ReductionFunction<T>* fn = ReductionFunction<T>::sum);

virtual ~AllreduceLocal() = default;
Expand All @@ -28,8 +28,8 @@ class AllreduceLocal : public Algorithm {

protected:
std::vector<T*> ptrs_;
const int count_;
const int bytes_;
const size_t count_;
const size_t bytes_;
const ReductionFunction<T>* fn_;
};

Expand Down
6 changes: 3 additions & 3 deletions gloo/allreduce_ring.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class AllreduceRing : public Algorithm {
AllreduceRing(
const std::shared_ptr<Context>& context,
const std::vector<T*>& ptrs,
const int count,
const size_t count,
const ReductionFunction<T>* fn = ReductionFunction<T>::sum)
: Algorithm(context),
ptrs_(ptrs),
Expand Down Expand Up @@ -114,8 +114,8 @@ class AllreduceRing : public Algorithm {

protected:
std::vector<T*> ptrs_;
const int count_;
const int bytes_;
const size_t count_;
const size_t bytes_;
const ReductionFunction<T>* fn_;

T* inbox_;
Expand Down
6 changes: 3 additions & 3 deletions gloo/allreduce_ring_chunked.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class AllreduceRingChunked : public Algorithm {
AllreduceRingChunked(
const std::shared_ptr<Context>& context,
const std::vector<T*>& ptrs,
const int count,
const size_t count,
const ReductionFunction<T>* fn = ReductionFunction<T>::sum)
: Algorithm(context),
ptrs_(ptrs),
Expand Down Expand Up @@ -236,8 +236,8 @@ class AllreduceRingChunked : public Algorithm {
}

std::vector<T*> ptrs_;
const int count_;
const int bytes_;
const size_t count_;
const size_t bytes_;
const ReductionFunction<T>* fn_;

size_t chunks_;
Expand Down