From b38fa40fa6462e266f3a165c2ef9817b905f505b Mon Sep 17 00:00:00 2001 From: tqchen Date: Sun, 7 Dec 2014 20:25:42 -0800 Subject: [PATCH] fix ring passing --- src/allreduce_robust.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/allreduce_robust.cc b/src/allreduce_robust.cc index c1d5119cc..3d2f128f2 100644 --- a/src/allreduce_robust.cc +++ b/src/allreduce_robust.cc @@ -45,6 +45,9 @@ void AllreduceRobust::SetParam(const char *name, const char *val) { if (!strcmp(name, "result_replicate")) { result_buffer_round = std::max(world_size / atoi(val), 1); } + if (!strcmp(name, "num_local_replica")) { + num_local_replica = atoi(val); + } } /*! * \brief perform in-place allreduce, on sendrecvbuf @@ -1010,9 +1013,9 @@ AllreduceRobust::RingPassing(void *sendrecvbuf_, LinkRecord *read_link, LinkRecord *write_link) { if (read_link == NULL || write_link == NULL || read_end == 0) return kSuccess; - utils::Assert(read_end <= write_end, "boundary check"); - utils::Assert(read_ptr <= read_end, "boundary check"); - utils::Assert(write_ptr <= write_end, "boundary check"); + utils::Assert(write_end <= read_end, "RingPassing: boundary check1"); + utils::Assert(read_ptr <= read_end, "RingPassing: boundary check2"); + utils::Assert(write_ptr <= write_end, "RingPassing: boundary check3"); // take reference LinkRecord &prev = *read_link, &next = *write_link; // send recv buffer