-#define CHECK_GROUP(num, group) \
- CHECK_MPI_NULL((num), MPI_GROUP_NULL, MPI_ERR_GROUP, (group))
-#define CHECK_WIN(num, win) \
- CHECK_MPI_NULL((num), MPI_WIN_NULL, MPI_ERR_WIN, (win))
-#define CHECK_RANK(num, rank, comm) \
- CHECK_ARGS(((rank) >= (comm)->group()->size() || (rank) <0), MPI_ERR_RANK, \
- "%s: param %d %s (=%d) cannot be < 0 or > %d", __func__, (num), _XBT_STRINGIFY(rank), \
- (rank), (comm)->group()->size() );
+
+#define CHECK_GROUP(num, group)\
+ CHECK_MPI_NULL((num), MPI_GROUP_NULL, MPI_ERR_GROUP, (group))
+
+#define CHECK_WIN(num, win)\
+ {\
+ CHECK_MPI_NULL((num), MPI_WIN_NULL, MPI_ERR_WIN, (win))\
+ simgrid::smpi::utils::set_current_handle(win);\
+ }
+#define CHECK_RANK(num, rank, comm)\
+ CHECK_ARGS(((rank) >= (comm)->size() || (rank) <0), MPI_ERR_RANK,\
+ "%s: param %d %s (=%d) cannot be < 0 or > %d", __func__, (num), _XBT_STRINGIFY(rank),\
+ (rank), (comm)->size() )
+
+#define CHECK_PROC_RMA(num,proc,win)\
+ {\
+ CHECK_VAL((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)
+