1
1

rename the sm_offset structure to mca_sharedfp_sm_offset to obey to the Open MPI naming convention

Этот коммит содержится в:
Edgar Gabriel 2015-07-24 10:10:41 -05:00
родитель c91cb67787
Коммит d1d23054c6
4 изменённых файлов: 11 добавлений и 12 удалений

Просмотреть файл

@ -100,8 +100,7 @@ int mca_sharedfp_sm_iwrite (mca_io_ompio_file_t *fh,
/*--------------------------------------------------------------*
*Structures and definitions only for this component
*--------------------------------------------------------------*/
#define OMPIO_SHAREDFP_USE_UNNAMED_SEMAPHORES 1
struct sm_offset{
struct mca_sharedfp_sm_offset{
sem_t mutex; /* the mutex: a Posix memory-based unnamed semaphore */
long long offset; /* and the shared file pointer offset */
};
@ -111,7 +110,7 @@ struct sm_offset{
*/
struct mca_sharedfp_sm_data
{
struct sm_offset * sm_offset_ptr;
struct mca_sharedfp_sm_offset * sm_offset_ptr;
/*save filename so that we can remove the file on close*/
char * sm_filename;
sem_t *mutex; /* the mutex: a Posix memory-based named semaphore */

Просмотреть файл

@ -54,8 +54,8 @@ int mca_sharedfp_sm_file_open (struct ompi_communicator_t *comm,
mca_io_ompio_file_t * shfileHandle;
char * filename_basename;
char * sm_filename;
struct sm_offset * sm_offset_ptr;
struct sm_offset sm_offset;
struct mca_sharedfp_sm_offset * sm_offset_ptr;
struct mca_sharedfp_sm_offset sm_offset;
int sm_fd;
int rank;
@ -139,13 +139,13 @@ int mca_sharedfp_sm_file_open (struct ompi_communicator_t *comm,
/*TODO: is it necessary to write to the file first?*/
if( 0 == rank ){
memset ( &sm_offset, 0, sizeof (struct sm_offset ));
write ( sm_fd, &sm_offset, sizeof(struct sm_offset));
memset ( &sm_offset, 0, sizeof (struct mca_sharedfp_sm_offset ));
write ( sm_fd, &sm_offset, sizeof(struct mca_sharedfp_sm_offset));
}
comm->c_coll.coll_barrier (comm, comm->c_coll.coll_barrier_module );
/*the file has been written to, now we can map*/
sm_offset_ptr = mmap(NULL, sizeof(struct sm_offset), PROT_READ | PROT_WRITE,
sm_offset_ptr = mmap(NULL, sizeof(struct mca_sharedfp_sm_offset), PROT_READ | PROT_WRITE,
MAP_SHARED, sm_fd, 0);
close(sm_fd);
@ -199,7 +199,7 @@ int mca_sharedfp_sm_file_open (struct ompi_communicator_t *comm,
free(sm_data);
free(sh);
free(shfileHandle);
munmap(sm_offset_ptr, sizeof(struct sm_offset));
munmap(sm_offset_ptr, sizeof(struct mca_sharedfp_sm_offset));
err = OMPI_ERROR;
}
@ -242,7 +242,7 @@ int mca_sharedfp_sm_file_close (mca_io_ompio_file_t *fh)
free (file_data->sem_name);
#endif
/*Release the shared memory segment.*/
munmap(file_data->sm_offset_ptr,sizeof(struct sm_offset));
munmap(file_data->sm_offset_ptr,sizeof(struct mca_sharedfp_sm_offset));
/*Q: Do we need to delete the file? */
remove(file_data->sm_filename);
}

Просмотреть файл

@ -36,7 +36,7 @@ int mca_sharedfp_sm_request_position(struct mca_sharedfp_base_data_t * sh,
OMPI_MPI_OFFSET_TYPE position = 0;
OMPI_MPI_OFFSET_TYPE old_offset;
struct mca_sharedfp_sm_data * sm_data = sh->selected_module_data;
struct sm_offset * sm_offset_ptr = NULL;
struct mca_sharedfp_sm_offset * sm_offset_ptr = NULL;
int rank = ompi_comm_rank ( sh->comm);
*offset = 0;

Просмотреть файл

@ -38,7 +38,7 @@ mca_sharedfp_sm_seek (mca_io_ompio_file_t *fh,
struct mca_sharedfp_base_data_t *sh = NULL;
mca_sharedfp_base_module_t * shared_fp_base_module = NULL;
struct mca_sharedfp_sm_data * sm_data = NULL;
struct sm_offset * sm_offset_ptr = NULL;
struct mca_sharedfp_sm_offset * sm_offset_ptr = NULL;
if( NULL == fh->f_sharedfp_data ) {
if ( mca_sharedfp_sm_verbose ) {