Skip to content

Commit b79a9fa

Browse files
authored
Merge pull request #3002 from jjhursey/fix/v2.x/session-dir-cleanup
ess: Make sure orted and HNP clean up their session directories
2 parents 6697514 + 6d4198b commit b79a9fa

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

orte/mca/ess/base/ess_base_std_orted.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* Copyright (c) 2011-2015 Los Alamos National Security, LLC. All rights
1616
* reserved.
1717
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved.
18+
* Copyright (c) 2017 IBM Corporation. All rights reserved.
1819
* $COPYRIGHT$
1920
*
2021
* Additional copyrights may follow
@@ -601,6 +602,10 @@ int orte_ess_base_orted_setup(char **hosts)
601602
"orte_init:startup:internal-failure",
602603
true, error, ORTE_ERROR_NAME(ret), ret);
603604

605+
/* remove our use of the session directory tree */
606+
orte_session_dir_finalize(ORTE_PROC_MY_NAME);
607+
/* ensure we scrub the session directory tree */
608+
orte_session_dir_cleanup(ORTE_JOBID_WILDCARD);
604609
return ORTE_ERR_SILENT;
605610
}
606611

orte/mca/ess/hnp/ess_hnp_module.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
* Copyright (c) 2013-2017 Intel, Inc. All rights reserved.
1818
* Copyright (c) 2017 Research Organization for Information Science
1919
* and Technology (RIST). All rights reserved.
20+
* Copyright (c) 2017 IBM Corporation. All rights reserved.
2021
* $COPYRIGHT$
2122
*
2223
* Additional copyrights may follow
@@ -755,6 +756,18 @@ static int rte_init(void)
755756
true, error, ORTE_ERROR_NAME(ret), ret);
756757
}
757758

759+
/* remove my contact info file, if we have session directories */
760+
if (NULL != orte_process_info.job_session_dir) {
761+
jobfam_dir = opal_dirname(orte_process_info.job_session_dir);
762+
contact_path = opal_os_path(false, jobfam_dir, "contact.txt", NULL);
763+
free(jobfam_dir);
764+
unlink(contact_path);
765+
free(contact_path);
766+
}
767+
/* remove our use of the session directory tree */
768+
orte_session_dir_finalize(ORTE_PROC_MY_NAME);
769+
/* ensure we scrub the session directory tree */
770+
orte_session_dir_cleanup(ORTE_JOBID_WILDCARD);
758771
return ORTE_ERR_SILENT;
759772
}
760773

@@ -820,6 +833,8 @@ static int rte_finalize(void)
820833
(void) mca_base_framework_close(&orte_rml_base_framework);
821834
(void) mca_base_framework_close(&orte_oob_base_framework);
822835

836+
/* remove our use of the session directory tree */
837+
orte_session_dir_finalize(ORTE_PROC_MY_NAME);
823838
/* ensure we scrub the session directory tree */
824839
orte_session_dir_cleanup(ORTE_JOBID_WILDCARD);
825840

0 commit comments

Comments
 (0)