+#define CHECK_RMA_REMOTE_WIN(fun, win)\
+ if(target_count*target_datatype->get_extent()>win->size_){\
+ XBT_WARN("%s: Trying to move %zd, which exceeds the window size on target process %d : %zd - Bailing out.",\
+ fun, target_count*target_datatype->get_extent(), target_rank, win->size_);\
+ simgrid::smpi::utils::set_current_buffer(1,"win_base",win->base_);\
+ return MPI_ERR_RMA_RANGE;\
+ }
+
+#define CHECK_WIN_LOCKED(win) \
+ if (opened_ == 0) { /*check that post/start has been done*/ \
+ bool locked = std::any_of(begin(win->lockers_), end(win->lockers_), [this](int it) { return it == this->rank_; }); \
+ if (not locked) \
+ return MPI_ERR_WIN; \
+ }