@@ -138,7 +138,7 @@ static int rte_init(void)
138138{
139139 int ret ;
140140 char * error = NULL ;
141- char * contact_path , * jobfam_dir ;
141+ char * contact_path ;
142142 orte_job_t * jdata ;
143143 orte_node_t * node ;
144144 orte_proc_t * proc ;
@@ -294,10 +294,7 @@ static int rte_init(void)
294294 /* take a pass thru the session directory code to fillin the
295295 * tmpdir names - don't create anything yet
296296 */
297- if (ORTE_SUCCESS != (ret = orte_session_dir (false,
298- orte_process_info .tmpdir_base ,
299- orte_process_info .nodename ,
300- ORTE_PROC_MY_NAME ))) {
297+ if (ORTE_SUCCESS != (ret = orte_session_dir (false, ORTE_PROC_MY_NAME ))) {
301298 error = "orte_session_dir define" ;
302299 goto error ;
303300 }
@@ -307,10 +304,7 @@ static int rte_init(void)
307304 orte_session_dir_cleanup (ORTE_JOBID_WILDCARD );
308305
309306 /* now actually create the directory tree */
310- if (ORTE_SUCCESS != (ret = orte_session_dir (true,
311- orte_process_info .tmpdir_base ,
312- orte_process_info .nodename ,
313- ORTE_PROC_MY_NAME ))) {
307+ if (ORTE_SUCCESS != (ret = orte_session_dir (true, ORTE_PROC_MY_NAME ))) {
314308 error = "orte_session_dir" ;
315309 goto error ;
316310 }
@@ -586,9 +580,12 @@ static int rte_init(void)
586580 opal_output_set_output_file_info (orte_process_info .proc_session_dir ,
587581 "output-" , NULL , NULL );
588582 /* save my contact info in a file for others to find */
589- jobfam_dir = opal_dirname (orte_process_info .job_session_dir );
590- contact_path = opal_os_path (false, jobfam_dir , "contact.txt" , NULL );
591- free (jobfam_dir );
583+ if ( NULL == orte_process_info .jobfam_session_dir ){
584+ /* has to be set here! */
585+ ORTE_ERROR_LOG (ORTE_ERR_BAD_PARAM );
586+ goto error ;
587+ }
588+ contact_path = opal_os_path (false, orte_process_info .jobfam_session_dir , "contact.txt" , NULL );
592589 OPAL_OUTPUT_VERBOSE ((2 , orte_debug_output ,
593590 "%s writing contact file %s" ,
594591 ORTE_NAME_PRINT (ORTE_PROC_MY_NAME ),
@@ -758,10 +755,9 @@ static int rte_init(void)
758755 true, error , ORTE_ERROR_NAME (ret ), ret );
759756 }
760757 /* remove my contact info file, if we have session directories */
761- if (NULL != orte_process_info .job_session_dir ) {
762- jobfam_dir = opal_dirname (orte_process_info .job_session_dir );
763- contact_path = opal_os_path (false, jobfam_dir , "contact.txt" , NULL );
764- free (jobfam_dir );
758+ if (NULL != orte_process_info .jobfam_session_dir ) {
759+ contact_path = opal_os_path (false, orte_process_info .jobfam_session_dir ,
760+ "contact.txt" , NULL );
765761 unlink (contact_path );
766762 free (contact_path );
767763 }
@@ -775,7 +771,6 @@ static int rte_init(void)
775771static int rte_finalize (void )
776772{
777773 char * contact_path ;
778- char * jobfam_dir ;
779774
780775 if (signals_set ) {
781776 /* Remove the epipe handler */
@@ -816,10 +811,9 @@ static int rte_finalize(void)
816811 (void ) mca_base_framework_close (& opal_pstat_base_framework );
817812
818813 /* remove my contact info file, if we have session directories */
819- if (NULL != orte_process_info .job_session_dir ) {
820- jobfam_dir = opal_dirname (orte_process_info .job_session_dir );
821- contact_path = opal_os_path (false, jobfam_dir , "contact.txt" , NULL );
822- free (jobfam_dir );
814+ if (NULL != orte_process_info .jobfam_session_dir ) {
815+ contact_path = opal_os_path (false, orte_process_info .jobfam_session_dir ,
816+ "contact.txt" , NULL );
823817 unlink (contact_path );
824818 free (contact_path );
825819 }
0 commit comments