Ensure that daemon debug flags get into the environment and propagated.
This commit was SVN r5844.
Этот коммит содержится в:
родитель
2451f3bdc9
Коммит
a0e96e92ca
@ -86,7 +86,7 @@ ompi_cmd_line_init_t orte_cmd_line_opts[] = {
|
||||
&orted_globals.debug, OMPI_CMD_LINE_TYPE_BOOL,
|
||||
"Debug the OpenRTE" },
|
||||
|
||||
{ NULL, NULL, NULL, '\0', NULL, "no-daemonize", 0,
|
||||
{ "orte", "no_daemonize", NULL, '\0', NULL, "no-daemonize", 0,
|
||||
&orted_globals.no_daemonize, OMPI_CMD_LINE_TYPE_BOOL,
|
||||
"Don't daemonize into the background" },
|
||||
|
||||
@ -166,7 +166,6 @@ int main(int argc, char *argv[])
|
||||
char *log_path = NULL;
|
||||
char log_file[PATH_MAX];
|
||||
char *jobidstring;
|
||||
int i;
|
||||
|
||||
/* setup to check common command line options that just report and die */
|
||||
memset(&orted_globals, 0, sizeof(orted_globals_t));
|
||||
@ -204,7 +203,7 @@ int main(int argc, char *argv[])
|
||||
* proper indicators in the environment so the name discovery service
|
||||
* can find it
|
||||
*/
|
||||
if (orted_globals.name) {
|
||||
if (orted_globals.name) {
|
||||
if (ORTE_SUCCESS != (ret = ompi_setenv("OMPI_MCA_ns_nds",
|
||||
"env", true, &environ))) {
|
||||
fprintf(stderr, "orted: could not set my name in environ\n");
|
||||
@ -250,7 +249,7 @@ int main(int argc, char *argv[])
|
||||
fprintf(stderr, "orted: failed to init rte\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/* if requested, report my uri to the indicated pipe */
|
||||
if (orted_globals.uri_pipe > 0) {
|
||||
write(orted_globals.uri_pipe, orte_universe_info.seed_uri,
|
||||
|
@ -36,6 +36,7 @@
|
||||
#include "class/ompi_pointer_array.h"
|
||||
#include "util/proc_info.h"
|
||||
#include "util/argv.h"
|
||||
#include "util/ompi_environ.h"
|
||||
#include "util/path.h"
|
||||
#include "util/cmd_line.h"
|
||||
#include "util/sys_info.h"
|
||||
@ -184,6 +185,9 @@ ompi_cmd_line_init_t cmd_line_init[] = {
|
||||
{ "orte", "debug", "daemons_file", '\0', NULL, "debug-daemons-file", 0,
|
||||
NULL, OMPI_CMD_LINE_TYPE_BOOL,
|
||||
"Enable debugging of any OpenRTE daemons used by this application, storing output in files" },
|
||||
{ "orte", "no_daemonize", NULL, '\0', NULL, "no-daemonize", 0,
|
||||
NULL, OMPI_CMD_LINE_TYPE_BOOL,
|
||||
"Do not detach OpenRTE daemons used by this application" },
|
||||
{ "universe", NULL, NULL, '\0', NULL, "universe", 1,
|
||||
NULL, OMPI_CMD_LINE_TYPE_STRING,
|
||||
"Set the universe name as username@hostname:universe_name for this application" },
|
||||
@ -215,6 +219,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
orte_app_context_t **apps;
|
||||
int rc, i, num_apps, j;
|
||||
int id, iparam;
|
||||
|
||||
/* Setup the abort message (for use in the signal handler) */
|
||||
|
||||
@ -271,6 +276,46 @@ int main(int argc, char *argv[])
|
||||
return rc;
|
||||
}
|
||||
|
||||
/* check for daemon flags and push them into the environment
|
||||
* since this isn't being automatically done
|
||||
*/
|
||||
id = mca_base_param_register_int("orte","debug","daemons",NULL,0);
|
||||
mca_base_param_lookup_int(id,&iparam);
|
||||
if (iparam) {
|
||||
if (ORTE_SUCCESS != (rc = ompi_setenv("OMPI_MCA_orte_debug_daemons",
|
||||
"1", true, &environ))) {
|
||||
fprintf(stderr, "orterun: could not set orte_debug_daemons in environ\n");
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
id = mca_base_param_register_int("orte","debug",NULL,NULL,0);
|
||||
mca_base_param_lookup_int(id,&iparam);
|
||||
if (iparam) {
|
||||
if (ORTE_SUCCESS != (rc = ompi_setenv("OMPI_MCA_orte_debug",
|
||||
"1", true, &environ))) {
|
||||
fprintf(stderr, "orterun: could not set orte_debug in environ\n");
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
id = mca_base_param_register_int("orte","debug","daemons_file",NULL,0);
|
||||
mca_base_param_lookup_int(id,&iparam);
|
||||
if (iparam) {
|
||||
if (ORTE_SUCCESS != (rc = ompi_setenv("OMPI_MCA_orte_debug_daemons_file",
|
||||
"1", true, &environ))) {
|
||||
fprintf(stderr, "orterun: could not set orte_debug_daemons_file in environ\n");
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
id = mca_base_param_register_int("orte","no_daemonize",NULL,NULL,0);
|
||||
mca_base_param_lookup_int(id,&iparam);
|
||||
if (iparam) {
|
||||
if (ORTE_SUCCESS != (rc = ompi_setenv("OMPI_MCA_orte_no_daemonize",
|
||||
"1", true, &environ))) {
|
||||
fprintf(stderr, "orterun: could not set orte_no_daemonize in environ\n");
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
|
||||
/* Prep to start the application */
|
||||
|
||||
ompi_event_set(&term_handler, SIGTERM, OMPI_EV_SIGNAL,
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user