Update the PMIx external components
Signed-off-by: Ralph Castain <rhc@open-mpi.org>
Этот коммит содержится в:
родитель
a5679ef000
Коммит
187352eb3d
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
|
||||
# Copyright (c) 2014-2018 Intel, Inc. All rights reserved.
|
||||
# Copyright (c) 2015 Cisco Systems, Inc. All rights reserved.
|
||||
# Copyright (c) 2014-2015 Mellanox Technologies, Inc.
|
||||
# All rights reserved.
|
||||
|
@ -13,7 +13,7 @@
|
||||
# Copyright (c) 2011-2013 Los Alamos National Security, LLC.
|
||||
# All rights reserved.
|
||||
# Copyright (c) 2010-2015 Cisco Systems, Inc. All rights reserved.
|
||||
# Copyright (c) 2013-2017 Intel, Inc. All rights reserved.
|
||||
# Copyright (c) 2013-2018 Intel, Inc. All rights reserved.
|
||||
# Copyright (c) 2015-2017 Research Organization for Information Science
|
||||
# and Technology (RIST). All rights reserved.
|
||||
# Copyright (c) 2014-2015 Mellanox Technologies, Inc.
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
||||
/*
|
||||
* Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2014-2018 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2014-2017 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* Copyright (c) 2014-2015 Mellanox Technologies, Inc.
|
||||
@ -48,8 +48,13 @@
|
||||
|
||||
static const char *pmix1_get_nspace(opal_jobid_t jobid);
|
||||
static void pmix1_register_jobid(opal_jobid_t jobid, const char *nspace);
|
||||
static bool legacy_get(void)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
const opal_pmix_base_module_t opal_pmix_ext1x_module = {
|
||||
.legacy_get = legacy_get,
|
||||
/* client APIs */
|
||||
.init = pmix1_client_init,
|
||||
.finalize = pmix1_client_finalize,
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2014-2018 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2014-2015 Mellanox Technologies, Inc.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2016-2017 Research Organization for Information Science
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
||||
/*
|
||||
* Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2014-2018 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2014-2017 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* Copyright (c) 2014-2015 Mellanox Technologies, Inc.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2014-2018 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2014-2017 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* Copyright (c) 2016 Cisco Systems, Inc. All rights reserved.
|
||||
@ -21,6 +21,7 @@
|
||||
#include "opal/constants.h"
|
||||
#include "opal/class/opal_list.h"
|
||||
#include "opal/util/proc.h"
|
||||
#include "opal/util/show_help.h"
|
||||
#include "opal/mca/pmix/pmix.h"
|
||||
#include "pmix1x.h"
|
||||
|
||||
@ -45,39 +46,48 @@ static int external_component_query(mca_base_module_t **module, int *priority);
|
||||
|
||||
mca_pmix_ext1x_component_t mca_pmix_ext1x_component = {
|
||||
{
|
||||
/* First, the mca_component_t struct containing meta information
|
||||
about the component itself */
|
||||
/* First, the mca_component_t struct containing meta information
|
||||
* about the component itself */
|
||||
|
||||
.base_version = {
|
||||
/* Indicate that we are a pmix v1.1.0 component (which also
|
||||
implies a specific MCA version) */
|
||||
.base_version = {
|
||||
/* Indicate that we are a pmix v1.1.0 component (which also
|
||||
* implies a specific MCA version) */
|
||||
|
||||
OPAL_PMIX_BASE_VERSION_2_0_0,
|
||||
OPAL_PMIX_BASE_VERSION_2_0_0,
|
||||
|
||||
/* Component name and version */
|
||||
/* Component name and version */
|
||||
|
||||
.mca_component_name = "ext1x",
|
||||
MCA_BASE_MAKE_VERSION(component, OPAL_MAJOR_VERSION, OPAL_MINOR_VERSION,
|
||||
OPAL_RELEASE_VERSION),
|
||||
.mca_component_name = "ext1x",
|
||||
MCA_BASE_MAKE_VERSION(component, OPAL_MAJOR_VERSION, OPAL_MINOR_VERSION,
|
||||
OPAL_RELEASE_VERSION),
|
||||
|
||||
/* Component open and close functions */
|
||||
/* Component open and close functions */
|
||||
|
||||
.mca_open_component = external_open,
|
||||
.mca_close_component = external_close,
|
||||
.mca_query_component = external_component_query,
|
||||
},
|
||||
/* Next the MCA v1.0.0 component meta data */
|
||||
.base_data = {
|
||||
/* The component is checkpoint ready */
|
||||
MCA_BASE_METADATA_PARAM_CHECKPOINT
|
||||
}
|
||||
.mca_open_component = external_open,
|
||||
.mca_close_component = external_close,
|
||||
.mca_query_component = external_component_query,
|
||||
},
|
||||
/* Next the MCA v1.0.0 component meta data */
|
||||
.base_data = {
|
||||
/* The component is checkpoint ready */
|
||||
MCA_BASE_METADATA_PARAM_CHECKPOINT
|
||||
}
|
||||
},
|
||||
.native_launch = false
|
||||
};
|
||||
|
||||
static int external_open(void)
|
||||
{
|
||||
const char *version;
|
||||
|
||||
OBJ_CONSTRUCT(&mca_pmix_ext1x_component.jobids, opal_list_t);
|
||||
|
||||
version = PMIx_Get_version();
|
||||
if (0 != strncmp(version, "1.2", 3)) {
|
||||
opal_show_help("help-pmix-base.txt",
|
||||
"old-pmix", true, version, "v1.2");
|
||||
return OPAL_ERROR;
|
||||
}
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
@ -94,12 +104,12 @@ static int external_component_query(mca_base_module_t **module, int *priority)
|
||||
|
||||
/* see if a PMIx server is present */
|
||||
if (NULL != (t = getenv("PMIX_SERVER_URI")) ||
|
||||
NULL != (id = getenv("PMIX_ID"))) {
|
||||
/* if PMIx is present, then we are a client and need to use it */
|
||||
*priority = 100;
|
||||
NULL != (id = getenv("PMIX_ID"))) {
|
||||
/* if PMIx is present, then we are a client and need to use it */
|
||||
*priority = 100;
|
||||
} else {
|
||||
/* we could be a server, so we still need to be considered */
|
||||
*priority = 5;
|
||||
/* we could be a server, so we still need to be considered */
|
||||
*priority = 5;
|
||||
}
|
||||
*module = (mca_base_module_t *)&opal_pmix_ext1x_module;
|
||||
return OPAL_SUCCESS;
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
||||
/*
|
||||
* Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2014-2018 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2014-2017 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* Copyright (c) 2014-2015 Mellanox Technologies, Inc.
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
||||
/*
|
||||
* Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2014-2018 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2014-2017 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
||||
/*
|
||||
* Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2014-2018 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2014-2017 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* Copyright (c) 2014-2015 Mellanox Technologies, Inc.
|
||||
@ -50,7 +50,7 @@
|
||||
|
||||
/* These are functions used by both client and server to
|
||||
* access common functions in the embedded PMIx library */
|
||||
|
||||
static bool legacy_get(void);
|
||||
static const char *ext2x_get_nspace(opal_jobid_t jobid);
|
||||
static void ext2x_register_jobid(opal_jobid_t jobid, const char *nspace);
|
||||
static void register_handler(opal_list_t *event_codes,
|
||||
@ -72,6 +72,7 @@ static void ext2x_log(opal_list_t *info,
|
||||
opal_pmix_op_cbfunc_t cbfunc, void *cbdata);
|
||||
|
||||
const opal_pmix_base_module_t opal_pmix_ext2x_module = {
|
||||
.legacy_get = legacy_get,
|
||||
/* client APIs */
|
||||
.init = ext2x_client_init,
|
||||
.finalize = ext2x_client_finalize,
|
||||
@ -126,6 +127,11 @@ const opal_pmix_base_module_t opal_pmix_ext2x_module = {
|
||||
.register_jobid = ext2x_register_jobid
|
||||
};
|
||||
|
||||
static bool legacy_get(void)
|
||||
{
|
||||
return mca_pmix_ext2x_component.legacy_get;
|
||||
}
|
||||
|
||||
static void opcbfunc(pmix_status_t status, void *cbdata)
|
||||
{
|
||||
ext2x_opcaddy_t *op = (ext2x_opcaddy_t*)cbdata;
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
||||
/*
|
||||
* Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2014-2018 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2014-2015 Mellanox Technologies, Inc.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2016 Research Organization for Information Science
|
||||
@ -45,6 +45,7 @@ BEGIN_C_DECLS
|
||||
|
||||
typedef struct {
|
||||
opal_pmix_base_component_t super;
|
||||
bool legacy_get;
|
||||
opal_list_t jobids;
|
||||
bool native_launch;
|
||||
size_t evindex;
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
||||
/*
|
||||
* Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2014-2018 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2014-2017 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* Copyright (c) 2014-2017 Mellanox Technologies, Inc.
|
||||
@ -400,7 +400,6 @@ int ext2x_store_local(const opal_process_name_t *proc, opal_value_t *val)
|
||||
|
||||
PMIX_VALUE_CONSTRUCT(&kv);
|
||||
ext2x_value_load(&kv, val);
|
||||
|
||||
/* call the library - this is a blocking call */
|
||||
rc = PMIx_Store_internal(&p, val->key, &kv);
|
||||
PMIX_VALUE_DESTRUCT(&kv);
|
||||
@ -596,10 +595,11 @@ int ext2x_get(const opal_process_name_t *proc, const char *key,
|
||||
return OPAL_ERR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
if (NULL == proc) {
|
||||
if (NULL == proc && NULL != key) {
|
||||
/* if they are asking for our jobid, then return it */
|
||||
if (0 == strcmp(key, OPAL_PMIX_JOBID)) {
|
||||
(*val) = OBJ_NEW(opal_value_t);
|
||||
(*val)->key = strdup(key);
|
||||
(*val)->type = OPAL_UINT32;
|
||||
(*val)->data.uint32 = OPAL_PROC_MY_NAME.jobid;
|
||||
OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock);
|
||||
@ -608,6 +608,7 @@ int ext2x_get(const opal_process_name_t *proc, const char *key,
|
||||
/* if they are asking for our rank, return it */
|
||||
if (0 == strcmp(key, OPAL_PMIX_RANK)) {
|
||||
(*val) = OBJ_NEW(opal_value_t);
|
||||
(*val)->key = strdup(key);
|
||||
(*val)->type = OPAL_INT;
|
||||
(*val)->data.integer = ext2x_convert_rank(my_proc.rank);
|
||||
OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock);
|
||||
@ -642,6 +643,9 @@ int ext2x_get(const opal_process_name_t *proc, const char *key,
|
||||
rc = PMIx_Get(&p, key, pinfo, sz, &pval);
|
||||
if (PMIX_SUCCESS == rc) {
|
||||
ival = OBJ_NEW(opal_value_t);
|
||||
if (NULL != key) {
|
||||
ival->key = strdup(key);
|
||||
}
|
||||
if (OPAL_SUCCESS != (ret = ext2x_value_unload(ival, pval))) {
|
||||
rc = ext2x_convert_opalrc(ret);
|
||||
} else {
|
||||
@ -663,6 +667,9 @@ static void val_cbfunc(pmix_status_t status,
|
||||
|
||||
OPAL_ACQUIRE_OBJECT(op);
|
||||
OBJ_CONSTRUCT(&val, opal_value_t);
|
||||
if (NULL != op->nspace) {
|
||||
val.key = strdup(op->nspace);
|
||||
}
|
||||
rc = ext2x_convert_opalrc(status);
|
||||
if (PMIX_SUCCESS == status && NULL != kv) {
|
||||
rc = ext2x_value_unload(&val, kv);
|
||||
@ -702,6 +709,7 @@ int ext2x_getnb(const opal_process_name_t *proc, const char *key,
|
||||
if (0 == strcmp(key, OPAL_PMIX_JOBID)) {
|
||||
if (NULL != cbfunc) {
|
||||
val = OBJ_NEW(opal_value_t);
|
||||
val->key = strdup(key);
|
||||
val->type = OPAL_UINT32;
|
||||
val->data.uint32 = OPAL_PROC_MY_NAME.jobid;
|
||||
cbfunc(OPAL_SUCCESS, val, cbdata);
|
||||
@ -713,6 +721,7 @@ int ext2x_getnb(const opal_process_name_t *proc, const char *key,
|
||||
if (0 == strcmp(key, OPAL_PMIX_RANK)) {
|
||||
if (NULL != cbfunc) {
|
||||
val = OBJ_NEW(opal_value_t);
|
||||
val->key = strdup(key);
|
||||
val->type = OPAL_INT;
|
||||
val->data.integer = ext2x_convert_rank(my_proc.rank);
|
||||
cbfunc(OPAL_SUCCESS, val, cbdata);
|
||||
@ -726,7 +735,9 @@ int ext2x_getnb(const opal_process_name_t *proc, const char *key,
|
||||
op = OBJ_NEW(ext2x_opcaddy_t);
|
||||
op->valcbfunc = cbfunc;
|
||||
op->cbdata = cbdata;
|
||||
|
||||
if (NULL != key) {
|
||||
op->nspace = strdup(key);
|
||||
}
|
||||
if (NULL == proc) {
|
||||
(void)strncpy(op->p.nspace, my_proc.nspace, PMIX_MAX_NSLEN);
|
||||
op->p.rank = ext2x_convert_rank(PMIX_RANK_WILDCARD);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2014-2018 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2014-2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* Copyright (c) 2016 Cisco Systems, Inc. All rights reserved.
|
||||
@ -21,6 +21,7 @@
|
||||
#include "opal/constants.h"
|
||||
#include "opal/class/opal_list.h"
|
||||
#include "opal/util/proc.h"
|
||||
#include "opal/util/show_help.h"
|
||||
#include "opal/mca/pmix/pmix.h"
|
||||
#include "ext2x.h"
|
||||
|
||||
@ -74,6 +75,7 @@ mca_pmix_ext2x_component_t mca_pmix_ext2x_component = {
|
||||
MCA_BASE_METADATA_PARAM_CHECKPOINT
|
||||
}
|
||||
},
|
||||
.legacy_get = true,
|
||||
.native_launch = false
|
||||
};
|
||||
|
||||
@ -94,11 +96,23 @@ static int external_register(void)
|
||||
|
||||
static int external_open(void)
|
||||
{
|
||||
const char *version;
|
||||
|
||||
mca_pmix_ext2x_component.evindex = 0;
|
||||
OBJ_CONSTRUCT(&mca_pmix_ext2x_component.jobids, opal_list_t);
|
||||
OBJ_CONSTRUCT(&mca_pmix_ext2x_component.events, opal_list_t);
|
||||
OBJ_CONSTRUCT(&mca_pmix_ext2x_component.dmdx, opal_list_t);
|
||||
|
||||
version = PMIx_Get_version();
|
||||
if ('2' != version[0]) {
|
||||
opal_show_help("help-pmix-base.txt",
|
||||
"incorrect-pmix", true, version, "v2.x");
|
||||
return OPAL_ERROR;
|
||||
}
|
||||
if (0 == strncmp(version, "2.1", 3)) {
|
||||
mca_pmix_ext2x_component.legacy_get = false;
|
||||
}
|
||||
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user