X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d9c79bac5bc813d1a89974ed83023cb9f532b46a..f2f6774b105704993c6a0e37597e29904bab314a:/src/smpi/smpi_pmpi.cpp diff --git a/src/smpi/smpi_pmpi.cpp b/src/smpi/smpi_pmpi.cpp index 1fc6775ba6..d09c579b55 100644 --- a/src/smpi/smpi_pmpi.cpp +++ b/src/smpi/smpi_pmpi.cpp @@ -2615,7 +2615,7 @@ 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 (win->dynamic()!=0 && 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) || @@ -2649,7 +2649,7 @@ 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 (win->dynamic()!=0 && 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) || @@ -2684,7 +2684,7 @@ 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 (win->dynamic()!=0 && 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) || @@ -2722,7 +2722,7 @@ MPI_Datatype target_datatype, MPI_Op op, MPI_Win win){ retval = MPI_SUCCESS; } else if (target_rank <0){ retval = MPI_ERR_RANK; - } else if (win->dynamic()!=0 && 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) || @@ -2752,6 +2752,10 @@ MPI_Datatype target_datatype, MPI_Op op, MPI_Win win){ return retval; } +int PMPI_Fetch_and_op(void *origin_addr, void *result_addr, MPI_Datatype dtype, int target_rank, MPI_Aint target_disp, MPI_Op op, MPI_Win win){ + return PMPI_Get_accumulate(origin_addr, origin_addr==nullptr?0:1, dtype, result_addr, 1, dtype, target_rank, target_disp, 1, dtype, op, win); +} + int PMPI_Win_post(MPI_Group group, int assert, MPI_Win win){ int retval = 0; smpi_bench_end(); @@ -2975,7 +2979,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){