diff --git a/src/io/page_dmatrix-inl.hpp b/src/io/page_dmatrix-inl.hpp index 46b4e1a81..80bd080a3 100644 --- a/src/io/page_dmatrix-inl.hpp +++ b/src/io/page_dmatrix-inl.hpp @@ -20,7 +20,7 @@ namespace io { class ThreadRowPageIterator: public utils::IIterator { public: ThreadRowPageIterator(void) { - itr.SetParam("buffer_size", "2"); + itr.SetParam("buffer_size", "4"); page_ = NULL; base_rowid_ = 0; } diff --git a/src/io/page_fmatrix-inl.hpp b/src/io/page_fmatrix-inl.hpp index 783e57465..58038a874 100644 --- a/src/io/page_fmatrix-inl.hpp +++ b/src/io/page_fmatrix-inl.hpp @@ -112,8 +112,9 @@ struct ColConvertFactory { #pragma omp parallel { nthread = omp_get_num_threads(); - if (nthread == omp_get_num_procs()) { - nthread = std::max(1, nthread / 2); + int max_nthread = std::max(omp_get_num_procs() / 2 - 4, 1); + if (nthread > max_nthread) { + nthread = max_nthread; } } pcol->Clear(); @@ -302,9 +303,11 @@ class FMatrixPage : public IFMatrix { col_size_[i] += pcol->offset[i + 1] - pcol->offset[i]; } pcol->Save(&fo); - bytes_write += pcol->MemCostBytes(); - double tdiff = rabit::utils::GetTime() - tstart; - utils::Printf("Writting to %s in %g MB/s, %lu MB written\n", + size_t spage = pcol->MemCostBytes(); + bytes_write += spage; + double tnow = rabit::utils::GetTime(); + double tdiff = tnow - tstart; + utils::Printf("Writting to %s in %g MB/s, %lu MB written current speed:%g MB/s\n", col_data_name_.c_str(), (bytes_write >> 20UL) / tdiff, (bytes_write >> 20UL));