|
8 | 8 | * reserved.
|
9 | 9 | * Copyright (c) 2014-2018 Cisco Systems, Inc. All rights reserved
|
10 | 10 | * Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights reserved.
|
11 |
| - * Copyright (c) 2018-2022 Triad National Security, LLC. All rights |
| 11 | + * Copyright (c) 2018-2023 Triad National Security, LLC. All rights |
12 | 12 | * reserved.
|
13 | 13 | * Copyright (c) 2019 Research Organization for Information Science
|
14 | 14 | * and Technology (RIST). All rights reserved.
|
|
62 | 62 | opal_process_name_t pmix_name_wildcard = {UINT32_MAX-1, UINT32_MAX-1};
|
63 | 63 | opal_process_name_t pmix_name_invalid = {UINT32_MAX, UINT32_MAX};
|
64 | 64 |
|
| 65 | +/** |
| 66 | + * Flag used to indicate whether we setup (and should destroy) our job session |
| 67 | + * directory. We keep track of this information because we may be using run-time |
| 68 | + * infrastructure that manages its structure (e.g., OpenPMIx). If we setup this |
| 69 | + * session directory structure, then we shall cleanup after ourselves. |
| 70 | + */ |
| 71 | +static bool destroy_job_session_dir = false; |
| 72 | + |
65 | 73 | static int _setup_top_session_dir(char **sdir);
|
66 | 74 | static int _setup_job_session_dir(char **sdir);
|
67 | 75 | static int _setup_proc_session_dir(char **sdir);
|
@@ -974,11 +982,12 @@ int ompi_rte_finalize(void)
|
974 | 982 | {
|
975 | 983 |
|
976 | 984 | /* cleanup the session directory we created */
|
977 |
| - if (NULL != opal_process_info.job_session_dir) { |
| 985 | + if (NULL != opal_process_info.job_session_dir && destroy_job_session_dir) { |
978 | 986 | opal_os_dirpath_destroy(opal_process_info.job_session_dir,
|
979 | 987 | false, check_file);
|
980 | 988 | free(opal_process_info.job_session_dir);
|
981 | 989 | opal_process_info.job_session_dir = NULL;
|
| 990 | + destroy_job_session_dir = false; |
982 | 991 | }
|
983 | 992 |
|
984 | 993 | if (NULL != opal_process_info.top_session_dir) {
|
@@ -1176,7 +1185,7 @@ static int _setup_job_session_dir(char **sdir)
|
1176 | 1185 | opal_process_info.job_session_dir = NULL;
|
1177 | 1186 | return OPAL_ERR_OUT_OF_RESOURCE;
|
1178 | 1187 | }
|
1179 |
| - |
| 1188 | + destroy_job_session_dir = true; |
1180 | 1189 | return OPAL_SUCCESS;
|
1181 | 1190 | }
|
1182 | 1191 |
|
|
0 commit comments