1
1

make the sm sharedfp component compile on Mac.

This commit was SVN r28844.
Этот коммит содержится в:
Edgar Gabriel 2013-07-18 20:17:14 +00:00
родитель 256034a3dc
Коммит 185e365dad
2 изменённых файлов: 6 добавлений и 3 удалений

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

@ -97,7 +97,6 @@ int mca_sharedfp_sm_iwrite (mca_io_ompio_file_t *fh,
int count,
struct ompi_datatype_t *datatype,
ompi_request_t **request);
/*--------------------------------------------------------------*
*Structures and definitions only for this component
*--------------------------------------------------------------*/
@ -105,7 +104,7 @@ int mca_sharedfp_sm_iwrite (mca_io_ompio_file_t *fh,
struct sm_offset{
sem_t mutex; /* the mutex: a Posix memory-based semaphore */
long long offset; /* and the shared file pointer offset */
} sm_offset;
};
/*This structure will hang off of the mca_sharedfp_base_data_t's
*selected_module_data attribute

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

@ -29,6 +29,8 @@
#include <semaphore.h>
#include <sys/mman.h>
#include <libgen.h>
int mca_sharedfp_sm_file_open (struct ompi_communicator_t *comm,
char* filename,
@ -43,6 +45,7 @@ int mca_sharedfp_sm_file_open (struct ompi_communicator_t *comm,
char * filename_basename;
char * sm_filename;
struct sm_offset * sm_offset_ptr;
struct sm_offset sm_offset;
int sm_fd;
int rank;
@ -123,7 +126,8 @@ int mca_sharedfp_sm_file_open (struct ompi_communicator_t *comm,
/*TODO: is it necessary to write to the file first?*/
if( 0 == rank ){
write(sm_fd, &sm_offset, sizeof(struct sm_offset));
memset ( &sm_offset, 0, sizeof (struct sm_offset ));
write ( sm_fd, &sm_offset, sizeof(struct sm_offset));
}
comm->c_coll.coll_barrier (comm, comm->c_coll.coll_barrier_module );