Exemplo n.º 1
0
int
ompi_osc_pt2pt_accumulate(const void *origin_addr, int origin_count,
                         struct ompi_datatype_t *origin_dt,
                         int target, OPAL_PTRDIFF_TYPE target_disp,
                         int target_count,
                         struct ompi_datatype_t *target_dt,
                         struct ompi_op_t *op, ompi_win_t *win)
{
    return ompi_osc_pt2pt_accumulate_w_req (origin_addr, origin_count, origin_dt,
                                           target, target_disp, target_count,
                                           target_dt, op, win, NULL);
}
Exemplo n.º 2
0
int ompi_osc_pt2pt_raccumulate(const void *origin_addr, int origin_count,
                              struct ompi_datatype_t *origin_dt, int target,
                              OPAL_PTRDIFF_TYPE target_disp, int target_count,
                              struct ompi_datatype_t *target_dt, struct ompi_op_t *op,
                              struct ompi_win_t *win, struct ompi_request_t **request)
{
    ompi_osc_pt2pt_request_t *pt2pt_request;
    int ret;

    OPAL_OUTPUT_VERBOSE((50, ompi_osc_base_framework.framework_output,
                         "raccumulate: 0x%lx, %d, %s, %d, %d, %d, %s, %s, %s",
                         (unsigned long) origin_addr, origin_count,
                         origin_dt->name, target, (int) target_disp,
                         target_count, target_dt->name, op->o_name,
                         win->w_name));

    OMPI_OSC_PT2PT_REQUEST_ALLOC(win, pt2pt_request);
    if (NULL == pt2pt_request) {
        return OMPI_ERR_OUT_OF_RESOURCE;
    }

    /* short-circuit case */
    if (0 == origin_count || 0 == target_count) {
        ompi_osc_pt2pt_request_complete (pt2pt_request, MPI_SUCCESS);
        *request = (ompi_request_t *) pt2pt_request;
        return OMPI_SUCCESS;
    }

    pt2pt_request->type = OMPI_OSC_PT2PT_HDR_TYPE_ACC;

    ret = ompi_osc_pt2pt_accumulate_w_req (origin_addr, origin_count, origin_dt, target,
                                          target_disp, target_count, target_dt, op, win,
                                          pt2pt_request);
    if (OMPI_SUCCESS != ret) {
        OMPI_OSC_PT2PT_REQUEST_RETURN(pt2pt_request);
        return ret;
    }

    *request = (ompi_request_t *) pt2pt_request;

    return OMPI_SUCCESS;
}