Implement process set name support
Add the --pset option for app_contexts so the user can provide a string name for each app_context. Use the new PMIx pset attribute to store the names in the PMIx local storage for retrieval Signed-off-by: Ralph Castain <rhc@open-mpi.org>
Этот коммит содержится в:
родитель
291d7654c5
Коммит
f609542bbf
@ -89,6 +89,8 @@ BEGIN_C_DECLS
|
||||
#define OPAL_PMIX_VERSION_INFO "pmix.version" // (char*) PMIx version of contactor
|
||||
#define OPAL_PMIX_REQUESTOR_IS_TOOL "pmix.req.tool" // (bool) requesting process is a tool
|
||||
#define OPAL_PMIX_REQUESTOR_IS_CLIENT "pmix.req.client" // (bool) requesting process is a client process
|
||||
#define OPAL_PMIX_PSET_NAME "pmix.pset.nm" // (char*) user-assigned name for the process
|
||||
// set containing the given process
|
||||
|
||||
/* model attributes */
|
||||
#define OPAL_PMIX_PROGRAMMING_MODEL "pmix.pgm.model" // (char*) programming model being initialized (e.g., "MPI" or "OpenMP")
|
||||
|
@ -1620,6 +1620,12 @@ static int create_app(int argc, char* argv[],
|
||||
}
|
||||
}
|
||||
|
||||
/* if they specified a process set name, then pass it along */
|
||||
if (NULL != orte_cmd_options.pset) {
|
||||
orte_set_attribute(&app->attributes, ORTE_APP_PSET_NAME, ORTE_ATTR_GLOBAL,
|
||||
orte_cmd_options.pset, OPAL_STRING);
|
||||
}
|
||||
|
||||
/* Did the user specify a hostfile. Need to check for both
|
||||
* hostfile and machine file.
|
||||
* We can only deal with one hostfile per app context, otherwise give an error.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015-2017 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2015-2018 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2016 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2017 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
@ -98,6 +98,7 @@ struct orte_cmd_options_t {
|
||||
int timeout;
|
||||
bool report_state_on_timeout;
|
||||
bool get_stack_traces;
|
||||
char *pset;
|
||||
};
|
||||
typedef struct orte_cmd_options_t orte_cmd_options_t;
|
||||
ORTE_DECLSPEC extern orte_cmd_options_t orte_cmd_options;
|
||||
|
@ -264,6 +264,9 @@ int pmix_server_spawn_fn(opal_process_name_t *requestor,
|
||||
} else if (0 == strcmp(info->key, OPAL_PMIX_APPEND_ENVAR)) {
|
||||
orte_add_attribute(&app->attributes, ORTE_APP_APPEND_ENVAR,
|
||||
ORTE_ATTR_GLOBAL, &info->data.envar, OPAL_ENVAR);
|
||||
} else if (0 == strcmp(info->key, OPAL_PMIX_PSET_NAME)) {
|
||||
orte_set_attribute(&app->attributes, ORTE_APP_PSET_NAME,
|
||||
ORTE_ATTR_GLOBAL, info->data.string, OPAL_STRING);
|
||||
|
||||
} else {
|
||||
/* unrecognized key */
|
||||
|
@ -430,6 +430,28 @@ int orte_pmix_server_register_nspace(orte_job_t *jdata, bool force)
|
||||
kv->type = OPAL_UINT32;
|
||||
kv->data.uint32 = app->num_procs;
|
||||
opal_list_append(info, &kv->super);
|
||||
|
||||
app = (orte_app_context_t*)opal_pointer_array_get_item(jdata->apps, pptr->app_idx);
|
||||
tmp = NULL;
|
||||
if (orte_get_attribute(&app->attributes, ORTE_APP_PSET_NAME, (void**)&tmp, OPAL_STRING) &&
|
||||
NULL != tmp) {
|
||||
kv = OBJ_NEW(opal_value_t);
|
||||
kv->key = strdup(OPAL_PMIX_PSET_NAME);
|
||||
kv->type = OPAL_STRING;
|
||||
kv->data.string = tmp;
|
||||
opal_list_append(pmap, &kv->super);
|
||||
}
|
||||
} else {
|
||||
app = (orte_app_context_t*)opal_pointer_array_get_item(jdata->apps, 0);
|
||||
tmp = NULL;
|
||||
if (orte_get_attribute(&app->attributes, ORTE_APP_PSET_NAME, (void**)&tmp, OPAL_STRING) &&
|
||||
NULL != tmp) {
|
||||
kv = OBJ_NEW(opal_value_t);
|
||||
kv->key = strdup(OPAL_PMIX_PSET_NAME);
|
||||
kv->type = OPAL_STRING;
|
||||
kv->data.string = tmp;
|
||||
opal_list_append(pmap, &kv->super);
|
||||
}
|
||||
}
|
||||
|
||||
/* local rank */
|
||||
|
@ -252,6 +252,8 @@ const char *orte_attr_key_to_str(orte_attribute_key_t key)
|
||||
return "ORTE_APP_APPEND_ENVAR";
|
||||
case ORTE_APP_ADD_ENVAR:
|
||||
return "ORTE_APP_ADD_ENVAR";
|
||||
case ORTE_APP_PSET_NAME:
|
||||
return "ORTE_APP_PSET_NAME";
|
||||
|
||||
case ORTE_NODE_USERNAME:
|
||||
return "NODE-USERNAME";
|
||||
|
@ -52,6 +52,8 @@ typedef uint8_t orte_app_context_flags_t;
|
||||
#define ORTE_APP_PREPEND_ENVAR 19 // opal_envar_t - prepend the specified value to the given envar
|
||||
#define ORTE_APP_APPEND_ENVAR 20 // opal_envar_t - append the specified value to the given envar
|
||||
#define ORTE_APP_ADD_ENVAR 21 // opal_envar_t - add envar, do not override pre-existing one
|
||||
#define ORTE_APP_PSET_NAME 23 // string - user-assigned name for the process
|
||||
// set containing the given process
|
||||
|
||||
#define ORTE_APP_MAX_KEY 100
|
||||
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user