Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Begin working on the communication optimization for partial shared malloc.
[simgrid.git] / src / smpi / smpi_pmpi.cpp
index d14354c..dabf499 100644 (file)
@@ -270,6 +270,17 @@ int PMPI_Op_free(MPI_Op * op)
   }
 }
 
+int PMPI_Op_commutative(MPI_Op op, int* commute){
+  if (op == MPI_OP_NULL) {
+    return MPI_ERR_OP;
+  } else if (commute==nullptr){
+    return MPI_ERR_ARG;
+  } else {
+    *commute = op->is_commutative();
+    return MPI_SUCCESS;
+  }
+}
+
 int PMPI_Group_free(MPI_Group * group)
 {
   if (group == nullptr) {
@@ -2604,7 +2615,8 @@ int PMPI_Get( void *origin_addr, int origin_count, MPI_Datatype origin_datatype,
     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)){
@@ -2637,7 +2649,8 @@ int PMPI_Put( void *origin_addr, int origin_count, MPI_Datatype origin_datatype,
     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)){
@@ -2671,7 +2684,8 @@ int PMPI_Accumulate( void *origin_addr, int origin_count, MPI_Datatype origin_da
     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)){
@@ -2708,7 +2722,8 @@ MPI_Datatype target_datatype, MPI_Op op, MPI_Win win){
     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) ||
@@ -2960,7 +2975,7 @@ int PMPI_Attr_delete(MPI_Comm comm, int keyval) {
 int PMPI_Attr_get(MPI_Comm comm, int keyval, void* attr_value, int* flag) {
   static int one = 1;
   static int zero = 0;
-  static int tag_ub = 1000000;
+  static int tag_ub = INT_MAX;
   static int last_used_code = MPI_ERR_LASTCODE;
 
   if (comm==MPI_COMM_NULL){