Skip to content

Commit a2d950c

Browse files
committed
romio321: invoke collective operations without holding the global lock
Signed-off-by: Gilles Gouaillardet <[email protected]>
1 parent 3b75ac8 commit a2d950c

File tree

4 files changed

+210
-14
lines changed

4 files changed

+210
-14
lines changed

ompi/mca/io/romio321/romio/adio/include/mpipr.h

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,30 @@
1010

1111
#ifndef USE_MPI_VERSIONS
1212

13+
#include "mpi-io/glue/openmpi/mpio_wrappers.h"
14+
1315
#undef MPI_Abort
1416
#define MPI_Abort PMPI_Abort
1517
#undef MPI_Allgather
16-
#define MPI_Allgather PMPI_Allgather
18+
#define MPI_Allgather MPIW_Allgather
1719
#undef MPI_Allgatherv
1820
#define MPI_Allgatherv PMPI_Allgatherv
1921
#undef MPI_Allreduce
20-
#define MPI_Allreduce PMPI_Allreduce
22+
#define MPI_Allreduce MPIW_Allreduce
2123
#undef MPI_Alltoall
22-
#define MPI_Alltoall PMPI_Alltoall
24+
#define MPI_Alltoall MPIW_Alltoall
2325
#undef MPI_Alltoallv
2426
#define MPI_Alltoallv PMPI_Alltoallv
2527
#undef MPI_Alltoallw
26-
#define MPI_Alltoallw PMPI_Alltoallw
28+
#define MPI_Alltoallw MPIW_Alltoallw
2729
#undef MPI_Attr_delete
2830
#define MPI_Attr_delete PMPI_Attr_delete
2931
#undef MPI_Attr_get
3032
#define MPI_Attr_get PMPI_Attr_get
3133
#undef MPI_Barrier
32-
#define MPI_Barrier PMPI_Barrier
34+
#define MPI_Barrier MPIW_Barrier
3335
#undef MPI_Bcast
34-
#define MPI_Bcast PMPI_Bcast
36+
#define MPI_Bcast MPIW_Bcast
3537
#undef MPI_Bsend
3638
#define MPI_Bsend PMPI_Bsend
3739
#undef MPI_Bsend_init
@@ -105,9 +107,9 @@
105107
#undef MPI_Finalize
106108
#define MPI_Finalize PMPI_Finalize
107109
#undef MPI_Gather
108-
#define MPI_Gather PMPI_Gather
110+
#define MPI_Gather MPIW_Gather
109111
#undef MPI_Gatherv
110-
#define MPI_Gatherv PMPI_Gatherv
112+
#define MPI_Gatherv MPIW_Gatherv
111113
#undef MPI_Get_address
112114
#define MPI_Get_address PMPI_Get_address
113115
#undef MPI_Get_count
@@ -191,7 +193,7 @@
191193
#undef MPI_Probe
192194
#define MPI_Probe PMPI_Probe
193195
#undef MPI_Recv
194-
#define MPI_Recv PMPI_Recv
196+
#define MPI_Recv MPIW_Recv
195197
#undef MPI_Recv_init
196198
#define MPI_Recv_init PMPI_Recv_init
197199
#undef MPI_Reduce
@@ -213,7 +215,7 @@
213215
#undef MPI_Scatterv
214216
#define MPI_Scatterv PMPI_Scatterv
215217
#undef MPI_Send
216-
#define MPI_Send PMPI_Send
218+
#define MPI_Send MPIW_Send
217219
#undef MPI_Send_init
218220
#define MPI_Send_init PMPI_Send_init
219221
#undef MPI_Sendrecv
@@ -281,11 +283,11 @@
281283
#undef MPI_Unpack
282284
#define MPI_Unpack PMPI_Unpack
283285
#undef MPI_Wait
284-
#define MPI_Wait PMPI_Wait
286+
#define MPI_Wait MPIW_Wait
285287
#undef MPI_Waitall
286-
#define MPI_Waitall PMPI_Waitall
288+
#define MPI_Waitall MPIW_Waitall
287289
#undef MPI_Waitany
288-
#define MPI_Waitany PMPI_Waitany
290+
#define MPI_Waitany MPIW_Waitany
289291
#undef MPI_Waitsome
290292
#define MPI_Waitsome PMPI_Waitsome
291293
#undef MPI_Wtick

ompi/mca/io/romio321/romio/mpi-io/glue/openmpi/Makefile.mk

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
if MPIO_GLUE_OPENMPI
99
romio_other_sources += \
1010
mpi-io/glue/openmpi/mpio_file.c \
11-
mpi-io/glue/openmpi/mpio_err.c
11+
mpi-io/glue/openmpi/mpio_err.c \
12+
mpi-io/glue/openmpi/mpio_wrappers.c
13+
14+
noinst_HEADERS += mpi-io/glue/openmpi/mpio_wrappers.h
15+
1216
endif MPIO_GLUE_OPENMPI
1317

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
#include "mpi-io/mpioimpl.h"
2+
3+
#include "mpi-io/glue/openmpi/mpio_wrappers.h"
4+
5+
int MPIW_Allreduce(const void *sendbuf, void *recvbuf, int count,
6+
MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
7+
{
8+
int res;
9+
ROMIO_THREAD_CS_EXIT();
10+
res = PMPI_Allreduce(sendbuf, recvbuf, count, datatype, op, comm);
11+
ROMIO_THREAD_CS_ENTER();
12+
return res;
13+
}
14+
15+
int MPIW_Allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
16+
void *recvbuf, int recvcount, MPI_Datatype recvtype,
17+
MPI_Comm comm)
18+
{
19+
int res;
20+
ROMIO_THREAD_CS_EXIT();
21+
res = PMPI_Allgather(sendbuf, sendcount, sendtype,
22+
recvbuf, recvcount, recvtype,
23+
comm);
24+
ROMIO_THREAD_CS_ENTER();
25+
return res;
26+
}
27+
28+
int MPIW_Alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
29+
void *recvbuf, int recvcount, MPI_Datatype recvtype,
30+
MPI_Comm comm)
31+
{
32+
int res;
33+
ROMIO_THREAD_CS_EXIT();
34+
res = PMPI_Alltoall(sendbuf, sendcount, sendtype,
35+
recvbuf, recvcount, recvtype,
36+
comm);
37+
ROMIO_THREAD_CS_ENTER();
38+
return res;
39+
}
40+
41+
int MPIW_Alltoallw(const void *sendbuf, const int sendcounts[], const int sdispls[], const MPI_Datatype sendtypes[],
42+
void *recvbuf, const int recvcounts[], const int rdispls[], const MPI_Datatype recvtypes[],
43+
MPI_Comm comm)
44+
{
45+
int res;
46+
ROMIO_THREAD_CS_EXIT();
47+
res = PMPI_Alltoallw(sendbuf, sendcounts, sdispls, sendtypes,
48+
recvbuf, recvcounts, rdispls, recvtypes,
49+
comm);
50+
ROMIO_THREAD_CS_ENTER();
51+
return res;
52+
}
53+
54+
int MPIW_Barrier(MPI_Comm comm)
55+
{
56+
int res;
57+
ROMIO_THREAD_CS_EXIT();
58+
res = PMPI_Barrier(comm);
59+
ROMIO_THREAD_CS_ENTER();
60+
return res;
61+
}
62+
63+
int MPIW_Bcast(void *buffer, int count, MPI_Datatype datatype,
64+
int root, MPI_Comm comm)
65+
{
66+
int res;
67+
ROMIO_THREAD_CS_EXIT();
68+
res = PMPI_Bcast(buffer, count, datatype, root, comm);
69+
ROMIO_THREAD_CS_ENTER();
70+
return res;
71+
}
72+
73+
int MPIW_Gather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
74+
void *recvbuf, int recvcount, MPI_Datatype recvtype,
75+
int root, MPI_Comm comm)
76+
{
77+
int res;
78+
ROMIO_THREAD_CS_EXIT();
79+
res = PMPI_Gather(sendbuf, sendcount, sendtype,
80+
recvbuf, recvcount, recvtype,
81+
root, comm);
82+
ROMIO_THREAD_CS_ENTER();
83+
return res;
84+
}
85+
86+
int MPIW_Gatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
87+
void *recvbuf, const int recvcounts[], const int displs[],
88+
MPI_Datatype recvtype, int root, MPI_Comm comm)
89+
{
90+
int res;
91+
ROMIO_THREAD_CS_EXIT();
92+
res = PMPI_Gatherv(sendbuf, sendcount, sendtype,
93+
recvbuf, recvcounts, displs, recvtype,
94+
root, comm);
95+
ROMIO_THREAD_CS_ENTER();
96+
return res;
97+
}
98+
99+
int MPIW_Recv(void *buf, int count, MPI_Datatype datatype, int source,
100+
int tag, MPI_Comm comm, MPI_Status *status)
101+
{
102+
int res;
103+
ROMIO_THREAD_CS_EXIT();
104+
res = PMPI_Recv(buf, count, datatype, source, tag, comm, status);
105+
ROMIO_THREAD_CS_ENTER();
106+
return res;
107+
}
108+
109+
110+
int MPIW_Send(const void *buf, int count, MPI_Datatype datatype, int dest,
111+
int tag, MPI_Comm comm)
112+
{
113+
int res;
114+
ROMIO_THREAD_CS_EXIT();
115+
res = PMPI_Send(buf, count, datatype, dest, tag, comm);
116+
ROMIO_THREAD_CS_ENTER();
117+
return res;
118+
}
119+
120+
int MPIW_Waitall(int count, MPI_Request array_of_requests[],
121+
MPI_Status array_of_statuses[])
122+
{
123+
int res;
124+
ROMIO_THREAD_CS_EXIT();
125+
res = PMPI_Waitall(count, array_of_requests, array_of_statuses);
126+
ROMIO_THREAD_CS_ENTER();
127+
return res;
128+
}
129+
130+
int MPIW_Waitany(int count, MPI_Request array_of_requests[],
131+
int *index, MPI_Status *status)
132+
{
133+
int res;
134+
ROMIO_THREAD_CS_EXIT();
135+
res = PMPI_Waitany(count, array_of_requests, index, status);
136+
ROMIO_THREAD_CS_ENTER();
137+
return res;
138+
}
139+
140+
int MPIW_Wait(MPI_Request *request, MPI_Status *status)
141+
{
142+
int res;
143+
ROMIO_THREAD_CS_EXIT();
144+
res = PMPI_Wait(request, status);
145+
ROMIO_THREAD_CS_ENTER();
146+
return res;
147+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#include <mpi.h>
2+
3+
int MPIW_Allreduce(const void *sendbuf, void *recvbuf, int count,
4+
MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);
5+
6+
int MPIW_Allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
7+
void *recvbuf, int recvcount, MPI_Datatype recvtype,
8+
MPI_Comm comm);
9+
10+
int MPIW_Alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
11+
void *recvbuf, int recvcount, MPI_Datatype recvtype,
12+
MPI_Comm comm);
13+
14+
int MPIW_Alltoallw(const void *sendbuf, const int sendcounts[], const int sdispls[], const MPI_Datatype sendtypes[],
15+
void *recvbuf, const int recvcounts[], const int rdispls[], const MPI_Datatype recvtypes[],
16+
MPI_Comm comm);
17+
18+
int MPIW_Barrier(MPI_Comm comm);
19+
20+
int MPIW_Bcast(void *buffer, int count, MPI_Datatype datatype,
21+
int root, MPI_Comm comm);
22+
23+
int MPIW_Gather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
24+
void *recvbuf, int recvcount, MPI_Datatype recvtype,
25+
int root, MPI_Comm comm);
26+
27+
int MPIW_Gatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
28+
void *recvbuf, const int recvcounts[], const int displs[],
29+
MPI_Datatype recvtype, int root, MPI_Comm comm);
30+
31+
int MPIW_Recv(void *buf, int count, MPI_Datatype datatype, int source,
32+
int tag, MPI_Comm comm, MPI_Status *status);
33+
34+
int MPIW_Send(const void *buf, int count, MPI_Datatype datatype, int dest,
35+
int tag, MPI_Comm comm);
36+
37+
int MPIW_Waitall(int count, MPI_Request array_of_requests[],
38+
MPI_Status array_of_statuses[]);
39+
40+
int MPIW_Waitany(int count, MPI_Request array_of_requests[],
41+
int *index, MPI_Status *status);
42+
43+
int MPIW_Wait(MPI_Request *request, MPI_Status *status);

0 commit comments

Comments
 (0)