@@ -94,6 +94,7 @@ static int rte_init(void)
9494 uint16_t u16 , * u16ptr ;
9595 char * * peers = NULL , * mycpuset , * * cpusets = NULL ;
9696 opal_process_name_t wildcard_rank , pname ;
97+ bool bool_val , tdir_mca_override = false;
9798 size_t i ;
9899
99100 /* run the prolog */
@@ -246,37 +247,51 @@ static int rte_init(void)
246247 OPAL_MODEX_RECV_VALUE_OPTIONAL (ret , OPAL_PMIX_TMPDIR , & wildcard_rank , & val , OPAL_STRING );
247248 if (OPAL_SUCCESS == ret && NULL != val ) {
248249 /* TODO: who has precedence - pmix of MCA setting??? */
249- if ( NULL = = orte_process_info .top_session_dir ){
250+ if ( NULL ! = orte_process_info .top_session_dir ){
250251 orte_process_info .top_session_dir = val ;
251252 } else {
252253 /* keep the MCA setting */
254+ tdir_mca_override = true;
253255 free (val );
254256 }
255257 val = NULL ;
256258 }
257259
258- OPAL_MODEX_RECV_VALUE_OPTIONAL (ret , OPAL_PMIX_NSDIR , & wildcard_rank , & val , OPAL_STRING );
259- if (OPAL_SUCCESS == ret && NULL != val ) {
260- /* TODO: who has precedence - pmix of MCA setting??? */
261- if ( NULL == orte_process_info .job_session_dir ){
262- orte_process_info .job_session_dir = val ;
263- } else {
264- /* keep the MCA setting */
265- free (val );
260+ if ( !tdir_mca_override ){
261+ OPAL_MODEX_RECV_VALUE_OPTIONAL (ret , OPAL_PMIX_NSDIR , & wildcard_rank , & val , OPAL_STRING );
262+ if (OPAL_SUCCESS == ret && NULL != val ) {
263+ /* TODO: who has precedence - pmix of MCA setting??? */
264+ if ( NULL == orte_process_info .job_session_dir ){
265+ orte_process_info .job_session_dir = val ;
266+ } else {
267+ /* keep the MCA setting */
268+ free (val );
269+ tdir_mca_override = true;
270+ }
271+ val = NULL ;
266272 }
267- val = NULL ;
268273 }
269274
270- OPAL_MODEX_RECV_VALUE_OPTIONAL (ret , OPAL_PMIX_PROCDIR , & wildcard_rank , & val , OPAL_STRING );
271- if (OPAL_SUCCESS == ret && NULL != val ) {
272- /* TODO: who has precedence - pmix of MCA setting??? */
273- if ( NULL == orte_process_info .proc_session_dir ){
274- orte_process_info .proc_session_dir = val ;
275- } else {
276- /* keep the MCA setting */
277- free (val );
275+ if ( !tdir_mca_override ){
276+ OPAL_MODEX_RECV_VALUE_OPTIONAL (ret , OPAL_PMIX_PROCDIR , & wildcard_rank , & val , OPAL_STRING );
277+ if (OPAL_SUCCESS == ret && NULL != val ) {
278+ /* TODO: who has precedence - pmix of MCA setting??? */
279+ if ( NULL == orte_process_info .proc_session_dir ){
280+ orte_process_info .proc_session_dir = val ;
281+ } else {
282+ /* keep the MCA setting */
283+ tdir_mca_override = true;
284+ free (val );
285+ }
286+ val = NULL ;
287+ }
288+ }
289+
290+ if ( !tdir_mca_override ){
291+ OPAL_MODEX_RECV_VALUE_OPTIONAL (ret , OPAL_PMIX_TDIR_RMCLEAN , & wildcard_rank , & bool_val , OPAL_BOOL );
292+ if (OPAL_SUCCESS == ret ) {
293+ orte_process_info .rm_session_dirs = val ;
278294 }
279- val = NULL ;
280295 }
281296
282297 /* retrieve our topology */
0 commit comments