Skip to content

Commit d1d2305

Browse files
committed
rename the sm_offset structure to mca_sharedfp_sm_offset to obey to the Open MPI naming convention
1 parent c91cb67 commit d1d2305

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

ompi/mca/sharedfp/sm/sharedfp_sm.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,7 @@ int mca_sharedfp_sm_iwrite (mca_io_ompio_file_t *fh,
100100
/*--------------------------------------------------------------*
101101
*Structures and definitions only for this component
102102
*--------------------------------------------------------------*/
103-
#define OMPIO_SHAREDFP_USE_UNNAMED_SEMAPHORES 1
104-
struct sm_offset{
103+
struct mca_sharedfp_sm_offset{
105104
sem_t mutex; /* the mutex: a Posix memory-based unnamed semaphore */
106105
long long offset; /* and the shared file pointer offset */
107106
};
@@ -111,7 +110,7 @@ struct sm_offset{
111110
*/
112111
struct mca_sharedfp_sm_data
113112
{
114-
struct sm_offset * sm_offset_ptr;
113+
struct mca_sharedfp_sm_offset * sm_offset_ptr;
115114
/*save filename so that we can remove the file on close*/
116115
char * sm_filename;
117116
sem_t *mutex; /* the mutex: a Posix memory-based named semaphore */

ompi/mca/sharedfp/sm/sharedfp_sm_file_open.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ int mca_sharedfp_sm_file_open (struct ompi_communicator_t *comm,
5454
mca_io_ompio_file_t * shfileHandle;
5555
char * filename_basename;
5656
char * sm_filename;
57-
struct sm_offset * sm_offset_ptr;
58-
struct sm_offset sm_offset;
57+
struct mca_sharedfp_sm_offset * sm_offset_ptr;
58+
struct mca_sharedfp_sm_offset sm_offset;
5959
int sm_fd;
6060
int rank;
6161

@@ -139,13 +139,13 @@ int mca_sharedfp_sm_file_open (struct ompi_communicator_t *comm,
139139

140140
/*TODO: is it necessary to write to the file first?*/
141141
if( 0 == rank ){
142-
memset ( &sm_offset, 0, sizeof (struct sm_offset ));
143-
write ( sm_fd, &sm_offset, sizeof(struct sm_offset));
142+
memset ( &sm_offset, 0, sizeof (struct mca_sharedfp_sm_offset ));
143+
write ( sm_fd, &sm_offset, sizeof(struct mca_sharedfp_sm_offset));
144144
}
145145
comm->c_coll.coll_barrier (comm, comm->c_coll.coll_barrier_module );
146146

147147
/*the file has been written to, now we can map*/
148-
sm_offset_ptr = mmap(NULL, sizeof(struct sm_offset), PROT_READ | PROT_WRITE,
148+
sm_offset_ptr = mmap(NULL, sizeof(struct mca_sharedfp_sm_offset), PROT_READ | PROT_WRITE,
149149
MAP_SHARED, sm_fd, 0);
150150

151151
close(sm_fd);
@@ -199,7 +199,7 @@ int mca_sharedfp_sm_file_open (struct ompi_communicator_t *comm,
199199
free(sm_data);
200200
free(sh);
201201
free(shfileHandle);
202-
munmap(sm_offset_ptr, sizeof(struct sm_offset));
202+
munmap(sm_offset_ptr, sizeof(struct mca_sharedfp_sm_offset));
203203
err = OMPI_ERROR;
204204
}
205205

@@ -242,7 +242,7 @@ int mca_sharedfp_sm_file_close (mca_io_ompio_file_t *fh)
242242
free (file_data->sem_name);
243243
#endif
244244
/*Release the shared memory segment.*/
245-
munmap(file_data->sm_offset_ptr,sizeof(struct sm_offset));
245+
munmap(file_data->sm_offset_ptr,sizeof(struct mca_sharedfp_sm_offset));
246246
/*Q: Do we need to delete the file? */
247247
remove(file_data->sm_filename);
248248
}

ompi/mca/sharedfp/sm/sharedfp_sm_request_position.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ int mca_sharedfp_sm_request_position(struct mca_sharedfp_base_data_t * sh,
3636
OMPI_MPI_OFFSET_TYPE position = 0;
3737
OMPI_MPI_OFFSET_TYPE old_offset;
3838
struct mca_sharedfp_sm_data * sm_data = sh->selected_module_data;
39-
struct sm_offset * sm_offset_ptr = NULL;
39+
struct mca_sharedfp_sm_offset * sm_offset_ptr = NULL;
4040
int rank = ompi_comm_rank ( sh->comm);
4141

4242
*offset = 0;

ompi/mca/sharedfp/sm/sharedfp_sm_seek.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ mca_sharedfp_sm_seek (mca_io_ompio_file_t *fh,
3838
struct mca_sharedfp_base_data_t *sh = NULL;
3939
mca_sharedfp_base_module_t * shared_fp_base_module = NULL;
4040
struct mca_sharedfp_sm_data * sm_data = NULL;
41-
struct sm_offset * sm_offset_ptr = NULL;
41+
struct mca_sharedfp_sm_offset * sm_offset_ptr = NULL;
4242

4343
if( NULL == fh->f_sharedfp_data ) {
4444
if ( mca_sharedfp_sm_verbose ) {

0 commit comments

Comments
 (0)