Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
\t removed
[simgrid.git] / src / smpi / include / private.hpp
index 322d4f7..87694a0 100644 (file)
@@ -534,9 +534,12 @@ XBT_PRIVATE void private_execute_flops(double flops);
 #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_NEGATIVE_OR_ZERO(num, err, val)                                                                          \
+  CHECK_ARGS((val) <= 0, (err),                                                                                        \
+             "%s: param %d %s cannot be negative or 0", __func__, (num), _XBT_STRINGIFY(val));
 #define CHECK_COMM2(num, comm)                                                                                         \
   CHECK_MPI_NULL((num), MPI_COMM_NULL, MPI_ERR_COMM, (comm))
-#define CHECK_DELETED(num, err, obj)                                                                                  \
+#define CHECK_DELETED(num, err, obj)                                                                                   \
   CHECK_ARGS((obj)->deleted(), (err), "%s: param %d %s has already been freed", __func__, (num), _XBT_STRINGIFY(obj));
 #define CHECK_COMM(num)                                                                                                \
   CHECK_COMM2((num), comm)                                                                                             \
@@ -580,4 +583,12 @@ XBT_PRIVATE void private_execute_flops(double flops);
 #define CHECK_PROC_RMA(num,proc,win)                                                                                   \
   CHECK_MPI_NULL((num), MPI_PROC_NULL, MPI_SUCCESS, (proc))                                                            \
   CHECK_RANK(num, proc, win->comm())
+#define CHECK_NOT_IN_PLACE_ROOT(num, buf)                                                                                   \
+  CHECK_ARGS((buf == MPI_IN_PLACE), MPI_ERR_BUFFER,                                                                    \
+             "%s: param %d %s cannot be MPI_IN_PLACE for rank %d with root %d", __func__, (num), _XBT_STRINGIFY(buf),  \
+             rank, root);
+#define CHECK_NOT_IN_PLACE(num, buf)                                                                                   \
+  CHECK_ARGS((buf == MPI_IN_PLACE), MPI_ERR_BUFFER,                                                                    \
+             "%s: param %d %s cannot be MPI_IN_PLACE for rank %d", __func__, (num), _XBT_STRINGIFY(buf),  \
+             rank);
 #endif