From 90a87c3ba09857904f2d719c2183a8cfd2b32cee Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Thu, 10 Jun 2021 10:23:37 +0200 Subject: [PATCH] Misc. Sonar smells. --- src/smpi/include/private.hpp | 2 +- src/smpi/internals/smpi_deployment.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/smpi/include/private.hpp b/src/smpi/include/private.hpp index 4deaddd533..08e6cf35cf 100644 --- a/src/smpi/include/private.hpp +++ b/src/smpi/include/private.hpp @@ -84,7 +84,7 @@ XBT_PRIVATE void smpi_deployment_unregister_process(const std::string& instance_ XBT_PRIVATE MPI_Comm* smpi_deployment_comm_world(const std::string& instance_id); XBT_PRIVATE void smpi_deployment_cleanup_instances(); -XBT_PRIVATE int smpi_deployment_smpirun(simgrid::s4u::Engine* e, const std::string& hostfile, int np, +XBT_PRIVATE int smpi_deployment_smpirun(const simgrid::s4u::Engine* e, const std::string& hostfile, int np, const std::string& replayfile, int map, int argc, char* argv[]); XBT_PRIVATE void smpi_comm_copy_buffer_callback(simgrid::kernel::activity::CommImpl* comm, void* buff, diff --git a/src/smpi/internals/smpi_deployment.cpp b/src/smpi/internals/smpi_deployment.cpp index 93c7e61443..ec87025370 100644 --- a/src/smpi/internals/smpi_deployment.cpp +++ b/src/smpi/internals/smpi_deployment.cpp @@ -105,7 +105,7 @@ int smpi_get_universe_size() } /** @brief Auxiliary method to get list of hosts to deploy app */ -static std::vector smpi_get_hosts(simgrid::s4u::Engine* e, const std::string& hostfile) +static std::vector smpi_get_hosts(const simgrid::s4u::Engine* e, const std::string& hostfile) { if (hostfile == "") { return e->get_all_hosts(); @@ -148,12 +148,12 @@ static std::vector smpi_deployment_get_args(int rank_id, const std: // pass arguments to process only if not a replay execution if (replay.empty()) { for (int i = 0; i < argc; i++) { - args.push_back(argv[i]); + args.emplace_back(argv[i]); } } /* one trace per process */ if (replay.size() > 1) { - args.push_back(replay[rank_id]); + args.emplace_back(replay[rank_id]); } return args; } @@ -164,8 +164,8 @@ static std::vector smpi_deployment_get_args(int rank_id, const std: * This used to be done at smpirun script, parsing either the hostfile or the platform XML. * If hostfile isn't provided, get the list of hosts from engine. */ -int smpi_deployment_smpirun(simgrid::s4u::Engine* e, const std::string& hostfile, int np, const std::string& replayfile, - int map, int argc, char* argv[]) +int smpi_deployment_smpirun(const simgrid::s4u::Engine* e, const std::string& hostfile, int np, + const std::string& replayfile, int map, int argc, char* argv[]) { auto hosts = smpi_get_hosts(e, hostfile); auto replay = smpi_read_replay(replayfile); -- 2.20.1