Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions opal/mca/pmix/pmix_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ BEGIN_C_DECLS
#define OPAL_PMIX_TMPDIR "pmix.tmpdir" // (char*) top-level tmp dir assigned to session
#define OPAL_PMIX_NSDIR "pmix.nsdir" // (char*) sub-tmpdir assigned to namespace
#define OPAL_PMIX_PROCDIR "pmix.pdir" // (char*) sub-nsdir assigned to proc
#define OPAL_PMIX_TDIR_RMCLEAN "pmix.tdir.rmclean" // (bool) Resource Manager will clean session directories

/* information about relative ranks as assigned by the RM */
#define OPAL_PMIX_JOBID "pmix.jobid" // (uint32_t) jobid assigned by scheduler
Expand Down
28 changes: 1 addition & 27 deletions orte/mca/ess/base/ess_base_std_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,7 @@ int orte_ess_base_app_setup(bool db_restrict_local)
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,
ORTE_PROC_MY_NAME))) {
if (ORTE_SUCCESS != (ret = orte_session_dir(true, ORTE_PROC_MY_NAME))) {
ORTE_ERROR_LOG(ret);
error = "orte_session_dir";
goto error;
Expand All @@ -149,29 +146,6 @@ int orte_ess_base_app_setup(bool db_restrict_local)
proc-specific session directory. */
opal_output_set_output_file_info(orte_process_info.proc_session_dir,
"output-", NULL, NULL);
/* store the session directory location */
OBJ_CONSTRUCT(&kv, opal_value_t);
kv.key = strdup(OPAL_PMIX_NSDIR);
kv.type = OPAL_STRING;
kv.data.string = strdup(orte_process_info.job_session_dir);
if (OPAL_SUCCESS != (ret = opal_pmix.store_local(ORTE_PROC_MY_NAME, &kv))) {
ORTE_ERROR_LOG(ret);
OBJ_DESTRUCT(&kv);
error = "opal pmix put job sessiondir";
goto error;
}
OBJ_DESTRUCT(&kv);
OBJ_CONSTRUCT(&kv, opal_value_t);
kv.key = strdup(OPAL_PMIX_PROCDIR);
kv.type = OPAL_STRING;
kv.data.string = strdup(orte_process_info.proc_session_dir);
if (OPAL_SUCCESS != (ret = opal_pmix.store_local(ORTE_PROC_MY_NAME, &kv))) {
ORTE_ERROR_LOG(ret);
OBJ_DESTRUCT(&kv);
error = "opal pmix put proc sessiondir";
goto error;
}
OBJ_DESTRUCT(&kv);
}
/* Setup the communication infrastructure */
/*
Expand Down
17 changes: 4 additions & 13 deletions orte/mca/ess/base/ess_base_std_orted.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,7 @@ int orte_ess_base_orted_setup(char **hosts)
/* take a pass thru the session directory code to fillin the
* tmpdir names - don't create anything yet
*/
if (ORTE_SUCCESS != (ret = orte_session_dir(false,
orte_process_info.tmpdir_base,
orte_process_info.nodename,
ORTE_PROC_MY_NAME))) {
if (ORTE_SUCCESS != (ret = orte_session_dir(false, ORTE_PROC_MY_NAME))) {
ORTE_ERROR_LOG(ret);
error = "orte_session_dir define";
goto error;
Expand All @@ -250,10 +247,7 @@ int orte_ess_base_orted_setup(char **hosts)
*/
orte_session_dir_cleanup(ORTE_JOBID_WILDCARD);
/* now actually create the directory tree */
if (ORTE_SUCCESS != (ret = orte_session_dir(true,
orte_process_info.tmpdir_base,
orte_process_info.nodename,
ORTE_PROC_MY_NAME))) {
if (ORTE_SUCCESS != (ret = orte_session_dir(true, ORTE_PROC_MY_NAME))) {
ORTE_ERROR_LOG(ret);
error = "orte_session_dir";
goto error;
Expand All @@ -277,11 +271,8 @@ int orte_ess_base_orted_setup(char **hosts)
/* define a log file name in the session directory */
snprintf(log_file, PATH_MAX, "output-orted-%s-%s.log",
jobidstring, orte_process_info.nodename);
log_path = opal_os_path(false,
orte_process_info.tmpdir_base,
orte_process_info.top_session_dir,
log_file,
NULL);
log_path = opal_os_path(false, orte_process_info.top_session_dir,
log_file, NULL);

fd = open(log_path, O_RDWR|O_CREAT|O_TRUNC, 0640);
if (fd < 0) {
Expand Down
7 changes: 3 additions & 4 deletions orte/mca/ess/base/ess_base_std_tool.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,9 @@ int orte_ess_base_tool_setup(void)
* tmp base where any other session directories on
* this node might be located
*/
if (ORTE_SUCCESS != (ret = orte_session_dir_get_name(NULL,
&orte_process_info.tmpdir_base,
&orte_process_info.top_session_dir,
orte_process_info.nodename, NULL))) {

ret = orte_session_setup_base(NULL);
if (ORTE_SUCCESS != ret ) {
ORTE_ERROR_LOG(ret);
error = "define session dir names";
goto error;
Expand Down
36 changes: 15 additions & 21 deletions orte/mca/ess/hnp/ess_hnp_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ static int rte_init(void)
{
int ret;
char *error = NULL;
char *contact_path, *jobfam_dir;
char *contact_path;
orte_job_t *jdata;
orte_node_t *node;
orte_proc_t *proc;
Expand Down Expand Up @@ -294,10 +294,7 @@ static int rte_init(void)
/* take a pass thru the session directory code to fillin the
* tmpdir names - don't create anything yet
*/
if (ORTE_SUCCESS != (ret = orte_session_dir(false,
orte_process_info.tmpdir_base,
orte_process_info.nodename,
ORTE_PROC_MY_NAME))) {
if (ORTE_SUCCESS != (ret = orte_session_dir(false, ORTE_PROC_MY_NAME))) {
error = "orte_session_dir define";
goto error;
}
Expand All @@ -307,10 +304,7 @@ static int rte_init(void)
orte_session_dir_cleanup(ORTE_JOBID_WILDCARD);

/* now actually create the directory tree */
if (ORTE_SUCCESS != (ret = orte_session_dir(true,
orte_process_info.tmpdir_base,
orte_process_info.nodename,
ORTE_PROC_MY_NAME))) {
if (ORTE_SUCCESS != (ret = orte_session_dir(true, ORTE_PROC_MY_NAME))) {
error = "orte_session_dir";
goto error;
}
Expand Down Expand Up @@ -586,9 +580,12 @@ static int rte_init(void)
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);
if( NULL == orte_process_info.jobfam_session_dir ){
/* has to be set here! */
ORTE_ERROR_LOG(ORTE_ERR_BAD_PARAM);
goto error;
}
contact_path = opal_os_path(false, orte_process_info.jobfam_session_dir, "contact.txt", NULL);
OPAL_OUTPUT_VERBOSE((2, orte_debug_output,
"%s writing contact file %s",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
Expand Down Expand Up @@ -758,10 +755,9 @@ static int rte_init(void)
true, error, ORTE_ERROR_NAME(ret), ret);
}
/* remove my contact info file, if we have session directories */
if (NULL != orte_process_info.job_session_dir) {
jobfam_dir = opal_dirname(orte_process_info.job_session_dir);
contact_path = opal_os_path(false, jobfam_dir, "contact.txt", NULL);
free(jobfam_dir);
if (NULL != orte_process_info.jobfam_session_dir) {
contact_path = opal_os_path(false, orte_process_info.jobfam_session_dir,
"contact.txt", NULL);
unlink(contact_path);
free(contact_path);
}
Expand All @@ -775,7 +771,6 @@ static int rte_init(void)
static int rte_finalize(void)
{
char *contact_path;
char *jobfam_dir;

if (signals_set) {
/* Remove the epipe handler */
Expand Down Expand Up @@ -816,10 +811,9 @@ static int rte_finalize(void)
(void) mca_base_framework_close(&opal_pstat_base_framework);

/* remove my contact info file, if we have session directories */
if (NULL != orte_process_info.job_session_dir) {
jobfam_dir = opal_dirname(orte_process_info.job_session_dir);
contact_path = opal_os_path(false, jobfam_dir, "contact.txt", NULL);
free(jobfam_dir);
if (NULL != orte_process_info.jobfam_session_dir) {
contact_path = opal_os_path(false, orte_process_info.jobfam_session_dir,
"contact.txt", NULL);
unlink(contact_path);
free(contact_path);
}
Expand Down
58 changes: 58 additions & 0 deletions orte/mca/ess/pmi/ess_pmi_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ static int rte_init(void)
uint16_t u16, *u16ptr;
char **peers=NULL, *mycpuset, **cpusets=NULL;
opal_process_name_t wildcard_rank, pname;
bool bool_val, *bool_ptr = &bool_val, tdir_mca_override = false;
size_t i;

/* run the prolog */
Expand Down Expand Up @@ -242,6 +243,63 @@ static int rte_init(void)
free(string_key);
}

/* retrieve temp directories info */
OPAL_MODEX_RECV_VALUE_OPTIONAL(ret, OPAL_PMIX_TMPDIR, &wildcard_rank, &val, OPAL_STRING);
if (OPAL_SUCCESS == ret && NULL != val) {
/* We want to provide user with ability
* to override RM settings at his own risk
*/
if( NULL == orte_process_info.top_session_dir ){
orte_process_info.top_session_dir = val;
} else {
/* keep the MCA setting */
tdir_mca_override = true;
free(val);
}
val = NULL;
}

if( !tdir_mca_override ){
OPAL_MODEX_RECV_VALUE_OPTIONAL(ret, OPAL_PMIX_NSDIR, &wildcard_rank, &val, OPAL_STRING);
if (OPAL_SUCCESS == ret && NULL != val) {
/* We want to provide user with ability
* to override RM settings at his own risk
*/
if( NULL == orte_process_info.job_session_dir ){
orte_process_info.job_session_dir = val;
} else {
/* keep the MCA setting */
free(val);
tdir_mca_override = true;
}
val = NULL;
}
}

if( !tdir_mca_override ){
OPAL_MODEX_RECV_VALUE_OPTIONAL(ret, OPAL_PMIX_PROCDIR, &wildcard_rank, &val, OPAL_STRING);
if (OPAL_SUCCESS == ret && NULL != val) {
/* We want to provide user with ability
* to override RM settings at his own risk
*/
if( NULL == orte_process_info.proc_session_dir ){
orte_process_info.proc_session_dir = val;
} else {
/* keep the MCA setting */
tdir_mca_override = true;
free(val);
}
val = NULL;
}
}

if( !tdir_mca_override ){
OPAL_MODEX_RECV_VALUE_OPTIONAL(ret, OPAL_PMIX_TDIR_RMCLEAN, &wildcard_rank, &bool_ptr, OPAL_BOOL);
if (OPAL_SUCCESS == ret ) {
orte_process_info.rm_session_dirs = bool_val;
}
}

/* retrieve our topology */
val = NULL;
OPAL_MODEX_RECV_VALUE_OPTIONAL(ret, OPAL_PMIX_LOCAL_TOPO,
Expand Down
Loading