Create a new mca parameter to control creation of session directories. Defaults to true so that the current behavior of always creating them is preserved. If set to false (0), then don't create session directories. Helps in those environments where session directories are a problem.
Tell the sm btl that it cannot run if no session directories were created. This commit was SVN r22756.
Этот коммит содержится в:
родитель
cd1efbb41e
Коммит
c88fe1ea54
@ -332,6 +332,11 @@ mca_btl_base_module_t** mca_btl_sm_component_init(
|
||||
|
||||
*num_btls = 0;
|
||||
|
||||
/* if no session directory was created, then we cannot be used */
|
||||
if (!orte_create_session_dirs) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* lookup/create shared memory pool only when used */
|
||||
mca_btl_sm_component.sm_mpool = NULL;
|
||||
mca_btl_sm_component.sm_mpool_base = NULL;
|
||||
|
@ -130,28 +130,29 @@ int orte_ess_base_app_setup(void)
|
||||
}
|
||||
|
||||
/* setup my session directory */
|
||||
OPAL_OUTPUT_VERBOSE((2, orte_debug_output,
|
||||
"%s setting up session dir with\n\ttmpdir: %s\n\thost %s",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
||||
(NULL == orte_process_info.tmpdir_base) ? "UNDEF" : orte_process_info.tmpdir_base,
|
||||
orte_process_info.nodename));
|
||||
|
||||
if (ORTE_SUCCESS != (ret = orte_session_dir(true,
|
||||
orte_process_info.tmpdir_base,
|
||||
orte_process_info.nodename, NULL,
|
||||
ORTE_PROC_MY_NAME))) {
|
||||
ORTE_ERROR_LOG(ret);
|
||||
error = "orte_session_dir";
|
||||
goto error;
|
||||
if (orte_create_session_dirs) {
|
||||
OPAL_OUTPUT_VERBOSE((2, orte_debug_output,
|
||||
"%s setting up session dir with\n\ttmpdir: %s\n\thost %s",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
||||
(NULL == orte_process_info.tmpdir_base) ? "UNDEF" : orte_process_info.tmpdir_base,
|
||||
orte_process_info.nodename));
|
||||
|
||||
if (ORTE_SUCCESS != (ret = orte_session_dir(true,
|
||||
orte_process_info.tmpdir_base,
|
||||
orte_process_info.nodename, NULL,
|
||||
ORTE_PROC_MY_NAME))) {
|
||||
ORTE_ERROR_LOG(ret);
|
||||
error = "orte_session_dir";
|
||||
goto error;
|
||||
}
|
||||
|
||||
/* Once the session directory location has been established, set
|
||||
the opal_output env file location to be in the
|
||||
proc-specific session directory. */
|
||||
opal_output_set_output_file_info(orte_process_info.proc_session_dir,
|
||||
"output-", NULL, NULL);
|
||||
}
|
||||
|
||||
/* Once the session directory location has been established, set
|
||||
the opal_output env file location to be in the
|
||||
proc-specific session directory. */
|
||||
opal_output_set_output_file_info(orte_process_info.proc_session_dir,
|
||||
"output-", NULL, NULL);
|
||||
|
||||
|
||||
/* setup the routed info - the selected routed component
|
||||
* will know what to do. Some may put us in a blocking
|
||||
* receive here so they can get ALL of the contact info
|
||||
@ -307,20 +308,26 @@ void orte_ess_base_app_abort(int status, bool report)
|
||||
orte_cr_finalize();
|
||||
|
||||
/* If we were asked to report this termination,
|
||||
* write an "abort" file into our session directory
|
||||
* write an "abort" file into our session directory if we have one
|
||||
*/
|
||||
if (report) {
|
||||
abort_file = opal_os_path(false, orte_process_info.proc_session_dir, "abort", NULL);
|
||||
if (NULL == abort_file) {
|
||||
/* got a problem */
|
||||
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||
goto CLEANUP;
|
||||
if (orte_create_session_dirs) {
|
||||
abort_file = opal_os_path(false, orte_process_info.proc_session_dir, "abort", NULL);
|
||||
if (NULL == abort_file) {
|
||||
/* got a problem */
|
||||
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||
goto CLEANUP;
|
||||
}
|
||||
OPAL_OUTPUT_VERBOSE((5, orte_debug_output,
|
||||
"%s orte_ess_app_abort: dropping abort file %s",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), abort_file));
|
||||
fd = open(abort_file, O_CREAT, 0600);
|
||||
if (0 < fd) close(fd);
|
||||
} else {
|
||||
OPAL_OUTPUT_VERBOSE((5, orte_debug_output,
|
||||
"%s cannot create abort file as no session dir was created",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
|
||||
}
|
||||
OPAL_OUTPUT_VERBOSE((5, orte_debug_output,
|
||||
"%s orte_ess_app_abort: dropping abort file %s",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), abort_file));
|
||||
fd = open(abort_file, O_CREAT, 0600);
|
||||
if (0 < fd) close(fd);
|
||||
}
|
||||
|
||||
CLEANUP:
|
||||
|
@ -287,19 +287,26 @@ int orte_ess_base_orted_setup(char **hosts)
|
||||
}
|
||||
|
||||
/* setup my session directory */
|
||||
OPAL_OUTPUT_VERBOSE((2, orte_debug_output,
|
||||
"%s setting up session dir with\n\ttmpdir: %s\n\thost %s",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
||||
(NULL == orte_process_info.tmpdir_base) ? "UNDEF" : orte_process_info.tmpdir_base,
|
||||
orte_process_info.nodename));
|
||||
|
||||
if (ORTE_SUCCESS != (ret = orte_session_dir(true,
|
||||
orte_process_info.tmpdir_base,
|
||||
orte_process_info.nodename, NULL,
|
||||
ORTE_PROC_MY_NAME))) {
|
||||
ORTE_ERROR_LOG(ret);
|
||||
error = "orte_session_dir";
|
||||
goto error;
|
||||
if (orte_create_session_dirs) {
|
||||
OPAL_OUTPUT_VERBOSE((2, orte_debug_output,
|
||||
"%s setting up session dir with\n\ttmpdir: %s\n\thost %s",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
||||
(NULL == orte_process_info.tmpdir_base) ? "UNDEF" : orte_process_info.tmpdir_base,
|
||||
orte_process_info.nodename));
|
||||
|
||||
if (ORTE_SUCCESS != (ret = orte_session_dir(true,
|
||||
orte_process_info.tmpdir_base,
|
||||
orte_process_info.nodename, NULL,
|
||||
ORTE_PROC_MY_NAME))) {
|
||||
ORTE_ERROR_LOG(ret);
|
||||
error = "orte_session_dir";
|
||||
goto error;
|
||||
}
|
||||
/* Once the session directory location has been established, set
|
||||
the opal_output env file location to be in the
|
||||
proc-specific session directory. */
|
||||
opal_output_set_output_file_info(orte_process_info.proc_session_dir,
|
||||
"output-", NULL, NULL);
|
||||
}
|
||||
|
||||
/* setup the routed info - the selected routed component
|
||||
|
20
orte/mca/ess/env/ess_env_module.c
поставляемый
20
orte/mca/ess/env/ess_env_module.c
поставляемый
@ -560,17 +560,19 @@ static int rte_ft_event(int state)
|
||||
/*
|
||||
* Session directory re-init
|
||||
*/
|
||||
if (ORTE_SUCCESS != (ret = orte_session_dir(true,
|
||||
orte_process_info.tmpdir_base,
|
||||
orte_process_info.nodename,
|
||||
NULL, /* Batch ID -- Not used */
|
||||
ORTE_PROC_MY_NAME))) {
|
||||
exit_status = ret;
|
||||
if (orte_create_session_dirs) {
|
||||
if (ORTE_SUCCESS != (ret = orte_session_dir(true,
|
||||
orte_process_info.tmpdir_base,
|
||||
orte_process_info.nodename,
|
||||
NULL, /* Batch ID -- Not used */
|
||||
ORTE_PROC_MY_NAME))) {
|
||||
exit_status = ret;
|
||||
}
|
||||
|
||||
opal_output_set_output_file_info(orte_process_info.proc_session_dir,
|
||||
"output-", NULL, NULL);
|
||||
}
|
||||
|
||||
opal_output_set_output_file_info(orte_process_info.proc_session_dir,
|
||||
"output-", NULL, NULL);
|
||||
|
||||
/*
|
||||
* Notify Routed
|
||||
*/
|
||||
|
@ -350,48 +350,50 @@ static int rte_init(void)
|
||||
#endif
|
||||
|
||||
/* setup my session directory */
|
||||
OPAL_OUTPUT_VERBOSE((2, orte_debug_output,
|
||||
"%s setting up session dir with\n\ttmpdir: %s\n\thost %s",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
||||
(NULL == orte_process_info.tmpdir_base) ? "UNDEF" : orte_process_info.tmpdir_base,
|
||||
orte_process_info.nodename));
|
||||
|
||||
if (ORTE_SUCCESS != (ret = orte_session_dir(true,
|
||||
orte_process_info.tmpdir_base,
|
||||
orte_process_info.nodename, NULL,
|
||||
ORTE_PROC_MY_NAME))) {
|
||||
ORTE_ERROR_LOG(ret);
|
||||
error = "orte_session_dir";
|
||||
goto error;
|
||||
}
|
||||
|
||||
/* Once the session directory location has been established, set
|
||||
the opal_output hnp file location to be in the
|
||||
proc-specific session directory. */
|
||||
opal_output_set_output_file_info(orte_process_info.proc_session_dir,
|
||||
"output-", NULL, NULL);
|
||||
|
||||
/* save my contact info in a file for others to find */
|
||||
jobfam_dir = opal_dirname(orte_process_info.job_session_dir);
|
||||
contact_path = opal_os_path(false, jobfam_dir, "contact.txt", NULL);
|
||||
free(jobfam_dir);
|
||||
|
||||
OPAL_OUTPUT_VERBOSE((2, orte_debug_output,
|
||||
"%s writing contact file %s",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
||||
contact_path));
|
||||
|
||||
if (ORTE_SUCCESS != (ret = orte_write_hnp_contact_file(contact_path))) {
|
||||
if (orte_create_session_dirs) {
|
||||
OPAL_OUTPUT_VERBOSE((2, orte_debug_output,
|
||||
"%s writing contact file failed with error %s",
|
||||
"%s setting up session dir with\n\ttmpdir: %s\n\thost %s",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
||||
ORTE_ERROR_NAME(ret)));
|
||||
} else {
|
||||
(NULL == orte_process_info.tmpdir_base) ? "UNDEF" : orte_process_info.tmpdir_base,
|
||||
orte_process_info.nodename));
|
||||
|
||||
if (ORTE_SUCCESS != (ret = orte_session_dir(true,
|
||||
orte_process_info.tmpdir_base,
|
||||
orte_process_info.nodename, NULL,
|
||||
ORTE_PROC_MY_NAME))) {
|
||||
ORTE_ERROR_LOG(ret);
|
||||
error = "orte_session_dir";
|
||||
goto error;
|
||||
}
|
||||
|
||||
/* Once the session directory location has been established, set
|
||||
the opal_output hnp file location to be in the
|
||||
proc-specific session directory. */
|
||||
opal_output_set_output_file_info(orte_process_info.proc_session_dir,
|
||||
"output-", NULL, NULL);
|
||||
|
||||
/* save my contact info in a file for others to find */
|
||||
jobfam_dir = opal_dirname(orte_process_info.job_session_dir);
|
||||
contact_path = opal_os_path(false, jobfam_dir, "contact.txt", NULL);
|
||||
free(jobfam_dir);
|
||||
|
||||
OPAL_OUTPUT_VERBOSE((2, orte_debug_output,
|
||||
"%s wrote contact file",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
|
||||
"%s writing contact file %s",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
||||
contact_path));
|
||||
|
||||
if (ORTE_SUCCESS != (ret = orte_write_hnp_contact_file(contact_path))) {
|
||||
OPAL_OUTPUT_VERBOSE((2, orte_debug_output,
|
||||
"%s writing contact file failed with error %s",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
||||
ORTE_ERROR_NAME(ret)));
|
||||
} else {
|
||||
OPAL_OUTPUT_VERBOSE((2, orte_debug_output,
|
||||
"%s wrote contact file",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
|
||||
}
|
||||
free(contact_path);
|
||||
}
|
||||
free(contact_path);
|
||||
|
||||
/* setup the global job and node arrays */
|
||||
orte_job_data = OBJ_NEW(opal_pointer_array_t);
|
||||
|
@ -422,17 +422,19 @@ static int rte_ft_event(int state)
|
||||
/*
|
||||
* Session directory re-init
|
||||
*/
|
||||
if (ORTE_SUCCESS != (ret = orte_session_dir(true,
|
||||
orte_process_info.tmpdir_base,
|
||||
orte_process_info.nodename,
|
||||
NULL, /* Batch ID -- Not used */
|
||||
ORTE_PROC_MY_NAME))) {
|
||||
exit_status = ret;
|
||||
if (orte_create_session_dirs) {
|
||||
if (ORTE_SUCCESS != (ret = orte_session_dir(true,
|
||||
orte_process_info.tmpdir_base,
|
||||
orte_process_info.nodename,
|
||||
NULL, /* Batch ID -- Not used */
|
||||
ORTE_PROC_MY_NAME))) {
|
||||
exit_status = ret;
|
||||
}
|
||||
|
||||
opal_output_set_output_file_info(orte_process_info.proc_session_dir,
|
||||
"output-", NULL, NULL);
|
||||
}
|
||||
|
||||
opal_output_set_output_file_info(orte_process_info.proc_session_dir,
|
||||
"output-", NULL, NULL);
|
||||
|
||||
/*
|
||||
* Notify Routed
|
||||
*/
|
||||
|
@ -52,6 +52,7 @@ ORTE_DECLSPEC extern bool orte_xml_output; /* instantiated in orte/runtime/orte
|
||||
ORTE_DECLSPEC extern FILE *orte_xml_fp; /* instantiated in orte/runtime/orte_globals.c */
|
||||
ORTE_DECLSPEC extern bool orte_help_want_aggregate; /* instantiated in orte/util/show_help.c */
|
||||
ORTE_DECLSPEC extern char *orte_job_ident; /* instantiated in orte/runtime/orte_globals.c */
|
||||
ORTE_DECLSPEC extern bool orte_create_session_dirs; /* instantiated in orte/runtime/orte_init.c */
|
||||
|
||||
/* Shortcut for some commonly used names */
|
||||
#define ORTE_NAME_WILDCARD (&orte_name_wildcard)
|
||||
|
@ -53,6 +53,7 @@ bool orte_finalizing = false;
|
||||
bool orte_debug_flag = false;
|
||||
int orte_debug_verbosity;
|
||||
char *orte_prohibited_session_dirs = NULL;
|
||||
bool orte_create_session_dirs = true;
|
||||
|
||||
orte_process_name_t orte_name_wildcard = {ORTE_JOBID_WILDCARD, ORTE_VPID_WILDCARD};
|
||||
orte_process_name_t orte_name_invalid = {ORTE_JOBID_INVALID, ORTE_VPID_INVALID};
|
||||
|
@ -68,6 +68,11 @@ int orte_register_params(void)
|
||||
"Prohibited locations for session directories (multiple locations separated by ',', default=NULL)",
|
||||
false, false, NULL, &orte_prohibited_session_dirs);
|
||||
|
||||
mca_base_param_reg_int_name("orte", "create_session_dirs",
|
||||
"Create session directories",
|
||||
false, false, (int) true, &value);
|
||||
orte_create_session_dirs = OPAL_INT_TO_BOOL(value);
|
||||
|
||||
#if !ORTE_DISABLE_FULL_SUPPORT
|
||||
|
||||
mca_base_param_reg_int_name("orte", "send_profile",
|
||||
|
@ -505,6 +505,11 @@ orte_session_dir_cleanup(orte_jobid_t jobid)
|
||||
char *tmp;
|
||||
char *job_session_dir=NULL;
|
||||
|
||||
if (!orte_create_session_dirs) {
|
||||
/* didn't create them */
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
/* need to setup the top_session_dir with the prefix */
|
||||
tmp = opal_os_path(false,
|
||||
orte_process_info.tmpdir_base,
|
||||
@ -570,6 +575,11 @@ orte_session_dir_finalize(orte_process_name_t *proc)
|
||||
char *tmp;
|
||||
char *job_session_dir, *vpid, *proc_session_dir;
|
||||
|
||||
if (!orte_create_session_dirs) {
|
||||
/* didn't create them */
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
/* need to setup the top_session_dir with the prefix */
|
||||
tmp = opal_os_path(false,
|
||||
orte_process_info.tmpdir_base,
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user