]> AND Public Git Repository - simgrid.git/blobdiff - src/smpi/bindings/smpi_mpi.cpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix bound checking in assert.
[simgrid.git] / src / smpi / bindings / smpi_mpi.cpp
index 5db772db220c9122cb38d9948b485d71ea2035c5..3bd52c78d7e4aab15b4330730ff50417a0098b00 100644 (file)
@@ -1,17 +1,22 @@
-/* Copyright (c) 2007-2022. The SimGrid Team. All rights reserved.           */
+/* Copyright (c) 2007-2023. 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. */
 
 #include "private.hpp"
 #include "simgrid/modelchecker.h"
-#include "simgrid/sg_config.hpp"
 #include "smpi_comm.hpp"
 #include "smpi_file.hpp"
 #include "smpi_win.hpp"
+#include "src/simgrid/sg_config.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_mpi, smpi, "Logging specific to SMPI ,(mpi)");
 
+void MPI_Init()
+{
+  MPI_Init(nullptr, nullptr);
+}
+
 #define NOT_YET_IMPLEMENTED                                                                                            \
   {                                                                                                                    \
     xbt_die("Not yet implemented: %s. Please contact the SimGrid team if support is needed", __func__);                \
@@ -26,13 +31,13 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_mpi, smpi, "Logging specific to SMPI ,(mpi)
 
 #define NOT_YET_IMPLEMENTED_NOFAIL                                                                                     \
   {                                                                                                                    \
-    static bool warning_todo = true;                                                                                   \
-    if (warning_todo)                                                                                                  \
+    if (static bool warned_todo = false; not warned_todo) {                                                            \
       XBT_WARN("Not yet implemented: %s. "                                                                             \
                "Please contact the SimGrid team if support is needed. "                                                \
                "Run with --log=smpi_mpi.thresh:error to hide",                                                         \
                __func__);                                                                                              \
-    warning_todo = false;                                                                                              \
+      warned_todo = true;                                                                                              \
+    }                                                                                                                  \
     return MPI_SUCCESS;                                                                                                \
   }