X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/50102ec1c30562e20d450afa7015374387bf1904..5ed37babb2fa9097abe82df299c0aa259ed84d5a:/examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual.cpp diff --git a/examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual.cpp b/examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual.cpp index 1d8a49532d..0b1edf1f9d 100644 --- a/examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual.cpp +++ b/examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2009-2020. The SimGrid Team. +/* Copyright (c) 2009-2023. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -96,12 +96,11 @@ static int job_executor_process(Job* job) } // Executes a workload of SMPI processes -static int workload_executor_process(const std::vector>* workload) +static int workload_executor_process(const std::vector>& workload) { - for (auto const& job : *workload) { + for (auto const& job : workload) { // Let's wait until the job's waiting time if needed - double curr_time = simgrid::s4u::Engine::get_clock(); - if (job->starting_time > curr_time) { + if (double curr_time = simgrid::s4u::Engine::get_clock(); job->starting_time > curr_time) { double time_to_sleep = (double)job->starting_time - curr_time; XBT_INFO("Sleeping %g seconds (waiting for job %d, app '%s')", time_to_sleep, job->starting_time, job->smpi_app_name.c_str()); @@ -164,7 +163,7 @@ static std::vector> all_jobs(const std::string& workload_fi // Let's read the filename std::ifstream traces_file(job->filename); - if (!traces_file.is_open()) + if (not traces_file.is_open()) throw std::invalid_argument("Cannot open file " + job->filename); std::string traces_line; @@ -236,10 +235,10 @@ int main(int argc, char* argv[]) } // Let's execute the workload - simgrid::s4u::Actor::create("workload", hosts[0], workload_executor_process, &jobs); + simgrid::s4u::Actor::create("workload", hosts[0], workload_executor_process, std::cref(jobs)); e.run(); - XBT_INFO("Simulation finished! Final time: %g", e.get_clock()); + XBT_INFO("Simulation finished! Final time: %g", simgrid::s4u::Engine::get_clock()); SMPI_finalize();