X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/dbb4b9d8b72ec01fe1748a7eb6b32222ffe3ece5..db5f97d1bc07f6e20cccd108be11e1e34b4ed109:/src/smpi/internals/smpi_deployment.cpp diff --git a/src/smpi/internals/smpi_deployment.cpp b/src/smpi/internals/smpi_deployment.cpp index 436a39ab3d..e73865cc55 100644 --- a/src/smpi/internals/smpi_deployment.cpp +++ b/src/smpi/internals/smpi_deployment.cpp @@ -57,10 +57,10 @@ void SMPI_app_instance_register(const char *name, xbt_main_func_t code, int num_ void SMPI_app_instance_start(const char* name, const std::function& code, std::vector const& hosts) { - xbt_assert(hosts.size() > 0, "Cannot start a SMPI instance on 0 hosts"); - xbt_assert(smpi_instances.find(name) == smpi_instances.end(), - "Cannot start two MPI applications of the same name '%s'", name); - smpi_instances.try_emplace(name, hosts.size()); + xbt_assert(not hosts.empty(), "Cannot start a SMPI instance on 0 hosts"); + + auto [_, inserted] = smpi_instances.try_emplace(name, hosts.size()); + xbt_assert(inserted, "Cannot start two MPI applications of the same name '%s'", name); int rank = 0; for (auto* host : hosts) {