- if (win == MPI_WIN_NULL) {
- retval = MPI_ERR_WIN;
- } else if (target_rank == MPI_PROC_NULL) {
- *request = MPI_REQUEST_NULL;
- retval = MPI_SUCCESS;
- } else if (target_rank <0){
- retval = MPI_ERR_RANK;
- } 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 && op != MPI_NO_OP) ||
- (result_addr==nullptr && result_count > 0)){
- retval = MPI_ERR_COUNT;
- } else if (((target_datatype == MPI_DATATYPE_NULL) || (result_datatype == MPI_DATATYPE_NULL)) ||
- (((origin_datatype != MPI_DATATYPE_NULL) && (not origin_datatype->is_valid())) || (not target_datatype->is_valid()) || (not result_datatype->is_valid()))) {
- retval = MPI_ERR_TYPE;
- } else if (op == MPI_OP_NULL) {
- retval = MPI_ERR_OP;
- } else if(request == nullptr){
- retval = MPI_ERR_REQUEST;
- } else {
- int my_proc_id = simgrid::s4u::this_actor::get_pid();
- MPI_Group group;
- win->get_group(&group);
- TRACE_smpi_comm_in(my_proc_id, __func__,
- new simgrid::instr::Pt2PtTIData(
- "Rget_accumulate", target_rank,
- target_datatype->is_replayable() ? target_count : target_count * target_datatype->size(),
- simgrid::smpi::Datatype::encode(target_datatype)));
-
- retval = win->get_accumulate( origin_addr, origin_count, origin_datatype, result_addr,
- result_count, result_datatype, target_rank, target_disp,
- target_count, target_datatype, op, request);