odls/base: fix support for PMIx < v2.1
wrap opal_pmix.get() around opal_pmix.legacy_get() to support previous PMIx releases. Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
Этот коммит содержится в:
родитель
69456c8962
Коммит
4f1cb4747c
@ -15,8 +15,8 @@
|
|||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2011-2017 Cisco Systems, Inc. All rights reserved
|
* Copyright (c) 2011-2017 Cisco Systems, Inc. All rights reserved
|
||||||
* Copyright (c) 2013-2018 Intel, Inc. All rights reserved.
|
* Copyright (c) 2013-2018 Intel, Inc. All rights reserved.
|
||||||
* Copyright (c) 2014-2017 Research Organization for Information Science
|
* Copyright (c) 2014-2018 Research Organization for Information Science
|
||||||
* and Technology (RIST). All rights reserved.
|
* and Technology (RIST). All rights reserved.
|
||||||
* Copyright (c) 2017 Mellanox Technologies Ltd. All rights reserved.
|
* Copyright (c) 2017 Mellanox Technologies Ltd. All rights reserved.
|
||||||
* Copyright (c) 2017 IBM Corporation. All rights reserved.
|
* Copyright (c) 2017 IBM Corporation. All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
@ -202,38 +202,60 @@ int orte_odls_base_default_get_add_procs_data(opal_buffer_t *buffer,
|
|||||||
wireup = OBJ_NEW(opal_buffer_t);
|
wireup = OBJ_NEW(opal_buffer_t);
|
||||||
/* always include data for mpirun as the daemons can't have it yet */
|
/* always include data for mpirun as the daemons can't have it yet */
|
||||||
val = NULL;
|
val = NULL;
|
||||||
if (OPAL_SUCCESS != (rc = opal_pmix.get(ORTE_PROC_MY_NAME, NULL, NULL, &val)) || NULL == val) {
|
if (opal_pmix.legacy_get()) {
|
||||||
ORTE_ERROR_LOG(rc);
|
if (OPAL_SUCCESS != (rc = opal_pmix.get(ORTE_PROC_MY_NAME, OPAL_PMIX_PROC_URI, NULL, &val)) || NULL == val) {
|
||||||
OBJ_RELEASE(wireup);
|
|
||||||
return rc;
|
|
||||||
} else {
|
|
||||||
/* the data is returned as a list of key-value pairs in the opal_value_t */
|
|
||||||
if (OPAL_PTR != val->type) {
|
|
||||||
ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND);
|
|
||||||
OBJ_RELEASE(wireup);
|
|
||||||
return ORTE_ERR_NOT_FOUND;
|
|
||||||
}
|
|
||||||
if (ORTE_SUCCESS != (rc = opal_dss.pack(wireup, ORTE_PROC_MY_NAME, 1, ORTE_NAME))) {
|
|
||||||
ORTE_ERROR_LOG(rc);
|
ORTE_ERROR_LOG(rc);
|
||||||
OBJ_RELEASE(wireup);
|
OBJ_RELEASE(wireup);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
} else {
|
||||||
modex = (opal_list_t*)val->data.ptr;
|
/* pack the name of the daemon */
|
||||||
numbytes = (int32_t)opal_list_get_size(modex);
|
if (ORTE_SUCCESS != (rc = opal_dss.pack(wireup, ORTE_PROC_MY_NAME, 1, ORTE_NAME))) {
|
||||||
if (ORTE_SUCCESS != (rc = opal_dss.pack(wireup, &numbytes, 1, OPAL_INT32))) {
|
|
||||||
ORTE_ERROR_LOG(rc);
|
|
||||||
OBJ_RELEASE(wireup);
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
OPAL_LIST_FOREACH(kv, modex, opal_value_t) {
|
|
||||||
if (ORTE_SUCCESS != (rc = opal_dss.pack(wireup, &kv, 1, OPAL_VALUE))) {
|
|
||||||
ORTE_ERROR_LOG(rc);
|
ORTE_ERROR_LOG(rc);
|
||||||
OBJ_RELEASE(wireup);
|
OBJ_RELEASE(wireup);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
/* pack the URI */
|
||||||
|
if (ORTE_SUCCESS != (rc = opal_dss.pack(wireup, &val->data.string, 1, OPAL_STRING))) {
|
||||||
|
ORTE_ERROR_LOG(rc);
|
||||||
|
OBJ_RELEASE(wireup);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
OBJ_RELEASE(val);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (OPAL_SUCCESS != (rc = opal_pmix.get(ORTE_PROC_MY_NAME, NULL, NULL, &val)) || NULL == val) {
|
||||||
|
ORTE_ERROR_LOG(rc);
|
||||||
|
OBJ_RELEASE(wireup);
|
||||||
|
return rc;
|
||||||
|
} else {
|
||||||
|
/* the data is returned as a list of key-value pairs in the opal_value_t */
|
||||||
|
if (OPAL_PTR != val->type) {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND);
|
||||||
|
OBJ_RELEASE(wireup);
|
||||||
|
return ORTE_ERR_NOT_FOUND;
|
||||||
|
}
|
||||||
|
if (ORTE_SUCCESS != (rc = opal_dss.pack(wireup, ORTE_PROC_MY_NAME, 1, ORTE_NAME))) {
|
||||||
|
ORTE_ERROR_LOG(rc);
|
||||||
|
OBJ_RELEASE(wireup);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
modex = (opal_list_t*)val->data.ptr;
|
||||||
|
numbytes = (int32_t)opal_list_get_size(modex);
|
||||||
|
if (ORTE_SUCCESS != (rc = opal_dss.pack(wireup, &numbytes, 1, OPAL_INT32))) {
|
||||||
|
ORTE_ERROR_LOG(rc);
|
||||||
|
OBJ_RELEASE(wireup);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
OPAL_LIST_FOREACH(kv, modex, opal_value_t) {
|
||||||
|
if (ORTE_SUCCESS != (rc = opal_dss.pack(wireup, &kv, 1, OPAL_VALUE))) {
|
||||||
|
ORTE_ERROR_LOG(rc);
|
||||||
|
OBJ_RELEASE(wireup);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
OPAL_LIST_RELEASE(modex);
|
||||||
|
OBJ_RELEASE(val);
|
||||||
}
|
}
|
||||||
OPAL_LIST_RELEASE(modex);
|
|
||||||
OBJ_RELEASE(val);
|
|
||||||
}
|
}
|
||||||
/* if we didn't rollup the connection info, then we have
|
/* if we didn't rollup the connection info, then we have
|
||||||
* to provide a complete map of connection info */
|
* to provide a complete map of connection info */
|
||||||
@ -243,41 +265,66 @@ int orte_odls_base_default_get_add_procs_data(opal_buffer_t *buffer,
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
val = NULL;
|
val = NULL;
|
||||||
if (OPAL_SUCCESS != (rc = opal_pmix.get(&dmn->name, NULL, NULL, &val)) || NULL == val) {
|
if (opal_pmix.legacy_get()) {
|
||||||
ORTE_ERROR_LOG(rc);
|
if (OPAL_SUCCESS != (rc = opal_pmix.get(&dmn->name, OPAL_PMIX_PROC_URI, NULL, &val)) || NULL == val) {
|
||||||
OBJ_RELEASE(buffer);
|
|
||||||
return rc;
|
|
||||||
} else {
|
|
||||||
/* the data is returned as a list of key-value pairs in the opal_value_t */
|
|
||||||
if (OPAL_PTR != val->type) {
|
|
||||||
ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND);
|
|
||||||
OBJ_RELEASE(buffer);
|
|
||||||
return ORTE_ERR_NOT_FOUND;
|
|
||||||
}
|
|
||||||
if (ORTE_SUCCESS != (rc = opal_dss.pack(wireup, &dmn->name, 1, ORTE_NAME))) {
|
|
||||||
ORTE_ERROR_LOG(rc);
|
ORTE_ERROR_LOG(rc);
|
||||||
OBJ_RELEASE(buffer);
|
OBJ_RELEASE(buffer);
|
||||||
OBJ_RELEASE(wireup);
|
OBJ_RELEASE(wireup);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
} else {
|
||||||
modex = (opal_list_t*)val->data.ptr;
|
/* pack the name of the daemon */
|
||||||
numbytes = (int32_t)opal_list_get_size(modex);
|
if (ORTE_SUCCESS != (rc = opal_dss.pack(wireup, &dmn->name, 1, ORTE_NAME))) {
|
||||||
if (ORTE_SUCCESS != (rc = opal_dss.pack(wireup, &numbytes, 1, OPAL_INT32))) {
|
|
||||||
ORTE_ERROR_LOG(rc);
|
|
||||||
OBJ_RELEASE(buffer);
|
|
||||||
OBJ_RELEASE(wireup);
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
OPAL_LIST_FOREACH(kv, modex, opal_value_t) {
|
|
||||||
if (ORTE_SUCCESS != (rc = opal_dss.pack(wireup, &kv, 1, OPAL_VALUE))) {
|
|
||||||
ORTE_ERROR_LOG(rc);
|
ORTE_ERROR_LOG(rc);
|
||||||
OBJ_RELEASE(buffer);
|
OBJ_RELEASE(buffer);
|
||||||
OBJ_RELEASE(wireup);
|
OBJ_RELEASE(wireup);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
/* pack the URI */
|
||||||
|
if (ORTE_SUCCESS != (rc = opal_dss.pack(wireup, &val->data.string, 1, OPAL_STRING))) {
|
||||||
|
ORTE_ERROR_LOG(rc);
|
||||||
|
OBJ_RELEASE(buffer);
|
||||||
|
OBJ_RELEASE(wireup);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
OBJ_RELEASE(val);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (OPAL_SUCCESS != (rc = opal_pmix.get(&dmn->name, NULL, NULL, &val)) || NULL == val) {
|
||||||
|
ORTE_ERROR_LOG(rc);
|
||||||
|
OBJ_RELEASE(buffer);
|
||||||
|
return rc;
|
||||||
|
} else {
|
||||||
|
/* the data is returned as a list of key-value pairs in the opal_value_t */
|
||||||
|
if (OPAL_PTR != val->type) {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND);
|
||||||
|
OBJ_RELEASE(buffer);
|
||||||
|
return ORTE_ERR_NOT_FOUND;
|
||||||
|
}
|
||||||
|
if (ORTE_SUCCESS != (rc = opal_dss.pack(wireup, &dmn->name, 1, ORTE_NAME))) {
|
||||||
|
ORTE_ERROR_LOG(rc);
|
||||||
|
OBJ_RELEASE(buffer);
|
||||||
|
OBJ_RELEASE(wireup);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
modex = (opal_list_t*)val->data.ptr;
|
||||||
|
numbytes = (int32_t)opal_list_get_size(modex);
|
||||||
|
if (ORTE_SUCCESS != (rc = opal_dss.pack(wireup, &numbytes, 1, OPAL_INT32))) {
|
||||||
|
ORTE_ERROR_LOG(rc);
|
||||||
|
OBJ_RELEASE(buffer);
|
||||||
|
OBJ_RELEASE(wireup);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
OPAL_LIST_FOREACH(kv, modex, opal_value_t) {
|
||||||
|
if (ORTE_SUCCESS != (rc = opal_dss.pack(wireup, &kv, 1, OPAL_VALUE))) {
|
||||||
|
ORTE_ERROR_LOG(rc);
|
||||||
|
OBJ_RELEASE(buffer);
|
||||||
|
OBJ_RELEASE(wireup);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
OPAL_LIST_RELEASE(modex);
|
||||||
|
OBJ_RELEASE(val);
|
||||||
}
|
}
|
||||||
OPAL_LIST_RELEASE(modex);
|
|
||||||
OBJ_RELEASE(val);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user