-/* Copyright (c) 2009-2020. The SimGrid Team.
+/* Copyright (c) 2009-2021. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
}
// Executes a workload of SMPI processes
-static int workload_executor_process(const std::vector<std::unique_ptr<Job>>* workload)
+static int workload_executor_process(const std::vector<std::unique_ptr<Job>>& 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) {
// 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;
}
// 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();