This basically sets the default errhandler to MPI_ERRORS_RETURN if set to false.
- The default SMPI compiler flags are no more taken from the environment.
They can be explicitly set through cmake parameters SMPI_C_FLAGS,
SMPI_CXX_FLAGS, or SMPI_Fortran_FLAGS.
- - New option: --cfg=smpi/finalization-barrier, which can be used to add
- a barrier inside MPI_Finalize. This can help for some codes which cleanup
- data attached to a process, but still used in other SMPI processes.
+ - New options:
+ --cfg=smpi/finalization-barrier: which can be used to add
+ a barrier inside MPI_Finalize. This can help for some codes which cleanup
+ data attached to a process, but still used in other SMPI processes.
+ --cfg=smpi/errors-are-fatal: True by default, behaves like if MPI_ERRORS_RETURN
+ is active when set to false, to keep going after a small error
LUA:
- Lua platform files are deprecated. Their support will be dropped after v3.31.
- **smpi/cpu-threshold:** :ref:`cfg=smpi/cpu-threshold`
- **smpi/display-allocs:** :ref:`cfg=smpi/display-allocs`
- **smpi/display-timing:** :ref:`cfg=smpi/display-timing`
+- **smpi/errors-are-fatal:** :ref:`cfg=smpi/errors-are-fatal`
- **smpi/finalization-barrier:** :ref:`cfg=smpi/finalization-barrier`
- **smpi/grow-injected-times:** :ref:`cfg=smpi/grow-injected-times`
- **smpi/host-speed:** :ref:`cfg=smpi/host-speed`
MPI_Finalize, so that all processes will terminate at almost the same point.
It might affect the total timing by the cost of a barrier.
+.. _cfg=smpi/errors-are-fatal:
+
+**Option** ``smpi/errors-are-fatal`` **default:** on
+
+By default, SMPI processes will crash if a MPI error code is returned. MPI allows
+to explicitely set MPI_ERRORS_RETURN errhandler to avoid this behaviour. This flag
+will turn on this behaviour by default (for all concerned types and errhandlers).
+This can ease debugging by going after the first reported error.
+
.. _cfg=smpi/iprobe:
Inject constant times for MPI_Iprobe
#include "smpi_keyvals.hpp"
#include "smpi_group.hpp"
#include "smpi_topo.hpp"
+#include "smpi_config.hpp"
namespace simgrid{
namespace smpi{
std::string name_;
MPI_Info info_ = MPI_INFO_NULL;
int id_;
- MPI_Errhandler errhandler_ = MPI_ERRORS_ARE_FATAL;
+ MPI_Errhandler errhandler_ = _smpi_cfg_default_errhandler_is_error ? MPI_ERRORS_ARE_FATAL : MPI_ERRORS_RETURN;;
MPI_Errhandler* errhandlers_ = nullptr; //for MPI_COMM_WORLD only
public:
extern XBT_PRIVATE simgrid::config::Flag<bool> _smpi_cfg_trace_call_use_absolute_path;
extern XBT_PRIVATE simgrid::config::Flag<bool> _smpi_cfg_trace_call_location;
extern XBT_PRIVATE simgrid::config::Flag<std::string> _smpi_cfg_comp_adjustment_file;
+extern XBT_PRIVATE simgrid::config::Flag<bool> _smpi_cfg_default_errhandler_is_error;
#if HAVE_PAPI
extern XBT_PRIVATE simgrid::config::Flag<std::string> _smpi_cfg_papi_events_file;
#endif
#include "smpi_errhandler.hpp"
#include "smpi_f2c.hpp"
#include "smpi_keyvals.hpp"
+#include "smpi_config.hpp"
#include <vector>
#include <list>
int mode_ = 0; // exclusive or shared lock
bool allocated_;
bool dynamic_;
- MPI_Errhandler errhandler_ = MPI_ERRORS_ARE_FATAL;
+ MPI_Errhandler errhandler_ = _smpi_cfg_default_errhandler_is_error ? MPI_ERRORS_ARE_FATAL : MPI_ERRORS_RETURN;
public:
static std::unordered_map<int, smpi_key_elem> keyvals_;
}
}
}};
-
+
+simgrid::config::Flag<bool> _smpi_cfg_default_errhandler_is_error{
+ "smpi/errors-are-fatal", "Whether MPI errors are fatal or just return. Default is true", true };
#if HAVE_PAPI
simgrid::config::Flag<std::string> _smpi_cfg_papi_events_file{"smpi/papi-events",
"This switch enables tracking the specified counters with PAPI", ""};
errhandler_->ref();
return errhandler_;
} else {
- if(errhandlers_==nullptr)
- return MPI_ERRORS_ARE_FATAL;
- else {
+ if(errhandlers_==nullptr){
+ if (_smpi_cfg_default_errhandler_is_error)
+ return MPI_ERRORS_ARE_FATAL;
+ else
+ return MPI_ERRORS_RETURN;
+ } else {
if(errhandlers_[this->rank()] != MPI_ERRHANDLER_NULL)
errhandlers_[this->rank()]->ref();
return errhandlers_[this->rank()];
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_io, smpi, "Logging specific to SMPI (RMA operations)");
-MPI_Errhandler SMPI_default_File_Errhandler = MPI_ERRORS_RETURN;
+MPI_Errhandler SMPI_default_File_Errhandler = _smpi_cfg_default_errhandler_is_error ? MPI_ERRORS_ARE_FATAL : MPI_ERRORS_RETURN;;
namespace simgrid{
namespace smpi{