diff --git a/paddle/fluid/framework/data_set.cc b/paddle/fluid/framework/data_set.cc index 62b28a8a0558e..691cf001f43f6 100644 --- a/paddle/fluid/framework/data_set.cc +++ b/paddle/fluid/framework/data_set.cc @@ -1479,26 +1479,6 @@ inline paddle::framework::ThreadPool* GetShufflePool(int thread_num) { } return thread_pool.get(); } -int PadBoxSlotDataset::GetMaxShuffleThreadId(void) { - double rate = static_cast(shuffle_thread_num_) / - static_cast(thread_num_); - int thread_num = static_cast(rate * read_ins_ref_); - int half_num = static_cast(shuffle_thread_num_ >> 1); - if (thread_num < half_num) { - return half_num; - } - return thread_num; -} -int PadBoxSlotDataset::GetMaxMergeThreadId(void) { - double rate = - static_cast(merge_thread_num_) / static_cast(thread_num_); - int half_num = static_cast(merge_thread_num_ >> 1); - int thread_num = static_cast(rate * read_ins_ref_); - if (thread_num < half_num) { - return half_num; - } - return thread_num; -} void PadBoxSlotDataset::CheckThreadPool(void) { wait_futures_.clear(); if (thread_pool_ != nullptr && merge_pool_ != nullptr) { @@ -1880,6 +1860,7 @@ void PadBoxSlotDataset::ReceiveSuffleData(int client_id, const char* buf, --receiver_cnt_; if (finished_counter_ == 0) { + usleep(10000); while (receiver_cnt_ > 0) { usleep(100); } diff --git a/paddle/fluid/framework/data_set.h b/paddle/fluid/framework/data_set.h index c1c254df8e294..a9fbb1832bf53 100644 --- a/paddle/fluid/framework/data_set.h +++ b/paddle/fluid/framework/data_set.h @@ -401,8 +401,6 @@ class PadBoxSlotDataset : public DatasetImpl { protected: void MergeInsKeys(const Channel& in); void CheckThreadPool(void); - int GetMaxShuffleThreadId(void); - int GetMaxMergeThreadId(void); protected: Channel shuffle_channel_ = nullptr;