Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Have SMPI fail on MPI_ERR_* in MC mode
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Sat, 17 Aug 2019 20:24:44 +0000 (22:24 +0200)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Sat, 17 Aug 2019 23:34:10 +0000 (01:34 +0200)
The standard says that upon error, implementations should call the
current MPI error handler, which is MPI_ERRORS_ARE_FATAL by default
but could be changed to MPI_ERRORS_RETURN on need.

Since we don't implement MPI_Comm_set_errhandler() to switch between
modes, the simulation mode of SMPI is only issuing a warning on
errors (which is similar to MPI_ERRORS_RETURN).

This commit adds a MC_assert() stating that every MPI call succeed.
This will lead to a property failure (visible only in MC mode) when a
MPI_ERR_* is issued by the implementation (which is somehow similar to
MPI_ERRORS_ARE_FATAL).

ChangeLog
src/smpi/bindings/smpi_mpi.cpp

index 0198945..4614f28 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -22,6 +22,8 @@ SMPI:
 
 Model-Checker:
  - Option model-checker/hash was removed. This is always activated now.
+ - MPI calls now MC_assert() that no MPI_ERR_* code is returned. 
+   This is useful to check for MPI compliance.
 
 XBT:
  - xbt_mutex_t and xbt_cond_t are now marked as deprecated, a new C interface
index 357e4f6..09b5a5d 100644 (file)
@@ -4,6 +4,7 @@
  * 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"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_mpi, smpi, "Logging specific to SMPI ,(mpi)");
@@ -36,6 +37,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_mpi, smpi, "Logging specific to SMPI ,(mpi)
       int error_size;                                                                                                  \
       PMPI_Error_string(ret, error_string, &error_size);                                                               \
       XBT_WARN("%s - returned %.*s instead of MPI_SUCCESS", __func__, error_size, error_string);                       \
+      MC_assert(not MC_is_active()); /* Only fail in MC mode */                                                        \
     }                                                                                                                  \
     XBT_VERB("SMPI - Leaving %s", __func__);                                                                           \
     return ret;                                                                                                        \