Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix MPI_Type_dup for derived datatypes.
[simgrid.git] / src / smpi / colls / smpi_coll.cpp
index 827d06d..65ea838 100644 (file)
@@ -1,6 +1,6 @@
 /* smpi_coll.c -- various optimized routing for collectives                 */
 
-/* Copyright (c) 2009-2019. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2009-2020. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -236,9 +236,10 @@ std::map<std::string, std::vector<s_mpi_coll_description_t>> smpi_coll_descripti
 // Needed by the automatic selector weird implementation
 std::vector<s_mpi_coll_description_t>* colls::get_smpi_coll_descriptions(const std::string& name)
 {
-  if (smpi_coll_descriptions.find(name) == smpi_coll_descriptions.end())
+  auto iter = smpi_coll_descriptions.find(name);
+  if (iter == smpi_coll_descriptions.end())
     xbt_die("No collective named %s. This is a bug.", name.c_str());
-  return &smpi_coll_descriptions[name];
+  return &iter->second;
 }
 
 static s_mpi_coll_description_t* find_coll_description(const std::string& collective, const std::string& algo)