Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
new MANIFEST.in after adding ns3 wifi
[simgrid.git] / src / smpi / colls / smpi_coll.cpp
index 65ea83831a5ae17f5fbe7813177a4b68b4073c55..6a213c0f8456b7aa300bc7c2c8630b93c365a796 100644 (file)
@@ -248,12 +248,11 @@ static s_mpi_coll_description_t* find_coll_description(const std::string& collec
   if (table->empty())
     xbt_die("No registered algorithm for collective '%s'! This is a bug.", collective.c_str());
 
-  for (unsigned long i = 0; i < table->size(); i++) {
-    auto desc = &table->at(i);
-    if (algo == desc->name) {
-      if (desc->name != "default")
-        XBT_INFO("Switch to algorithm %s for collective %s", desc->name.c_str(), collective.c_str());
-      return desc;
+  for (auto& desc : *table) {
+    if (algo == desc.name) {
+      if (desc.name != "default")
+        XBT_INFO("Switch to algorithm %s for collective %s", desc.name.c_str(), collective.c_str());
+      return &desc;
     }
   }
 
@@ -361,8 +360,8 @@ int colls::scan(const void* sendbuf, void* recvbuf, int count, MPI_Datatype data
   Datatype::copy(sendbuf, count, datatype, recvbuf, count, datatype);
 
   // Send/Recv buffers to/from others
-  MPI_Request* requests = new MPI_Request[size - 1];
-  unsigned char** tmpbufs = new unsigned char*[rank];
+  auto* requests = new MPI_Request[size - 1];
+  auto** tmpbufs = new unsigned char*[rank];
   int index = 0;
   for (int other = 0; other < rank; other++) {
     tmpbufs[index] = smpi_get_tmp_sendbuffer(count * dataext);
@@ -419,8 +418,8 @@ int colls::exscan(const void* sendbuf, void* recvbuf, int count, MPI_Datatype da
   datatype->extent(&lb, &dataext);
 
   // Send/Recv buffers to/from others
-  MPI_Request* requests = new MPI_Request[size - 1];
-  unsigned char** tmpbufs = new unsigned char*[rank];
+  auto* requests = new MPI_Request[size - 1];
+  auto** tmpbufs = new unsigned char*[rank];
   int index = 0;
   for (int other = 0; other < rank; other++) {
     tmpbufs[index] = smpi_get_tmp_sendbuffer(count * dataext);