@@ -130,12 +130,10 @@ int mca_sharedfp_sm_file_open (struct ompi_communicator_t *comm,
130130 /* the shared memory segment is identified opening a file
131131 ** and then mapping it to memory
132132 ** For sharedfp we also want to put the file backed shared memory into the tmp directory
133- ** TODO: properly name the file so that different jobs can run on the same system w/o
134- ** overwriting each other, e.g. orte_process_info.proc_session_dir
135133 */
136134 /*sprintf(sm_filename,"%s%s",filename,".sm");*/
137135 filename_basename = basename ((void * )filename );
138- sm_filename = (char * ) malloc ( sizeof (char ) * (strlen (filename_basename )+ 64 ) );
136+ sm_filename = (char * ) malloc ( sizeof (char ) * (strlen (filename_basename )+ strlen ( ompi_process_info . job_session_dir ) + 64 ) );
139137 if (NULL == sm_filename ) {
140138 free (sm_data );
141139 free (sh );
@@ -151,7 +149,7 @@ int mca_sharedfp_sm_file_open (struct ompi_communicator_t *comm,
151149 comm -> c_coll -> coll_bcast ( & masterjobid , 1 , MPI_UNSIGNED , 0 , comm ,
152150 comm -> c_coll -> coll_bcast_module );
153151
154- sprintf (sm_filename ,"/tmp/ OMPIO_%s_%d_%s" ,filename_basename , masterjobid , ".sm" );
152+ sprintf (sm_filename ,"%s/ OMPIO_%s_%d_%s" ,ompi_process_info . job_session_dir , filename_basename , masterjobid , ".sm" );
155153 /* open shared memory file, initialize to 0, map into memory */
156154 sm_fd = open (sm_filename , O_RDWR | O_CREAT ,
157155 S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH );
0 commit comments