Enable the passing of MCA params to dynamically spawned jobs. This creates a new info_key "ompi_param" that allows a user to specify MCA params for a dynamically spawned job.
We currently apply all of the MCA params in the parent job to the child. This commit allows a user to specify additional params for the child job, and to override any pre-existing params with the new value so they can better control behavior of the child job. This commit was SVN r20989.
Этот коммит содержится в:
родитель
339948928d
Коммит
9c39a3edd7
@ -497,6 +497,7 @@ static int spawn(int count, char **array_of_commands,
|
|||||||
char host[OMPI_PATH_MAX]; /*** should define OMPI_HOST_MAX ***/
|
char host[OMPI_PATH_MAX]; /*** should define OMPI_HOST_MAX ***/
|
||||||
char prefix[OMPI_PATH_MAX];
|
char prefix[OMPI_PATH_MAX];
|
||||||
char stdin_target[OMPI_PATH_MAX];
|
char stdin_target[OMPI_PATH_MAX];
|
||||||
|
char params[OMPI_PATH_MAX];
|
||||||
|
|
||||||
orte_job_t *jdata;
|
orte_job_t *jdata;
|
||||||
orte_app_context_t *app;
|
orte_app_context_t *app;
|
||||||
@ -686,6 +687,12 @@ static int spawn(int count, char **array_of_commands,
|
|||||||
jdata->controls |= ORTE_JOB_CONTROL_NON_ORTE_JOB;
|
jdata->controls |= ORTE_JOB_CONTROL_NON_ORTE_JOB;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* see if this is an MCA param that the user wants applied to the child job */
|
||||||
|
ompi_info_get (array_of_info[i], "ompi_param", valuelen, params, &flag);
|
||||||
|
if ( flag ) {
|
||||||
|
opal_argv_append_unique_nosize(&app->env, params, true);
|
||||||
|
}
|
||||||
|
|
||||||
/* see if user specified what to do with stdin - defaults to
|
/* see if user specified what to do with stdin - defaults to
|
||||||
* not forwarding stdin to child processes
|
* not forwarding stdin to child processes
|
||||||
*/
|
*/
|
||||||
|
@ -140,6 +140,10 @@ ompi_non_mpi bool If set to true, launching a non-MPI
|
|||||||
this flag when launching a non-MPI
|
this flag when launching a non-MPI
|
||||||
application will cause both the child
|
application will cause both the child
|
||||||
and parent jobs to "hang".
|
and parent jobs to "hang".
|
||||||
|
ompi_param char * Pass an OMPI MCA parameter to the child job.
|
||||||
|
If that parameter already exists in the
|
||||||
|
environment, the value will be overwritten
|
||||||
|
by the provided value.
|
||||||
.fi
|
.fi
|
||||||
|
|
||||||
\fIbool\fP info keys are actually strings but are evaluated as
|
\fIbool\fP info keys are actually strings but are evaluated as
|
||||||
|
@ -151,6 +151,10 @@ ompi_non_mpi bool If set to true, launching a non-MPI
|
|||||||
this flag when launching a non-MPI
|
this flag when launching a non-MPI
|
||||||
application will cause both the child
|
application will cause both the child
|
||||||
and parent jobs to "hang".
|
and parent jobs to "hang".
|
||||||
|
ompi_param char * Pass an OMPI MCA parameter to the child job.
|
||||||
|
If that parameter already exists in the
|
||||||
|
environment, the value will be overwritten
|
||||||
|
by the provided value.
|
||||||
.fi
|
.fi
|
||||||
|
|
||||||
.sp
|
.sp
|
||||||
|
@ -90,7 +90,7 @@ int opal_argv_append_nosize(char ***argv, const char *arg)
|
|||||||
return OPAL_SUCCESS;
|
return OPAL_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
int opal_argv_append_unique_nosize(char ***argv, const char *arg)
|
int opal_argv_append_unique_nosize(char ***argv, const char *arg, bool overwrite)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -104,7 +104,11 @@ int opal_argv_append_unique_nosize(char ***argv, const char *arg)
|
|||||||
/* see if this arg is already present in the array */
|
/* see if this arg is already present in the array */
|
||||||
for (i=0; NULL != (*argv)[i]; i++) {
|
for (i=0; NULL != (*argv)[i]; i++) {
|
||||||
if (0 == strcmp(arg, (*argv)[i])) {
|
if (0 == strcmp(arg, (*argv)[i])) {
|
||||||
/* already exists - nothing to do */
|
/* already exists - are we authorized to overwrite? */
|
||||||
|
if (overwrite) {
|
||||||
|
free((*argv)[i]);
|
||||||
|
(*argv)[i] = strdup(arg);
|
||||||
|
}
|
||||||
return OPAL_SUCCESS;
|
return OPAL_SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -91,15 +91,16 @@ OPAL_DECLSPEC int opal_argv_append_nosize(char ***argv, const char *arg);
|
|||||||
*
|
*
|
||||||
* @param argv Pointer to an argv array.
|
* @param argv Pointer to an argv array.
|
||||||
* @param str Pointer to the string to append.
|
* @param str Pointer to the string to append.
|
||||||
|
* @param bool Whether or not to overwrite a matching value if found
|
||||||
*
|
*
|
||||||
* @retval OPAL_SUCCESS On success
|
* @retval OPAL_SUCCESS On success
|
||||||
* @retval OPAL_ERROR On failure
|
* @retval OPAL_ERROR On failure
|
||||||
*
|
*
|
||||||
* This function is identical to the opal_argv_append_nosize() function
|
* This function is identical to the opal_argv_append_nosize() function
|
||||||
* except that it only appends the provided argument if it does not already
|
* except that it only appends the provided argument if it does not already
|
||||||
* exist in the provided array.
|
* exist in the provided array, or overwrites it if it is.
|
||||||
*/
|
*/
|
||||||
OPAL_DECLSPEC int opal_argv_append_unique_nosize(char ***argv, const char *arg);
|
OPAL_DECLSPEC int opal_argv_append_unique_nosize(char ***argv, const char *arg, bool overwrite);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Free a NULL-terminated argv array.
|
* Free a NULL-terminated argv array.
|
||||||
|
@ -123,12 +123,12 @@ int orte_ras_base_node_insert(opal_list_t* nodes, orte_job_t *jdata)
|
|||||||
/* if the node name is different, store it as an alias */
|
/* if the node name is different, store it as an alias */
|
||||||
if (0 != strcmp(node->name, hnp_node->name)) {
|
if (0 != strcmp(node->name, hnp_node->name)) {
|
||||||
/* add to list of aliases for this node - only add if unique */
|
/* add to list of aliases for this node - only add if unique */
|
||||||
opal_argv_append_unique_nosize(&hnp_node->alias, node->name);
|
opal_argv_append_unique_nosize(&hnp_node->alias, node->name, false);
|
||||||
}
|
}
|
||||||
if (NULL != node->alias) {
|
if (NULL != node->alias) {
|
||||||
/* now copy over any aliases that are unique */
|
/* now copy over any aliases that are unique */
|
||||||
for (i=0; NULL != node->alias[i]; i++) {
|
for (i=0; NULL != node->alias[i]; i++) {
|
||||||
opal_argv_append_unique_nosize(&hnp_node->alias, node->alias[i]);
|
opal_argv_append_unique_nosize(&hnp_node->alias, node->alias[i], false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -117,7 +117,7 @@ int orte_util_add_dash_host_nodes(opal_list_t *nodes,
|
|||||||
if (orte_show_resolved_nodenames &&
|
if (orte_show_resolved_nodenames &&
|
||||||
0 != strcmp(mapped_nodes[i], orte_process_info.nodename)) {
|
0 != strcmp(mapped_nodes[i], orte_process_info.nodename)) {
|
||||||
/* add to list of aliases for this node - only add if unique */
|
/* add to list of aliases for this node - only add if unique */
|
||||||
opal_argv_append_unique_nosize(&node->alias, mapped_nodes[i]);
|
opal_argv_append_unique_nosize(&node->alias, mapped_nodes[i], false);
|
||||||
}
|
}
|
||||||
node->name = strdup(orte_process_info.nodename);
|
node->name = strdup(orte_process_info.nodename);
|
||||||
} else {
|
} else {
|
||||||
|
@ -236,7 +236,7 @@ static int hostfile_parse_line(int token, opal_list_t* updates, opal_list_t* exc
|
|||||||
/* do we need to record an alias for this node? */
|
/* do we need to record an alias for this node? */
|
||||||
if (NULL != node_alias) {
|
if (NULL != node_alias) {
|
||||||
/* add to list of aliases for this node - only add if unique */
|
/* add to list of aliases for this node - only add if unique */
|
||||||
opal_argv_append_unique_nosize(&node->alias, node_alias);
|
opal_argv_append_unique_nosize(&node->alias, node_alias, false);
|
||||||
free(node_alias);
|
free(node_alias);
|
||||||
}
|
}
|
||||||
} else if (ORTE_HOSTFILE_RELATIVE == token) {
|
} else if (ORTE_HOSTFILE_RELATIVE == token) {
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user