Skip to content
Snippets Groups Projects
Commit 892cd80f authored by Xinqi's avatar Xinqi
Browse files

fix eord bug

parent ee52e070
No related branches found
No related tags found
No related merge requests found
......@@ -354,7 +354,9 @@ void Actor::TryLogActEvent(const std::function<void()>& DoAct) const {
void Actor::ActUntilFail() {
while (IsReadReady() && IsWriteReady()) {
act_id_ += 1;
TryLogActEvent([&] { Act(); });
bool cur_act_encounter_eord = false;
TryLogActEvent([&] { Act(&cur_act_encounter_eord); });
if (cur_act_encounter_eord) { return; }
AsyncSendCustomizedProducedRegstMsgToConsumer();
AsyncSendNaiveProducedRegstMsgToConsumer();
......
......@@ -148,6 +148,7 @@ class Actor {
// Act
void ActUntilFail();
virtual void Act(bool* cur_act_encounter_eord) { Act(); }
virtual void Act() { UNIMPLEMENTED(); }
virtual int64_t ActNumForEachOutput(int64_t regst_desc_id) const { return 1; }
virtual bool CheckOutputActId(int64_t regst_desc_id) const {
......
......@@ -12,11 +12,12 @@ void WaitAndSendIdsCompActor::VirtualCompActorInit(const TaskProto& task_proto)
OF_SET_MSG_HANDLER(&WaitAndSendIdsCompActor::HandlerWaitToStart);
}
void WaitAndSendIdsCompActor::Act() {
void WaitAndSendIdsCompActor::Act(bool* cur_act_encounter_eord) {
CHECK_LE(wait_and_send_ids_status_.out_idx_, wait_and_send_ids_status_.out_num_);
KernelCtx kernel_ctx = GenDefaultKernelCtx();
kernel_ctx.other = &wait_and_send_ids_status_;
AsyncLaunchKernel(kernel_ctx);
*cur_act_encounter_eord = (wait_and_send_ids_status_.channel_status_ != kChannelStatusSuccess);
}
bool WaitAndSendIdsCompActor::IsCustomizedReadReady() {
......
......@@ -14,7 +14,7 @@ class WaitAndSendIdsCompActor final : public CompActor {
private:
void VirtualCompActorInit(const TaskProto&) override;
void Act() override;
void Act(bool* cur_act_encounter_eord) override;
std::pair<RegstNameType, HashSet<std::string>> GetNaiveOrCustomizedConsumedRegstDescName()
override {
return std::make_pair(RegstNameType::kNaive, HashSet<std::string>{});
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment