Skip to content

Commit d87d3e6

Browse files
authored
Merge pull request open-mpi#1382 from rhc54/cmr20x/pmixclean
v2.0.x: Eliminate the litter problem by moving the PMIx connection point
2 parents a32c145 + f0ec595 commit d87d3e6

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

orte/orted/pmix/pmix_server.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
#include "opal/mca/base/mca_base_var.h"
5555
#include "opal/mca/pmix/pmix.h"
5656
#include "opal/util/opal_environ.h"
57+
#include "opal/util/os_path.h"
5758
#include "opal/util/show_help.h"
5859
#include "opal/util/error.h"
5960
#include "opal/util/output.h"
@@ -189,6 +190,7 @@ int pmix_server_init(void)
189190
int rc;
190191
opal_list_t info;
191192
opal_value_t *kv;
193+
char *tmp;
192194

193195
if (orte_pmix_server_globals.initialized) {
194196
return ORTE_SUCCESS;
@@ -242,12 +244,18 @@ int pmix_server_init(void)
242244
kv->type = OPAL_STRING;
243245
opal_list_append(&info, &kv->super);
244246
}
245-
/* tell the server our temp directory */
247+
/* tell the server our temp directory - use the
248+
* job-family level so all our connection info
249+
* is unique to us */
250+
tmp = opal_os_path(false,
251+
orte_process_info.tmpdir_base,
252+
orte_process_info.top_session_dir, NULL);
246253
kv = OBJ_NEW(opal_value_t);
247254
kv->key = strdup(OPAL_PMIX_SERVER_TMPDIR);
248255
kv->type = OPAL_STRING;
249-
kv->data.string = strdup(orte_process_info.tmpdir_base);
256+
kv->data.string = orte_build_job_session_dir(tmp, ORTE_PROC_MY_NAME, ORTE_JOBID_WILDCARD);
250257
opal_list_append(&info, &kv->super);
258+
free(tmp);
251259

252260
/* setup the local server */
253261
if (ORTE_SUCCESS != (rc = opal_pmix.server_init(&pmix_server, &info))) {

orte/util/session_dir.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,6 @@ static int orte_create_dir(char *directory);
7373

7474
static bool orte_dir_check_file(const char *root, const char *path);
7575

76-
static char *orte_build_job_session_dir(char *top_dir,
77-
orte_process_name_t *proc,
78-
orte_jobid_t jobid);
79-
8076
#define OMPI_PRINTF_FIX_STRING(a) ((NULL == a) ? "(null)" : a)
8177

8278
/****************************
@@ -674,9 +670,9 @@ orte_dir_check_file(const char *root, const char *path)
674670
return true;
675671
}
676672

677-
static char *orte_build_job_session_dir(char *top_dir,
678-
orte_process_name_t *proc,
679-
orte_jobid_t jobid)
673+
char *orte_build_job_session_dir(char *top_dir,
674+
orte_process_name_t *proc,
675+
orte_jobid_t jobid)
680676
{
681677
char *jobfam = NULL;
682678
char *job_session_dir;

orte/util/session_dir.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,10 @@ ORTE_DECLSPEC int orte_session_dir_finalize(orte_process_name_t *proc);
162162
*/
163163
ORTE_DECLSPEC int orte_session_dir_cleanup(orte_jobid_t jobid);
164164

165+
ORTE_DECLSPEC char *orte_build_job_session_dir(char *top_dir,
166+
orte_process_name_t *proc,
167+
orte_jobid_t jobid);
168+
165169
END_C_DECLS
166170

167171
#endif /* ORTE_SESSION_DIR_H_HAS_BEEN_INCLUDED */

0 commit comments

Comments
 (0)