Пример #1
0
void ompi_win_allocate_f(MPI_Aint *size, MPI_Fint *disp_unit,
                                MPI_Fint *info, MPI_Fint *comm, char *baseptr,
                                MPI_Fint *win, MPI_Fint *ierr)
{
    int c_ierr;
    MPI_Info c_info;
    MPI_Comm c_comm;
    MPI_Win c_win;

    c_info = PMPI_Info_f2c(*info);
    c_comm = PMPI_Comm_f2c(*comm);

    c_ierr = PMPI_Win_allocate(*size, OMPI_FINT_2_INT(*disp_unit),
                                     c_info, c_comm,
                                     baseptr, &c_win);
    *win = PMPI_Win_c2f(c_win);
    if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
}
Пример #2
0
int MPI_Win_allocate(MPI_Aint win_size, int disp_unit, MPI_Info info, MPI_Comm comm, void* baseptr, MPI_Win* winptr)
{
    int ret;
    cqueue_t* mycqueue = handle_get_cqueue(comm);

    if (mycqueue != NULL)
        ret = cqueue_win_allocate(mycqueue, win_size, disp_unit, info, comm, baseptr, winptr);
    else
        ret = PMPI_Win_allocate(win_size, disp_unit, info, comm, baseptr, winptr);

    /* Register window object */
    /* For EP-lib: value represent window object in server,
       replace with index of free entry in the window table.
       Additionally, MPI_Win_free should free the buffer */
    /* Default: track value in window table, don't modify */
    window_register(winptr, baseptr, myclient, 1);

    return ret;
}