int ompi_win_create_dynamic(opal_info_t *info, ompi_communicator_t *comm, ompi_win_t **newwin) { ompi_win_t *win; int model; int ret; ret = alloc_window (comm, info, MPI_WIN_FLAVOR_DYNAMIC, &win); if (OMPI_SUCCESS != ret) { return ret; } ret = ompi_osc_base_select(win, MPI_BOTTOM, 0, 1, comm, info, MPI_WIN_FLAVOR_DYNAMIC, &model); if (OMPI_SUCCESS != ret) { OBJ_RELEASE(win); return ret; } ret = config_window(MPI_BOTTOM, 0, 1, MPI_WIN_FLAVOR_DYNAMIC, model, win); if (OMPI_SUCCESS != ret) { OBJ_RELEASE(win); return ret; } *newwin = win; return OMPI_SUCCESS; }
int ompi_win_create(void *base, size_t size, int disp_unit, ompi_communicator_t *comm, opal_info_t *info, ompi_win_t** newwin) { ompi_win_t *win; int model; int ret; ret = alloc_window (comm, info, MPI_WIN_FLAVOR_CREATE, &win); if (OMPI_SUCCESS != ret) { return ret; } ret = ompi_osc_base_select(win, &base, size, disp_unit, comm, info, MPI_WIN_FLAVOR_CREATE, &model); if (OMPI_SUCCESS != ret) { OBJ_RELEASE(win); return ret; } ret = config_window(base, size, disp_unit, MPI_WIN_FLAVOR_CREATE, model, win); if (OMPI_SUCCESS != ret) { OBJ_RELEASE(win); return ret; } *newwin = win; return OMPI_SUCCESS; }
int ompi_win_allocate_shared(size_t size, int disp_unit, opal_info_t *info, ompi_communicator_t *comm, void *baseptr, ompi_win_t **newwin) { ompi_win_t *win; int model; int ret; void *base; ret = alloc_window (comm, info, MPI_WIN_FLAVOR_SHARED, &win); if (OMPI_SUCCESS != ret) { return ret; } ret = ompi_osc_base_select(win, &base, size, disp_unit, comm, info, MPI_WIN_FLAVOR_SHARED, &model); if (OMPI_SUCCESS != ret) { OBJ_RELEASE(win); return ret; } ret = config_window(base, size, disp_unit, MPI_WIN_FLAVOR_SHARED, model, win); if (OMPI_SUCCESS != ret) { OBJ_RELEASE(win); return ret; } *((void**) baseptr) = base; *newwin = win; return OMPI_SUCCESS; }
int ompi_win_allocate(size_t size, int disp_unit, ompi_info_t *info, ompi_communicator_t *comm, void *baseptr, ompi_win_t **newwin) { ompi_win_t *win; int model; int ret; void *base; win = alloc_window(comm); if (NULL == win) return OMPI_ERR_OUT_OF_RESOURCE; ret = ompi_osc_base_select(win, &base, size, disp_unit, comm, info, MPI_WIN_FLAVOR_ALLOCATE, &model); if (OMPI_SUCCESS != ret) { OBJ_RELEASE(win); return ret; } ret = config_window(base, size, disp_unit, MPI_WIN_FLAVOR_ALLOCATE, model, win); if (OMPI_SUCCESS != ret) { OBJ_RELEASE(win); return ret; } *((void**) baseptr) = base; *newwin = win; return OMPI_SUCCESS; }