Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
SMPI: only warn once on unimplemented calls
authorMartin Quinson <martin.quinson@loria.fr>
Fri, 23 Mar 2018 21:53:28 +0000 (22:53 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Fri, 23 Mar 2018 21:53:28 +0000 (22:53 +0100)
src/smpi/bindings/smpi_mpi.cpp

index 92442a0..483f17d 100644 (file)
@@ -10,13 +10,19 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_mpi, smpi, "Logging specific to SMPI ,(mpi)
 
 #define NOT_YET_IMPLEMENTED                                                                                            \
   {                                                                                                                    \
 
 #define NOT_YET_IMPLEMENTED                                                                                            \
   {                                                                                                                    \
-    xbt_die("Not yet implemented : %s. Please contact the SimGrid team if support is needed", __FUNCTION__);          \
+    xbt_die("Not yet implemented: %s. Please contact the SimGrid team if support is needed", __FUNCTION__);            \
     return MPI_SUCCESS;                                                                                                \
   }
     return MPI_SUCCESS;                                                                                                \
   }
-  
-#define NOT_YET_IMPLEMENTED_NOFAIL                                                                                            \
+
+#define NOT_YET_IMPLEMENTED_NOFAIL                                                                                     \
   {                                                                                                                    \
   {                                                                                                                    \
-    XBT_WARN("Not yet implemented : %s. Please contact the SimGrid team if support is needed. Run with --log=smpi_mpi.thresh:error to hide", __FUNCTION__);          \
+    static bool warning_todo = true;                                                                                   \
+    if (warning_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",                                                         \
+               __FUNCTION__);                                                                                          \
+    warning_todo = false;                                                                                              \
     return MPI_SUCCESS;                                                                                                \
   }
 
     return MPI_SUCCESS;                                                                                                \
   }