From 49b26bd04bffe742284c753af6fc1997162cd5f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Monta=C3=B1ana=20G=C3=B3mez?= Date: Sat, 16 Dec 2023 12:53:25 +0100 Subject: [PATCH] fix duration output --- src/Platform/GridSearch.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Platform/GridSearch.cc b/src/Platform/GridSearch.cc index de7e060..d7d18b2 100644 --- a/src/Platform/GridSearch.cc +++ b/src/Platform/GridSearch.cc @@ -116,8 +116,7 @@ namespace platform { } } // It's important to shuffle the array so heavy datasets are spread across the Workers - std::random_device rd; - std::mt19937 g(rd()); + std::mt19937 g{ 271 }; // Use fixed seed to obtain the same shuffle std::shuffle(tasks.begin(), tasks.end(), g); std::cout << "Tasks size: " << tasks.size() << std::endl; std::cout << "|"; @@ -258,6 +257,7 @@ namespace platform { char* msg; int tasks_size; if (config_mpi.rank == config_mpi.manager) { + timer.start(); auto tasks = build_tasks_mpi(); auto tasks_str = tasks.dump(); tasks_size = tasks_str.size(); @@ -305,7 +305,7 @@ namespace platform { MPI_Gather(msg, max_size, MPI_CHAR, total, max_size, MPI_CHAR, config_mpi.manager, MPI_COMM_WORLD); delete[] msg; if (config_mpi.rank == config_mpi.manager) { - std::cout << "|" << std::endl; + std::cout << Colors::RESET() << "|" << std::endl; json total_results; json best_results; // 3.3 Compile the results from all the workers