Add new function: orte_show_help_norender(). It is exactly the same
as orte_show_help(), but it takes a fully-rendered string instead of a varargs list that must be rendered. This function is useful in cases where one entity renders the "show help" string and a different entity sends the string via the normal orte "show help" mechanisms for aggregation, etc. Example usage: errors occur in the ODLS after forking but before exec'ing. In such cases, it makes sense for the the child process to render the "show help" string because it has all the details about the error. But the child process can't call orte_show_help() itself because it is not an ORTE process -- it can't OOB send the message to the HNP, etc. After rendering the help string, the child sends the rendered string to its parent via normal IPC (e.g., via a pipe) and the parent can then invoke orte_show_help_norender() with the ready-to-go string. The message then displays out via the normal mechanisms (i.e., out via the HNP, aggregated/coalesced, etc.). This commit was SVN r23651.
Этот коммит содержится в:
родитель
a5ce58f098
Коммит
2c03554fe7
@ -612,7 +612,6 @@ int orte_show_help(const char *filename, const char *topic,
|
||||
bool want_error_header, ...)
|
||||
{
|
||||
int rc = ORTE_SUCCESS;
|
||||
int8_t have_output = 1;
|
||||
va_list arglist;
|
||||
char *output;
|
||||
|
||||
@ -630,6 +629,17 @@ int orte_show_help(const char *filename, const char *topic,
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
rc = orte_show_help_norender(filename, topic, want_error_header, output);
|
||||
free(output);
|
||||
return rc;
|
||||
}
|
||||
|
||||
int orte_show_help_norender(const char *filename, const char *topic,
|
||||
bool want_error_header, const char *output)
|
||||
{
|
||||
int rc = ORTE_SUCCESS;
|
||||
int8_t have_output = 1;
|
||||
|
||||
if (!ready) {
|
||||
/* if we are finalizing, then we have no way to process
|
||||
* this through the orte_show_help system - just drop it to
|
||||
@ -692,7 +702,6 @@ int orte_show_help(const char *filename, const char *topic,
|
||||
}
|
||||
|
||||
CLEANUP:
|
||||
free(output);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
@ -71,6 +71,15 @@ ORTE_DECLSPEC void orte_show_help_finalize(void);
|
||||
ORTE_DECLSPEC int orte_show_help(const char *filename, const char *topic,
|
||||
bool want_error_header, ...);
|
||||
|
||||
/**
|
||||
* Exactly the same as orte_show_help, but pass in a rendered string,
|
||||
* rather than a varargs list which must be rendered.
|
||||
*/
|
||||
ORTE_DECLSPEC int orte_show_help_norender(const char *filename,
|
||||
const char *topic,
|
||||
bool want_error_header,
|
||||
const char *output);
|
||||
|
||||
/**
|
||||
* Pretend that this message has already been shown.
|
||||
*
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user