+#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*/\
+ int locked=0;\
+ for (auto const& it : win->lockers_)\
+ if (it == comm_->rank())\
+ locked = 1;\
+ if(locked != 1)\
+ return MPI_ERR_WIN;\
+ }