XBT_PRIVATE MPI_Comm* smpi_deployment_comm_world(const std::string& instance_id);
XBT_PRIVATE void smpi_deployment_cleanup_instances();
-XBT_PRIVATE int smpi_deployment_smpirun(simgrid::s4u::Engine* e, const std::string& hostfile, int np,
- const std::string& replayfile, int map, int argc, char* argv[]);
+XBT_PRIVATE int smpi_deployment_smpirun(const simgrid::s4u::Engine* e, const std::string& hostfile, int np,
+ const std::string& replayfile, int map,
+ const std::vector<const char*>& run_args);
XBT_PRIVATE void smpi_comm_copy_buffer_callback(simgrid::kernel::activity::CommImpl* comm, void* buff,
size_t buff_size);
CHECK_ARGS(init_flag, MPI_ERR_OTHER, "%s: MPI_Finalize was already called !", __func__) \
}
-#define CHECK_MPI_NULL(num, val, err, ptr)\
- CHECK_ARGS((ptr) == (val), (err),\
- "%s: param %d %s cannot be %s", __func__, (num), _XBT_STRINGIFY(ptr), _XBT_STRINGIFY(val))
-
#define CHECK_VAL(num, val, err, value)\
CHECK_ARGS((value) == (val), (err),\
"%s: param %d %s cannot be %s", __func__, (num), _XBT_STRINGIFY(value), _XBT_STRINGIFY(val))
CHECK_ARGS((buf) == nullptr, (err),\
"%s: param %d %s cannot be NULL", __func__, (num), _XBT_STRINGIFY(buf))
+#define CHECK_MPI_NULL(num, val, err, ptr)\
+ {\
+ CHECK_ARGS((ptr) == (val), (err),\
+ "%s: param %d %s cannot be %s", __func__, (num), _XBT_STRINGIFY(ptr), _XBT_STRINGIFY(val))\
+ CHECK_NULL(num, err, ptr)\
+ }
+
#define CHECK_NEGATIVE(num, err, val)\
CHECK_ARGS((val) < 0, (err),\
"%s: param %d %s cannot be negative", __func__, (num), _XBT_STRINGIFY(val))
#define CHECK_TYPE(num, datatype)\
{\
- CHECK_ARGS(((datatype) == MPI_DATATYPE_NULL|| not (datatype)->is_valid()), MPI_ERR_TYPE,\
- "%s: param %d %s cannot be MPI_DATATYPE_NULL or invalid", __func__, (num), _XBT_STRINGIFY(datatype));\
+ CHECK_MPI_NULL((num), MPI_DATATYPE_NULL, MPI_ERR_TYPE, (datatype))\
+ CHECK_ARGS((not (datatype)->is_valid()), MPI_ERR_TYPE,\
+ "%s: param %d %s is invalid", __func__, (num), _XBT_STRINGIFY(datatype));\
CHECK_DELETED((num), MPI_ERR_TYPE, datatype)\
if (not datatype->is_basic())\
simgrid::smpi::utils::set_current_handle(datatype);\
#define CHECK_OP(num, op, type)\
{\
CHECK_MPI_NULL((num), MPI_OP_NULL, MPI_ERR_OP, (op))\
+ CHECK_ARGS((op == MPI_REPLACE || op == MPI_NO_OP), MPI_ERR_OP,\
+ "%s: param %d op %s cannot be used in non RMA calls", __func__, (num), _XBT_STRINGIFY(op));\
CHECK_DELETED((num), MPI_ERR_OP, op)\
if (not op->is_predefined())\
simgrid::smpi::utils::set_current_handle(op);\