osc: add missing MPI_ERR_RMA_SHARED error code and internal equivalent
cmr=v1.8:reviewer=jsquyres This commit was SVN r31259.
Этот коммит содержится в:
родитель
cdb396697c
Коммит
545d5daced
@ -46,6 +46,7 @@ static ompi_errcode_intern_t ompi_err_not_found;
|
||||
static ompi_errcode_intern_t ompi_err_request;
|
||||
static ompi_errcode_intern_t ompi_err_buffer;
|
||||
static ompi_errcode_intern_t ompi_err_rma_sync;
|
||||
static ompi_errcode_intern_t ompi_err_rma_shared;
|
||||
|
||||
static void ompi_errcode_intern_construct(ompi_errcode_intern_t* errcode);
|
||||
static void ompi_errcode_intern_destruct(ompi_errcode_intern_t* errcode);
|
||||
@ -201,6 +202,14 @@ int ompi_errcode_intern_init (void)
|
||||
opal_pointer_array_set_item(&ompi_errcodes_intern, ompi_err_rma_sync.index,
|
||||
&ompi_err_rma_sync);
|
||||
|
||||
OBJ_CONSTRUCT(&ompi_err_rma_shared, ompi_errcode_intern_t);
|
||||
ompi_err_rma_shared.code = OMPI_ERR_RMA_SHARED;
|
||||
ompi_err_rma_shared.mpi_code = MPI_ERR_RMA_SHARED;
|
||||
ompi_err_rma_shared.index = pos++;
|
||||
strncpy(ompi_err_rma_shared.errstring, "OMPI_ERR_RMA_SHARED", OMPI_MAX_ERROR_STRING);
|
||||
opal_pointer_array_set_item(&ompi_errcodes_intern, ompi_err_rma_shared.index,
|
||||
&ompi_err_rma_shared);
|
||||
|
||||
ompi_errcode_intern_lastused=pos;
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
@ -225,6 +234,7 @@ int ompi_errcode_intern_finalize(void)
|
||||
OBJ_DESTRUCT(&ompi_err_buffer);
|
||||
OBJ_DESTRUCT(&ompi_err_request);
|
||||
OBJ_DESTRUCT(&ompi_err_rma_sync);
|
||||
OBJ_DESTRUCT(&ompi_err_rma_shared);
|
||||
|
||||
OBJ_DESTRUCT(&ompi_errcodes_intern);
|
||||
return OMPI_SUCCESS;
|
||||
|
@ -110,6 +110,7 @@ ompi_mpi_errcode_t ompi_t_err_pvar_no_atomic;
|
||||
ompi_mpi_errcode_t ompi_err_rma_range;
|
||||
ompi_mpi_errcode_t ompi_err_rma_attach;
|
||||
ompi_mpi_errcode_t ompi_err_rma_flavor;
|
||||
ompi_mpi_errcode_t ompi_err_rma_shared;
|
||||
|
||||
static void ompi_mpi_errcode_construct(ompi_mpi_errcode_t* errcode);
|
||||
static void ompi_mpi_errcode_destruct(ompi_mpi_errcode_t* errcode);
|
||||
@ -208,6 +209,7 @@ int ompi_mpi_errcode_init (void)
|
||||
CONSTRUCT_ERRCODE( ompi_err_rma_range, MPI_ERR_RMA_RANGE, "MPI_ERR_RMA_RANGE: invalid RMA address range" );
|
||||
CONSTRUCT_ERRCODE( ompi_err_rma_attach, MPI_ERR_RMA_ATTACH, "MPI_ERR_RMA_ATTACH: Could not attach RMA segment" );
|
||||
CONSTRUCT_ERRCODE( ompi_err_rma_flavor, MPI_ERR_RMA_FLAVOR, "MPI_ERR_RMA_FLAVOR: Invalid type of window" );
|
||||
CONSTRUCT_ERRCODE( ompi_err_rma_shared, MPI_ERR_RMA_SHARED, "MPI_ERR_RMA_SHARED: Memory cannot be shared" );
|
||||
|
||||
/* Per MPI-3 p353:27-32, MPI_LASTUSEDCODE must be >=
|
||||
MPI_ERR_LASTCODE. So just start it as == MPI_ERR_LASTCODE. */
|
||||
@ -301,6 +303,7 @@ int ompi_mpi_errcode_finalize(void)
|
||||
OBJ_DESTRUCT(&ompi_err_rma_range);
|
||||
OBJ_DESTRUCT(&ompi_err_rma_attach);
|
||||
OBJ_DESTRUCT(&ompi_err_rma_flavor);
|
||||
OBJ_DESTRUCT(&ompi_err_rma_shared);
|
||||
|
||||
OBJ_DESTRUCT(&ompi_mpi_errcodes);
|
||||
return OMPI_SUCCESS;
|
||||
|
@ -602,11 +602,12 @@ enum {
|
||||
#define MPI_ERR_RMA_RANGE 68
|
||||
#define MPI_ERR_RMA_ATTACH 69
|
||||
#define MPI_ERR_RMA_FLAVOR 70
|
||||
#define MPI_ERR_RMA_SHARED 71
|
||||
|
||||
/* Per MPI-3 p349 47, MPI_ERR_LASTCODE must be >= the last predefined
|
||||
MPI_ERR_<foo> code. So just set it equal to the last code --
|
||||
MPI_ERR_RMA_FLAVOR, in this case. */
|
||||
#define MPI_ERR_LASTCODE MPI_ERR_RMA_FLAVOR
|
||||
#define MPI_ERR_LASTCODE MPI_ERR_RMA_SHARED
|
||||
|
||||
#define MPI_ERR_SYSRESOURCE -2
|
||||
|
||||
|
@ -323,7 +323,8 @@ $constants->{MPI_T_ERR_PVAR_NO_ATOMIC} = 67;
|
||||
$constants->{MPI_ERR_RMA_RANGE} = 68;
|
||||
$constants->{MPI_ERR_RMA_ATTACH} = 69;
|
||||
$constants->{MPI_ERR_RMA_FLAVOR} = 70;
|
||||
$constants->{MPI_ERR_LASTCODE} = $constants->{MPI_ERR_RMA_FLAVOR};
|
||||
$constants->{MPI_ERR_RMA_SHARED} = 71;
|
||||
$constants->{MPI_ERR_LASTCODE} = $constants->{MPI_ERR_RMA_SHARED};
|
||||
|
||||
$constants->{MPI_ERR_SYSRESOURCE} = -2;
|
||||
|
||||
|
@ -65,7 +65,8 @@ enum {
|
||||
OMPI_ERR_SILENT = OPAL_ERR_SILENT,
|
||||
|
||||
OMPI_ERR_REQUEST = OMPI_ERR_BASE - 1,
|
||||
OMPI_ERR_RMA_SYNC = OMPI_ERR_BASE - 2
|
||||
OMPI_ERR_RMA_SYNC = OMPI_ERR_BASE - 2,
|
||||
OMPI_ERR_RMA_SHARED = OMPI_ERR_BASE - 3,
|
||||
};
|
||||
|
||||
#define OMPI_ERR_MAX (OMPI_ERR_BASE - 100)
|
||||
|
@ -1,3 +1,4 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University.
|
||||
* All rights reserved.
|
||||
@ -7,6 +8,8 @@
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2014 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -51,7 +54,14 @@ ompi_osc_base_select(ompi_win_t *win,
|
||||
((mca_base_component_list_item_t*) item)->cli_component;
|
||||
|
||||
priority = component->osc_query(win, base, size, disp_unit, comm, info, flavor);
|
||||
if (priority < 0) continue;
|
||||
if (priority < 0) {
|
||||
if (MPI_WIN_FLAVOR_SHARED == flavor && OMPI_ERR_RMA_SHARED == priority) {
|
||||
/* NTH: quick fix to return OMPI_ERR_RMA_SHARED */
|
||||
return OMPI_ERR_RMA_SHARED;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (priority > best_priority) {
|
||||
best_component = component;
|
||||
best_priority = priority;
|
||||
|
@ -146,16 +146,16 @@ check_win_ok(ompi_communicator_t *comm, int flavor)
|
||||
|
||||
if (! (MPI_WIN_FLAVOR_SHARED == flavor
|
||||
|| MPI_WIN_FLAVOR_ALLOCATE == flavor) ) {
|
||||
return -1;
|
||||
return OMPI_ERR_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
for (i = 0 ; i < ompi_comm_size(comm) ; ++i) {
|
||||
if (!OPAL_PROC_ON_LOCAL_NODE(ompi_comm_peer_lookup(comm, i)->proc_flags)) {
|
||||
return -1;
|
||||
return OMPI_ERR_RMA_SHARED;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
@ -164,7 +164,13 @@ component_query(struct ompi_win_t *win, void **base, size_t size, int disp_unit,
|
||||
struct ompi_communicator_t *comm, struct ompi_info_t *info,
|
||||
int flavor)
|
||||
{
|
||||
if (0 != check_win_ok(comm, flavor)) return -1;
|
||||
int ret;
|
||||
if (OMPI_SUCCESS != (ret = check_win_ok(comm, flavor))) {
|
||||
if (OMPI_ERR_NOT_SUPPORTED == ret) {
|
||||
return -1;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 100;
|
||||
}
|
||||
@ -178,7 +184,9 @@ component_select(struct ompi_win_t *win, void **base, size_t size, int disp_unit
|
||||
ompi_osc_sm_module_t *module = NULL;
|
||||
int ret = OMPI_ERROR;
|
||||
|
||||
if (0 != check_win_ok(comm, flavor)) return OMPI_ERR_NOT_SUPPORTED;
|
||||
if (OMPI_SUCCESS != (ret = check_win_ok(comm, flavor))) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* create module structure */
|
||||
module = (ompi_osc_sm_module_t*)
|
||||
|
@ -1,3 +1,4 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
@ -10,6 +11,8 @@
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2014 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -79,7 +82,7 @@ int MPI_Win_allocate_shared(MPI_Aint size, int disp_unit, MPI_Info info,
|
||||
if (OMPI_SUCCESS != ret) {
|
||||
*win = MPI_WIN_NULL;
|
||||
OPAL_CR_EXIT_LIBRARY();
|
||||
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_WIN, FUNC_NAME);
|
||||
OMPI_ERRHANDLER_RETURN (ret, comm, ret, FUNC_NAME);
|
||||
}
|
||||
|
||||
OPAL_CR_EXIT_LIBRARY();
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user