@@ -370,45 +370,33 @@ int orte_session_dir(bool create, orte_process_name_t *proc)
370370int
371371orte_session_dir_cleanup (orte_jobid_t jobid )
372372{
373- int rc = ORTE_SUCCESS ;
374-
375373 if (!orte_create_session_dirs || orte_process_info .rm_session_dirs ) {
376374 /* we haven't created them or RM will clean them up for us*/
377375 return ORTE_SUCCESS ;
378376 }
379377
380- if (NULL == orte_process_info .job_session_dir ||
378+ if (NULL == orte_process_info .jobfam_session_dir ||
381379 NULL == orte_process_info .proc_session_dir ) {
382380 /* this should never happen - it means we are calling
383381 * cleanup *before* properly setting up the session
384382 * dir system. This leaves open the possibility of
385383 * accidentally removing directories we shouldn't
386384 * touch
387385 */
388- rc = ORTE_ERR_NOT_INITIALIZED ;
389- goto CLEANUP ;
386+ return ORTE_ERR_NOT_INITIALIZED ;
390387 }
391388
392389 /* recursively blow the whole session away for our job family,
393390 * saving only output files
394391 */
395- opal_os_dirpath_destroy (orte_process_info .job_session_dir ,
392+ opal_os_dirpath_destroy (orte_process_info .jobfam_session_dir ,
396393 true, orte_dir_check_file );
397394
398- /* now attempt to eliminate the top level directory itself - this
399- * will fail if anything is present, but ensures we cleanup if
400- * we are the last one out
401- */
402- if ( NULL != orte_process_info .top_session_dir ){
403- opal_os_dirpath_destroy (orte_process_info .top_session_dir ,
404- false, orte_dir_check_file );
405- }
406-
407- if (opal_os_dirpath_is_empty (orte_process_info .job_session_dir )) {
395+ if (opal_os_dirpath_is_empty (orte_process_info .jobfam_session_dir )) {
408396 if (orte_debug_flag ) {
409- opal_output (0 , "sess_dir_cleanup: found job session dir empty - deleting" );
397+ opal_output (0 , "sess_dir_cleanup: found jobfam session dir empty - deleting" );
410398 }
411- rmdir (orte_process_info .job_session_dir );
399+ rmdir (orte_process_info .jobfam_session_dir );
412400 } else {
413401 if (orte_debug_flag ) {
414402 if (OPAL_ERR_NOT_FOUND ==
@@ -418,12 +406,10 @@ orte_session_dir_cleanup(orte_jobid_t jobid)
418406 opal_output (0 , "sess_dir_cleanup: job session dir not empty - leaving" );
419407 }
420408 }
421- goto CLEANUP ;
422409 }
423410
424- if ( NULL != orte_process_info .top_session_dir ){
425-
426- if ( opal_os_dirpath_is_empty (orte_process_info .top_session_dir ) ) {
411+ if (NULL != orte_process_info .top_session_dir ) {
412+ if (opal_os_dirpath_is_empty (orte_process_info .top_session_dir )) {
427413 if (orte_debug_flag ) {
428414 opal_output (0 , "sess_dir_cleanup: found top session dir empty - deleting" );
429415 }
@@ -440,9 +426,17 @@ orte_session_dir_cleanup(orte_jobid_t jobid)
440426 }
441427 }
442428
443- CLEANUP :
429+ /* now attempt to eliminate the top level directory itself - this
430+ * will fail if anything is present, but ensures we cleanup if
431+ * we are the last one out
432+ */
433+ if ( NULL != orte_process_info .top_session_dir ){
434+ opal_os_dirpath_destroy (orte_process_info .top_session_dir ,
435+ false, orte_dir_check_file );
436+ }
437+
444438
445- return rc ;
439+ return ORTE_SUCCESS ;
446440}
447441
448442
0 commit comments