Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Save more std::string copies.
[simgrid.git] / src / smpi / internals / smpi_utils.cpp
index 04b6daa..77436cc 100644 (file)
@@ -350,24 +350,23 @@ void account_free(const void* ptr){
 
 int check_collectives_ordering(MPI_Comm comm, const std::string& call)
 {
-  if(_smpi_cfg_pedantic){
-    unsigned int count = comm->get_collectives_count();
-    comm->increment_collectives_count();
-    auto vec = collective_calls.find(comm->id());
-    if (vec == collective_calls.end()) {
-      collective_calls.emplace(comm->id(), std::vector<std::string>{call});
-    }else{
-      //are we the first ? add the call
-      if (vec->second.size() == count) {
-        vec->second.emplace_back(call);
-      } else if (vec->second.size() > count) {
-        if (vec->second[count] != call){
-          XBT_WARN("Collective operation mismatch. For process %ld, expected %s, got %s", simgrid::s4u::this_actor::get_pid(), vec->second[count].c_str(), call.c_str());
-          return MPI_ERR_OTHER;
-        }
-      } else {
-        THROW_IMPOSSIBLE;
+  unsigned int count = comm->get_collectives_count();
+  comm->increment_collectives_count();
+  auto vec = collective_calls.find(comm->id());
+  if (vec == collective_calls.end()) {
+    collective_calls.emplace(comm->id(), std::vector<std::string>{call});
+  } else {
+    // are we the first ? add the call
+    if (vec->second.size() == count) {
+      vec->second.emplace_back(call);
+    } else if (vec->second.size() > count) {
+      if (vec->second[count] != call) {
+        XBT_WARN("Collective operation mismatch. For process %ld, expected %s, got %s",
+                 simgrid::s4u::this_actor::get_pid(), vec->second[count].c_str(), call.c_str());
+        return MPI_ERR_OTHER;
       }
+    } else {
+      THROW_IMPOSSIBLE;
     }
   }
   return MPI_SUCCESS;