The move of the orte_db framework to opal required that we create an opaque opal_identifier_t type as OPAL cannot know anything about the ORTE process name. However, passing a value down to opal and then having the db components reference it causes alignment issues on Solaris Sparc platforms. So pass the pointer instead and do the old "memcpy" trick to avoid the problem.
This commit was SVN r28308.
This commit is contained in:
parent
112fd70da1
commit
45af6cf59e
@ -142,48 +142,33 @@ void ompi_rte_wait_for_debugger(void)
|
||||
int ompi_rte_db_store(const orte_process_name_t *nm, const char* key,
|
||||
const void *data, opal_data_type_t type)
|
||||
{
|
||||
opal_identifier_t *id;
|
||||
|
||||
id = (opal_identifier_t*)nm;
|
||||
return opal_db.store((*id), OPAL_DB_GLOBAL, key, data, type);
|
||||
return opal_db.store((opal_identifier_t*)nm, OPAL_DB_GLOBAL, key, data, type);
|
||||
}
|
||||
|
||||
int ompi_rte_db_fetch(const orte_process_name_t *nm,
|
||||
const char *key,
|
||||
void **data, opal_data_type_t type)
|
||||
{
|
||||
opal_identifier_t *id;
|
||||
|
||||
id = (opal_identifier_t*)nm;
|
||||
return opal_db.fetch((*id), key, data, type);
|
||||
return opal_db.fetch((opal_identifier_t*)nm, key, data, type);
|
||||
}
|
||||
|
||||
int ompi_rte_db_fetch_pointer(const orte_process_name_t *nm,
|
||||
const char *key,
|
||||
void **data, opal_data_type_t type)
|
||||
{
|
||||
opal_identifier_t *id;
|
||||
|
||||
id = (opal_identifier_t*)nm;
|
||||
return opal_db.fetch_pointer((*id), key, data, type);
|
||||
return opal_db.fetch_pointer((opal_identifier_t*)nm, key, data, type);
|
||||
}
|
||||
|
||||
int ompi_rte_db_fetch_multiple(const orte_process_name_t *nm,
|
||||
const char *key,
|
||||
opal_list_t *kvs)
|
||||
{
|
||||
opal_identifier_t *id;
|
||||
|
||||
id = (opal_identifier_t*)nm;
|
||||
return opal_db.fetch_multiple((*id), key, kvs);
|
||||
return opal_db.fetch_multiple((opal_identifier_t*)nm, key, kvs);
|
||||
}
|
||||
|
||||
int ompi_rte_db_remove(const orte_process_name_t *nm,
|
||||
const char *key)
|
||||
{
|
||||
opal_identifier_t *id;
|
||||
|
||||
id = (opal_identifier_t*)nm;
|
||||
return opal_db.remove((*id), key);
|
||||
return opal_db.remove((opal_identifier_t*)nm, key);
|
||||
}
|
||||
|
||||
|
@ -47,23 +47,23 @@ typedef struct {
|
||||
|
||||
OPAL_DECLSPEC extern opal_db_base_t opal_db_base;
|
||||
|
||||
OPAL_DECLSPEC int opal_db_base_store(opal_identifier_t proc,
|
||||
OPAL_DECLSPEC int opal_db_base_store(const opal_identifier_t *proc,
|
||||
opal_db_locality_t locality,
|
||||
const char *key, const void *object,
|
||||
opal_data_type_t type);
|
||||
OPAL_DECLSPEC int opal_db_base_store_pointer(opal_identifier_t proc,
|
||||
OPAL_DECLSPEC int opal_db_base_store_pointer(const opal_identifier_t *proc,
|
||||
opal_db_locality_t locality,
|
||||
opal_value_t *kv);
|
||||
OPAL_DECLSPEC int opal_db_base_fetch(opal_identifier_t proc,
|
||||
OPAL_DECLSPEC int opal_db_base_fetch(const opal_identifier_t *proc,
|
||||
const char *key, void **data,
|
||||
opal_data_type_t type);
|
||||
OPAL_DECLSPEC int opal_db_base_fetch_pointer(opal_identifier_t proc,
|
||||
OPAL_DECLSPEC int opal_db_base_fetch_pointer(const opal_identifier_t *proc,
|
||||
const char *key,
|
||||
void **data, opal_data_type_t type);
|
||||
OPAL_DECLSPEC int opal_db_base_fetch_multiple(opal_identifier_t proc,
|
||||
OPAL_DECLSPEC int opal_db_base_fetch_multiple(const opal_identifier_t *proc,
|
||||
const char *key,
|
||||
opal_list_t *kvs);
|
||||
OPAL_DECLSPEC int opal_db_base_remove_data(opal_identifier_t proc,
|
||||
OPAL_DECLSPEC int opal_db_base_remove_data(const opal_identifier_t *proc,
|
||||
const char *key);
|
||||
|
||||
OPAL_DECLSPEC int opal_db_base_add_log(const char *table,
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include "opal/mca/db/base/base.h"
|
||||
|
||||
|
||||
int opal_db_base_store(opal_identifier_t proc,
|
||||
int opal_db_base_store(const opal_identifier_t *proc,
|
||||
opal_db_locality_t locality,
|
||||
const char *key, const void *object,
|
||||
opal_data_type_t type)
|
||||
@ -30,10 +30,6 @@ int opal_db_base_store(opal_identifier_t proc,
|
||||
opal_db_active_module_t *mod;
|
||||
int rc;
|
||||
|
||||
opal_output_verbose(1, opal_db_base_framework.framework_output,
|
||||
"db:hash:base:store storing data for proc %" PRIu64 " at locality %d",
|
||||
proc, (int)locality);
|
||||
|
||||
/* cycle thru the active modules until one agrees to perform the op */
|
||||
did_op = false;
|
||||
OPAL_LIST_FOREACH(mod, &opal_db_base.store_order, opal_db_active_module_t) {
|
||||
@ -61,7 +57,7 @@ int opal_db_base_store(opal_identifier_t proc,
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
int opal_db_base_store_pointer(opal_identifier_t proc,
|
||||
int opal_db_base_store_pointer(const opal_identifier_t *proc,
|
||||
opal_db_locality_t locality,
|
||||
opal_value_t *kv)
|
||||
{
|
||||
@ -96,7 +92,7 @@ int opal_db_base_store_pointer(opal_identifier_t proc,
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
int opal_db_base_fetch(opal_identifier_t proc,
|
||||
int opal_db_base_fetch(const opal_identifier_t *proc,
|
||||
const char *key, void **data,
|
||||
opal_data_type_t type)
|
||||
{
|
||||
@ -131,7 +127,7 @@ int opal_db_base_fetch(opal_identifier_t proc,
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
int opal_db_base_fetch_pointer(opal_identifier_t proc,
|
||||
int opal_db_base_fetch_pointer(const opal_identifier_t *proc,
|
||||
const char *key,
|
||||
void **data, opal_data_type_t type)
|
||||
{
|
||||
@ -166,7 +162,7 @@ int opal_db_base_fetch_pointer(opal_identifier_t proc,
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
int opal_db_base_fetch_multiple(opal_identifier_t proc,
|
||||
int opal_db_base_fetch_multiple(const opal_identifier_t *proc,
|
||||
const char *key,
|
||||
opal_list_t *kvs)
|
||||
{
|
||||
@ -201,7 +197,7 @@ int opal_db_base_fetch_multiple(opal_identifier_t proc,
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
int opal_db_base_remove_data(opal_identifier_t proc,
|
||||
int opal_db_base_remove_data(const opal_identifier_t *proc,
|
||||
const char *key)
|
||||
{
|
||||
bool did_op;
|
||||
|
@ -65,7 +65,7 @@ typedef void (*opal_db_base_module_finalize_fn_t)(void);
|
||||
* copied into the database and therefore does not need to be preserved by
|
||||
* the caller.
|
||||
*/
|
||||
typedef int (*opal_db_base_module_store_fn_t)(opal_identifier_t proc,
|
||||
typedef int (*opal_db_base_module_store_fn_t)(const opal_identifier_t *proc,
|
||||
opal_db_locality_t locality,
|
||||
const char *key, const void *data,
|
||||
opal_data_type_t type);
|
||||
@ -75,7 +75,7 @@ typedef int (*opal_db_base_module_store_fn_t)(opal_identifier_t proc,
|
||||
* This allows users to share data across the code base without consuming
|
||||
* additional memory, but while retaining local access
|
||||
*/
|
||||
typedef int (*opal_db_base_module_store_pointer_fn_t)(opal_identifier_t proc,
|
||||
typedef int (*opal_db_base_module_store_pointer_fn_t)(const opal_identifier_t *proc,
|
||||
opal_db_locality_t locality,
|
||||
opal_value_t *kv);
|
||||
|
||||
@ -86,7 +86,7 @@ typedef int (*opal_db_base_module_store_pointer_fn_t)(opal_identifier_t proc,
|
||||
* are supported here as well. Caller is responsible for releasing any returned
|
||||
* object.
|
||||
*/
|
||||
typedef int (*opal_db_base_module_fetch_fn_t)(opal_identifier_t proc,
|
||||
typedef int (*opal_db_base_module_fetch_fn_t)(const opal_identifier_t *proc,
|
||||
const char *key,
|
||||
void **data, opal_data_type_t type);
|
||||
|
||||
@ -98,7 +98,7 @@ typedef int (*opal_db_base_module_fetch_fn_t)(opal_identifier_t proc,
|
||||
* will directly alter information in the database! A local copy of the data should be made
|
||||
* wherever modification is possible.
|
||||
*/
|
||||
typedef int (*opal_db_base_module_fetch_pointer_fn_t)(opal_identifier_t proc,
|
||||
typedef int (*opal_db_base_module_fetch_pointer_fn_t)(const opal_identifier_t *proc,
|
||||
const char *key,
|
||||
void **data, opal_data_type_t type);
|
||||
/*
|
||||
@ -107,7 +107,7 @@ typedef int (*opal_db_base_module_fetch_pointer_fn_t)(opal_identifier_t proc,
|
||||
* Retrieve data for the given proc associated with the specified key. Wildcards
|
||||
* are supported here as well. Caller is responsible for releasing the objects on the list.
|
||||
*/
|
||||
typedef int (*opal_db_base_module_fetch_multiple_fn_t)(opal_identifier_t proc,
|
||||
typedef int (*opal_db_base_module_fetch_multiple_fn_t)(const opal_identifier_t *proc,
|
||||
const char *key,
|
||||
opal_list_t *kvs);
|
||||
|
||||
@ -121,7 +121,7 @@ typedef int (*opal_db_base_module_fetch_multiple_fn_t)(opal_identifier_t proc,
|
||||
* that ALL data in the database is to be purged. A WILDCARD vpid will delete all matching
|
||||
* keys from that jobid. Etc.
|
||||
*/
|
||||
typedef int (*opal_db_base_module_remove_fn_t)(opal_identifier_t proc, const char *key);
|
||||
typedef int (*opal_db_base_module_remove_fn_t)(const opal_identifier_t *proc, const char *key);
|
||||
|
||||
/*
|
||||
* Log data
|
||||
|
@ -32,22 +32,22 @@
|
||||
|
||||
static int init(void);
|
||||
static void finalize(void);
|
||||
static int store(opal_identifier_t proc,
|
||||
static int store(const opal_identifier_t *proc,
|
||||
opal_db_locality_t locality,
|
||||
const char *key, const void *object,
|
||||
opal_data_type_t type);
|
||||
static int store_pointer(opal_identifier_t proc,
|
||||
static int store_pointer(const opal_identifier_t *proc,
|
||||
opal_db_locality_t locality,
|
||||
opal_value_t *kv);
|
||||
static int fetch(opal_identifier_t proc,
|
||||
static int fetch(const opal_identifier_t *proc,
|
||||
const char *key, void **data, opal_data_type_t type);
|
||||
static int fetch_pointer(opal_identifier_t proc,
|
||||
static int fetch_pointer(const opal_identifier_t *proc,
|
||||
const char *key,
|
||||
void **data, opal_data_type_t type);
|
||||
static int fetch_multiple(opal_identifier_t proc,
|
||||
static int fetch_multiple(const opal_identifier_t *proc,
|
||||
const char *key,
|
||||
opal_list_t *kvs);
|
||||
static int remove_data(opal_identifier_t proc, const char *key);
|
||||
static int remove_data(const opal_identifier_t *proc, const char *key);
|
||||
|
||||
opal_db_base_module_t opal_db_hash_module = {
|
||||
init,
|
||||
@ -152,7 +152,7 @@ static proc_data_t* lookup_opal_proc(opal_hash_table_t *jtable, opal_identifier_
|
||||
return proc_data;
|
||||
}
|
||||
|
||||
static int store(const opal_identifier_t id,
|
||||
static int store(const opal_identifier_t *uid,
|
||||
opal_db_locality_t locality,
|
||||
const char *key, const void *data,
|
||||
opal_data_type_t type)
|
||||
@ -160,6 +160,10 @@ static int store(const opal_identifier_t id,
|
||||
proc_data_t *proc_data;
|
||||
opal_value_t *kv;
|
||||
opal_byte_object_t *boptr;
|
||||
opal_identifier_t id;
|
||||
|
||||
/* to protect alignment, copy the data across */
|
||||
memcpy(&id, uid, sizeof(opal_identifier_t));
|
||||
|
||||
/* we are at the bottom of the store priorities, so
|
||||
* if this fell to us, we store it
|
||||
@ -259,12 +263,16 @@ static int store(const opal_identifier_t id,
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
static int store_pointer(opal_identifier_t id,
|
||||
static int store_pointer(const opal_identifier_t *uid,
|
||||
opal_db_locality_t locality,
|
||||
opal_value_t *kv)
|
||||
{
|
||||
proc_data_t *proc_data;
|
||||
opal_value_t *k2;
|
||||
opal_identifier_t id;
|
||||
|
||||
/* to protect alignment, copy the data across */
|
||||
memcpy(&id, uid, sizeof(opal_identifier_t));
|
||||
|
||||
/* we are at the bottom of the store priorities, so
|
||||
* if this fell to us, we store it
|
||||
@ -298,12 +306,16 @@ static int store_pointer(opal_identifier_t id,
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
static int fetch(opal_identifier_t id,
|
||||
static int fetch(const opal_identifier_t *uid,
|
||||
const char *key, void **data, opal_data_type_t type)
|
||||
{
|
||||
proc_data_t *proc_data;
|
||||
opal_value_t *kv;
|
||||
opal_byte_object_t *boptr;
|
||||
opal_identifier_t id;
|
||||
|
||||
/* to protect alignment, copy the data across */
|
||||
memcpy(&id, uid, sizeof(opal_identifier_t));
|
||||
|
||||
OPAL_OUTPUT_VERBOSE((5, opal_db_base_framework.framework_output,
|
||||
"db:hash:fetch: searching for key %s[%s] on proc %" PRIu64 "",
|
||||
@ -387,12 +399,16 @@ static int fetch(opal_identifier_t id,
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
static int fetch_pointer(opal_identifier_t id,
|
||||
static int fetch_pointer(const opal_identifier_t *uid,
|
||||
const char *key,
|
||||
void **data, opal_data_type_t type)
|
||||
{
|
||||
proc_data_t *proc_data;
|
||||
opal_value_t *kv;
|
||||
opal_identifier_t id;
|
||||
|
||||
/* to protect alignment, copy the data across */
|
||||
memcpy(&id, uid, sizeof(opal_identifier_t));
|
||||
|
||||
OPAL_OUTPUT_VERBOSE((5, opal_db_base_framework.framework_output,
|
||||
"db:hash:fetch_pointer: searching for key %s on proc %" PRIu64 "",
|
||||
@ -461,7 +477,7 @@ static int fetch_pointer(opal_identifier_t id,
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
static int fetch_multiple(opal_identifier_t id,
|
||||
static int fetch_multiple(const opal_identifier_t *uid,
|
||||
const char *key,
|
||||
opal_list_t *kvs)
|
||||
{
|
||||
@ -470,6 +486,10 @@ static int fetch_multiple(opal_identifier_t id,
|
||||
int rc;
|
||||
char *srchkey, *ptr;
|
||||
size_t len = 0;
|
||||
opal_identifier_t id;
|
||||
|
||||
/* to protect alignment, copy the data across */
|
||||
memcpy(&id, uid, sizeof(opal_identifier_t));
|
||||
|
||||
OPAL_OUTPUT_VERBOSE((5, opal_db_base_framework.framework_output,
|
||||
"db:hash:fetch_multiple: searching for key %s on proc %" PRIu64 "",
|
||||
@ -519,10 +539,14 @@ static int fetch_multiple(opal_identifier_t id,
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
static int remove_data(opal_identifier_t id, const char *key)
|
||||
static int remove_data(const opal_identifier_t *uid, const char *key)
|
||||
{
|
||||
proc_data_t *proc_data;
|
||||
opal_value_t *kv;
|
||||
opal_identifier_t id;
|
||||
|
||||
/* to protect alignment, copy the data across */
|
||||
memcpy(&id, uid, sizeof(opal_identifier_t));
|
||||
|
||||
/* lookup the specified proc */
|
||||
if (NULL == (proc_data = lookup_opal_proc(&hash_data, id))) {
|
||||
|
@ -35,22 +35,22 @@
|
||||
|
||||
static int init(void);
|
||||
static void finalize(void);
|
||||
static int store(opal_identifier_t id,
|
||||
static int store(const opal_identifier_t *id,
|
||||
opal_db_locality_t locality,
|
||||
const char *key, const void *object,
|
||||
opal_data_type_t type);
|
||||
static int store_pointer(opal_identifier_t proc,
|
||||
static int store_pointer(const opal_identifier_t *proc,
|
||||
opal_db_locality_t locality,
|
||||
opal_value_t *kv);
|
||||
static int fetch(opal_identifier_t proc,
|
||||
static int fetch(const opal_identifier_t *proc,
|
||||
const char *key, void **data, opal_data_type_t type);
|
||||
static int fetch_pointer(opal_identifier_t proc,
|
||||
static int fetch_pointer(const opal_identifier_t *proc,
|
||||
const char *key,
|
||||
void **data, opal_data_type_t type);
|
||||
static int fetch_multiple(opal_identifier_t proc,
|
||||
static int fetch_multiple(const opal_identifier_t *proc,
|
||||
const char *key,
|
||||
opal_list_t *kvs);
|
||||
static int remove_data(opal_identifier_t proc, const char *key);
|
||||
static int remove_data(const opal_identifier_t *proc, const char *key);
|
||||
|
||||
opal_db_base_module_t opal_db_pmi_module = {
|
||||
init,
|
||||
@ -124,7 +124,7 @@ static void finalize(void)
|
||||
|
||||
}
|
||||
|
||||
static int store(opal_identifier_t proc,
|
||||
static int store(const opal_identifier_t *uid,
|
||||
opal_db_locality_t locality,
|
||||
const char *key, const void *data, opal_data_type_t type)
|
||||
{
|
||||
@ -135,6 +135,10 @@ static int store(opal_identifier_t proc,
|
||||
opal_byte_object_t *bo;
|
||||
char *pmikey, *tmpkey, *tmp, sav;
|
||||
char **strdata=NULL;
|
||||
opal_identifier_t proc;
|
||||
|
||||
/* to protect alignment, copy the data across */
|
||||
memcpy(&proc, uid, sizeof(opal_identifier_t));
|
||||
|
||||
/* pass internal stores down to someone else */
|
||||
if (OPAL_DB_INTERNAL == locality) {
|
||||
@ -312,7 +316,7 @@ static int store(opal_identifier_t proc,
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
static int store_pointer(opal_identifier_t proc,
|
||||
static int store_pointer(const opal_identifier_t *proc,
|
||||
opal_db_locality_t locality,
|
||||
opal_value_t *kv)
|
||||
{
|
||||
@ -323,10 +327,6 @@ static int store_pointer(opal_identifier_t proc,
|
||||
return OPAL_ERR_TAKE_NEXT_OPTION;
|
||||
}
|
||||
|
||||
OPAL_OUTPUT_VERBOSE((5, opal_db_base_framework.framework_output,
|
||||
"db:pmi:store: storing pointer of key %s for proc %" PRIu64 "",
|
||||
kv->key, proc));
|
||||
|
||||
/* just push this to PMI */
|
||||
if (OPAL_SUCCESS != (rc = store(proc, locality, kv->key, (void*)&kv->data, kv->type))) {
|
||||
OPAL_ERROR_LOG(rc);
|
||||
@ -439,7 +439,7 @@ static char* fetch_string(const char *key)
|
||||
return data;
|
||||
}
|
||||
|
||||
static int fetch(const opal_identifier_t proc,
|
||||
static int fetch(const opal_identifier_t *uid,
|
||||
const char *key, void **data, opal_data_type_t type)
|
||||
{
|
||||
opal_byte_object_t *boptr;
|
||||
@ -450,6 +450,10 @@ static int fetch(const opal_identifier_t proc,
|
||||
char *pmikey;
|
||||
char tmp_val[1024];
|
||||
size_t sval;
|
||||
opal_identifier_t proc;
|
||||
|
||||
/* to protect alignment, copy the data across */
|
||||
memcpy(&proc, uid, sizeof(opal_identifier_t));
|
||||
|
||||
OPAL_OUTPUT_VERBOSE((5, opal_db_base_framework.framework_output,
|
||||
"db:pmi:fetch: searching for key %s[%s] on proc %" PRIu64 "",
|
||||
@ -525,7 +529,7 @@ static int fetch(const opal_identifier_t proc,
|
||||
* hostname for the process - so don't worry about other uses
|
||||
* here just yet
|
||||
*/
|
||||
static int fetch_pointer(opal_identifier_t proc,
|
||||
static int fetch_pointer(const opal_identifier_t *proc,
|
||||
const char *key,
|
||||
void **data, opal_data_type_t type)
|
||||
{
|
||||
@ -533,19 +537,15 @@ static int fetch_pointer(opal_identifier_t proc,
|
||||
return OPAL_ERR_TAKE_NEXT_OPTION;
|
||||
}
|
||||
|
||||
static int fetch_multiple(opal_identifier_t proc,
|
||||
static int fetch_multiple(const opal_identifier_t *proc,
|
||||
const char *key,
|
||||
opal_list_t *kvs)
|
||||
{
|
||||
|
||||
OPAL_OUTPUT_VERBOSE((5, opal_db_base_framework.framework_output,
|
||||
"db:pmi:fetch_multiple: searching for key %s on proc %" PRIu64 "",
|
||||
(NULL == key) ? "NULL" : key, proc));
|
||||
|
||||
return OPAL_ERR_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
static int remove_data(opal_identifier_t proc, const char *key)
|
||||
static int remove_data(const opal_identifier_t *proc, const char *key)
|
||||
{
|
||||
/* nothing to do here */
|
||||
return OPAL_SUCCESS;
|
||||
|
@ -507,7 +507,6 @@ static void process_opens(int fd, short args, void *cbdata)
|
||||
char *scheme, *host, *filename;
|
||||
orte_process_name_t daemon;
|
||||
orte_vpid_t *v;
|
||||
opal_identifier_t *id;
|
||||
|
||||
/* get the scheme to determine if we can process locally or not */
|
||||
if (NULL == (scheme = opal_uri_get_scheme(dfs->uri))) {
|
||||
@ -558,8 +557,7 @@ static void process_opens(int fd, short args, void *cbdata)
|
||||
"%s looking for daemon on host %s",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), host);
|
||||
v = &daemon.vpid;
|
||||
id = (opal_identifier_t*)ORTE_NAME_WILDCARD;
|
||||
if (ORTE_SUCCESS != (rc = opal_db.fetch((*id), host, (void**)&v, ORTE_VPID))) {
|
||||
if (ORTE_SUCCESS != (rc = opal_db.fetch((opal_identifier_t*)ORTE_NAME_WILDCARD, host, (void**)&v, ORTE_VPID))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
goto complete;
|
||||
}
|
||||
|
@ -451,7 +451,6 @@ static void process_opens(int fd, short args, void *cbdata)
|
||||
orte_process_name_t daemon;
|
||||
bool found;
|
||||
orte_vpid_t v;
|
||||
opal_identifier_t *id;
|
||||
|
||||
opal_output(0, "%s PROCESSING OPEN", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME));
|
||||
/* get the scheme to determine if we can process locally or not */
|
||||
@ -480,11 +479,10 @@ static void process_opens(int fd, short args, void *cbdata)
|
||||
/* ident the daemon on that host */
|
||||
daemon.jobid = ORTE_PROC_MY_DAEMON->jobid;
|
||||
found = false;
|
||||
id = (opal_identifier_t*)&daemon;
|
||||
for (v=0; v < orte_process_info.num_daemons; v++) {
|
||||
daemon.vpid = v;
|
||||
/* fetch the hostname where this daemon is located */
|
||||
if (ORTE_SUCCESS != (rc = opal_db.fetch_pointer((*id), ORTE_DB_HOSTNAME, (void**)&hostname, OPAL_STRING))) {
|
||||
if (ORTE_SUCCESS != (rc = opal_db.fetch_pointer((opal_identifier_t*)&daemon, ORTE_DB_HOSTNAME, (void**)&hostname, OPAL_STRING))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
goto complete;
|
||||
}
|
||||
|
@ -94,7 +94,6 @@ static int rte_init(void)
|
||||
orte_local_rank_t local_rank;
|
||||
orte_node_rank_t node_rank;
|
||||
char *rmluri;
|
||||
opal_identifier_t *id;
|
||||
opal_hwloc_locality_t locality;
|
||||
|
||||
/* run the prolog */
|
||||
@ -303,36 +302,35 @@ static int rte_init(void)
|
||||
orte_process_info.cpuset);
|
||||
}
|
||||
/* push our info into the cloud */
|
||||
id = (opal_identifier_t*)ORTE_PROC_MY_NAME;
|
||||
if (ORTE_SUCCESS != (ret = opal_db.store((*id), OPAL_DB_GLOBAL, "RTE", pmirte, OPAL_STRING))) {
|
||||
if (ORTE_SUCCESS != (ret = opal_db.store((opal_identifier_t*)ORTE_PROC_MY_NAME, OPAL_DB_GLOBAL, "RTE", pmirte, OPAL_STRING))) {
|
||||
error = "db store RTE info";
|
||||
goto error;
|
||||
}
|
||||
free(pmirte);
|
||||
/* store our info in the internal database */
|
||||
if (ORTE_SUCCESS != (ret = opal_db.store((*id), OPAL_DB_INTERNAL, ORTE_DB_RMLURI, rmluri, OPAL_STRING))) {
|
||||
if (ORTE_SUCCESS != (ret = opal_db.store((opal_identifier_t*)ORTE_PROC_MY_NAME, OPAL_DB_INTERNAL, ORTE_DB_RMLURI, rmluri, OPAL_STRING))) {
|
||||
error = "db store uri";
|
||||
goto error;
|
||||
}
|
||||
free(rmluri);
|
||||
if (ORTE_SUCCESS != (ret = opal_db.store((*id), OPAL_DB_INTERNAL, ORTE_DB_HOSTNAME, orte_process_info.nodename, OPAL_STRING))) {
|
||||
if (ORTE_SUCCESS != (ret = opal_db.store((opal_identifier_t*)ORTE_PROC_MY_NAME, OPAL_DB_INTERNAL, ORTE_DB_HOSTNAME, orte_process_info.nodename, OPAL_STRING))) {
|
||||
error = "db store hostname";
|
||||
goto error;
|
||||
}
|
||||
if (ORTE_SUCCESS != (ret = opal_db.store((*id), OPAL_DB_INTERNAL, ORTE_DB_CPUSET, orte_process_info.cpuset, OPAL_STRING))) {
|
||||
if (ORTE_SUCCESS != (ret = opal_db.store((opal_identifier_t*)ORTE_PROC_MY_NAME, OPAL_DB_INTERNAL, ORTE_DB_CPUSET, orte_process_info.cpuset, OPAL_STRING))) {
|
||||
error = "db store cpuset";
|
||||
goto error;
|
||||
}
|
||||
if (ORTE_SUCCESS != (ret = opal_db.store((*id), OPAL_DB_INTERNAL, ORTE_DB_LOCALRANK, &orte_process_info.my_local_rank, ORTE_LOCAL_RANK))) {
|
||||
if (ORTE_SUCCESS != (ret = opal_db.store((opal_identifier_t*)ORTE_PROC_MY_NAME, OPAL_DB_INTERNAL, ORTE_DB_LOCALRANK, &orte_process_info.my_local_rank, ORTE_LOCAL_RANK))) {
|
||||
error = "db store local rank";
|
||||
goto error;
|
||||
}
|
||||
if (ORTE_SUCCESS != (ret = opal_db.store((*id), OPAL_DB_INTERNAL, ORTE_DB_NODERANK, &orte_process_info.my_node_rank, ORTE_NODE_RANK))) {
|
||||
if (ORTE_SUCCESS != (ret = opal_db.store((opal_identifier_t*)ORTE_PROC_MY_NAME, OPAL_DB_INTERNAL, ORTE_DB_NODERANK, &orte_process_info.my_node_rank, ORTE_NODE_RANK))) {
|
||||
error = "db store node rank";
|
||||
goto error;
|
||||
}
|
||||
locality = OPAL_PROC_ALL_LOCAL;
|
||||
if (ORTE_SUCCESS != (ret = opal_db.store((*id), OPAL_DB_INTERNAL, ORTE_DB_LOCALITY, &locality, OPAL_HWLOC_LOCALITY_T))) {
|
||||
if (ORTE_SUCCESS != (ret = opal_db.store((opal_identifier_t*)ORTE_PROC_MY_NAME, OPAL_DB_INTERNAL, ORTE_DB_LOCALITY, &locality, OPAL_HWLOC_LOCALITY_T))) {
|
||||
error = "db store locality";
|
||||
goto error;
|
||||
}
|
||||
|
@ -221,7 +221,6 @@ void orte_grpcomm_base_store_peer_modex(opal_buffer_t *rbuf, void *cbdata)
|
||||
{
|
||||
int rc, cnt;
|
||||
orte_process_name_t pname;
|
||||
opal_identifier_t *id;
|
||||
char *hostname;
|
||||
orte_vpid_t daemon;
|
||||
orte_node_rank_t node_rank;
|
||||
@ -236,14 +235,13 @@ void orte_grpcomm_base_store_peer_modex(opal_buffer_t *rbuf, void *cbdata)
|
||||
/* unpack the process name */
|
||||
cnt=1;
|
||||
while (ORTE_SUCCESS == (rc = opal_dss.unpack(rbuf, &pname, &cnt, ORTE_NAME))) {
|
||||
id = (opal_identifier_t*)&pname;
|
||||
/* unpack and store the hostname */
|
||||
cnt = 1;
|
||||
if (ORTE_SUCCESS != (rc = opal_dss.unpack(rbuf, &hostname, &cnt, OPAL_STRING))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
goto cleanup;
|
||||
}
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((*id), OPAL_DB_INTERNAL, ORTE_DB_HOSTNAME, hostname, OPAL_STRING))) {
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((opal_identifier_t*)&pname, OPAL_DB_INTERNAL, ORTE_DB_HOSTNAME, hostname, OPAL_STRING))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
goto cleanup;
|
||||
}
|
||||
@ -254,7 +252,7 @@ void orte_grpcomm_base_store_peer_modex(opal_buffer_t *rbuf, void *cbdata)
|
||||
ORTE_ERROR_LOG(rc);
|
||||
goto cleanup;
|
||||
}
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((*id), OPAL_DB_INTERNAL, ORTE_DB_DAEMON_VPID, &daemon, OPAL_UINT32))) {
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((opal_identifier_t*)&pname, OPAL_DB_INTERNAL, ORTE_DB_DAEMON_VPID, &daemon, OPAL_UINT32))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
goto cleanup;
|
||||
}
|
||||
@ -265,7 +263,7 @@ void orte_grpcomm_base_store_peer_modex(opal_buffer_t *rbuf, void *cbdata)
|
||||
ORTE_ERROR_LOG(rc);
|
||||
goto cleanup;
|
||||
}
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((*id), OPAL_DB_INTERNAL, ORTE_DB_NODERANK, &node_rank, ORTE_NODE_RANK))) {
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((opal_identifier_t*)&pname, OPAL_DB_INTERNAL, ORTE_DB_NODERANK, &node_rank, ORTE_NODE_RANK))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
goto cleanup;
|
||||
}
|
||||
@ -276,7 +274,7 @@ void orte_grpcomm_base_store_peer_modex(opal_buffer_t *rbuf, void *cbdata)
|
||||
ORTE_ERROR_LOG(rc);
|
||||
goto cleanup;
|
||||
}
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((*id), OPAL_DB_INTERNAL, ORTE_DB_LOCALRANK, &local_rank, ORTE_LOCAL_RANK))) {
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((opal_identifier_t*)&pname, OPAL_DB_INTERNAL, ORTE_DB_LOCALRANK, &local_rank, ORTE_LOCAL_RANK))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
goto cleanup;
|
||||
}
|
||||
@ -292,7 +290,7 @@ void orte_grpcomm_base_store_peer_modex(opal_buffer_t *rbuf, void *cbdata)
|
||||
ORTE_ERROR_LOG(rc);
|
||||
goto cleanup;
|
||||
}
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((*id), OPAL_DB_INTERNAL, ORTE_DB_CPUSET, cpuset, OPAL_STRING))) {
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((opal_identifier_t*)&pname, OPAL_DB_INTERNAL, ORTE_DB_CPUSET, cpuset, OPAL_STRING))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
goto cleanup;
|
||||
}
|
||||
@ -352,7 +350,7 @@ void orte_grpcomm_base_store_peer_modex(opal_buffer_t *rbuf, void *cbdata)
|
||||
locality = OPAL_PROC_ON_NODE;
|
||||
}
|
||||
#endif
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((*id), OPAL_DB_INTERNAL, ORTE_DB_LOCALITY, &locality, OPAL_HWLOC_LOCALITY_T))) {
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((opal_identifier_t*)&pname, OPAL_DB_INTERNAL, ORTE_DB_LOCALITY, &locality, OPAL_HWLOC_LOCALITY_T))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
goto cleanup;
|
||||
}
|
||||
@ -446,7 +444,6 @@ int orte_grpcomm_base_update_modex_entries(orte_process_name_t *proc_name,
|
||||
int32_t num_recvd_entries;
|
||||
orte_std_cntr_t cnt;
|
||||
orte_std_cntr_t j;
|
||||
opal_identifier_t *id;
|
||||
|
||||
/* unpack the number of entries for this proc */
|
||||
cnt=1;
|
||||
@ -460,8 +457,6 @@ int orte_grpcomm_base_update_modex_entries(orte_process_name_t *proc_name,
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), num_recvd_entries,
|
||||
ORTE_NAME_PRINT(proc_name)));
|
||||
|
||||
id = (opal_identifier_t*)proc_name;
|
||||
|
||||
/*
|
||||
* Extract the attribute names and values
|
||||
*/
|
||||
@ -478,7 +473,7 @@ int orte_grpcomm_base_update_modex_entries(orte_process_name_t *proc_name,
|
||||
OBJ_RELEASE(kv);
|
||||
} else {
|
||||
/* store it in the database */
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store_pointer((*id), OPAL_DB_INTERNAL, kv))) {
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store_pointer((opal_identifier_t*)proc_name, OPAL_DB_INTERNAL, kv))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
goto cleanup;
|
||||
}
|
||||
@ -497,12 +492,10 @@ int orte_grpcomm_base_pack_modex_entries(opal_buffer_t *buf)
|
||||
opal_value_t *kv;
|
||||
opal_list_t data;
|
||||
opal_list_item_t *item, *next;
|
||||
opal_identifier_t *id;
|
||||
|
||||
/* fetch our data */
|
||||
OBJ_CONSTRUCT(&data, opal_list_t);
|
||||
id = (opal_identifier_t*)ORTE_PROC_MY_NAME;
|
||||
if (ORTE_SUCCESS != (rc = opal_db.fetch_multiple((*id), NULL, &data))) {
|
||||
if (ORTE_SUCCESS != (rc = opal_db.fetch_multiple((opal_identifier_t*)ORTE_PROC_MY_NAME, NULL, &data))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -175,7 +175,6 @@ static int modex(orte_grpcomm_collective_t *coll)
|
||||
orte_vpid_t v;
|
||||
orte_process_name_t name;
|
||||
int rc;
|
||||
opal_identifier_t *id;
|
||||
opal_hwloc_locality_t locality;
|
||||
orte_local_rank_t local_rank;
|
||||
orte_node_rank_t node_rank;
|
||||
@ -205,7 +204,6 @@ static int modex(orte_grpcomm_collective_t *coll)
|
||||
|
||||
/* cycle thru all my peers and collect their RTE info */
|
||||
name.jobid = ORTE_PROC_MY_NAME->jobid;
|
||||
id = (opal_identifier_t*)&name;
|
||||
fields = NULL;
|
||||
for (v=0; v < orte_process_info.num_procs; v++) {
|
||||
if (v == ORTE_PROC_MY_NAME->vpid) {
|
||||
@ -213,7 +211,7 @@ static int modex(orte_grpcomm_collective_t *coll)
|
||||
}
|
||||
name.vpid = v;
|
||||
/* fetch the RTE data for this proc */
|
||||
if (ORTE_SUCCESS != (rc = opal_db.fetch((*id), "RTE", (void **)&cptr, OPAL_STRING))) {
|
||||
if (ORTE_SUCCESS != (rc = opal_db.fetch((opal_identifier_t*)&name, "RTE", (void **)&cptr, OPAL_STRING))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
return rc;
|
||||
}
|
||||
@ -229,7 +227,7 @@ static int modex(orte_grpcomm_collective_t *coll)
|
||||
|
||||
/* store the composite parts */
|
||||
/* first field is the URI */
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((*id), OPAL_DB_INTERNAL, ORTE_DB_RMLURI, fields[0], OPAL_STRING))) {
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((opal_identifier_t*)&name, OPAL_DB_INTERNAL, ORTE_DB_RMLURI, fields[0], OPAL_STRING))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
opal_argv_free(fields);
|
||||
return rc;
|
||||
@ -244,21 +242,21 @@ static int modex(orte_grpcomm_collective_t *coll)
|
||||
return rc;
|
||||
}
|
||||
/* next is the hostname */
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((*id), OPAL_DB_INTERNAL, ORTE_DB_HOSTNAME, fields[1], OPAL_STRING))) {
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((opal_identifier_t*)&name, OPAL_DB_INTERNAL, ORTE_DB_HOSTNAME, fields[1], OPAL_STRING))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
opal_argv_free(fields);
|
||||
return rc;
|
||||
}
|
||||
/* local rank */
|
||||
local_rank = strtoul(fields[2], NULL, 10);
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((*id), OPAL_DB_INTERNAL, ORTE_DB_LOCALRANK, &local_rank, ORTE_LOCAL_RANK))) {
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((opal_identifier_t*)&name, OPAL_DB_INTERNAL, ORTE_DB_LOCALRANK, &local_rank, ORTE_LOCAL_RANK))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
opal_argv_free(fields);
|
||||
return rc;
|
||||
}
|
||||
/* node rank */
|
||||
node_rank = strtoul(fields[3], NULL, 10);
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((*id), OPAL_DB_INTERNAL, ORTE_DB_NODERANK, &node_rank, ORTE_NODE_RANK))) {
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((opal_identifier_t*)&name, OPAL_DB_INTERNAL, ORTE_DB_NODERANK, &node_rank, ORTE_NODE_RANK))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
opal_argv_free(fields);
|
||||
return rc;
|
||||
@ -267,7 +265,7 @@ static int modex(orte_grpcomm_collective_t *coll)
|
||||
* that contains its cpuset
|
||||
*/
|
||||
if (5 == opal_argv_count(fields)) {
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((*id), OPAL_DB_INTERNAL, ORTE_DB_CPUSET, fields[4], OPAL_STRING))) {
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((opal_identifier_t*)&name, OPAL_DB_INTERNAL, ORTE_DB_CPUSET, fields[4], OPAL_STRING))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
opal_argv_free(fields);
|
||||
return rc;
|
||||
@ -277,7 +275,7 @@ static int modex(orte_grpcomm_collective_t *coll)
|
||||
/* store a placeholder so we know that this value was retrieved,
|
||||
* but the proc wasn't bound
|
||||
*/
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((*id), OPAL_DB_INTERNAL, ORTE_DB_CPUSET, NULL, OPAL_STRING))) {
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((opal_identifier_t*)&name, OPAL_DB_INTERNAL, ORTE_DB_CPUSET, NULL, OPAL_STRING))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
opal_argv_free(fields);
|
||||
return rc;
|
||||
@ -300,7 +298,7 @@ static int modex(orte_grpcomm_collective_t *coll)
|
||||
orte_process_info.cpuset,
|
||||
fields[4]);
|
||||
}
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((*id), OPAL_DB_INTERNAL, ORTE_DB_LOCALITY, &locality, OPAL_HWLOC_LOCALITY_T))) {
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((opal_identifier_t*)&name, OPAL_DB_INTERNAL, ORTE_DB_LOCALITY, &locality, OPAL_HWLOC_LOCALITY_T))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
opal_argv_free(fields);
|
||||
return rc;
|
||||
|
@ -481,7 +481,6 @@ char* orte_get_proc_hostname(orte_process_name_t *proc)
|
||||
orte_proc_t *proct;
|
||||
char *hostname;
|
||||
int rc;
|
||||
opal_identifier_t *id;
|
||||
|
||||
if (ORTE_PROC_IS_DAEMON || ORTE_PROC_IS_HNP) {
|
||||
/* look it up on our arrays */
|
||||
@ -497,8 +496,7 @@ char* orte_get_proc_hostname(orte_process_name_t *proc)
|
||||
}
|
||||
|
||||
/* if we are an app, get the pointer from the modex db */
|
||||
id = (opal_identifier_t*)proc;
|
||||
if (ORTE_SUCCESS != (rc = opal_db.fetch_pointer((*id), ORTE_DB_HOSTNAME,
|
||||
if (ORTE_SUCCESS != (rc = opal_db.fetch_pointer((opal_identifier_t*)proc, ORTE_DB_HOSTNAME,
|
||||
(void**)&hostname, OPAL_STRING))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
return NULL;
|
||||
@ -511,7 +509,6 @@ orte_node_rank_t orte_get_proc_node_rank(orte_process_name_t *proc)
|
||||
orte_proc_t *proct;
|
||||
orte_node_rank_t noderank, *nr;
|
||||
int rc;
|
||||
opal_identifier_t *id;
|
||||
|
||||
if (ORTE_PROC_IS_DAEMON || ORTE_PROC_IS_HNP) {
|
||||
/* look it up on our arrays */
|
||||
@ -524,8 +521,7 @@ orte_node_rank_t orte_get_proc_node_rank(orte_process_name_t *proc)
|
||||
|
||||
/* if we are an app, get the value from the modex db */
|
||||
nr = &noderank;
|
||||
id = (opal_identifier_t*)proc;
|
||||
if (ORTE_SUCCESS != (rc = opal_db.fetch_pointer((*id), ORTE_DB_NODERANK,
|
||||
if (ORTE_SUCCESS != (rc = opal_db.fetch_pointer((opal_identifier_t*)proc, ORTE_DB_NODERANK,
|
||||
(void**)&nr, ORTE_NODE_RANK))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
return ORTE_NODE_RANK_INVALID;
|
||||
|
@ -163,7 +163,6 @@ int orte_util_build_daemon_nidmap(char **nodes)
|
||||
orte_process_name_t proc;
|
||||
char *uri, *addr;
|
||||
char *proc_name;
|
||||
opal_identifier_t *id;
|
||||
|
||||
num_nodes = opal_argv_count(nodes);
|
||||
|
||||
@ -179,13 +178,12 @@ int orte_util_build_daemon_nidmap(char **nodes)
|
||||
/* install the entry for the HNP */
|
||||
proc.jobid = ORTE_PROC_MY_NAME->jobid;
|
||||
proc.vpid = 0;
|
||||
id = (opal_identifier_t*)&proc;
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((*id), OPAL_DB_INTERNAL, ORTE_DB_DAEMON_VPID, &proc.vpid, OPAL_UINT32))) {
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((opal_identifier_t*)&proc, OPAL_DB_INTERNAL, ORTE_DB_DAEMON_VPID, &proc.vpid, OPAL_UINT32))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
return rc;
|
||||
}
|
||||
addr = "HNP";
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((*id), OPAL_DB_INTERNAL, ORTE_DB_HOSTNAME, addr, OPAL_STRING))) {
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((opal_identifier_t*)&proc, OPAL_DB_INTERNAL, ORTE_DB_HOSTNAME, addr, OPAL_STRING))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
return rc;
|
||||
}
|
||||
@ -199,14 +197,14 @@ int orte_util_build_daemon_nidmap(char **nodes)
|
||||
/* define the vpid for this daemon */
|
||||
proc.vpid = i+1;
|
||||
/* store the hostname for the proc */
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((*id), OPAL_DB_INTERNAL, ORTE_DB_HOSTNAME, nodes[i], OPAL_STRING))) {
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((opal_identifier_t*)&proc, OPAL_DB_INTERNAL, ORTE_DB_HOSTNAME, nodes[i], OPAL_STRING))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
return rc;
|
||||
}
|
||||
/* the arch defaults to our arch so that non-hetero
|
||||
* case will yield correct behavior
|
||||
*/
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((*id), OPAL_DB_INTERNAL, ORTE_DB_ARCH, &opal_local_arch, OPAL_UINT32))) {
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((opal_identifier_t*)&proc, OPAL_DB_INTERNAL, ORTE_DB_ARCH, &opal_local_arch, OPAL_UINT32))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
return rc;
|
||||
}
|
||||
@ -358,7 +356,6 @@ int orte_util_decode_nodemap(opal_byte_object_t *bo)
|
||||
int rc=ORTE_SUCCESS;
|
||||
uint8_t oversub;
|
||||
char *nodename;
|
||||
opal_identifier_t *id;
|
||||
|
||||
OPAL_OUTPUT_VERBOSE((1, orte_nidmap_output,
|
||||
"%s decode:nidmap decoding nodemap",
|
||||
@ -386,8 +383,7 @@ int orte_util_decode_nodemap(opal_byte_object_t *bo)
|
||||
ORTE_ERROR_LOG(rc);
|
||||
return rc;
|
||||
}
|
||||
id = (opal_identifier_t*)&daemon;
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((*id), OPAL_DB_INTERNAL, ORTE_DB_HOSTNAME, nodename, OPAL_STRING))) {
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((opal_identifier_t*)&daemon, OPAL_DB_INTERNAL, ORTE_DB_HOSTNAME, nodename, OPAL_STRING))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
return rc;
|
||||
}
|
||||
@ -396,8 +392,7 @@ int orte_util_decode_nodemap(opal_byte_object_t *bo)
|
||||
"%s storing nodename %s for daemon %s",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
||||
nodename, ORTE_VPID_PRINT(daemon.vpid));
|
||||
id = (opal_identifier_t*)ORTE_NAME_WILDCARD;
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((*id), OPAL_DB_INTERNAL, nodename, &daemon.vpid, OPAL_UINT32))) {
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((opal_identifier_t*)ORTE_NAME_WILDCARD, OPAL_DB_INTERNAL, nodename, &daemon.vpid, OPAL_UINT32))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
return rc;
|
||||
}
|
||||
@ -409,12 +404,11 @@ int orte_util_decode_nodemap(opal_byte_object_t *bo)
|
||||
|
||||
/* if this is my daemon, then store the data for me too */
|
||||
if (daemon.vpid == ORTE_PROC_MY_DAEMON->vpid) {
|
||||
id = (opal_identifier_t*)ORTE_PROC_MY_NAME;
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((*id), OPAL_DB_INTERNAL, ORTE_DB_HOSTNAME, nodename, OPAL_STRING))) {
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((opal_identifier_t*)ORTE_PROC_MY_NAME, OPAL_DB_INTERNAL, ORTE_DB_HOSTNAME, nodename, OPAL_STRING))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
return rc;
|
||||
}
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((*id), OPAL_DB_INTERNAL, ORTE_DB_DAEMON_VPID, &daemon.vpid, OPAL_UINT32))) {
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((opal_identifier_t*)ORTE_PROC_MY_NAME, OPAL_DB_INTERNAL, ORTE_DB_DAEMON_VPID, &daemon.vpid, OPAL_UINT32))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
return rc;
|
||||
}
|
||||
@ -440,8 +434,7 @@ int orte_util_decode_nodemap(opal_byte_object_t *bo)
|
||||
"%s storing alias %s for daemon %s",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
||||
alias, ORTE_VPID_PRINT(daemon.vpid));
|
||||
id = (opal_identifier_t*)ORTE_NAME_WILDCARD;
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((*id), OPAL_DB_INTERNAL, alias, &daemon.vpid, OPAL_UINT32))) {
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((opal_identifier_t*)ORTE_NAME_WILDCARD, OPAL_DB_INTERNAL, alias, &daemon.vpid, OPAL_UINT32))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
return rc;
|
||||
}
|
||||
@ -774,7 +767,6 @@ int orte_util_decode_pidmap(opal_byte_object_t *bo)
|
||||
uint8_t flag;
|
||||
opal_buffer_t *bptr;
|
||||
bool barrier;
|
||||
opal_identifier_t *id;
|
||||
|
||||
/* xfer the byte object to a buffer for unpacking */
|
||||
OBJ_CONSTRUCT(&buf, opal_buffer_t);
|
||||
@ -806,8 +798,7 @@ int orte_util_decode_pidmap(opal_byte_object_t *bo)
|
||||
goto cleanup;
|
||||
}
|
||||
proc.vpid = ORTE_VPID_INVALID;
|
||||
id = (opal_identifier_t*)&proc;
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((*id), OPAL_DB_INTERNAL, ORTE_DB_NPROCS, &num_procs, OPAL_UINT32))) {
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((opal_identifier_t*)&proc, OPAL_DB_INTERNAL, ORTE_DB_NPROCS, &num_procs, OPAL_UINT32))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
goto cleanup;
|
||||
}
|
||||
@ -877,16 +868,16 @@ int orte_util_decode_pidmap(opal_byte_object_t *bo)
|
||||
goto cleanup;
|
||||
}
|
||||
/* store the values in the database */
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((*id), OPAL_DB_INTERNAL, ORTE_DB_LOCALRANK, &local_rank, ORTE_LOCAL_RANK))) {
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((opal_identifier_t*)&proc, OPAL_DB_INTERNAL, ORTE_DB_LOCALRANK, &local_rank, ORTE_LOCAL_RANK))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
goto cleanup;
|
||||
}
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((*id), OPAL_DB_INTERNAL, ORTE_DB_NODERANK, &node_rank, ORTE_NODE_RANK))) {
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((opal_identifier_t*)&proc, OPAL_DB_INTERNAL, ORTE_DB_NODERANK, &node_rank, ORTE_NODE_RANK))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
goto cleanup;
|
||||
}
|
||||
#if OPAL_HAVE_HWLOC
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((*id), OPAL_DB_INTERNAL, ORTE_DB_CPUSET, cpu_bitmap, OPAL_STRING))) {
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((opal_identifier_t*)&proc, OPAL_DB_INTERNAL, ORTE_DB_CPUSET, cpu_bitmap, OPAL_STRING))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
goto cleanup;
|
||||
}
|
||||
@ -901,18 +892,16 @@ int orte_util_decode_pidmap(opal_byte_object_t *bo)
|
||||
if (proc.jobid != ORTE_PROC_MY_NAME->jobid ||
|
||||
proc.vpid != ORTE_PROC_MY_NAME->vpid) {
|
||||
/* store the data for this proc */
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((*id), OPAL_DB_INTERNAL, ORTE_DB_DAEMON_VPID, &dmn.vpid, OPAL_UINT32))) {
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((opal_identifier_t*)&proc, OPAL_DB_INTERNAL, ORTE_DB_DAEMON_VPID, &dmn.vpid, OPAL_UINT32))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
goto cleanup;
|
||||
}
|
||||
/* lookup and store the hostname for this proc */
|
||||
id = (opal_identifier_t*)&dmn;
|
||||
if (ORTE_SUCCESS != (rc = opal_db.fetch_pointer((*id), ORTE_DB_HOSTNAME, (void**)&hostname, OPAL_STRING))) {
|
||||
if (ORTE_SUCCESS != (rc = opal_db.fetch_pointer((opal_identifier_t*)&dmn, ORTE_DB_HOSTNAME, (void**)&hostname, OPAL_STRING))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
goto cleanup;
|
||||
}
|
||||
id = (opal_identifier_t*)&proc;
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((*id), OPAL_DB_INTERNAL, ORTE_DB_HOSTNAME, hostname, OPAL_STRING))) {
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((opal_identifier_t*)&proc, OPAL_DB_INTERNAL, ORTE_DB_HOSTNAME, hostname, OPAL_STRING))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
goto cleanup;
|
||||
}
|
||||
@ -951,8 +940,7 @@ int orte_util_decode_pidmap(opal_byte_object_t *bo)
|
||||
/* recover the number of procs in this job */
|
||||
vptr = &num_procs;
|
||||
proc.vpid = ORTE_VPID_INVALID;
|
||||
id = (opal_identifier_t*)&proc;
|
||||
if (ORTE_SUCCESS != (rc = opal_db.fetch((*id), ORTE_DB_NPROCS, (void**)&vptr, OPAL_UINT32))) {
|
||||
if (ORTE_SUCCESS != (rc = opal_db.fetch((opal_identifier_t*)&proc, ORTE_DB_NPROCS, (void**)&vptr, OPAL_UINT32))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
goto cleanup;
|
||||
}
|
||||
@ -966,7 +954,7 @@ int orte_util_decode_pidmap(opal_byte_object_t *bo)
|
||||
proc.vpid = i;
|
||||
/* recover the daemon for this proc */
|
||||
vptr = &daemon;
|
||||
if (ORTE_SUCCESS != (rc = opal_db.fetch((*id), ORTE_DB_DAEMON_VPID, (void**)&vptr, OPAL_UINT32))) {
|
||||
if (ORTE_SUCCESS != (rc = opal_db.fetch((opal_identifier_t*)&proc, ORTE_DB_DAEMON_VPID, (void**)&vptr, OPAL_UINT32))) {
|
||||
if (orte_staged_execution) {
|
||||
/* when using staged execution, we will see processes that have not
|
||||
* yet been launched and thus do not have a daemon assigned to them.
|
||||
@ -990,7 +978,7 @@ int orte_util_decode_pidmap(opal_byte_object_t *bo)
|
||||
orte_process_info.num_local_peers++;
|
||||
#if OPAL_HAVE_HWLOC
|
||||
/* retrieve the binding for the other proc */
|
||||
if (ORTE_SUCCESS != (rc = opal_db.fetch((*id), ORTE_DB_CPUSET, (void**)&cpu_bitmap, OPAL_STRING))) {
|
||||
if (ORTE_SUCCESS != (rc = opal_db.fetch((opal_identifier_t*)&proc, ORTE_DB_CPUSET, (void**)&cpu_bitmap, OPAL_STRING))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
goto cleanup;
|
||||
}
|
||||
@ -1017,7 +1005,7 @@ int orte_util_decode_pidmap(opal_byte_object_t *bo)
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
||||
ORTE_NAME_PRINT(&proc),
|
||||
opal_hwloc_base_print_locality(locality)));
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((*id), OPAL_DB_INTERNAL, ORTE_DB_LOCALITY, &locality, OPAL_HWLOC_LOCALITY_T))) {
|
||||
if (ORTE_SUCCESS != (rc = opal_db.store((opal_identifier_t*)&proc, OPAL_DB_INTERNAL, ORTE_DB_LOCALITY, &locality, OPAL_HWLOC_LOCALITY_T))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
goto cleanup;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user