提交 79c6001a 编写于 作者: S seiriosPlus

rename communicator meet->BatchesCounter

上级 db272ca5
......@@ -157,16 +157,18 @@ void AsyncCommunicator::MainThread() {
}
while (running_) {
int meet = Meet();
VLOG(1) << "async_meet: " << meet;
SendGlobalStep(meet);
SendByCommunicator(meet);
BarrierSend();
RecvByCommunicator();
BarrierRecv();
BarrierWeakUp();
int batches = BatchesCounter();
if (batches > 0) {
SendGlobalStep(batches);
SendByCommunicator(batches);
BarrierSend();
RecvByCommunicator();
BarrierRecv();
BarrierWeakUp();
} else {
VLOG(1) << "get nothing from sending queue, will skip send/recv";
}
}
VLOG(1) << "communicator stopped, send thread exit";
}
......@@ -197,7 +199,7 @@ void AsyncCommunicator::RecvNoBarrier() {
}
}
int AsyncCommunicator::Meet() {
int AsyncCommunicator::BatchesCounter() {
auto &step_queue = send_varname_to_queue_.at(STEP_COUNTER);
size_t merged_var_num = 0;
......@@ -316,7 +318,7 @@ void HalfAsyncCommunicator::Clean() {
}
}
int HalfAsyncCommunicator::Meet() {
int HalfAsyncCommunicator::BatchesCounter() {
while (running_) {
if (barrier_counter_.load() >= barrier_trigger_.load() &&
barrier_trigger_.load() != 0) {
......
......@@ -293,7 +293,7 @@ class AsyncCommunicator : public Communicator {
virtual void RecvNoBarrier();
virtual int Meet();
virtual int BatchesCounter();
virtual void BarrierSend() {}
......@@ -350,7 +350,7 @@ class HalfAsyncCommunicator : public AsyncCommunicator {
void BarrierTriggerReset(int initial_val) override;
int Meet();
int BatchesCounter();
void BarrierWeakUp();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册