diff --git a/ompi/mca/io/romio321/romio/adio/include/mpipr.h b/ompi/mca/io/romio321/romio/adio/include/mpipr.h index 8b86c4cfe13..a151995bf12 100644 --- a/ompi/mca/io/romio321/romio/adio/include/mpipr.h +++ b/ompi/mca/io/romio321/romio/adio/include/mpipr.h @@ -10,28 +10,30 @@ #ifndef USE_MPI_VERSIONS +#include "mpi-io/glue/openmpi/mpio_wrappers.h" + #undef MPI_Abort #define MPI_Abort PMPI_Abort #undef MPI_Allgather -#define MPI_Allgather PMPI_Allgather +#define MPI_Allgather MPIW_Allgather #undef MPI_Allgatherv #define MPI_Allgatherv PMPI_Allgatherv #undef MPI_Allreduce -#define MPI_Allreduce PMPI_Allreduce +#define MPI_Allreduce MPIW_Allreduce #undef MPI_Alltoall -#define MPI_Alltoall PMPI_Alltoall +#define MPI_Alltoall MPIW_Alltoall #undef MPI_Alltoallv #define MPI_Alltoallv PMPI_Alltoallv #undef MPI_Alltoallw -#define MPI_Alltoallw PMPI_Alltoallw +#define MPI_Alltoallw MPIW_Alltoallw #undef MPI_Attr_delete #define MPI_Attr_delete PMPI_Attr_delete #undef MPI_Attr_get #define MPI_Attr_get PMPI_Attr_get #undef MPI_Barrier -#define MPI_Barrier PMPI_Barrier +#define MPI_Barrier MPIW_Barrier #undef MPI_Bcast -#define MPI_Bcast PMPI_Bcast +#define MPI_Bcast MPIW_Bcast #undef MPI_Bsend #define MPI_Bsend PMPI_Bsend #undef MPI_Bsend_init @@ -105,9 +107,9 @@ #undef MPI_Finalize #define MPI_Finalize PMPI_Finalize #undef MPI_Gather -#define MPI_Gather PMPI_Gather +#define MPI_Gather MPIW_Gather #undef MPI_Gatherv -#define MPI_Gatherv PMPI_Gatherv +#define MPI_Gatherv MPIW_Gatherv #undef MPI_Get_address #define MPI_Get_address PMPI_Get_address #undef MPI_Get_count @@ -191,7 +193,7 @@ #undef MPI_Probe #define MPI_Probe PMPI_Probe #undef MPI_Recv -#define MPI_Recv PMPI_Recv +#define MPI_Recv MPIW_Recv #undef MPI_Recv_init #define MPI_Recv_init PMPI_Recv_init #undef MPI_Reduce @@ -213,7 +215,7 @@ #undef MPI_Scatterv #define MPI_Scatterv PMPI_Scatterv #undef MPI_Send -#define MPI_Send PMPI_Send +#define MPI_Send MPIW_Send #undef MPI_Send_init #define MPI_Send_init PMPI_Send_init #undef MPI_Sendrecv @@ -281,11 +283,11 @@ #undef MPI_Unpack #define MPI_Unpack PMPI_Unpack #undef MPI_Wait -#define MPI_Wait PMPI_Wait +#define MPI_Wait MPIW_Wait #undef MPI_Waitall -#define MPI_Waitall PMPI_Waitall +#define MPI_Waitall MPIW_Waitall #undef MPI_Waitany -#define MPI_Waitany PMPI_Waitany +#define MPI_Waitany MPIW_Waitany #undef MPI_Waitsome #define MPI_Waitsome PMPI_Waitsome #undef MPI_Wtick diff --git a/ompi/mca/io/romio321/romio/mpi-io/glue/openmpi/Makefile.mk b/ompi/mca/io/romio321/romio/mpi-io/glue/openmpi/Makefile.mk index ab7c15078e9..29df8307eda 100644 --- a/ompi/mca/io/romio321/romio/mpi-io/glue/openmpi/Makefile.mk +++ b/ompi/mca/io/romio321/romio/mpi-io/glue/openmpi/Makefile.mk @@ -8,6 +8,10 @@ if MPIO_GLUE_OPENMPI romio_other_sources += \ mpi-io/glue/openmpi/mpio_file.c \ - mpi-io/glue/openmpi/mpio_err.c + mpi-io/glue/openmpi/mpio_err.c \ + mpi-io/glue/openmpi/mpio_wrappers.c + +noinst_HEADERS += mpi-io/glue/openmpi/mpio_wrappers.h + endif MPIO_GLUE_OPENMPI diff --git a/ompi/mca/io/romio321/romio/mpi-io/glue/openmpi/mpio_wrappers.c b/ompi/mca/io/romio321/romio/mpi-io/glue/openmpi/mpio_wrappers.c new file mode 100644 index 00000000000..0b3a6c43848 --- /dev/null +++ b/ompi/mca/io/romio321/romio/mpi-io/glue/openmpi/mpio_wrappers.c @@ -0,0 +1,147 @@ +#include "mpi-io/mpioimpl.h" + +#include "mpi-io/glue/openmpi/mpio_wrappers.h" + +int MPIW_Allreduce(const void *sendbuf, void *recvbuf, int count, + MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) +{ + int res; + ROMIO_THREAD_CS_EXIT(); + res = PMPI_Allreduce(sendbuf, recvbuf, count, datatype, op, comm); + ROMIO_THREAD_CS_ENTER(); + return res; +} + +int MPIW_Allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype, + void *recvbuf, int recvcount, MPI_Datatype recvtype, + MPI_Comm comm) +{ + int res; + ROMIO_THREAD_CS_EXIT(); + res = PMPI_Allgather(sendbuf, sendcount, sendtype, + recvbuf, recvcount, recvtype, + comm); + ROMIO_THREAD_CS_ENTER(); + return res; +} + +int MPIW_Alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype, + void *recvbuf, int recvcount, MPI_Datatype recvtype, + MPI_Comm comm) +{ + int res; + ROMIO_THREAD_CS_EXIT(); + res = PMPI_Alltoall(sendbuf, sendcount, sendtype, + recvbuf, recvcount, recvtype, + comm); + ROMIO_THREAD_CS_ENTER(); + return res; +} + +int MPIW_Alltoallw(const void *sendbuf, const int sendcounts[], const int sdispls[], const MPI_Datatype sendtypes[], + void *recvbuf, const int recvcounts[], const int rdispls[], const MPI_Datatype recvtypes[], + MPI_Comm comm) +{ + int res; + ROMIO_THREAD_CS_EXIT(); + res = PMPI_Alltoallw(sendbuf, sendcounts, sdispls, sendtypes, + recvbuf, recvcounts, rdispls, recvtypes, + comm); + ROMIO_THREAD_CS_ENTER(); + return res; +} + +int MPIW_Barrier(MPI_Comm comm) +{ + int res; + ROMIO_THREAD_CS_EXIT(); + res = PMPI_Barrier(comm); + ROMIO_THREAD_CS_ENTER(); + return res; +} + +int MPIW_Bcast(void *buffer, int count, MPI_Datatype datatype, + int root, MPI_Comm comm) +{ + int res; + ROMIO_THREAD_CS_EXIT(); + res = PMPI_Bcast(buffer, count, datatype, root, comm); + ROMIO_THREAD_CS_ENTER(); + return res; +} + +int MPIW_Gather(const void *sendbuf, int sendcount, MPI_Datatype sendtype, + void *recvbuf, int recvcount, MPI_Datatype recvtype, + int root, MPI_Comm comm) +{ + int res; + ROMIO_THREAD_CS_EXIT(); + res = PMPI_Gather(sendbuf, sendcount, sendtype, + recvbuf, recvcount, recvtype, + root, comm); + ROMIO_THREAD_CS_ENTER(); + return res; +} + +int MPIW_Gatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, + void *recvbuf, const int recvcounts[], const int displs[], + MPI_Datatype recvtype, int root, MPI_Comm comm) +{ + int res; + ROMIO_THREAD_CS_EXIT(); + res = PMPI_Gatherv(sendbuf, sendcount, sendtype, + recvbuf, recvcounts, displs, recvtype, + root, comm); + ROMIO_THREAD_CS_ENTER(); + return res; +} + +int MPIW_Recv(void *buf, int count, MPI_Datatype datatype, int source, + int tag, MPI_Comm comm, MPI_Status *status) +{ + int res; + ROMIO_THREAD_CS_EXIT(); + res = PMPI_Recv(buf, count, datatype, source, tag, comm, status); + ROMIO_THREAD_CS_ENTER(); + return res; +} + + +int MPIW_Send(const void *buf, int count, MPI_Datatype datatype, int dest, + int tag, MPI_Comm comm) +{ + int res; + ROMIO_THREAD_CS_EXIT(); + res = PMPI_Send(buf, count, datatype, dest, tag, comm); + ROMIO_THREAD_CS_ENTER(); + return res; +} + +int MPIW_Waitall(int count, MPI_Request array_of_requests[], + MPI_Status array_of_statuses[]) +{ + int res; + ROMIO_THREAD_CS_EXIT(); + res = PMPI_Waitall(count, array_of_requests, array_of_statuses); + ROMIO_THREAD_CS_ENTER(); + return res; +} + +int MPIW_Waitany(int count, MPI_Request array_of_requests[], + int *index, MPI_Status *status) +{ + int res; + ROMIO_THREAD_CS_EXIT(); + res = PMPI_Waitany(count, array_of_requests, index, status); + ROMIO_THREAD_CS_ENTER(); + return res; +} + +int MPIW_Wait(MPI_Request *request, MPI_Status *status) +{ + int res; + ROMIO_THREAD_CS_EXIT(); + res = PMPI_Wait(request, status); + ROMIO_THREAD_CS_ENTER(); + return res; +} diff --git a/ompi/mca/io/romio321/romio/mpi-io/glue/openmpi/mpio_wrappers.h b/ompi/mca/io/romio321/romio/mpi-io/glue/openmpi/mpio_wrappers.h new file mode 100644 index 00000000000..61c89eb5936 --- /dev/null +++ b/ompi/mca/io/romio321/romio/mpi-io/glue/openmpi/mpio_wrappers.h @@ -0,0 +1,43 @@ +#include + +int MPIW_Allreduce(const void *sendbuf, void *recvbuf, int count, + MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); + +int MPIW_Allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype, + void *recvbuf, int recvcount, MPI_Datatype recvtype, + MPI_Comm comm); + +int MPIW_Alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype, + void *recvbuf, int recvcount, MPI_Datatype recvtype, + MPI_Comm comm); + +int MPIW_Alltoallw(const void *sendbuf, const int sendcounts[], const int sdispls[], const MPI_Datatype sendtypes[], + void *recvbuf, const int recvcounts[], const int rdispls[], const MPI_Datatype recvtypes[], + MPI_Comm comm); + +int MPIW_Barrier(MPI_Comm comm); + +int MPIW_Bcast(void *buffer, int count, MPI_Datatype datatype, + int root, MPI_Comm comm); + +int MPIW_Gather(const void *sendbuf, int sendcount, MPI_Datatype sendtype, + void *recvbuf, int recvcount, MPI_Datatype recvtype, + int root, MPI_Comm comm); + +int MPIW_Gatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, + void *recvbuf, const int recvcounts[], const int displs[], + MPI_Datatype recvtype, int root, MPI_Comm comm); + +int MPIW_Recv(void *buf, int count, MPI_Datatype datatype, int source, + int tag, MPI_Comm comm, MPI_Status *status); + +int MPIW_Send(const void *buf, int count, MPI_Datatype datatype, int dest, + int tag, MPI_Comm comm); + +int MPIW_Waitall(int count, MPI_Request array_of_requests[], + MPI_Status array_of_statuses[]); + +int MPIW_Waitany(int count, MPI_Request array_of_requests[], + int *index, MPI_Status *status); + +int MPIW_Wait(MPI_Request *request, MPI_Status *status); diff --git a/ompi/mca/io/romio321/romio/mpi-io/mpioimpl.h b/ompi/mca/io/romio321/romio/mpi-io/mpioimpl.h index 4eb2843bcaf..48f38828597 100644 --- a/ompi/mca/io/romio321/romio/mpi-io/mpioimpl.h +++ b/ompi/mca/io/romio321/romio/mpi-io/mpioimpl.h @@ -35,8 +35,10 @@ error reporting features provided by MPICH must implement these four functions. Defining these as empty should not change the behavior of correct programs */ -#define ROMIO_THREAD_CS_ENTER() -#define ROMIO_THREAD_CS_EXIT() +extern void mca_io_romio321_lock(void); +extern void mca_io_romio321_unlock(void); +#define ROMIO_THREAD_CS_ENTER() mca_io_romio321_lock() +#define ROMIO_THREAD_CS_EXIT() mca_io_romio321_unlock() #define ROMIO_THREAD_CS_YIELD() /* The MPI_DATATYPE_ISCOMMITTED macro now always sets err_=0. This is an optimistic approach for Open MPI, but it is likely other diff --git a/ompi/mca/io/romio321/src/io_romio321.h b/ompi/mca/io/romio321/src/io_romio321.h index 0f948bc3b2d..d373fdb9d2d 100644 --- a/ompi/mca/io/romio321/src/io_romio321.h +++ b/ompi/mca/io/romio321/src/io_romio321.h @@ -293,6 +293,10 @@ int mca_io_romio321_file_get_atomicity (struct ompi_file_t *fh, int *flag); int mca_io_romio321_file_sync (struct ompi_file_t *fh); +void mca_io_romio321_lock(void); + +void mca_io_romio321_unlock(void); + /* End Prototypes */ END_C_DECLS diff --git a/ompi/mca/io/romio321/src/io_romio321_component.c b/ompi/mca/io/romio321/src/io_romio321_component.c index e3dbbcf3919..0f842102dba 100644 --- a/ompi/mca/io/romio321/src/io_romio321_component.c +++ b/ompi/mca/io/romio321/src/io_romio321_component.c @@ -13,8 +13,8 @@ * Copyright (c) 2008-2015 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2015-2017 Research Organization for Information Science - * and Technology (RIST). All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * Copyright (c) 2016-2017 IBM Corporation. All rights reserved. * $COPYRIGHT$ * @@ -249,9 +249,7 @@ static int delete_select(const char *filename, struct opal_info_t *info, opal_info_t *opal_info = &(ompi_info->super); opal_info_dup (info, &opal_info); - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_delete)(filename, ompi_info); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); ompi_info_free(&ompi_info); return ret; @@ -267,10 +265,18 @@ register_datarep(const char * datarep, { int ret; - OPAL_THREAD_LOCK(&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_Register_datarep(datarep, read_fn, write_fn, extent_fn, state)); - OPAL_THREAD_UNLOCK(&mca_io_romio321_mutex); return ret; } + +void mca_io_romio321_lock() +{ + OPAL_THREAD_LOCK(&mca_io_romio321_mutex); +} + +void mca_io_romio321_unlock() +{ + OPAL_THREAD_UNLOCK(&mca_io_romio321_mutex); +} diff --git a/ompi/mca/io/romio321/src/io_romio321_file_open.c b/ompi/mca/io/romio321/src/io_romio321_file_open.c index 5b641c3e4e5..c2283feeeed 100644 --- a/ompi/mca/io/romio321/src/io_romio321_file_open.c +++ b/ompi/mca/io/romio321/src/io_romio321_file_open.c @@ -9,7 +9,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. - * Copyright (c) 2015-2017 Research Organization for Information Science + * Copyright (c) 2015-2019 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2016-2019 IBM Corporation. All rights reserved. * $COPYRIGHT$ @@ -48,10 +48,8 @@ mca_io_romio321_file_open (ompi_communicator_t *comm, opal_info_dup (info, &opal_info); data = (mca_io_romio321_data_t *) fh->f_io_selected_data; -// OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_open)(comm, filename, amode, ompi_info, &data->romio_fh); -// OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); ompi_info_free(&ompi_info); return ret; @@ -89,9 +87,7 @@ mca_io_romio321_file_close (ompi_file_t *fh) data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_close) (&data->romio_fh); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -105,9 +101,7 @@ mca_io_romio321_file_set_size (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_set_size) (data->romio_fh, size); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -120,9 +114,7 @@ mca_io_romio321_file_preallocate (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_preallocate) (data->romio_fh, size); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -136,9 +128,7 @@ mca_io_romio321_file_get_size (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_get_size) (data->romio_fh, size); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -152,9 +142,7 @@ mca_io_romio321_file_get_amode (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_get_amode) (data->romio_fh, amode); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -168,10 +156,7 @@ mca_io_romio321_file_set_info (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_set_info) (data->romio_fh, info); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); - return ret; } @@ -184,10 +169,7 @@ mca_io_romio321_file_get_info (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_get_info) (data->romio_fh, info_used); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); - return ret; } @@ -213,11 +195,9 @@ mca_io_romio321_file_set_view (ompi_file_t *fh, opal_info_dup (info, &opal_info); data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_set_view) (data->romio_fh, disp, etype, filetype, datarep, ompi_info); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); ompi_info_free(&ompi_info); return ret; @@ -235,11 +215,9 @@ mca_io_romio321_file_get_view (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_get_view) (data->romio_fh, disp, etype, filetype, datarep); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; @@ -255,10 +233,8 @@ mca_io_romio321_file_get_type_extent (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_get_type_extent) (data->romio_fh, datatype, extent); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -272,9 +248,7 @@ mca_io_romio321_file_set_atomicity (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_set_atomicity) (data->romio_fh, flag); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -287,9 +261,7 @@ mca_io_romio321_file_get_atomicity (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_get_atomicity) (data->romio_fh, flag); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -301,9 +273,7 @@ mca_io_romio321_file_sync (ompi_file_t *fh) mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_sync) (data->romio_fh); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -318,9 +288,7 @@ mca_io_romio321_file_seek_shared (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_seek_shared) (data->romio_fh, offset, whence); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -334,9 +302,7 @@ mca_io_romio321_file_get_position_shared (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_get_position_shared) (data->romio_fh, offset); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -351,9 +317,7 @@ mca_io_romio321_file_seek (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_seek) (data->romio_fh, offset, whence); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -367,9 +331,7 @@ mca_io_romio321_file_get_position (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_get_position) (data->romio_fh, offset); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -384,9 +346,7 @@ mca_io_romio321_file_get_byte_offset (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_get_byte_offset) (data->romio_fh, offset, disp); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } diff --git a/ompi/mca/io/romio321/src/io_romio321_file_read.c b/ompi/mca/io/romio321/src/io_romio321_file_read.c index 8944d926cc9..738db37b920 100644 --- a/ompi/mca/io/romio321/src/io_romio321_file_read.c +++ b/ompi/mca/io/romio321/src/io_romio321_file_read.c @@ -10,8 +10,8 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. - * Copyright (c) 2017 Research Organization for Information Science - * and Technology (RIST). All rights reserved. + * Copyright (c) 2017-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -37,11 +37,9 @@ mca_io_romio321_file_read_at (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_read_at) (data->romio_fh, offset, buf, count, datatype, status); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -59,11 +57,9 @@ mca_io_romio321_file_read_at_all (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_read_at_all) (data->romio_fh, offset, buf, count, datatype, status); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -81,11 +77,9 @@ mca_io_romio321_file_iread_at (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_iread_at) (data->romio_fh, offset, buf, count, datatype, request); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -102,7 +96,6 @@ mca_io_romio321_file_iread_at_all (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); // ---------------------------------------------------- // NOTE: If you upgrade ROMIO, replace this with the actual ROMIO call. // ---------------------------------------------------- @@ -112,7 +105,6 @@ mca_io_romio321_file_iread_at_all (ompi_file_t *fh, ret = ROMIO_PREFIX(MPI_File_iread_at_all) (data->romio_fh, offset, buf, count, datatype, request); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -129,11 +121,9 @@ mca_io_romio321_file_read (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_read) (data->romio_fh, buf, count, datatype, status); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -150,11 +140,9 @@ mca_io_romio321_file_read_all (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_read_all) (data->romio_fh, buf, count, datatype, status); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -171,11 +159,9 @@ mca_io_romio321_file_iread (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_iread) (data->romio_fh, buf, count, datatype, request); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -191,7 +177,6 @@ mca_io_romio321_file_iread_all (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); // ---------------------------------------------------- // NOTE: If you upgrade ROMIO, replace this with the actual ROMIO call. // ---------------------------------------------------- @@ -201,7 +186,6 @@ mca_io_romio321_file_iread_all (ompi_file_t *fh, ret = ROMIO_PREFIX(MPI_File_iread_all) (data->romio_fh, buf, count, datatype, request); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -217,11 +201,9 @@ mca_io_romio321_file_read_shared (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_read_shared) (data->romio_fh, buf, count, datatype, status); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -238,11 +220,9 @@ mca_io_romio321_file_iread_shared (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_iread_shared) (data->romio_fh, buf, count, datatype, request); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -259,11 +239,9 @@ mca_io_romio321_file_read_ordered (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_read_ordered) (data->romio_fh, buf, count, datatype, status); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -280,11 +258,9 @@ mca_io_romio321_file_read_at_all_begin (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_read_at_all_begin) (data->romio_fh, offset, buf, count, datatype); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -299,9 +275,7 @@ mca_io_romio321_file_read_at_all_end (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_read_at_all_end) (data->romio_fh, buf, status); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -317,11 +291,9 @@ mca_io_romio321_file_read_all_begin (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_read_all_begin) (data->romio_fh, buf, count, datatype); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -336,9 +308,7 @@ mca_io_romio321_file_read_all_end (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_read_all_end) (data->romio_fh, buf, status); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -354,11 +324,9 @@ mca_io_romio321_file_read_ordered_begin (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_read_ordered_begin) (data->romio_fh, buf, count, datatype); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -373,10 +341,8 @@ mca_io_romio321_file_read_ordered_end (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_read_ordered_end) (data->romio_fh, buf, status); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } diff --git a/ompi/mca/io/romio321/src/io_romio321_file_write.c b/ompi/mca/io/romio321/src/io_romio321_file_write.c index 2eb74d7f5a9..a9fb1ed128b 100644 --- a/ompi/mca/io/romio321/src/io_romio321_file_write.c +++ b/ompi/mca/io/romio321/src/io_romio321_file_write.c @@ -9,8 +9,8 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. - * Copyright (c) 2015-2017 Research Organization for Information Science - * and Technology (RIST). All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. * $COPYRIGHT$ * @@ -37,11 +37,9 @@ mca_io_romio321_file_write_at (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_write_at) (data->romio_fh, offset, buf, count, datatype, status); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -60,11 +58,9 @@ mca_io_romio321_file_write_at_all (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_write_at_all) (data->romio_fh, offset, buf, count, datatype, status); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -83,11 +79,9 @@ mca_io_romio321_file_iwrite_at (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_iwrite_at) (data->romio_fh, offset, buf, count, datatype, request); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -105,7 +99,6 @@ mca_io_romio321_file_iwrite_at_all (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); // ---------------------------------------------------- // NOTE: If you upgrade ROMIO, replace this with the actual ROMIO call. // ---------------------------------------------------- @@ -115,7 +108,6 @@ mca_io_romio321_file_iwrite_at_all (ompi_file_t *fh, ret = ROMIO_PREFIX(MPI_File_iwrite_at_all) (data->romio_fh, offset, buf, count, datatype, request); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -133,11 +125,9 @@ mca_io_romio321_file_write (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_write) (data->romio_fh, buf, count, datatype, status); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -153,11 +143,9 @@ mca_io_romio321_file_write_all (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_write_all) (data->romio_fh, buf, count, datatype, status); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -173,11 +161,9 @@ mca_io_romio321_file_iwrite (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_iwrite) (data->romio_fh, buf, count, datatype, request); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -193,7 +179,6 @@ mca_io_romio321_file_iwrite_all (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); // ---------------------------------------------------- // NOTE: If you upgrade ROMIO, replace this with the actual ROMIO call. // ---------------------------------------------------- @@ -203,7 +188,6 @@ mca_io_romio321_file_iwrite_all (ompi_file_t *fh, ret = ROMIO_PREFIX(MPI_File_iwrite_all) (data->romio_fh, buf, count, datatype, request); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -220,11 +204,9 @@ mca_io_romio321_file_write_shared (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_write_shared) (data->romio_fh, buf, count, datatype, status); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -240,11 +222,9 @@ mca_io_romio321_file_iwrite_shared (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_iwrite_shared) (data->romio_fh, buf, count, datatype, request); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -260,11 +240,9 @@ mca_io_romio321_file_write_ordered (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_write_ordered) (data->romio_fh, buf, count, datatype, status); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -280,10 +258,8 @@ mca_io_romio321_file_write_at_all_begin (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_write_at_all_begin) (data->romio_fh, offset, buf, count, datatype); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -297,10 +273,8 @@ mca_io_romio321_file_write_at_all_end (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_write_at_all_end) (data->romio_fh, buf, status); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -315,10 +289,8 @@ mca_io_romio321_file_write_all_begin (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_write_all_begin) (data->romio_fh, buf, count, datatype); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -332,9 +304,7 @@ mca_io_romio321_file_write_all_end (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_write_all_end) (data->romio_fh, buf, status); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -349,10 +319,8 @@ mca_io_romio321_file_write_ordered_begin (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_write_ordered_begin) (data->romio_fh, buf, count, datatype); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; } @@ -366,10 +334,8 @@ mca_io_romio321_file_write_ordered_end (ompi_file_t *fh, mca_io_romio321_data_t *data; data = (mca_io_romio321_data_t *) fh->f_io_selected_data; - OPAL_THREAD_LOCK (&mca_io_romio321_mutex); ret = ROMIO_PREFIX(MPI_File_write_ordered_end) (data->romio_fh, buf, status); - OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex); return ret; }