This is due to the fact that in this case, the disp is actually an address, which is stored in a signed type.
We can't do much about that, and all MPI libraries I checked have this particular check disabled for this case.
retval = MPI_SUCCESS;
} else if (target_rank <0){
retval = MPI_ERR_RANK;
- } else if (target_disp <0){
+ } else if (win->dynamic()!=0 && target_disp <0){
+ //in case of dynamic window, target_disp can be mistakenly seen as negative, as it is an address
retval = MPI_ERR_ARG;
} else if ((origin_count < 0 || target_count < 0) ||
(origin_addr==nullptr && origin_count > 0)){
retval = MPI_SUCCESS;
} else if (target_rank <0){
retval = MPI_ERR_RANK;
- } else if (target_disp <0){
+ } else if (win->dynamic()!=0 && target_disp <0){
+ //in case of dynamic window, target_disp can be mistakenly seen as negative, as it is an address
retval = MPI_ERR_ARG;
} else if ((origin_count < 0 || target_count < 0) ||
(origin_addr==nullptr && origin_count > 0)){
retval = MPI_SUCCESS;
} else if (target_rank <0){
retval = MPI_ERR_RANK;
- } else if (target_disp <0){
+ } else if (win->dynamic()!=0 && target_disp <0){
+ //in case of dynamic window, target_disp can be mistakenly seen as negative, as it is an address
retval = MPI_ERR_ARG;
} else if ((origin_count < 0 || target_count < 0) ||
(origin_addr==nullptr && origin_count > 0)){
retval = MPI_SUCCESS;
} else if (target_rank <0){
retval = MPI_ERR_RANK;
- } else if (target_disp <0){
+ } else if (win->dynamic()!=0 && target_disp <0){
+ //in case of dynamic window, target_disp can be mistakenly seen as negative, as it is an address
retval = MPI_ERR_ARG;
} else if ((origin_count < 0 || target_count < 0 || result_count <0) ||
(origin_addr==nullptr && origin_count > 0) ||
std::unordered_map<int, smpi_key_elem> Win::keyvals_;
int Win::keyval_id_=0;
-Win::Win(void *base, MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, int allocated): base_(base), size_(size), disp_unit_(disp_unit), assert_(0), info_(info), comm_(comm), allocated_(allocated){
+Win::Win(void *base, MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, int allocated, int dynamic): base_(base), size_(size), disp_unit_(disp_unit), assert_(0), info_(info), comm_(comm), allocated_(allocated), dynamic_(dynamic){
int comm_size = comm->size();
rank_ = comm->rank();
XBT_DEBUG("Creating window");
return disp_unit_;
}
+int Win::dynamic(){
+ return dynamic_;
+}
+
void Win::set_info(MPI_Info info){
if(info_!= MPI_INFO_NULL)
info->ref();
int rank_; // to identify owner for barriers in MPI_COMM_WORLD
int mode_; // exclusive or shared lock
int allocated_;
+ int dynamic_;
public:
static std::unordered_map<int, smpi_key_elem> keyvals_;
static int keyval_id_;
- Win(void *base, MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, int allocated = 0);
- Win(MPI_Info info, MPI_Comm comm) : Win(MPI_BOTTOM, 0, 1, info, comm) {};
+ Win(void *base, MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, int allocated = 0, int dynamic = 0);
+ Win(MPI_Info info, MPI_Comm comm) : Win(MPI_BOTTOM, 0, 1, info, comm, 0, 1) {};
~Win();
int attach (void *base, MPI_Aint size);
int detach (void *base);
void get_group( MPI_Group* group);
void set_name( char* name);
int rank();
+ int dynamic();
int start(MPI_Group group, int assert);
int post(MPI_Group group, int assert);
int complete();